[libvirt] [PATCH 0/2] qemu: active blockjob error tweaks

Just a couple error message tweaks/cleanups regarding active block jobs, noticed while looking at https://bugzilla.redhat.com/show_bug.cgi?id=1342276 Cole Robinson (2): qemu: More usage of qemuDomainDiskBlockJobIsActive qemu: migration: use consistent error message src/qemu/qemu_driver.c | 7 +------ src/qemu/qemu_hotplug.c | 6 +----- src/qemu/qemu_migration.c | 2 +- 3 files changed, 3 insertions(+), 12 deletions(-) -- 2.7.4

--- src/remote/remote_protocol.x | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/remote/remote_protocol.x b/src/remote/remote_protocol.x index 3f813a5..0170c0c 100644 --- a/src/remote/remote_protocol.x +++ b/src/remote/remote_protocol.x @@ -5818,7 +5818,8 @@ enum remote_procedure { /** * @generate: none * @priority: high - * @acl: connect:read + * @acl: connect:search_storage_pools + * @aclfilter: storage_pool:getattr */ REMOTE_PROC_CONNECT_STORAGE_POOL_EVENT_REGISTER_ANY = 368, -- 2.7.4

On 06/09/2016 08:15 AM, Cole Robinson wrote:
--- src/remote/remote_protocol.x | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/remote/remote_protocol.x b/src/remote/remote_protocol.x index 3f813a5..0170c0c 100644 --- a/src/remote/remote_protocol.x +++ b/src/remote/remote_protocol.x @@ -5818,7 +5818,8 @@ enum remote_procedure { /** * @generate: none * @priority: high - * @acl: connect:read + * @acl: connect:search_storage_pools + * @aclfilter: storage_pool:getattr */ REMOTE_PROC_CONNECT_STORAGE_POOL_EVENT_REGISTER_ANY = 368,
err, ignore this, was part of offlist GSOC work - Cole

qemuDomainDiskBlockJobIsActive already checks if a disk has a blockjob, and if so, raises an error --- src/qemu/qemu_driver.c | 7 +------ src/qemu/qemu_hotplug.c | 6 +----- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index e70d3ce..e251194 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -13716,15 +13716,10 @@ qemuDomainSnapshotPrepare(virConnectPtr conn, for (i = 0; i < def->ndisks; i++) { virDomainSnapshotDiskDefPtr disk = &def->disks[i]; virDomainDiskDefPtr dom_disk = vm->def->disks[i]; - qemuDomainDiskPrivatePtr dom_diskPriv = QEMU_DOMAIN_DISK_PRIVATE(dom_disk); if (disk->snapshot != VIR_DOMAIN_SNAPSHOT_LOCATION_NONE && - dom_diskPriv->blockjob) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("disk '%s' has an active block job"), - disk->name); + qemuDomainDiskBlockJobIsActive(dom_disk)) goto cleanup; - } switch ((virDomainSnapshotLocation) disk->snapshot) { case VIR_DOMAIN_SNAPSHOT_LOCATION_INTERNAL: diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index 6ce0a84..8c9e7ed 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -3429,12 +3429,8 @@ qemuDomainDetachDiskDevice(virQEMUDriverPtr driver, int ret = -1; qemuDomainObjPrivatePtr priv = vm->privateData; - if (detach->mirror) { - virReportError(VIR_ERR_BLOCK_COPY_ACTIVE, - _("disk '%s' is in an active block job"), - detach->dst); + if (qemuDomainDiskBlockJobIsActive(detach)) goto cleanup; - } qemuDomainMarkDeviceForRemoval(vm, &detach->info); -- 2.7.4

The other two DomainHasBlockJob usage error messages don't contain 'an', so unify things to save translators some effort. Dropping the 'an' is closer to the sentence structure in the errors from qemuDomainDiskBlockJobIsActive as well --- src/qemu/qemu_migration.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index 38c07a8..8afd2a7 100644 --- a/src/qemu/qemu_migration.c +++ b/src/qemu/qemu_migration.c @@ -2276,7 +2276,7 @@ qemuMigrationIsAllowed(virQEMUDriverPtr driver, if (qemuDomainHasBlockjob(vm, false)) { virReportError(VIR_ERR_OPERATION_INVALID, "%s", - _("domain has an active block job")); + _("domain has active block job")); return false; } -- 2.7.4

On 06/09/2016 08:15 AM, Cole Robinson wrote:
Just a couple error message tweaks/cleanups regarding active block jobs, noticed while looking at https://bugzilla.redhat.com/show_bug.cgi?id=1342276
Cole Robinson (2): qemu: More usage of qemuDomainDiskBlockJobIsActive qemu: migration: use consistent error message
src/qemu/qemu_driver.c | 7 +------ src/qemu/qemu_hotplug.c | 6 +----- src/qemu/qemu_migration.c | 2 +- 3 files changed, 3 insertions(+), 12 deletions(-)
ACK series (e.g the real patches not the GSOC one ;-)) John
participants (2)
-
Cole Robinson
-
John Ferlan