[libvirt] [dbus PATCH v2 06/22] Implement DetachDevice method for Domain Interface

Pavel Hrdina phrdina at redhat.com
Fri Apr 13 08:22:00 UTC 2018


On Thu, Apr 12, 2018 at 04:32:45PM +0200, Katerina Koukiou wrote:
> This method is not tested for now since the test driver
> doesn't suport this API.
> 
> Signed-off-by: Katerina Koukiou <kkoukiou at redhat.com>
> ---
>  data/org.libvirt.Domain.xml |  6 ++++++
>  src/domain.c                | 25 +++++++++++++++++++++++++
>  2 files changed, 31 insertions(+)

[...]

> +static void
> +virtDBusDomainDetachDevice(GVariant *inArgs,
> +                           GUnixFDList *inFDs G_GNUC_UNUSED,
> +                           const gchar *objectPath,
> +                           gpointer userData,
> +                           GVariant **outArgs G_GNUC_UNUSED,
> +                           GUnixFDList **outFDs G_GNUC_UNUSED,
> +                           GError **error)
> +{
> +    virtDBusConnect *connect = userData;
> +    g_autoptr(virDomain) domain = NULL;
> +    const gchar *xml;
> +    guint flags;
> +
> +    g_variant_get(inArgs, "(&su)", &xml, &flags);
> +
> +    domain = virtDBusDomainGetVirDomain(connect, objectPath, error);
> +    if (!domain)
> +        return;
> +
> +    if (virDomainDetachDeviceFlags(domain, xml, flags) == -1)
> +        return virtDBusUtilSetLastVirtError(error);

Same here, no need for 'return' and I forgot to mention it for the
previous patch, '< 0' is the preferred form.

Pavel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20180413/9c96335a/attachment-0001.sig>


More information about the libvir-list mailing list