[libvirt] [PATCH] qemu:Add support L2 table cache for qcow2 disk
by Allen Do
The patch add support L2 table cache for qcow2 disk. L2 table cache can
improve IO read and write performance for qcow2 img.
Diff follows:
src/conf/domain_conf.c | 47
+++++++++++++++++++++++++++++++++++++++++++++++
src/conf/domain_conf.h | 5 +++++
src/qemu/qemu_command.c | 7 +++++++
src/qemu/qemu_domain.c | 6 ++++++
tests/qemuxml2argvdata/qemuxml2argv-disk-virtio.args | 2 +-
tests/qemuxml2argvdata/qemuxml2argv-disk-virtio.xml | 3 ++-
6 files changed, 68 insertions(+), 2 deletions(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index beca0be..0a6afca 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -8058,6 +8058,8 @@ virDomainDiskDefParseXML(virDomainXMLOptionPtr xmlopt,
char *domain_name = NULL;
int expected_secret_usage = -1;
int auth_secret_usage = -1;
+ char *disk_l2_cache_size = NULL;
+ char *disk_cache_clean_interval = NULL;
if (!(def = virDomainDiskDefNew(xmlopt)))
return NULL;
@@ -8233,6 +8235,27 @@ virDomainDiskDefParseXML(virDomainXMLOptionPtr
xmlopt,
}
} else if (xmlStrEqual(cur->name, BAD_CAST "boot")) {
/* boot is parsed as part of virDomainDeviceInfoParseXML */
+ } else if (xmlStrEqual(cur->name, BAD_CAST "diskCache")) {
+ disk_l2_cache_size =
+ virXMLPropString(cur, "disk_l2_cache_size");
+ if (disk_l2_cache_size &&
+ virStrToLong_ui(disk_l2_cache_size, NULL, 0,
+ &def->disk_cache.disk_l2_cache_size) < 0) {
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("invalid disk L2 cache size '%s'"),
+ disk_l2_cache_size);
+ goto error;
+ }
+ disk_cache_clean_interval =
+ virXMLPropString(cur, "disk_cache_clean_interval");
+ if (disk_cache_clean_interval &&
+ virStrToLong_ui(disk_cache_clean_interval, NULL, 0,
+
&def->disk_cache.disk_cache_clean_interval) < 0) {
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("invalid disk cache clean interval '%s'"),
+ disk_cache_clean_interval);
+ goto error;
+ }
}
}
@@ -8472,6 +8495,8 @@ virDomainDiskDefParseXML(virDomainXMLOptionPtr xmlopt,
VIR_FREE(vendor);
VIR_FREE(product);
VIR_FREE(domain_name);
+ VIR_FREE(disk_l2_cache_size);
+ VIR_FREE(disk_cache_clean_interval);
ctxt->node = save_ctxt;
return def;
@@ -20646,6 +20671,27 @@ virDomainDiskBlockIoDefFormat(virBufferPtr buf,
}
}
+static void
+virDomainDiskCacheDefFormat(virBufferPtr buf,
+ virDomainDiskDefPtr def)
+{
+ if (def->disk_cache.disk_l2_cache_size > 0 ||
+ def->disk_cache.disk_cache_clean_interval > 0) {
+ virBufferAddLit(buf, "<diskCache");
+ if (def->disk_cache.disk_l2_cache_size > 0) {
+ virBufferAsprintf(buf,
+ " disk_l2_cache_size='%u'",
+ def->disk_cache.disk_l2_cache_size);
+ }
+ if (def->disk_cache.disk_cache_clean_interval > 0) {
+ virBufferAsprintf(buf,
+ " disk_cache_clean_interval='%u'",
+ def->disk_cache.disk_cache_clean_interval);
+ }
+ virBufferAddLit(buf, "/>\n");
+ }
+}
+
/* virDomainSourceDefFormatSeclabel:
*
@@ -20990,6 +21036,7 @@ virDomainDiskDefFormat(virBufferPtr buf,
virDomainDiskGeometryDefFormat(buf, def);
virDomainDiskBlockIoDefFormat(buf, def);
+ virDomainDiskCacheDefFormat(buf, def);
/* For now, mirroring is currently output-only: we only output it
* for live domains, therefore we ignore it on input except for
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index 91a33cb..83ea9d3 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -647,6 +647,11 @@ struct _virDomainDiskDef {
unsigned int physical_block_size;
} blockio;
+ struct {
+ unsigned int disk_l2_cache_size;
+ unsigned int disk_cache_clean_interval;
+ } disk_cache;
+
virDomainBlockIoTuneInfo blkdeviotune;
char *serial;
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index e087891..7c47cd3 100755
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -1662,6 +1662,13 @@ qemuBuildDriveStr(virDomainDiskDefPtr disk,
if (qemuBuildDriveSourceStr(disk, cfg, &opt, qemuCaps) < 0)
goto error;
+ if (disk->disk_cache.disk_l2_cache_size > 0)
+ virBufferAsprintf(&opt, "l2-cache-size=%u,",
+ disk->disk_cache.disk_l2_cache_size);
+ if (disk->disk_cache.disk_cache_clean_interval > 0)
+ virBufferAsprintf(&opt, "cache-clean-interval=%u,",
+ disk->disk_cache.disk_cache_clean_interval);
+
if (emitDeviceSyntax)
virBufferAddLit(&opt, "if=none");
else
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index 9f165c1..de334a7 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -5408,6 +5408,12 @@ qemuDomainDiskChangeSupported(virDomainDiskDefPtr
disk,
CHECK_EQ(ioeventfd, "ioeventfd", true);
CHECK_EQ(event_idx, "event_idx", true);
CHECK_EQ(copy_on_read, "copy_on_read", true);
+
+ CHECK_EQ(disk_cache.disk_l2_cache_size,
+ "diskCache disk_l2_cache_size", true);
+ CHECK_EQ(disk_cache.disk_cache_clean_interval,
+ "diskCache disk_cache_clean_interval", true);
+
/* "snapshot" is a libvirt internal field and thus can be changed */
/* startupPolicy is allowed to be updated. Therefore not checked here.
*/
CHECK_EQ(transient, "transient", true);
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-virtio.args
b/tests/qemuxml2argvdata/qemuxml2argv-disk-virtio.args
index b405242..b968302 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-disk-virtio.args
+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-virtio.args
@@ -22,7 +22,7 @@ QEMU_AUDIO_DRV=none \
-drive file=/dev/HostVG/QEMUGuest2,format=raw,if=none,media=cdrom,\
id=drive-ide0-1-0,readonly=on \
-device ide-drive,bus=ide.1,unit=0,drive=drive-ide0-1-0,id=ide0-1-0 \
--drive file=/tmp/data.img,format=raw,if=none,id=drive-virtio-disk0 \
+-drive
file=/tmp/data.img,format=qcow2,l2-cache-size=536870912,cache-clean-interval=900,if=none,id=drive-virtio-disk0
\
-device virtio-blk-pci,bus=pci.0,addr=0x3,drive=drive-virtio-disk0,\
id=virtio-disk0 \
-drive file=/tmp/logs.img,format=raw,if=none,id=drive-virtio-disk1 \
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-virtio.xml
b/tests/qemuxml2argvdata/qemuxml2argv-disk-virtio.xml
index b843878..43298fb 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-disk-virtio.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-virtio.xml
@@ -28,8 +28,9 @@
<address type='drive' controller='0' bus='1' target='0' unit='0'/>
</disk>
<disk type='file' device='disk'>
- <driver name='qemu' type='raw'/>
+ <driver name='qemu' type='qcow2'/>
<source file='/tmp/data.img'/>
+ <diskCache disk_l2_cache_size='53687'
disk_cache_clean_interval='900' />
<target dev='vda' bus='virtio'/>
</disk>
<disk type='file' device='disk'>
Thanks
6 years, 4 months
[libvirt] [PATCH v2 00/11] RISC-V Guest Support
by Lubomir Rintel
Hello,
here's a second version of the RISV-V support patch set, initally
submitted just under a month ago [1].
[1] https://www.redhat.com/archives/libvir-list/2018-May/thread.html#01008
Thanks to the Andrea's suggestions the patch is now considerably
thinner, and split to hopefully more manageable changes.
Aside from the test suite, my test case is this (with images from [2]):
virt-install \
--import --name riscv64 \
--arch riscv64 --machine virt \
--memory 2048 \
--rng /dev/urandom \
--disk /var/lib/libvirt/images/stage4-disk.img,bus=virtio \
--boot kernel=/var/lib/libvirt/images/bbl,kernel_args="console=ttyS0 ro root=/dev/vda"
[2] https://fedorapeople.org/groups/risc-v/disk-images/
Note that the large test suite changes that touch the '*.replies' files
seem to upset the mail server, thus you're unlikely to receive them from
the list. You can get them straight from my repository instead:
git fetch https://github.com/lkundrak/libvirt.git lr/riscv-v2:riscv-v2
git checkout riscv-v2
Thanks!
Lubo
Diffstat follows.
Lubomir Rintel (11):
qemu: rename qemuDomainMachineIsVirt()
qemu: rename qemuDomainArmVirt()
util: add RISC-V architectures
docs/schemas: add RISC-V architectures
qemu: no USB by default on RISC-V machines
qemu: assign addresses to virtio devices on RISC-V
tests/capabilitiestest: add RISC-V capability tests
tests/util: add RISC-V capabilities
tests/captest: check RISC-V capabilities lookup
tests/qemuxml2argvtest: test RISC-V virt machine arguments
tests/virschematest: add RISC-V to capabilityschemadata/caps-qemu-kvm
docs/schemas/basictypes.rng | 2 +
src/qemu/qemu_capabilities.c | 6 +-
src/qemu/qemu_command.c | 4 +-
src/qemu/qemu_domain.c | 27 +-
src/qemu/qemu_domain.h | 6 +-
src/qemu/qemu_domain_address.c | 23 +-
src/util/virarch.c | 3 +
src/util/virarch.h | 6 +
tests/capabilityschemadata/caps-qemu-kvm.xml | 36 +
.../caps_2.12.0.riscv32.replies | 14679 ++++++++++++++++
.../caps_2.12.0.riscv32.xml | 126 +
.../caps_2.12.0.riscv64.replies | 14679 ++++++++++++++++
.../caps_2.12.0.riscv64.xml | 126 +
tests/qemucapabilitiestest.c | 2 +
tests/qemuxml2argvdata/riscv64-virt.args | 31 +
tests/qemuxml2argvdata/riscv64-virt.xml | 32 +
tests/qemuxml2argvtest.c | 3 +
.../riscv64-virt.xml | 39 +
tests/testutilsqemu.c | 72 +
tests/vircapstest.c | 6 +
20 files changed, 29887 insertions(+), 21 deletions(-)
create mode 100644 tests/qemucapabilitiesdata/caps_2.12.0.riscv32.replies
create mode 100644 tests/qemucapabilitiesdata/caps_2.12.0.riscv32.xml
create mode 100644 tests/qemucapabilitiesdata/caps_2.12.0.riscv64.replies
create mode 100644 tests/qemucapabilitiesdata/caps_2.12.0.riscv64.xml
create mode 100644 tests/qemuxml2argvdata/riscv64-virt.args
create mode 100644 tests/qemuxml2argvdata/riscv64-virt.xml
create mode 100644 tests/qemuxml2startupxmloutdata/riscv64-virt.xml
--
2.17.1
6 years, 4 months
[libvirt] [PATCH 0/2] {lxc, util}: Fixing issues with NULL argument for
by Julio Faracco
This serie fixes the argument 'type' of syscall mount(). Valgrind is
throwing a memory issue when that parameter is NULL. The best option
to fix this issue is replace NULL to "none" filesystem.
Julio Faracco (2):
lxc: moving 'type' argument to avoid issues with mount() syscall.
util: moving 'type' argument to avoid issues with mount() syscall.
src/lxc/lxc_container.c | 26 +++++++++++++-------------
src/util/vircgroup.c | 2 +-
2 files changed, 14 insertions(+), 14 deletions(-)
--
2.17.1
6 years, 4 months
[libvirt] [PATCH] spec: list new nwfilter schema files
by Pavel Hrdina
Commit <41d619e99c2015eab2d56bea874e23ba9f52f829> introduced new RNG
schema files for nwfilter but forgot to update spec file.
Signed-off-by: Pavel Hrdina <phrdina(a)redhat.com>
---
Pushed under build-breaker rule.
libvirt.spec.in | 2 ++
1 file changed, 2 insertions(+)
diff --git a/libvirt.spec.in b/libvirt.spec.in
index 54549cc737..720870e2b1 100644
--- a/libvirt.spec.in
+++ b/libvirt.spec.in
@@ -2052,6 +2052,8 @@ exit 0
%{_datadir}/libvirt/schemas/networkcommon.rng
%{_datadir}/libvirt/schemas/nodedev.rng
%{_datadir}/libvirt/schemas/nwfilter.rng
+%{_datadir}/libvirt/schemas/nwfilter_params.rng
+%{_datadir}/libvirt/schemas/nwfilterbinding.rng
%{_datadir}/libvirt/schemas/secret.rng
%{_datadir}/libvirt/schemas/storagecommon.rng
%{_datadir}/libvirt/schemas/storagepool.rng
--
2.17.1
6 years, 4 months
[libvirt] [PATCH] qemu: hotplug: fix mdev attach for vfio-ccw
by Bjoern Walk
Mediated devices of model 'vfio-ccw' are using CCW addresses, so make
sure to call the correct address preparation code for the model.
Reviewed-by: Shalini Chellathurai Saroja <shalini(a)linux.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy(a)linux.ibm.com>
Signed-off-by: Bjoern Walk <bwalk(a)linux.ibm.com>
---
src/qemu/qemu_hotplug.c | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
index 7a1bbc7c..46d30ddd 100644
--- a/src/qemu/qemu_hotplug.c
+++ b/src/qemu/qemu_hotplug.c
@@ -2446,8 +2446,15 @@ qemuDomainAttachMediatedDevice(virQEMUDriverPtr driver,
virDomainDeviceDef dev = { VIR_DOMAIN_DEVICE_HOSTDEV,
{ .hostdev = hostdev } };
- if (qemuDomainEnsurePCIAddress(vm, &dev, driver) < 0)
- return -1;
+ switch (hostdev->source.subsys.u.mdev.model) {
+ case VIR_MDEV_MODEL_TYPE_VFIO_PCI:
+ if (qemuDomainEnsurePCIAddress(vm, &dev, driver) < 0)
+ return -1;
+ break;
+ case VIR_MDEV_MODEL_TYPE_VFIO_CCW:
+ case VIR_MDEV_MODEL_TYPE_LAST:
+ break;
+ }
if (qemuHostdevPrepareMediatedDevices(driver,
vm->def->name,
--
2.17.0
6 years, 4 months
[libvirt] [PATCH] syms: Fix placement of virDomainGetBlkioParametersAssignFromDef
by Cole Robinson
It's in the domain_addr.h section, but should be in the
domain_conf.h section
Signed-off-by: Cole Robinson <crobinso(a)redhat.com>
---
Pushed as trivial
src/libvirt_private.syms | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
index f81333baf6..5499a368c0 100644
--- a/src/libvirt_private.syms
+++ b/src/libvirt_private.syms
@@ -110,7 +110,6 @@ virDomainCCWAddressReleaseAddr;
virDomainCCWAddressSetCreate;
virDomainCCWAddressSetFree;
virDomainCCWAddressValidate;
-virDomainGetBlkioParametersAssignFromDef;
virDomainPCIAddressAsString;
virDomainPCIAddressBusIsFullyReserved;
virDomainPCIAddressBusSetModel;
@@ -364,6 +363,7 @@ virDomainFSTypeToString;
virDomainFSWrpolicyTypeFromString;
virDomainFSWrpolicyTypeToString;
virDomainGenerateMachineName;
+virDomainGetBlkioParametersAssignFromDef;
virDomainGetFilesystemForTarget;
virDomainGraphicsAuthConnectedTypeFromString;
virDomainGraphicsAuthConnectedTypeToString;
--
2.17.1
6 years, 4 months
[libvirt] [PATCH] domain_addr: Fix weird comment format
by Cole Robinson
Signed-off-by: Cole Robinson <crobinso(a)redhat.com>
---
Pushed as trivial
src/conf/domain_addr.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/src/conf/domain_addr.c b/src/conf/domain_addr.c
index 8964973e03..39f22b82eb 100644
--- a/src/conf/domain_addr.c
+++ b/src/conf/domain_addr.c
@@ -1348,12 +1348,12 @@ virDomainVirtioSerialAddrSetFree(virDomainVirtioSerialAddrSetPtr addrs)
/* virDomainVirtioSerialAddrSetCreateFromDomain
-+ *
-+ * @def: Domain def to introspect
-+ *
-+ * Inspect the domain definition and return an address set containing
-+ * every virtio serial address we find
-+ */
+ *
+ * @def: Domain def to introspect
+ *
+ * Inspect the domain definition and return an address set containing
+ * every virtio serial address we find
+ */
virDomainVirtioSerialAddrSetPtr
virDomainVirtioSerialAddrSetCreateFromDomain(virDomainDefPtr def)
{
--
2.17.1
6 years, 4 months
[libvirt] [PATCH v4 0/6] nwfilter: refactor the driver to make it independent of virt drivers
by Daniel P. Berrangé
v1: https://www.redhat.com/archives/libvir-list/2018-April/msg02616.html
v2: https://www.redhat.com/archives/libvir-list/2018-May/msg01145.html
v3: https://www.redhat.com/archives/libvir-list/2018-June/msg01121.html
Today the nwfilter driver is entangled with the virt drivers in both
directions. At various times when rebuilding filters nwfilter will call
out to the virt driver to iterate over running guest's NICs. This has
caused very complicated lock ordering rules to be required. If we are to
split the virt drivers out into separate daemons we need to get rid of
this coupling since we don't want the separate daemons calling each
other, as that risks deadlock if all of the RPC workers are busy.
The obvious way to solve this is to have the nwfilter driver remember
all the filters it has active, avoiding the need to iterate over running
guests.
Changed in v4:
- Merged already reviewed patches
- Correctly handle nwfilter recreate on daemon startup
- Added virsh docs
Changed in v3:
- Updated API version numbers
- Use accessors for virNWFilterBindingObjPtr struct
- Other fixes John mentioned
Changed in v2:
- The virNWFilterBindingPtr was renamed virNWFilterBindingDefPtr
- New virNWFilterBindingObjPtr & virNWFilterBindingObjListPtr
structs added to track the objects in the driver
- New virNWFilterBindingPtr public API type was added
- New public APIs for listing filter bindings, querying XML, and
creating/deleting them
- Convert the virt drivers to use the public API for creating
and deleting bindings
- Persistent active bindings out to disk so they're preserved
across restarts
- Added RNG schema and XML-2-XML test
- New virsh commands for listing/querying XML/creating/deleting
bindings
Daniel P. Berrangé (6):
virsh: add manpage docs for nwfilter-binding commands.
nwfilter: keep track of active filter bindings
nwfilter: remove virt driver callback layer for rebuilding filters
nwfilter: wire up new APIs for listing and querying filter bindings
nwfilter: wire up new APIs for creating and deleting nwfilter bindings
nwfilter: convert virt drivers to use public API for nwfilter bindings
src/conf/domain_nwfilter.c | 135 ++++++++++++--
src/conf/domain_nwfilter.h | 16 +-
src/conf/nwfilter_conf.c | 136 ++------------
src/conf/nwfilter_conf.h | 51 +-----
src/conf/virnwfilterobj.c | 4 +-
src/conf/virnwfilterobj.h | 4 +
src/libvirt_private.syms | 8 +-
src/lxc/lxc_driver.c | 28 ---
src/lxc/lxc_process.c | 2 +-
src/nwfilter/nwfilter_driver.c | 236 ++++++++++++++++++++-----
src/nwfilter/nwfilter_gentech_driver.c | 187 ++++++++++----------
src/nwfilter/nwfilter_gentech_driver.h | 8 +-
src/qemu/qemu_driver.c | 25 ---
src/qemu/qemu_hotplug.c | 4 +-
src/qemu/qemu_interface.c | 4 +-
src/qemu/qemu_process.c | 6 +-
src/remote/remote_daemon.c | 1 +
src/uml/uml_conf.c | 2 +-
src/uml/uml_driver.c | 29 ---
tools/virsh.pod | 35 ++++
20 files changed, 478 insertions(+), 443 deletions(-)
--
2.17.1
6 years, 4 months
[libvirt] [PATCH 0/2] qemu: add comma escaping in qemuBuildSCSIiSCSIHostdevDrvStr
by Anya Harter
In order to use the virQEMUBuildBufferEscapeComma function to escape the
commas, the function first had to be converted to use a buffer.
Added a test case for comma escaping in name-escape.xml.
This should complete the BiteSizedTask entry at
https://wiki.libvirt.org/page/BiteSizedTasks#qemu:_Use_comma_escaping_for....
Anya Harter (2):
qemu: use virBuffer in qemuBuildSCSIiSCSIHostdevDrvStr
qemu: Escape commas for qemuBuildSCSIiSCSIHostdevDrvStr
src/qemu/qemu_command.c | 19 +++++++++++++------
tests/qemuxml2argvdata/name-escape.args | 6 +++++-
tests/qemuxml2argvdata/name-escape.xml | 7 +++++++
tests/qemuxml2argvtest.c | 5 ++++-
4 files changed, 29 insertions(+), 8 deletions(-)
--
2.17.1
6 years, 4 months
[libvirt] [PATCH v2] qemuDomainObjBeginJobInternal: Report agent job in error message
by Michal Privoznik
If a thread is unable to acquire a job (e.g. because of timeout)
an error is reported and the error message contains reference to
the other thread holding the job. Well, the error message should
report agent job too as it is yet another source of possible
failure.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
diff to v1:
- Expand messages to cover all @blocker and @agentBlocker possibilities
(as Jira requested in review)
src/qemu/qemu_domain.c | 46 ++++++++++++++++++++++++++++++++++++++--------
1 file changed, 38 insertions(+), 8 deletions(-)
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index 95c3e3a8aa..3410774781 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -6420,6 +6420,7 @@ qemuDomainObjBeginJobInternal(virQEMUDriverPtr driver,
bool async = job == QEMU_JOB_ASYNC;
virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver);
const char *blocker = NULL;
+ const char *agentBlocker = NULL;
int ret = -1;
unsigned long long duration = 0;
unsigned long long agentDuration = 0;
@@ -6549,16 +6550,32 @@ qemuDomainObjBeginJobInternal(virQEMUDriverPtr driver,
priv->job.apiFlags,
duration / 1000, agentDuration / 1000, asyncDuration / 1000);
- if (nested || qemuDomainNestedJobAllowed(priv, job))
- blocker = priv->job.ownerAPI;
- else
- blocker = priv->job.asyncOwnerAPI;
+ if (job) {
+ if (nested || qemuDomainNestedJobAllowed(priv, job))
+ blocker = priv->job.ownerAPI;
+ else
+ blocker = priv->job.asyncOwnerAPI;
+ }
+
+ if (agentJob)
+ agentBlocker = priv->job.agentOwnerAPI;
if (errno == ETIMEDOUT) {
- if (blocker) {
+ if (blocker && agentBlocker) {
virReportError(VIR_ERR_OPERATION_TIMEOUT,
- _("cannot acquire state change lock (held by %s)"),
+ _("cannot acquire state change "
+ "lock (held by monitor=%s agent=%s)"),
+ blocker, agentBlocker);
+ } else if (blocker) {
+ virReportError(VIR_ERR_OPERATION_TIMEOUT,
+ _("cannot acquire state change "
+ "lock (held by monitor=%s)"),
blocker);
+ } else if (agentBlocker) {
+ virReportError(VIR_ERR_OPERATION_TIMEOUT,
+ _("cannot acquire state change "
+ "lock (held by agent=%s)"),
+ agentBlocker);
} else {
virReportError(VIR_ERR_OPERATION_TIMEOUT, "%s",
_("cannot acquire state change lock"));
@@ -6566,11 +6583,24 @@ qemuDomainObjBeginJobInternal(virQEMUDriverPtr driver,
ret = -2;
} else if (cfg->maxQueuedJobs &&
priv->jobs_queued > cfg->maxQueuedJobs) {
- if (blocker) {
+ if (blocker && agentBlocker) {
virReportError(VIR_ERR_OPERATION_FAILED,
- _("cannot acquire state change lock (held by %s) "
+ _("cannot acquire state change "
+ "lock (held by monitor=%s agent=%s) "
+ "due to max_queued limit"),
+ blocker, agentBlocker);
+ } else if (blocker) {
+ virReportError(VIR_ERR_OPERATION_FAILED,
+ _("cannot acquire state change "
+ "lock (held by monitor=%s) "
"due to max_queued limit"),
blocker);
+ } else if (agentBlocker) {
+ virReportError(VIR_ERR_OPERATION_FAILED,
+ _("cannot acquire state change "
+ "lock (held by agent=%s) "
+ "due to max_queued limit"),
+ agentBlocker);
} else {
virReportError(VIR_ERR_OPERATION_FAILED, "%s",
_("cannot acquire state change lock "
--
2.16.4
6 years, 4 months