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

Martin Kletzander mkletzan at redhat.com
Fri Dec 9 14:52:22 UTC 2016


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
>
>--
>libvir-list mailing list
>libvir-list at redhat.com
>https://www.redhat.com/mailman/listinfo/libvir-list
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: Digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20161209/095adfd5/attachment-0001.sig>


More information about the libvir-list mailing list