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

Re: [libvirt] [PATCH 08/24] maint: improve VIR_ERR_NO_SUPPORT usage



On 01/04/2014 07:21 AM, Eric Blake wrote:

>>> The only one that I'd say is different is virDomainOpenGraphics(). It
>>> checks VIR_DRV_SUPPORTS_FEATURE on one of its calls to
>>> virLibDomainError(). Thus perhaps it'd be better to generate a "real"
>>> error so as to differentiate between the function not being available as
>>> a general rule of thumb as opposed to it not being available to a
>>> specific domain because the domain doesn't support a specific feature.
>>> In this case VIR_DRV_FEATURE_FD_PASSING supported in the driver.
> 
> Okay, I'll revisit that function, and possibly just defer that hunk or a
> modified version of it to my v2 series so I can push the rest of the patch.

All other clients that report an error if VIR_DRV_SUPPORTS_FEATURE fails
use VIR_ERR_ARGUMENT_UNSUPPORTED rather than VIR_ERR_NO_SUPPORT.  So
that seems straightforward enough that I squashed this in and pushed.

diff --git i/src/libvirt.c w/src/libvirt.c
index d9705bb..b0c1595 100644
--- i/src/libvirt.c
+++ w/src/libvirt.c
@@ -21759,7 +21759,8 @@ virDomainOpenGraphics(virDomainPtr dom,

     if (!VIR_DRV_SUPPORTS_FEATURE(dom->conn->driver, dom->conn,
                                   VIR_DRV_FEATURE_FD_PASSING)) {
-        virReportUnsupportedError();
+        virReportError(VIR_ERR_ARGUMENT_UNSUPPORTED, "%s",
+                       _("fd passing is not supported by this
connection"));
         goto error;
     }


-- 
Eric Blake   eblake redhat com    +1-919-301-3266
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]