[libvirt] [PATCH 2/4] conf: Parse and format disk <wwn>

Osier Yang jyang at redhat.com
Fri Aug 31 01:36:45 UTC 2012


On 2012年08月31日 00:14, Paolo Bonzini wrote:
> Il 29/08/2012 18:36, Osier Yang ha scritto:
>> @@ -11557,6 +11564,7 @@ virDomainDiskDefFormat(virBufferPtr buf,
>>       if (def->transient)
>>           virBufferAddLit(buf, "<transient/>\n");
>>       virBufferEscapeString(buf, "<serial>%s</serial>\n", def->serial);
>> +    virBufferEscapeString(buf, "<wwn>%s</wwn>\n", def->wwn);
>
> What happens if the wwn was not passed?
>
> If it is NULL, it's a bug (same for serial).
>
> If it is empty, the output will not obey the schema, so the whole
> element should be left out.  I think it's best to do the same for
> serial, but technically it should be ok.
>

See Eric's follow up explaination. I was also confused about it
before not looking into virBufferEscapeString one step further
though. :-)

Osier




More information about the libvir-list mailing list