From: Peter Krempa Date: Wed, 22 Nov 2023 15:47:00 +0000 (+0100) Subject: testQemuMonitorJSONBlockdevReopen: Don't use qemuBlockReopenFormatMon X-Git-Tag: v9.10.0-rc1~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=abd1e08c422e72e4afc39ff48ae260ee8abb494a;p=thirdparty%2Flibvirt.git testQemuMonitorJSONBlockdevReopen: Don't use qemuBlockReopenFormatMon Use the low level monitor API directly to test the QMP wrapper itself. Signed-off-by: Peter Krempa Reviewed-by: Ján Tomko --- diff --git a/tests/qemumonitorjsontest.c b/tests/qemumonitorjsontest.c index 6293b416bd..d9ebb429e7 100644 --- a/tests/qemumonitorjsontest.c +++ b/tests/qemumonitorjsontest.c @@ -2594,6 +2594,8 @@ testQemuMonitorJSONBlockdevReopen(const void *opaque) const testGenericData *data = opaque; g_autoptr(qemuMonitorTest) test = NULL; g_autoptr(virStorageSource) src = virStorageSourceNew(); + g_autoptr(virJSONValue) reopenoptions = virJSONValueNewArray(); + g_autoptr(virJSONValue) srcprops = NULL; if (!(test = qemuMonitorTestNewSchema(data->xmlopt, data->schema))) return -1; @@ -2604,10 +2606,16 @@ testQemuMonitorJSONBlockdevReopen(const void *opaque) qemuBlockStorageSourceSetStorageNodename(src, g_strdup("backing nodename")); src->backingStore = virStorageSourceNew(); + if (!(srcprops = qemuBlockStorageSourceGetFormatProps(src, src->backingStore))) + return -1; + + if (virJSONValueArrayAppend(reopenoptions, &srcprops) < 0) + return -1; + if (qemuMonitorTestAddItem(test, "blockdev-reopen", "{\"return\":{}}") < 0) return -1; - if (qemuBlockReopenFormatMon(qemuMonitorTestGetMonitor(test), src) < 0) + if (qemuMonitorBlockdevReopen(qemuMonitorTestGetMonitor(test), &reopenoptions) < 0) return -1; return 0;