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

Eric Blake eblake at redhat.com
Sat Jan 4 20:30:52 UTC 2014

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
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
         goto error;

Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

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

More information about the libvir-list mailing list