[libvirt] [PATCH v3] Add warning message to XML definition files stored on disk

Eric Blake eblake at redhat.com
Fri May 6 14:44:32 UTC 2011


On 05/06/2011 08:13 AM, Michal Privoznik wrote:
> Users often edit XML file stored in configuration directory
> thinking of modifying a domain/network/pool/etc. Thus it is wise
> to let them know they are using the wrong way and give them hint.
> ---
> diff to v2:
>  - remove redundant flag VIR_XML_EMIT_WARNING
>  - remove enum, pass const string instead
>  - don't translate warning message

ACK with one nit.  That certainly reduced the size of the patch; thanks
for putting up with my reviews.

> +int virEmitXMLWarning(int fd,
> +                      const char *name,
> +                      const char *cmd) {
> +    size_t len;
> +    const char *prologue = "<!--\n\
> +WARNING: THIS IS AN AUTO-GENERATED FILE. CHANGES TO IT ARE LIKELY TO BE \n\
> +OVERWRITTEN AND LOST. Changes to this xml configuration should be made using:\n\
> +virsh ";

Let's indent this line a bit (2 spaces is probably fine), to make it
obvious that we are calling out a shell command that can be literally
copied and pasted.  No need to send a v4, just make that change and push.

> +    const char *epilogue = "\n\
> +or other application using the libvirt API.\n\
> +-->\n\n";
> +

-- 
Eric Blake   eblake at redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 619 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20110506/1110f09a/attachment-0001.sig>


More information about the libvir-list mailing list