[libvirt] [PATCH v2] qemu: migration: Don't crash on access to 'current' job
by Peter Krempa
When a VM is destroyed while being migrated (waiting in
qemuMigrationSrcWaitForCompletion) the private object cleanup code frees
the 'current' job info. Since the migration code attempts to setup
various aspects of the current job even on failure this results into a
crash.
Job data is cleared in qemuDomainObjPrivateDataClear since commit
888aa4b6b9db
Fix this by skipping all of the code which requires the qemu process to
be alive if the VM is not active any more.
Signed-off-by: Peter Krempa <pkrempa(a)redhat.com>
---
src/qemu/qemu_migration.c | 33 +++++++++++++++++----------------
1 file changed, 17 insertions(+), 16 deletions(-)
diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
index b913e99928..1a857329ec 100644
--- a/src/qemu/qemu_migration.c
+++ b/src/qemu/qemu_migration.c
@@ -3561,27 +3561,28 @@ qemuMigrationSrcRun(virQEMUDriverPtr driver,
error:
orig_err = virSaveLastError();
- if (cancel &&
- priv->job.current->status != QEMU_DOMAIN_JOB_STATUS_QEMU_COMPLETED &&
- virDomainObjIsActive(vm) &&
- qemuDomainObjEnterMonitorAsync(driver, vm,
- QEMU_ASYNC_JOB_MIGRATION_OUT) == 0) {
- qemuMonitorMigrateCancel(priv->mon);
- ignore_value(qemuDomainObjExitMonitor(driver, vm));
- }
+ if (virDomainObjIsActive(vm)) {
+ if (cancel &&
+ priv->job.current->status != QEMU_DOMAIN_JOB_STATUS_QEMU_COMPLETED &&
+ qemuDomainObjEnterMonitorAsync(driver, vm,
+ QEMU_ASYNC_JOB_MIGRATION_OUT) == 0) {
+ qemuMonitorMigrateCancel(priv->mon);
+ ignore_value(qemuDomainObjExitMonitor(driver, vm));
+ }
- /* cancel any outstanding NBD jobs */
- if (mig && mig->nbd)
- qemuMigrationSrcCancelDriveMirror(driver, vm, false,
- QEMU_ASYNC_JOB_MIGRATION_OUT,
- dconn);
+ /* cancel any outstanding NBD jobs */
+ if (mig && mig->nbd)
+ qemuMigrationSrcCancelDriveMirror(driver, vm, false,
+ QEMU_ASYNC_JOB_MIGRATION_OUT,
+ dconn);
+
+ if (priv->job.current->status != QEMU_DOMAIN_JOB_STATUS_CANCELED)
+ priv->job.current->status = QEMU_DOMAIN_JOB_STATUS_FAILED;
+ }
if (iothread)
qemuMigrationSrcStopTunnel(iothread, true);
- if (priv->job.current->status != QEMU_DOMAIN_JOB_STATUS_CANCELED)
- priv->job.current->status = QEMU_DOMAIN_JOB_STATUS_FAILED;
-
goto cleanup;
exit_monitor:
--
2.16.2
6 years, 5 months
[libvirt] [PATCH] qemu: migration: Don't crash on access to 'current' job
by Peter Krempa
When a VM is destroyed while being migrated (waiting in
qemuMigrationSrcWaitForCompletion) the private object cleanup code frees
the 'current' job info. Since the migration code attempts to setup
various aspects of the current job even on failure this results into a
crash.
Job data is cleared in qemuDomainObjPrivateDataClear since commit
888aa4b6b9db
Signed-off-by: Peter Krempa <pkrempa(a)redhat.com>
---
I'm not certain that there isn't any other bigger root cause for this,
but if the job is not present due to the VM being destroyed, it does not
make much sense to set any data.
src/qemu/qemu_migration.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
index 88b8253fa9..9f4de08d46 100644
--- a/src/qemu/qemu_migration.c
+++ b/src/qemu/qemu_migration.c
@@ -3552,6 +3552,7 @@ qemuMigrationSrcRun(virQEMUDriverPtr driver,
orig_err = virSaveLastError();
if (cancel &&
+ priv->job.current &&
priv->job.current->status != QEMU_DOMAIN_JOB_STATUS_QEMU_COMPLETED &&
virDomainObjIsActive(vm) &&
qemuDomainObjEnterMonitorAsync(driver, vm,
@@ -3569,7 +3570,8 @@ qemuMigrationSrcRun(virQEMUDriverPtr driver,
if (iothread)
qemuMigrationSrcStopTunnel(iothread, true);
- if (priv->job.current->status != QEMU_DOMAIN_JOB_STATUS_CANCELED)
+ if (priv->job.current &&
+ priv->job.current->status != QEMU_DOMAIN_JOB_STATUS_CANCELED)
priv->job.current->status = QEMU_DOMAIN_JOB_STATUS_FAILED;
goto cleanup;
--
2.16.2
6 years, 5 months
[libvirt] [PATCH v2] nwfilter: increase pcap buffer size to be compatible with TPACKET_V3
by Laine Stump
When an nwfilter rule sets the parameter CTRL_IP_LEARNING to "dhcp",
this turns on the "dhcpsnoop" thread, which uses libpcap to monitor
traffic on the domain's tap device and extract the IP address from the
DHCP response.
If libpcap on the host is built with HAVE_TPACKET3 defined (to enable
support for TPACKET_V3), the dhcpsnoop code's initialization of the
libpcap socket would fail with the following error:
virNWFilterSnoopDHCPOpen:1134 : internal error: pcap_setfilter: can't remove kernel filter: Bad file descriptor
It turns out that this was because TPACKET_V3 requires a larger buffer
size than libvirt was setting (we were setting it to 128k). Changing
the buffer size to 256k eliminates the error, and the dhcpsnoop thread
once again works properly.
A fuller explanation of why TPACKET_V3 requires such a large buffer,
for future git spelunkers:
libpcap calls setsockopt(... SOL_PACKET, PACKET_RX_RING...) to setup a
ring buffer for receiving packets; two of the attributes sent to this
API are called tp_frame_size, and tp_frame_nr. If libpcap was built
with HAVE_TPACKET3 defined, tp_trame_size is set to MAXIMUM_SNAPLEN
(defined in libpcap sources as 262144) and tp_frame_nr is set to:
[the buffer size we set, i.e. PCAP_BUFFERSIZE i.e. 262144] / tp_frame_size.
So if PCAP_BUFFERSIZE < MAXIMUM_SNAPLEN, then tp_frame_nr (the number
of frames in the ring buffer) is 0, which is nonsensical. This same
value is later used as a multiplier to determine the size for a call
to malloc() (which would also fail).
(NB: if HAVE_TPACKET3 is *not* defined, then tp_frame_size is set to
the snaplen set by the user (in our case 576) plus a small amount to
account for ethernet headers, so 256k is far more than adequate)
Since the TPACKET_V3 code in libpcap actually reads multiple packets
into each frame, it's not a problem to have only a single frame
(especially when we are monitoring such infrequent traffic), so it's
okay to set this relatively small buffer size (in comparison to the
default, which is 2MB), which is important since every guest using
dhcp snooping in a nwfilter rule will hold 2 of these buffers for the
entire life of the guest.
Thanks to Christian Ehrhardt <paelzer(a)gmail.com> for discovering that
buffer size was the problem (this was not at all obvious from the
error that was logged!)
Resolves: https://bugzilla.redhat.com/1547237
Fixes: https://bugs.launchpad.net/libvirt/+bug/1758037
Signed-off-by: Laine Stump <laine(a)laine.org>
---
change from V1: you asked for "big comment", you got it!
If you think this is overkill, or underkill, let me know. I decided
that the details about proper buffersize were better sitting right
next to the definition of PCAP_BUFFERSIZE, but that there should also
be a comment down in the code where any potential future error would
occur, as that would more easily catch the eye of the hapless keyboard
jockey who gets to rediscover this problem the next time libpcap
changes.
Also, I'm planning to request that the libpcap developers check for a
viable buffersize during the pcap_set_buffer_size() call so that in
the future this error is reported immediately rather than just having
some random-seeming failure at a later time when pcap_setfilter() is
called.
src/nwfilter/nwfilter_dhcpsnoop.c | 22 +++++++++++++++++++---
1 file changed, 19 insertions(+), 3 deletions(-)
diff --git a/src/nwfilter/nwfilter_dhcpsnoop.c b/src/nwfilter/nwfilter_dhcpsnoop.c
index 6069e70460..50cfb944a2 100644
--- a/src/nwfilter/nwfilter_dhcpsnoop.c
+++ b/src/nwfilter/nwfilter_dhcpsnoop.c
@@ -256,10 +256,21 @@ struct _virNWFilterDHCPDecodeJob {
# define DHCP_BURST_INTERVAL_S 10 /* sec */
/*
- * libpcap 1.5 requires a 128kb buffer
- * 128 kb is bigger than (DHCP_PKT_BURST * PCAP_PBUFSIZE / 2)
+ * NB: Any libpcap built with HAVE_TPACKET3 will require
+ * PCAP_BUFFERSIZE to be at least 262144 (although
+ * pcap_set_buffer_size() with a lower value will succeed, and the
+ * error will only show up later when pcap_setfilter() is called).
+ *
+ * It is possible that in the future libpcap could increase the
+ * minimum size even further, but due to the fact that each guest
+ * using dhcp snooping keeps 2 pcap sockets open (and thus 2 buffers
+ * allocated) for the life of the guest, we want to minimize the
+ * length of the buffer, so instead of leaving it at the default size
+ * (2MB), we are setting it to the minimum viable size and including
+ * this clue in the source to help quickly resolve the problem when/if
+ * it reoccurs.
*/
-# define PCAP_BUFFERSIZE (128 * 1024)
+# define PCAP_BUFFERSIZE (256 * 1024)
# define MAX_QUEUED_JOBS (DHCP_PKT_BURST + 2 * DHCP_PKT_RATE)
@@ -1114,6 +1125,11 @@ virNWFilterSnoopDHCPOpen(const char *ifname, virMacAddr *mac,
goto cleanup_nohandle;
}
+ /* IMPORTANT: If there is any failure of *any* pcap_* function
+ * during setup of the socket, look to the comment where
+ * PCAP_BUFFERSIZE is defined. It may be too small, even if the
+ * generated error doesn't imply that.
+ */
if (pcap_set_snaplen(handle, PCAP_PBUFSIZE) < 0 ||
pcap_set_buffer_size(handle, PCAP_BUFFERSIZE) < 0 ||
pcap_activate(handle) < 0) {
--
2.14.3
6 years, 5 months
[libvirt] ignore_value
by gaosheng cui
Hi,using ignore_value in libvirt source code
to do function return value processing,but I
can’t understand about it,can you give me some tips?thanks very much!
6 years, 5 months
[libvirt] [PATCH v2 0/6] Add support for TPM emulator and CRB interface
by Stefan Berger
This series of patches add support for the new TPM CRB interface in
QEMU that will become available with QEMU 2.12.
The rest of the patches add support for the TPM emulator backend that is
available in QEMU and based on swtpm + libtpms. It allows to attach a
TPM 1.2 or 2 to a QEMU VM. sVirt labels are used for labeling the swtpm
process, its UnixIO socket, and log file with the same label that the
QEMU process gets. Besides that swtpm is added to the emulator cgroup.
The device XML can be changed from a TPM 1.2 to a TPM 2 and back to a
TPM 1.2. The device state is not removed during those changes but only
when the domain is undefined.
I must admit that the first swtpm support patch is quite big. So far I
only broke out the test cases into a subsequent patch.
Regards,
Stefan
v1->v2:
- reorganized directories where files are written to
- all directories and files are chown'ed before swtpm is started
- much refactoring
Stefan Berger (6):
tpm: Enable TPM CRB interface
tpm: Add support for external swtpm TPM emulator
tpm: Add test cases for external swtpm TPM emulator
tpm: Label the external swtpm with SELinux labels
tpm: Add support for choosing emulation of a TPM 2
tpm: Add swtpm to emulator cgroup
docs/formatdomain.html.in | 47 ++
docs/schemas/domaincommon.rng | 23 +-
src/conf/domain_audit.c | 2 +
src/conf/domain_conf.c | 73 ++-
src/conf/domain_conf.h | 15 +
src/libvirt_private.syms | 9 +
src/qemu/Makefile.inc.am | 2 +
src/qemu/libvirtd_qemu.aug | 3 +
src/qemu/qemu.conf | 7 +
src/qemu/qemu_capabilities.c | 10 +
src/qemu/qemu_capabilities.h | 2 +
src/qemu/qemu_cgroup.c | 54 ++
src/qemu/qemu_cgroup.h | 1 +
src/qemu/qemu_command.c | 52 +-
src/qemu/qemu_conf.c | 35 +-
src/qemu/qemu_conf.h | 5 +
src/qemu/qemu_domain.c | 4 +
src/qemu/qemu_driver.c | 7 +
src/qemu/qemu_extdevice.c | 303 +++++++++++
src/qemu/qemu_extdevice.h | 44 ++
src/qemu/qemu_process.c | 16 +
src/qemu/test_libvirtd_qemu.aug.in | 1 +
src/security/security_dac.c | 6 +
src/security/security_driver.h | 4 +
src/security/security_manager.c | 18 +
src/security/security_manager.h | 3 +
src/security/security_selinux.c | 75 +++
src/security/security_stack.c | 19 +
src/util/vircgroup.c | 42 ++
src/util/vircgroup.h | 1 +
src/util/virfile.c | 60 +++
src/util/virfile.h | 2 +
src/util/virtpm.c | 596 ++++++++++++++++++++-
src/util/virtpm.h | 25 +-
tests/qemucapabilitiesdata/caps_2.11.0.s390x.xml | 1 +
tests/qemucapabilitiesdata/caps_2.12.0.aarch64.xml | 1 +
tests/qemucapabilitiesdata/caps_2.12.0.ppc64.xml | 1 +
tests/qemucapabilitiesdata/caps_2.12.0.s390x.xml | 1 +
tests/qemucapabilitiesdata/caps_2.12.0.x86_64.xml | 2 +
tests/qemuxml2argvdata/tpm-emulator-tpm2.args | 24 +
tests/qemuxml2argvdata/tpm-emulator-tpm2.xml | 30 ++
tests/qemuxml2argvdata/tpm-emulator.args | 24 +
tests/qemuxml2argvdata/tpm-emulator.xml | 30 ++
tests/qemuxml2argvdata/tpm-passthrough-crb.args | 24 +
tests/qemuxml2argvdata/tpm-passthrough-crb.xml | 32 ++
tests/qemuxml2argvtest.c | 20 +
tests/qemuxml2xmloutdata/tpm-emulator-tpm2.xml | 34 ++
tests/qemuxml2xmloutdata/tpm-emulator.xml | 34 ++
tests/qemuxml2xmloutdata/tpm-passthrough-crb.xml | 36 ++
tests/qemuxml2xmltest.c | 1 +
50 files changed, 1842 insertions(+), 19 deletions(-)
create mode 100644 src/qemu/qemu_extdevice.c
create mode 100644 src/qemu/qemu_extdevice.h
create mode 100644 tests/qemuxml2argvdata/tpm-emulator-tpm2.args
create mode 100644 tests/qemuxml2argvdata/tpm-emulator-tpm2.xml
create mode 100644 tests/qemuxml2argvdata/tpm-emulator.args
create mode 100644 tests/qemuxml2argvdata/tpm-emulator.xml
create mode 100644 tests/qemuxml2argvdata/tpm-passthrough-crb.args
create mode 100644 tests/qemuxml2argvdata/tpm-passthrough-crb.xml
create mode 100644 tests/qemuxml2xmloutdata/tpm-emulator-tpm2.xml
create mode 100644 tests/qemuxml2xmloutdata/tpm-emulator.xml
create mode 100644 tests/qemuxml2xmloutdata/tpm-passthrough-crb.xml
--
2.5.5
6 years, 5 months
[libvirt] [dbus PATCH 0/6] More DomainAPIs
by Katerina Koukiou
Katerina Koukiou (6):
Implement BlockCopy method for Domain Interface
Implement InterfaceAddresses method for Domain Interface
Implement PinEmulator method for Domain Interface
Implement PinIOThread method for Domain Interface
Implement PinVcpu method for Domain Interface
Implement PMWakeup method for Domain Interface
data/org.libvirt.Domain.xml | 40 +++++++
src/domain.c | 269 ++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 309 insertions(+)
--
2.15.0
6 years, 5 months
[libvirt] [dbus PATCH v3] Implement GetIOThreadInfo method for Domain Interface
by Katerina Koukiou
Signed-off-by: Katerina Koukiou <kkoukiou(a)redhat.com>
---
Use VIR_CPU_USED to parse cpumap
data/org.libvirt.Domain.xml | 6 ++++
src/domain.c | 68 +++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 74 insertions(+)
diff --git a/data/org.libvirt.Domain.xml b/data/org.libvirt.Domain.xml
index 1cd79f8..8be4c52 100644
--- a/data/org.libvirt.Domain.xml
+++ b/data/org.libvirt.Domain.xml
@@ -222,6 +222,12 @@
<arg name="flags" type="u" direction="in"/>
<arg name="interfaceParameters" type="a{sv}" direction="out"/>
</method>
+ <method name="GetIOThreadInfo">
+ <annotation name="org.gtk.GDBus.DocString"
+ value="See https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetIOThread..."/>
+ <arg name="flags" type="u" direction="in"/>
+ <arg name="ioThreadInfo" type="a(uab)" direction="out"/>
+ </method>
<method name="GetJobInfo">
<annotation name="org.gtk.GDBus.DocString"
value="See https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainGetJobInfo"/>
diff --git a/src/domain.c b/src/domain.c
index ec5b99c..9f6ad1b 100644
--- a/src/domain.c
+++ b/src/domain.c
@@ -85,6 +85,25 @@ virtDBusDomainFSInfoListClear(virtDBusDomainFSInfoList *info)
G_DEFINE_AUTO_CLEANUP_CLEAR_FUNC(virtDBusDomainFSInfoList,
virtDBusDomainFSInfoListClear);
+struct _virtDBusDomainIOThreadInfoList {
+ virDomainIOThreadInfoPtr *info;
+ gint count;
+};
+
+typedef struct _virtDBusDomainIOThreadInfoList virtDBusDomainIOThreadInfoList;
+
+static void
+virtDBusDomainIOThreadInfoListClear(virtDBusDomainIOThreadInfoList *info)
+{
+ for (gint i = 0; i < info->count; i++)
+ virDomainIOThreadInfoFree(info->info[i]);
+
+ g_free(info->info);
+}
+
+G_DEFINE_AUTO_CLEANUP_CLEAR_FUNC(virtDBusDomainIOThreadInfoList,
+ virtDBusDomainIOThreadInfoListClear);
+
static GVariant *
virtDBusDomainMemoryStatsToGVariant(virDomainMemoryStatPtr stats,
gint nr_stats)
@@ -1218,6 +1237,54 @@ virtDBusDomainGetInterfaceParameters(GVariant *inArgs,
*outArgs = g_variant_new_tuple(&grecords, 1);
}
+static void
+virtDBusDomainGetIOThreadInfo(GVariant *inArgs,
+ GUnixFDList *inFDs G_GNUC_UNUSED,
+ const gchar *objectPath,
+ gpointer userData,
+ GVariant **outArgs,
+ GUnixFDList **outFDs G_GNUC_UNUSED,
+ GError **error)
+{
+ virtDBusConnect *connect = userData;
+ g_autoptr(virDomain) domain = NULL;
+ g_auto(virtDBusDomainIOThreadInfoList) info = { 0 };
+ GVariantBuilder builder;
+ guint flags;
+ gint cpuCount;
+ GVariant *gret;
+
+ g_variant_get(inArgs, "(u)", &flags);
+
+ domain = virtDBusDomainGetVirDomain(connect, objectPath, error);
+ if (!domain)
+ return;
+
+ info.count = virDomainGetIOThreadInfo(domain, &info.info, flags);
+ if (info.count < 0)
+ return virtDBusUtilSetLastVirtError(error);
+
+ cpuCount = virNodeGetCPUMap(virDomainGetConnect(domain), NULL, NULL, 0);
+ if (cpuCount < 0)
+ return virtDBusUtilSetLastVirtError(error);
+
+ g_variant_builder_init(&builder, G_VARIANT_TYPE("a(uab)"));
+
+ for (gint i = 0; i < info.count; i++) {
+ g_variant_builder_open(&builder, G_VARIANT_TYPE("(uab)"));
+ g_variant_builder_add(&builder, "u", info.info[i]->iothread_id);
+ g_variant_builder_open(&builder, G_VARIANT_TYPE("ab"));
+
+ for (gint j = 0; j < cpuCount; j++)
+ g_variant_builder_add(&builder, "b", VIR_CPU_USED(info.info[i]->cpumap, j));
+ g_variant_builder_close(&builder);
+ g_variant_builder_close(&builder);
+ }
+ gret = g_variant_builder_end(&builder);
+
+ *outArgs = g_variant_new_tuple(&gret, 1);
+}
+
static void
virtDBusDomainGetJobInfo(GVariant *inArgs G_GNUC_UNUSED,
GUnixFDList *inFDs G_GNUC_UNUSED,
@@ -2651,6 +2718,7 @@ static virtDBusGDBusMethodTable virtDBusDomainMethodTable[] = {
{ "GetGuestVcpus", virtDBusDomainGetGuestVcpus },
{ "GetHostname", virtDBusDomainGetHostname },
{ "GetInterfaceParameters", virtDBusDomainGetInterfaceParameters },
+ { "GetIOThreadInfo", virtDBusDomainGetIOThreadInfo },
{ "GetJobInfo", virtDBusDomainGetJobInfo },
{ "GetJobStats", virtDBusDomainGetJobStats },
{ "GetMemoryParameters", virtDBusDomainGetMemoryParameters },
--
2.15.0
6 years, 5 months
[libvirt] [PATCH 0/2] URGENT: Fix TLS migration
by Peter Krempa
TLS would not be enabled for migration even when requested. This is a
regression introduced in the migration params refactoring series pushed
in this devel cycle.
Peter Krempa (2):
qemu: migration: Move and unexport qemuMigrationParamsSetString
qemu: migration: Set the 'set' boolean in qemuMigrationParamsSetString
src/qemu/qemu_migration_params.c | 41 +++++++++++++++++++++++++---------------
src/qemu/qemu_migration_params.h | 5 -----
2 files changed, 26 insertions(+), 20 deletions(-)
--
2.16.2
6 years, 5 months
[libvirt] [dbus PATCH] Revert "Implement MigrateGetMaxDowntime method for Domain Interface"
by Katerina Koukiou
This reverts commit d4a4fd4e9e0ab50f473c24192abc34644cd8213e.
This API was introduced in libvirt 3.7.0 and no APIs from
version > 3.0.0 should be included until next release.
---
data/org.libvirt.Domain.xml | 6 ------
src/domain.c | 31 -------------------------------
2 files changed, 37 deletions(-)
diff --git a/data/org.libvirt.Domain.xml b/data/org.libvirt.Domain.xml
index 1cd79f8..6f919da 100644
--- a/data/org.libvirt.Domain.xml
+++ b/data/org.libvirt.Domain.xml
@@ -332,12 +332,6 @@
<arg name="flags" type="u" direction="in"/>
<arg name="cacheSize" type="t" direction="out"/>
</method>
- <method name="MigrateGetMaxDowntime">
- <annotation name="org.gtk.GDBus.DocString"
- value="See https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainMigrateGetM..."/>
- <arg name="flags" type="u" direction="in"/>
- <arg name="downtime" type="t" direction="out"/>
- </method>
<method name="MigrateGetMaxSpeed">
<annotation name="org.gtk.GDBus.DocString"
value="See https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainMigrateGetM..."/>
diff --git a/src/domain.c b/src/domain.c
index ec5b99c..06cad6f 100644
--- a/src/domain.c
+++ b/src/domain.c
@@ -1793,36 +1793,6 @@ virtDBusDomainMigrateGetCompressionCache(GVariant *inArgs,
*outArgs = g_variant_new("(t)", cacheSize);
}
-static void
-virtDBusDomainMigrateGetMaxDowntime(GVariant *inArgs,
- GUnixFDList *inFDs G_GNUC_UNUSED,
- const gchar *objectPath,
- gpointer userData,
- GVariant **outArgs,
- GUnixFDList **outFDs G_GNUC_UNUSED,
- GError **error)
-{
- virtDBusConnect *connect = userData;
- g_autoptr(virDomain) domain = NULL;
- gulong downtime;
- guint flags;
- gint ret;
-
- g_variant_get(inArgs, "(u)", &flags);
-
- domain = virtDBusDomainGetVirDomain(connect, objectPath, error);
- if (!domain)
- return;
-
- ret = virDomainMigrateGetMaxDowntime(domain,
- (unsigned long long *)&downtime,
- flags);
- if (ret < 0)
- return virtDBusUtilSetLastVirtError(error);
-
- *outArgs = g_variant_new("(t)", downtime);
-}
-
static void
virtDBusDomainMigrateGetMaxSpeed(GVariant *inArgs,
GUnixFDList *inFDs G_GNUC_UNUSED,
@@ -2669,7 +2639,6 @@ static virtDBusGDBusMethodTable virtDBusDomainMethodTable[] = {
{ "MemoryPeek", virtDBusDomainMemoryPeek },
{ "MemoryStats", virtDBusDomainMemoryStats },
{ "MigrateGetCompressionCache", virtDBusDomainMigrateGetCompressionCache },
- { "MigrateGetMaxDowntime", virtDBusDomainMigrateGetMaxDowntime },
{ "MigrateGetMaxSpeed", virtDBusDomainMigrateGetMaxSpeed },
{ "MigrateSetCompressionCache", virtDBusDomainMigrateSetCompressionCache },
{ "MigrateSetMaxDowntime", virtDBusDomainMigrateSetMaxDowntime },
--
2.15.0
6 years, 5 months