qemu: monitor: Remove unused migration property getters/setters

The getters/setters for individual properties of migration
speed/downtime/cache size are unused once we switched to setting them
purely via migration parameters. Remove the unused helpers.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
Peter Krempa 2022-07-15 14:27:41 +02:00
parent e2b86ffa19
commit d531b9c724
5 changed files with 0 additions and 216 deletions

View File

@ -2245,61 +2245,6 @@ qemuMonitorSetDBusVMStateIdList(qemuMonitor *mon,
}
int
qemuMonitorSetMigrationSpeed(qemuMonitor *mon,
unsigned long bandwidth)
{
VIR_DEBUG("bandwidth=%lu", bandwidth);
QEMU_CHECK_MONITOR(mon);
if (bandwidth > QEMU_DOMAIN_MIG_BANDWIDTH_MAX) {
virReportError(VIR_ERR_OVERFLOW,
_("bandwidth must be less than %llu"),
QEMU_DOMAIN_MIG_BANDWIDTH_MAX + 1ULL);
return -1;
}
return qemuMonitorJSONSetMigrationSpeed(mon, bandwidth);
}
int
qemuMonitorSetMigrationDowntime(qemuMonitor *mon,
unsigned long long downtime)
{
VIR_DEBUG("downtime=%llu", downtime);
QEMU_CHECK_MONITOR(mon);
return qemuMonitorJSONSetMigrationDowntime(mon, downtime);
}
int
qemuMonitorGetMigrationCacheSize(qemuMonitor *mon,
unsigned long long *cacheSize)
{
VIR_DEBUG("cacheSize=%p", cacheSize);
QEMU_CHECK_MONITOR(mon);
return qemuMonitorJSONGetMigrationCacheSize(mon, cacheSize);
}
int
qemuMonitorSetMigrationCacheSize(qemuMonitor *mon,
unsigned long long cacheSize)
{
VIR_DEBUG("cacheSize=%llu", cacheSize);
QEMU_CHECK_MONITOR(mon);
return qemuMonitorJSONSetMigrationCacheSize(mon, cacheSize);
}
/**
* qemuMonitorGetMigrationParams:
* @mon: Pointer to the monitor object.

View File

@ -770,17 +770,6 @@ int qemuMonitorSavePhysicalMemory(qemuMonitor *mon,
int qemuMonitorSetDBusVMStateIdList(qemuMonitor *mon,
GSList *list);
int qemuMonitorSetMigrationSpeed(qemuMonitor *mon,
unsigned long bandwidth);
int qemuMonitorSetMigrationDowntime(qemuMonitor *mon,
unsigned long long downtime);
int qemuMonitorGetMigrationCacheSize(qemuMonitor *mon,
unsigned long long *cacheSize);
int qemuMonitorSetMigrationCacheSize(qemuMonitor *mon,
unsigned long long cacheSize);
int qemuMonitorGetMigrationParams(qemuMonitor *mon,
virJSONValue **params);
int qemuMonitorSetMigrationParams(qemuMonitor *mon,

View File

@ -3034,102 +3034,6 @@ qemuMonitorJSONSavePhysicalMemory(qemuMonitor *mon,
}
int qemuMonitorJSONSetMigrationSpeed(qemuMonitor *mon,
unsigned long bandwidth)
{
g_autoptr(virJSONValue) cmd = NULL;
g_autoptr(virJSONValue) reply = NULL;
cmd = qemuMonitorJSONMakeCommand("migrate_set_speed",
"U:value", bandwidth * 1024ULL * 1024ULL,
NULL);
if (!cmd)
return -1;
if (qemuMonitorJSONCommand(mon, cmd, &reply) < 0)
return -1;
if (qemuMonitorJSONCheckError(cmd, reply) < 0)
return -1;
return 0;
}
int qemuMonitorJSONSetMigrationDowntime(qemuMonitor *mon,
unsigned long long downtime)
{
g_autoptr(virJSONValue) cmd = NULL;
g_autoptr(virJSONValue) reply = NULL;
cmd = qemuMonitorJSONMakeCommand("migrate_set_downtime",
"d:value", downtime / 1000.0,
NULL);
if (!cmd)
return -1;
if (qemuMonitorJSONCommand(mon, cmd, &reply) < 0)
return -1;
if (qemuMonitorJSONCheckError(cmd, reply) < 0)
return -1;
return 0;
}
int
qemuMonitorJSONGetMigrationCacheSize(qemuMonitor *mon,
unsigned long long *cacheSize)
{
g_autoptr(virJSONValue) cmd = NULL;
g_autoptr(virJSONValue) reply = NULL;
*cacheSize = 0;
cmd = qemuMonitorJSONMakeCommand("query-migrate-cache-size", NULL);
if (!cmd)
return -1;
if (qemuMonitorJSONCommand(mon, cmd, &reply) < 0)
return -1;
if (qemuMonitorJSONCheckReply(cmd, reply, VIR_JSON_TYPE_NUMBER) < 0)
return -1;
if (virJSONValueObjectGetNumberUlong(reply, "return", cacheSize) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("invalid cache size in query-migrate-cache-size reply"));
return -1;
}
return 0;
}
int
qemuMonitorJSONSetMigrationCacheSize(qemuMonitor *mon,
unsigned long long cacheSize)
{
g_autoptr(virJSONValue) cmd = NULL;
g_autoptr(virJSONValue) reply = NULL;
cmd = qemuMonitorJSONMakeCommand("migrate-set-cache-size",
"U:value", cacheSize,
NULL);
if (!cmd)
return -1;
if (qemuMonitorJSONCommand(mon, cmd, &reply) < 0)
return -1;
if (qemuMonitorJSONCheckError(cmd, reply) < 0)
return -1;
return 0;
}
int
qemuMonitorJSONGetMigrationParams(qemuMonitor *mon,
virJSONValue **params)

View File

@ -152,21 +152,6 @@ qemuMonitorJSONSavePhysicalMemory(qemuMonitor *mon,
unsigned long long length,
const char *path);
int
qemuMonitorJSONSetMigrationSpeed(qemuMonitor *mon,
unsigned long bandwidth);
int
qemuMonitorJSONSetMigrationDowntime(qemuMonitor *mon,
unsigned long long downtime);
int
qemuMonitorJSONGetMigrationCacheSize(qemuMonitor *mon,
unsigned long long *cacheSize);
int
qemuMonitorJSONSetMigrationCacheSize(qemuMonitor *mon,
unsigned long long cacheSize);
int
qemuMonitorJSONGetMigrationParams(qemuMonitor *mon,
virJSONValue **params);

View File

@ -1203,8 +1203,6 @@ GEN_TEST_FUNC(qemuMonitorJSONEjectMedia, "hdc", true)
GEN_TEST_FUNC(qemuMonitorJSONChangeMedia, "hdc", "/foo/bar", "formatstr")
GEN_TEST_FUNC(qemuMonitorJSONSaveVirtualMemory, 0, 1024, "/foo/bar")
GEN_TEST_FUNC(qemuMonitorJSONSavePhysicalMemory, 0, 1024, "/foo/bar")
GEN_TEST_FUNC(qemuMonitorJSONSetMigrationSpeed, 1024)
GEN_TEST_FUNC(qemuMonitorJSONSetMigrationDowntime, 1)
GEN_TEST_FUNC(qemuMonitorJSONMigrate, QEMU_MONITOR_MIGRATE_BACKGROUND |
QEMU_MONITOR_MIGRATE_NON_SHARED_DISK |
QEMU_MONITOR_MIGRATE_NON_SHARED_INC, "tcp:localhost:12345")
@ -1714,40 +1712,6 @@ testQemuMonitorJSONqemuMonitorJSONGetAllBlockStatsInfo(const void *opaque)
}
static int
testQemuMonitorJSONqemuMonitorJSONGetMigrationCacheSize(const void *opaque)
{
const testGenericData *data = opaque;
virDomainXMLOption *xmlopt = data->xmlopt;
unsigned long long cacheSize;
g_autoptr(qemuMonitorTest) test = NULL;
if (!(test = qemuMonitorTestNewSchema(xmlopt, data->schema)))
return -1;
qemuMonitorTestSkipDeprecatedValidation(test, true);
if (qemuMonitorTestAddItem(test, "query-migrate-cache-size",
"{"
" \"return\": 67108864,"
" \"id\": \"libvirt-12\""
"}") < 0)
return -1;
if (qemuMonitorJSONGetMigrationCacheSize(qemuMonitorTestGetMonitor(test),
&cacheSize) < 0)
return -1;
if (cacheSize != 67108864) {
virReportError(VIR_ERR_INTERNAL_ERROR,
"Invalid cacheSize: %llu, expected 67108864",
cacheSize);
return -1;
}
return 0;
}
static int
testQemuMonitorJSONqemuMonitorJSONGetMigrationStats(const void *opaque)
{
@ -3105,8 +3069,6 @@ mymain(void)
DO_TEST_GEN_DEPRECATED(qemuMonitorJSONChangeMedia, true);
DO_TEST_GEN(qemuMonitorJSONSaveVirtualMemory);
DO_TEST_GEN(qemuMonitorJSONSavePhysicalMemory);
DO_TEST_GEN_DEPRECATED(qemuMonitorJSONSetMigrationSpeed, true);
DO_TEST_GEN_DEPRECATED(qemuMonitorJSONSetMigrationDowntime, true);
DO_TEST_GEN(qemuMonitorJSONMigrate);
DO_TEST_GEN(qemuMonitorJSONMigrateRecover);
DO_TEST_SIMPLE("migrate-pause", qemuMonitorJSONMigratePause);
@ -3136,7 +3098,6 @@ mymain(void)
DO_TEST(qemuMonitorJSONGetBalloonInfo);
DO_TEST(qemuMonitorJSONGetBlockInfo);
DO_TEST(qemuMonitorJSONGetAllBlockStatsInfo);
DO_TEST(qemuMonitorJSONGetMigrationCacheSize);
DO_TEST(qemuMonitorJSONGetMigrationStats);
DO_TEST(qemuMonitorJSONGetChardevInfo);
DO_TEST(qemuMonitorJSONSetBlockIoThrottle);