[dbus PATCH 03/10] virtDBusDomainShutdown: Use virDomainShutdownFlags instead of virDomainShutdown

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Katerina Koukiou <kkoukiou@xxxxxxxxxx>
---
 data/org.libvirt.Domain.xml | 4 +++-
 src/domain.c                | 5 ++++-
 test/test_domain.py         | 6 +++---
 3 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/data/org.libvirt.Domain.xml b/data/org.libvirt.Domain.xml
index 46cc8a7..28f5609 100644
--- a/data/org.libvirt.Domain.xml
+++ b/data/org.libvirt.Domain.xml
@@ -24,7 +24,9 @@
       <arg name="flags" type="u" direction="in"/>
       <arg name="records" type="a{sv}" direction="out"/>
     </method>
-    <method name="Shutdown"/>
+    <method name="Shutdown">
+      <arg name="flags" type="u" direction="in"/>
+    </method>
     <method name="Destroy"/>
     <method name="Reboot">
       <arg name="flags" type="u" direction="in"/>
diff --git a/src/domain.c b/src/domain.c
index 333b5e8..b6e72db 100644
--- a/src/domain.c
+++ b/src/domain.c
@@ -320,12 +320,15 @@ virtDBusDomainShutdown(GVariant *inArgs G_GNUC_UNUSED,
 {
     virtDBusConnect *connect = userData;
     g_autoptr(virDomain) domain = NULL;
+    guint flags;
+
+    g_variant_get(inArgs, "(u)", &flags);
 
     domain = virtDBusDomainGetVirDomain(connect, objectPath, error);
     if (!domain)
         return;
 
-    if (virDomainShutdown(domain) < 0)
+    if (virDomainShutdownFlags(domain, flags) < 0)
         virtDBusUtilSetLastVirtError(error);
 }
 
diff --git a/test/test_domain.py b/test/test_domain.py
index c7f9ca2..0c5ee45 100755
--- a/test/test_domain.py
+++ b/test/test_domain.py
@@ -32,7 +32,7 @@ class TestDomain(libvirttest.BaseTestClass):
         assert isinstance(vcpus, dbus.UInt32)
 
         domain.Reboot(0)
-        domain.Shutdown()
+        domain.Shutdown(0)
         domain.Create()
         domain.Destroy()
         domain.Undefine()
@@ -46,7 +46,7 @@ class TestDomain(libvirttest.BaseTestClass):
         self.connect.connect_to_signal('DomainStopped', domain_stopped)
 
         obj, domain = self.domain()
-        domain.Shutdown()
+        domain.Shutdown(0)
 
         state = obj.Get('org.libvirt.Domain', 'State', dbus_interface=dbus.PROPERTIES_IFACE)
         assert state == 'shutoff'
@@ -62,7 +62,7 @@ class TestDomain(libvirttest.BaseTestClass):
         self.connect.connect_to_signal('DomainUndefined', domain_undefined)
 
         _, domain = self.domain()
-        domain.Shutdown()
+        domain.Shutdown(0)
         domain.Undefine()
 
         self.main_loop()
-- 
2.15.0

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux