[libvirt] [PATCH 1/2] conf: Format the "nocow" field.

John Ferlan jferlan at redhat.com
Fri Dec 9 15:00:11 UTC 2016



On 12/09/2016 09:52 AM, Martin Kletzander wrote:
> On Fri, Dec 09, 2016 at 03:38:09PM +0100, Michal Privoznik wrote:
>> On 07.12.2016 16:31, John Ferlan wrote:
>>> Commit id 'a9fd30e63' added a '<nocow/>' field to be parsed, but
>>> didn't Format the field on output. This patch fixes that and adds
>>> the vol-qcow2-nocow test to/for storagevolxml2xml
>>>
>>> Signed-off-by: John Ferlan <jferlan at redhat.com>
>>> ---
>>>  src/conf/storage_conf.c                        | 2 ++
>>>  tests/storagevolxml2xmlout/vol-qcow2-nocow.xml | 1 +
>>>  tests/storagevolxml2xmltest.c                  | 1 +
>>>  3 files changed, 4 insertions(+)
>>>
>>> diff --git a/src/conf/storage_conf.c b/src/conf/storage_conf.c
>>> index 7e7bb72..dc7cc25 100644
>>> --- a/src/conf/storage_conf.c
>>> +++ b/src/conf/storage_conf.c
>>> @@ -1590,6 +1590,8 @@
>>> virStorageVolTargetDefFormat(virStorageVolOptionsPtr options,
>>>              return -1;
>>>
>>>      virBufferEscapeString(buf, "<compat>%s</compat>\n", def->compat);
>>> +    if (def->nocow)
>>> +        virBufferAddLit(buf, "<nocow/>\n");
>>>
>>
>> I wonder whether we should detect this flag over a volume and set it so
>> that vol-dumpxml reports the flag even after libvirtd restart.
>>
> 
> Well, I don't think we output things we cannot detect (like
> "prealloc_metadata") which we accept on input.  So if we output it, we
> need to be able to detect it.  If we only accept it on input, then we
> should not output it (because we cannot guarantee reproducibility after
> daemon restart).
> 
> Martin
> 
>> Michal


Hmmm. detection after restart would only be possible if we can probe the
file and so far it only matters for btrfs...

Ummm.. I'll just drop this then


John




More information about the libvir-list mailing list