mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-20 07:59:00 +00:00
qemu: monitor: Store whether 'query-named-block-nodes' supports 'flat' parameter
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>
This commit is contained in:
parent
3fe74ebd90
commit
b0e4ad5263
@ -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,
|
||||
|
@ -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;
|
||||
};
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user