computing-offload/generic_vdpa/libvirt/qemu-Avoid-deprecated-query-migrate-cache-size-QMP-c.patch
jiangdongxu 79c4324644 add generic_vdpa basecode
Change-Id: I2d302dda68298877c65c99147f5bf22186a59aac
2024-09-19 17:19:46 +08:00

63 lines
2.1 KiB
Diff

From c458102192d82a3a8a5f045cd9df34c29b287ab8 Mon Sep 17 00:00:00 2001
From: Jiri Denemark <jdenemar@redhat.com>
Date: Wed, 10 Jun 2020 16:13:15 +0200
Subject: [PATCH 4/8] qemu: Avoid deprecated query-migrate-cache-size QMP
command
The same functionality can be achieved using query-migrate-parameters
QMP command and checking the xbzrle-cache-size parameter.
https://bugzilla.redhat.com/show_bug.cgi?id=1829544
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
---
src/qemu/qemu_driver.c | 21 +++++++++++++++++----
1 file changed, 17 insertions(+), 4 deletions(-)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 3482dccc43..1ad33197e0 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -14006,7 +14006,9 @@ qemuDomainMigrateGetCompressionCache(virDomainPtr dom,
virQEMUDriverPtr driver = dom->conn->privateData;
virDomainObjPtr vm;
qemuDomainObjPrivatePtr priv;
+ g_autoptr(qemuMigrationParams) migParams = NULL;
int ret = -1;
+ int rc;
virCheckFlags(0, -1);
@@ -14031,12 +14033,23 @@ qemuDomainMigrateGetCompressionCache(virDomainPtr dom,
goto endjob;
}
- qemuDomainObjEnterMonitor(driver, vm);
+ if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_MIGRATION_PARAM_XBZRLE_CACHE_SIZE)) {
+ if (qemuMigrationParamsFetch(driver, vm, QEMU_ASYNC_JOB_NONE,
+ &migParams) < 0)
+ goto endjob;
- ret = qemuMonitorGetMigrationCacheSize(priv->mon, cacheSize);
+ if (qemuMigrationParamsGetULL(migParams,
+ QEMU_MIGRATION_PARAM_XBZRLE_CACHE_SIZE,
+ cacheSize) < 0)
+ goto endjob;
+ } else {
+ qemuDomainObjEnterMonitor(driver, vm);
+ rc = qemuMonitorGetMigrationCacheSize(priv->mon, cacheSize);
+ if (qemuDomainObjExitMonitor(driver, vm) < 0 || rc < 0)
+ goto endjob;
+ }
- if (qemuDomainObjExitMonitor(driver, vm) < 0)
- ret = -1;
+ ret = 0;
endjob:
qemuDomainObjEndJob(driver, vm);
--
2.27.0