qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [Qemu-block] Can I only commit from active image to cor


From: Max Reitz
Subject: Re: [Qemu-devel] [Qemu-block] Can I only commit from active image to corresponding range of its backing file by qemu cmd?
Date: Thu, 27 Sep 2018 16:14:15 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.0

On 25.09.18 16:13, Alberto Garcia wrote:
> On Thu 13 Sep 2018 08:37:05 PM CEST, Max Reitz wrote:
>> First, split .003 into the part we want to commit and the part we
>> don't want to commit.  This is a bit tricky without qemu-img dd @seek
>> (or a corresponding convert parameter), so we'll have to make do with
>> backing=null so we don't copy anything into the output from img.003's
>> backing chain.
>>
>> Or, we would have to use backing=null, but for some reason that
>> doesn't work.  I'll have to investigate.
>>
>> So rebase will need to do:
>>
>> $ qemu-img rebase -u -b '' img.003
>>
>> $ qemu-img convert -O qcow2 \
>>     "json:{'driver':'raw','offset':0,'size':1048576,\
>>            'file':{'driver':'qcow2',\
>>                    'file':{'driver':'file','filename':'img.003'}}}" \
>>     "json:{'driver':'null-co','size':2097152}" \
>>     img.003.commit.000
> 
> If you only want to copy parts of a backing file I think it's much
> simpler if you use copy-on-read:

And you can do it at runtime!

Max

> qemu-io -C -c 'read 0 1M' img.003.commit.000 
> 
>> $ qemu-img convert -O qcow2 \
>>     "json:{'driver':'null-co','size':1048576}" \
>>     "json:{'driver':'raw','offset':1048576,'size':2097152,\
>>            'file':{'driver':'qcow2',\
>>                    'file':{'driver':'file','filename':'img.003'}}}" \
>>     img.003.nocommit
> 
> qemu-io -C -c 'read 1M 1M' img.003.nocommit
> 
> Berto
> 


Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]