Signed-off-by: Katerina Koukiou <kkoukiou(a)redhat.com>
---
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 1ecf826..692948c 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 09b3440..8b821a2 100644
--- a/src/domain.c
+++ b/src/domain.c
@@ -321,12 +321,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 22039dc..18a1434 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