diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 57cd9b1327f2d55136044ab7ea473aa05e9ba677..308a96beef586999196d0738c3cddeb0694d541e 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -18339,7 +18339,8 @@ virDomainDefFindDeviceCallback(virDomainDefPtr def ATTRIBUTE_UNUSED, int virDomainDefFindDevice(virDomainDefPtr def, const char *devAlias, - virDomainDeviceDefPtr dev) + virDomainDeviceDefPtr dev, + bool reportError) { virDomainDefFindDeviceCallbackData data = { devAlias, dev }; @@ -18348,8 +18349,12 @@ virDomainDefFindDevice(virDomainDefPtr def, true, &data); if (dev->type == VIR_DOMAIN_DEVICE_NONE) { - virReportError(VIR_ERR_INTERNAL_ERROR, - _("no device found with alias %s"), devAlias); + if (reportError) { + virReportError(VIR_ERR_INTERNAL_ERROR, + _("no device found with alias %s"), devAlias); + } else { + VIR_DEBUG("no device found with alias %s", devAlias); + } return -1; } diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 25dad16bf1a20b60ab7d2503c0b2afe23e1947c6..00d3c3a4ab3a6574408330afececcd13d2e587ca 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -2690,6 +2690,7 @@ char *virDomainDefGetDefaultEmulator(virDomainDefPtr def, virCapsPtr caps); int virDomainDefFindDevice(virDomainDefPtr def, const char *devAlias, - virDomainDeviceDefPtr dev); + virDomainDeviceDefPtr dev, + bool reportError); #endif /* __DOMAIN_CONF_H */ diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index ef81536791015a193effd63abca577507e92d4af..33839d18120de42734e1521f98aa5a8ab00a3586 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -1329,7 +1329,7 @@ qemuProcessHandleDeviceDeleted(qemuMonitorPtr mon ATTRIBUTE_UNUSED, qemuDomainSignalDeviceRemoval(vm, devAlias); - if (virDomainDefFindDevice(vm->def, devAlias, &dev) < 0) + if (virDomainDefFindDevice(vm->def, devAlias, &dev, true) < 0) goto cleanup; qemuDomainRemoveDevice(driver, vm, &dev);