qemuProcessHandleIOError: Prefer lookup by node name

When qemu reports a node name for an I/O error we should prefer the
lookup by node name instead as it gives us the path to the specific
image which caused the error instead of the top level image path.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
Peter Krempa 2025-01-24 17:17:51 +01:00
parent f8f8d5a253
commit 784538a470

View File

@ -837,22 +837,26 @@ qemuProcessHandleIOError(qemuMonitor *mon G_GNUC_UNUSED,
const char *eventPath = ""; const char *eventPath = "";
const char *eventAlias = ""; const char *eventAlias = "";
const char *eventReason = ""; const char *eventReason = "";
virDomainDiskDef *disk; virDomainDiskDef *disk = NULL;
virStorageSource *src = NULL;
virObjectLock(vm); virObjectLock(vm);
priv = QEMU_DOMAIN_PRIVATE(vm); priv = QEMU_DOMAIN_PRIVATE(vm);
if (device) if (nodename)
disk = qemuProcessFindDomainDiskByAliasOrQOM(vm, device, NULL); disk = qemuDomainDiskLookupByNodename(vm->def, priv->backup, nodename, &src);
else if (nodename)
disk = qemuDomainDiskLookupByNodename(vm->def, NULL, nodename, NULL);
else
disk = NULL;
if (disk) { if (!disk)
eventPath = virDomainDiskGetSource(disk); disk = qemuProcessFindDomainDiskByAliasOrQOM(vm, device, NULL);
if (!src && disk)
src = disk->src;
if (disk)
eventAlias = disk->info.alias; eventAlias = disk->info.alias;
}
if (src && src->path)
eventPath = src->path;
if (nospace) if (nospace)
eventReason = "enospc"; eventReason = "enospc";