Re: [PATCH] Bug 1086726: Reworked error messages in libvirt.c, libvirt-domain.c removing uses of __FUNCTION__, except one

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

 



On 01.04.2015 12:13, Noella Ashu wrote:
>

We tend to do different formatting of commit messages. If you do 'git log' you'll immediately get a picture.

> ---
>  src/libvirt-domain.c | 13 +++++++------
>  src/libvirt.c        |  4 ++--
>  2 files changed, 9 insertions(+), 8 deletions(-)
> 
> diff --git a/src/libvirt-domain.c b/src/libvirt-domain.c
> index f1608dc..4a45b9e 100644
> --- a/src/libvirt-domain.c
> +++ b/src/libvirt-domain.c
> @@ -2613,7 +2613,7 @@ virDomainGetXMLDesc(virDomainPtr domain, unsigned int flags)
>      if ((conn->flags & VIR_CONNECT_RO) &&
>          (flags & (VIR_DOMAIN_XML_SECURE | VIR_DOMAIN_XML_MIGRATABLE))) {
>          virReportError(VIR_ERR_OPERATION_DENIED, "%s",
> -                       _("virDomainGetXMLDesc with secure flag"));
> +                       _("Invalid secure flag for XML domain description"));

This actually was a correct message:

virsh > dumpxml --security-info $dom
error: operation forbidden: virDomainGetXMLDesc with secure flag


The idea of the bug report is to do something like this:

diff --git a/src/libvirt-domain.c b/src/libvirt-domain.c
index 4a45b9e..c39590d 100644
--- a/src/libvirt-domain.c
+++ b/src/libvirt-domain.c
@@ -385,9 +385,7 @@ virDomainLookupByUUIDString(virConnectPtr conn, const char *uuidstr)
     virCheckNonNullArgGoto(uuidstr, error);
 
     if (virUUIDParse(uuidstr, uuid) < 0) {
-        virReportInvalidArg(uuidstr,
-                            _("uuidstr in %s must be a valid UUID"),
-                            __FUNCTION__);
+        virReportInvalidArg(uuidstr, "%s", _("invalid UUID"));
         goto error;
     }
 
@@ -2180,9 +2178,8 @@ virDomainGetMemoryParameters(virDomainPtr domain,
     if ((flags & VIR_DOMAIN_AFFECT_LIVE) &&
         (flags & VIR_DOMAIN_AFFECT_CONFIG)) {
         virReportInvalidArg(flags,
-                            _("flags 'affect live' and 'affect config' in %s "
-                              "are mutually exclusive"),
-                            __FUNCTION__);
+                            _("flags 'affect live' and 'affect config' "
+                              "are mutually exclusive"));
         goto error;
     }
     conn = domain->conn;

And so on.

Michal

--
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]