[libvirt] [dbus PATCH v2 15/22] Implement SetVcpus method for Domain Interface

Pavel Hrdina phrdina at redhat.com
Fri Apr 13 10:12:48 UTC 2018


On Thu, Apr 12, 2018 at 04:32:54PM +0200, Katerina Koukiou wrote:
> Move testing of [Get,Set]Vcpus to seperate test.
> 
> Signed-off-by: Katerina Koukiou <kkoukiou at redhat.com>
> ---
>  data/org.libvirt.Domain.xml |  6 ++++++
>  src/domain.c                | 26 ++++++++++++++++++++++++++
>  test/test_domain.py         |  9 +++++++--
>  3 files changed, 39 insertions(+), 2 deletions(-)

[...]

> +static void
> +virtDBusDomainSetVcpus(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;
> +    guint vcpus;
> +    guint flags;
> +
> +    g_variant_get(inArgs, "(uu)", &vcpus, &flags);
> +
> +    domain = virtDBusDomainGetVirDomain(connect, objectPath, error);
> +    if (!domain)
> +        return;
> +
> +    if (virDomainSetVcpusFlags(domain, vcpus, flags) < 0)
> +        return virtDBusUtilSetLastVirtError(error);

No need to use 'return'.

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/d565e365/attachment-0001.sig>


More information about the libvir-list mailing list