]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: monitor: Store whether 'query-named-block-nodes' supports 'flat' parameter
authorPeter Krempa <pkrempa@redhat.com>
Wed, 9 Nov 2022 09:53:49 +0000 (10:53 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Wed, 9 Nov 2022 13:08:31 +0000 (14:08 +0100)
Rather than having callers always pass this flag store it in the
qemuMonitor object. Following patches will convert the code to use this
internal flag.

In the future this will also simplify removal when all supported qemu
versions will support the new mode.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/qemu/qemu_monitor.c
src/qemu/qemu_monitor_priv.h

index d09c561e47606b344bbc5e45e1d4a91d1bbae567..dd394cd19bc1fd01f2cc9e78fb8b8c4044f7dcbd 100644 (file)
@@ -622,8 +622,10 @@ qemuMonitorOpenInternal(virDomainObj *vm,
     mon->waitGreeting = true;
     mon->cb = cb;
 
-    if (priv)
+    if (priv) {
         mon->objectAddNoWrap = virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_OBJECT_JSON);
+        mon->queryNamedBlockNodesFlat = virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_QMP_QUERY_NAMED_BLOCK_NODES_FLAT);
+    }
 
     if (virSetCloseExec(mon->fd) < 0) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
index 2f7c662cefe6c5ce34f05058eb7a12c49eef4f97..0826a1da944ed91b68180c20016def4cb4af7e1d 100644 (file)
@@ -90,6 +90,8 @@ struct _qemuMonitor {
 
     /* true if qemu no longer wants 'props' sub-object of object-add */
     bool objectAddNoWrap;
+    /* query-named-block-nodes supports the 'flat' option */
+    bool queryNamedBlockNodesFlat;
 };