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(a)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