mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-12 07:42:56 +00:00
qemu: Drop qemuMonitorGetMigrationCapability
The only remaining user of qemuMonitorGetMigrationCapability is our test suite. Let's replace qemuMonitorGetMigrationCapability with qemuMonitorGetMigrationCapabilities there and drop the unused function. Signed-off-by: Jiri Denemark <jdenemar@redhat.com> Reviewed-by: John Ferlan <jferlan@redhat.com>
This commit is contained in:
parent
310287b1c9
commit
38b0e4f58f
@ -3938,25 +3938,6 @@ qemuMonitorGetMigrationCapabilities(qemuMonitorPtr mon,
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns 1 if @capability is supported, 0 if it's not, or -1 on error.
|
||||
*/
|
||||
int
|
||||
qemuMonitorGetMigrationCapability(qemuMonitorPtr mon,
|
||||
qemuMonitorMigrationCaps capability)
|
||||
{
|
||||
VIR_DEBUG("capability=%d", capability);
|
||||
|
||||
QEMU_CHECK_MONITOR(mon);
|
||||
|
||||
/* No capability is supported without JSON monitor */
|
||||
if (!mon->json)
|
||||
return 0;
|
||||
|
||||
return qemuMonitorJSONGetMigrationCapability(mon, capability);
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
qemuMonitorSetMigrationCapability(qemuMonitorPtr mon,
|
||||
qemuMonitorMigrationCaps capability,
|
||||
|
@ -714,8 +714,6 @@ VIR_ENUM_DECL(qemuMonitorMigrationCaps);
|
||||
|
||||
int qemuMonitorGetMigrationCapabilities(qemuMonitorPtr mon,
|
||||
char ***capabilities);
|
||||
int qemuMonitorGetMigrationCapability(qemuMonitorPtr mon,
|
||||
qemuMonitorMigrationCaps capability);
|
||||
int qemuMonitorSetMigrationCapability(qemuMonitorPtr mon,
|
||||
qemuMonitorMigrationCaps capability,
|
||||
bool state);
|
||||
|
@ -6068,24 +6068,6 @@ qemuMonitorJSONGetMigrationCapabilities(qemuMonitorPtr mon,
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
qemuMonitorJSONGetMigrationCapability(qemuMonitorPtr mon,
|
||||
qemuMonitorMigrationCaps capability)
|
||||
{
|
||||
int ret;
|
||||
char **capsList = NULL;
|
||||
const char *cap = qemuMonitorMigrationCapsTypeToString(capability);
|
||||
|
||||
if (qemuMonitorJSONGetMigrationCapabilities(mon, &capsList) < 0)
|
||||
return -1;
|
||||
|
||||
ret = virStringListHasString((const char **) capsList, cap);
|
||||
|
||||
virStringListFree(capsList);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
qemuMonitorJSONSetMigrationCapability(qemuMonitorPtr mon,
|
||||
qemuMonitorMigrationCaps capability,
|
||||
|
@ -146,8 +146,6 @@ int qemuMonitorJSONGetMigrationStats(qemuMonitorPtr mon,
|
||||
|
||||
int qemuMonitorJSONGetMigrationCapabilities(qemuMonitorPtr mon,
|
||||
char ***capabilities);
|
||||
int qemuMonitorJSONGetMigrationCapability(qemuMonitorPtr mon,
|
||||
qemuMonitorMigrationCaps capability);
|
||||
int qemuMonitorJSONSetMigrationCapability(qemuMonitorPtr mon,
|
||||
qemuMonitorMigrationCaps capability,
|
||||
bool state);
|
||||
|
@ -2214,7 +2214,8 @@ testQemuMonitorJSONqemuMonitorJSONGetMigrationCapability(const void *data)
|
||||
virDomainXMLOptionPtr xmlopt = (virDomainXMLOptionPtr)data;
|
||||
qemuMonitorTestPtr test = qemuMonitorTestNewSimple(true, xmlopt);
|
||||
int ret = -1;
|
||||
int cap;
|
||||
const char *cap;
|
||||
char **caps = NULL;
|
||||
const char *reply =
|
||||
"{"
|
||||
" \"return\": ["
|
||||
@ -2234,12 +2235,14 @@ testQemuMonitorJSONqemuMonitorJSONGetMigrationCapability(const void *data)
|
||||
"{\"return\":{}}") < 0)
|
||||
goto cleanup;
|
||||
|
||||
cap = qemuMonitorJSONGetMigrationCapability(qemuMonitorTestGetMonitor(test),
|
||||
QEMU_MONITOR_MIGRATION_CAPS_XBZRLE);
|
||||
if (cap != 1) {
|
||||
if (qemuMonitorGetMigrationCapabilities(qemuMonitorTestGetMonitor(test),
|
||||
&caps) < 0)
|
||||
goto cleanup;
|
||||
|
||||
cap = qemuMonitorMigrationCapsTypeToString(QEMU_MONITOR_MIGRATION_CAPS_XBZRLE);
|
||||
if (!virStringListHasString((const char **) caps, cap)) {
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
"Unexpected capability: %d, expecting 1",
|
||||
cap);
|
||||
"Expected capability %s is missing", cap);
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
@ -2251,6 +2254,7 @@ testQemuMonitorJSONqemuMonitorJSONGetMigrationCapability(const void *data)
|
||||
ret = 0;
|
||||
cleanup:
|
||||
qemuMonitorTestFree(test);
|
||||
virStringListFree(caps);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user