[libvirt] [dbus PATCH v2 21/22] Implement SetMemory method for Domain Interface
Pavel Hrdina
phrdina at redhat.com
Fri Apr 13 11:14:38 UTC 2018
On Thu, Apr 12, 2018 at 04:33:00PM +0200, Katerina Koukiou wrote:
> Signed-off-by: Katerina Koukiou <kkoukiou at redhat.com>
> ---
> data/org.libvirt.Domain.xml | 6 ++++++
> src/domain.c | 26 ++++++++++++++++++++++++++
> 2 files changed, 32 insertions(+)
[...]
> +static void
> +virtDBusDomainSetMemory(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;
> + gulong memory;
> + guint flags;
> +
> + g_variant_get(inArgs, "(tu)", &memory, &flags);
> +
> + domain = virtDBusDomainGetVirDomain(connect, objectPath, error);
> + if (!domain)
> + return;
> +
> + if (virDomainSetMemoryFlags(domain, memory, 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/52894537/attachment-0001.sig>
More information about the libvir-list
mailing list