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

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



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 redhat com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


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