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

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

 



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

Attachment: signature.asc
Description: OpenPGP digital signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]