mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-06 11:49:29 +00:00
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:
parent
f8f8d5a253
commit
784538a470
@ -837,22 +837,26 @@ qemuProcessHandleIOError(qemuMonitor *mon G_GNUC_UNUSED,
|
||||
const char *eventPath = "";
|
||||
const char *eventAlias = "";
|
||||
const char *eventReason = "";
|
||||
virDomainDiskDef *disk;
|
||||
virDomainDiskDef *disk = NULL;
|
||||
virStorageSource *src = NULL;
|
||||
|
||||
virObjectLock(vm);
|
||||
priv = QEMU_DOMAIN_PRIVATE(vm);
|
||||
|
||||
if (device)
|
||||
disk = qemuProcessFindDomainDiskByAliasOrQOM(vm, device, NULL);
|
||||
else if (nodename)
|
||||
disk = qemuDomainDiskLookupByNodename(vm->def, NULL, nodename, NULL);
|
||||
else
|
||||
disk = NULL;
|
||||
if (nodename)
|
||||
disk = qemuDomainDiskLookupByNodename(vm->def, priv->backup, nodename, &src);
|
||||
|
||||
if (disk) {
|
||||
eventPath = virDomainDiskGetSource(disk);
|
||||
if (!disk)
|
||||
disk = qemuProcessFindDomainDiskByAliasOrQOM(vm, device, NULL);
|
||||
|
||||
if (!src && disk)
|
||||
src = disk->src;
|
||||
|
||||
if (disk)
|
||||
eventAlias = disk->info.alias;
|
||||
}
|
||||
|
||||
if (src && src->path)
|
||||
eventPath = src->path;
|
||||
|
||||
if (nospace)
|
||||
eventReason = "enospc";
|
||||
|
Loading…
x
Reference in New Issue
Block a user