[libvirt] [PATCH v3 0/5] Introduce VIR_ERR_DEVICE_MISSING

Use Introduce VIR_ERR_DEVICE_MISSING for hotplug and detach device error message. Chen Hanxiao (5): qemu: Add some more details for hotplug errors when device not found qemu: Introduce VIR_ERR_DEVICE_MISSING qemu: Use VIR_ERR_DEVICE_MISSING for various hotplug messages qemu: Use VIR_ERR_DEVICE_MISSING for various DetachDeviceConfig messages news: Add VIR_ERR_DEVICE_MISSING change as improvements docs/news.xml | 5 +++++ include/libvirt/virterror.h | 1 + src/conf/domain_conf.c | 8 ++++---- src/libvirt_private.syms | 2 ++ src/qemu/qemu_driver.c | 20 +++++++++---------- src/qemu/qemu_hotplug.c | 47 ++++++++++++++++++++++++++++----------------- src/util/virerror.c | 6 ++++++ 7 files changed, 57 insertions(+), 32 deletions(-) -- 2.14.3

From: Chen Hanxiao <chenhanxiao@gmail.com> More proper/detail error messages updated. Signed-off-by: Chen Hanxiao <chenhanxiao@gmail.com> --- v3: subject changed. some description of logs changed. src/libvirt_private.syms | 2 ++ src/qemu/qemu_hotplug.c | 35 +++++++++++++++++++++++------------ 2 files changed, 25 insertions(+), 12 deletions(-) diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index bc8cc1fba..70a91e5fd 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -203,6 +203,7 @@ virDomainChrConsoleTargetTypeToString; virDomainChrDefForeach; virDomainChrDefFree; virDomainChrDefNew; +virDomainChrDeviceTypeToString; virDomainChrEquals; virDomainChrFind; virDomainChrGetDomainPtrs; @@ -427,6 +428,7 @@ virDomainMemoryDefFree; virDomainMemoryFindByDef; virDomainMemoryFindInactiveByDef; virDomainMemoryInsert; +virDomainMemoryModelTypeToString; virDomainMemoryRemove; virDomainMemorySourceTypeFromString; virDomainMemorySourceTypeToString; diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index 6b245bd6a..1f67ab74a 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -3514,8 +3514,9 @@ qemuDomainChangeGraphics(virQEMUDriverPtr driver, int ret = -1; if (!olddev) { - virReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("cannot find existing graphics device to modify")); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("cannot find existing graphics device to modify of " + "type '%s'"), type); goto cleanup; } @@ -5101,8 +5102,10 @@ qemuDomainDetachShmemDevice(virQEMUDriverPtr driver, qemuDomainObjPrivatePtr priv = vm->privateData; if ((idx = virDomainShmemDefFind(vm->def, dev)) < 0) { - virReportError(VIR_ERR_OPERATION_INVALID, "%s", - _("device not present in domain configuration")); + virReportError(VIR_ERR_OPERATION_INVALID, + _("model '%s' shmem device not present " + "in domain configuration"), + virDomainShmemModelTypeToString(dev->model)); return -1; } @@ -5158,8 +5161,10 @@ qemuDomainDetachWatchdog(virQEMUDriverPtr driver, watchdog->model == dev->model && watchdog->action == dev->action && virDomainDeviceInfoAddressIsEqual(&dev->info, &watchdog->info))) { - virReportError(VIR_ERR_OPERATION_INVALID, "%s", - _("watchdog device not present in domain configuration")); + virReportError(VIR_ERR_OPERATION_INVALID, + _("model '%s' watchdog device not present " + "in domain configuration"), + virDomainWatchdogModelTypeToString(watchdog->model)); return -1; } @@ -5429,8 +5434,10 @@ int qemuDomainDetachChrDevice(virQEMUDriverPtr driver, char *devstr = NULL; if (!(tmpChr = virDomainChrFind(vmdef, chr))) { - virReportError(VIR_ERR_OPERATION_INVALID, "%s", - _("device not present in domain configuration")); + virReportError(VIR_ERR_OPERATION_INVALID, + _("chr type '%s' device not present " + "in domain configuration"), + virDomainChrDeviceTypeToString(chr->deviceType)); goto cleanup; } @@ -5476,8 +5483,10 @@ qemuDomainDetachRNGDevice(virQEMUDriverPtr driver, int ret = -1; if ((idx = virDomainRNGFind(vm->def, rng)) < 0) { - virReportError(VIR_ERR_OPERATION_INVALID, "%s", - _("device not present in domain configuration")); + virReportError(VIR_ERR_OPERATION_INVALID, + _("model '%s' RNG device not present " + "in domain configuration"), + virDomainRNGBackendTypeToString(rng->model)); return -1; } @@ -5519,8 +5528,10 @@ qemuDomainDetachMemoryDevice(virQEMUDriverPtr driver, qemuDomainMemoryDeviceAlignSize(vm->def, memdef); if ((idx = virDomainMemoryFindByDef(vm->def, memdef)) < 0) { - virReportError(VIR_ERR_OPERATION_INVALID, "%s", - _("device not present in domain configuration")); + virReportError(VIR_ERR_OPERATION_INVALID, + _("model '%s' memory device not present " + "in the domain configuration"), + virDomainMemoryModelTypeToString(memdef->model)); return -1; } -- 2.14.3

On 01/22/2018 11:24 PM, Chen Hanxiao wrote:
From: Chen Hanxiao <chenhanxiao@gmail.com>
More proper/detail error messages updated.
Signed-off-by: Chen Hanxiao <chenhanxiao@gmail.com> --- v3: subject changed. some description of logs changed.
src/libvirt_private.syms | 2 ++ src/qemu/qemu_hotplug.c | 35 +++++++++++++++++++++++------------ 2 files changed, 25 insertions(+), 12 deletions(-)
Reviewed-by: John Ferlan <jferlan@redhat.com> John

From: Chen Hanxiao <chenhanxiao@gmail.com> Add new error code to be able to allow consumers (such as Nova) to be able to key of a specific error code rather than needing to search the error message." Signed-off-by: Chen Hanxiao <chenhanxiao@gmail.com> --- v3: commit message updated include/libvirt/virterror.h | 1 + src/util/virerror.c | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/include/libvirt/virterror.h b/include/libvirt/virterror.h index 91ba29784..3e7c7a02c 100644 --- a/include/libvirt/virterror.h +++ b/include/libvirt/virterror.h @@ -320,6 +320,7 @@ typedef enum { VIR_ERR_AGENT_UNSYNCED = 97, /* guest agent replies with wrong id to guest-sync command (DEPRECATED)*/ VIR_ERR_LIBSSH = 98, /* error in libssh transport driver */ + VIR_ERR_DEVICE_MISSING = 99, /* fail to find the desired device */ } virErrorNumber; /** diff --git a/src/util/virerror.c b/src/util/virerror.c index 562c3bc61..c000b0043 100644 --- a/src/util/virerror.c +++ b/src/util/virerror.c @@ -1453,6 +1453,12 @@ virErrorMsg(virErrorNumber error, const char *info) else errmsg = _("libssh transport error: %s"); break; + case VIR_ERR_DEVICE_MISSING: + if (info == NULL) + errmsg = _("device not found"); + else + errmsg = _("device not found: %s"); + break; } return errmsg; } -- 2.14.3

On 01/22/2018 11:24 PM, Chen Hanxiao wrote:
From: Chen Hanxiao <chenhanxiao@gmail.com>
Add new error code to be able to allow consumers (such as Nova) to be able to key of a specific error code rather than needing to search the error message."
Signed-off-by: Chen Hanxiao <chenhanxiao@gmail.com> --- v3: commit message updated
include/libvirt/virterror.h | 1 + src/util/virerror.c | 6 ++++++ 2 files changed, 7 insertions(+)
BTW: This introduces issues for libvirt-perl and I'm assuming libvirt-go - can you generate patches for those and post them? Reviewed-by: John Ferlan <jferlan@redhat.com> John

At 2018-01-31 23:32:35, "John Ferlan" <jferlan@redhat.com> wrote:
On 01/22/2018 11:24 PM, Chen Hanxiao wrote:
From: Chen Hanxiao <chenhanxiao@gmail.com>
Add new error code to be able to allow consumers (such as Nova) to be able to key of a specific error code rather than needing to search the error message."
Signed-off-by: Chen Hanxiao <chenhanxiao@gmail.com> --- v3: commit message updated
include/libvirt/virterror.h | 1 + src/util/virerror.c | 6 ++++++ 2 files changed, 7 insertions(+)
BTW: This introduces issues for libvirt-perl and I'm assuming libvirt-go - can you generate patches for those and post them?
Sure, patches will come soon. Regards, - Chen

From: Chen Hanxiao <chenhanxiao@gmail.com> Modify OPERATION_FAILED error codes to use DEVICE_MISSING instead. Signed-off-by: Chen Hanxiao <chenhanxiao@gmail.com> --- v3: modify virDomainNetFindIdx to use VIR_ERR_DEVICE_MISSING src/conf/domain_conf.c | 8 ++++---- src/qemu/qemu_hotplug.c | 24 ++++++++++++------------ 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index a1c25060f..b81aeed59 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -16228,7 +16228,7 @@ virDomainNetFindIdx(virDomainDefPtr def, virDomainNetDefPtr net) if (matchidx < 0) { if (MACAddrSpecified && PCIAddrSpecified) { - virReportError(VIR_ERR_OPERATION_FAILED, + virReportError(VIR_ERR_DEVICE_MISSING, _("no device matching MAC address %s found on " "%.4x:%.2x:%.2x.%.1x"), virMacAddrFormat(&net->mac, mac), @@ -16237,18 +16237,18 @@ virDomainNetFindIdx(virDomainDefPtr def, virDomainNetDefPtr net) net->info.addr.pci.slot, net->info.addr.pci.function); } else if (PCIAddrSpecified) { - virReportError(VIR_ERR_OPERATION_FAILED, + virReportError(VIR_ERR_DEVICE_MISSING, _("no device found on %.4x:%.2x:%.2x.%.1x"), net->info.addr.pci.domain, net->info.addr.pci.bus, net->info.addr.pci.slot, net->info.addr.pci.function); } else if (MACAddrSpecified) { - virReportError(VIR_ERR_OPERATION_FAILED, + virReportError(VIR_ERR_DEVICE_MISSING, _("no device matching MAC address %s found"), virMacAddrFormat(&net->mac, mac)); } else { - virReportError(VIR_ERR_OPERATION_FAILED, "%s", + virReportError(VIR_ERR_DEVICE_MISSING, "%s", _("no matching device found")); } } diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index 1f67ab74a..12198ec8f 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -3514,7 +3514,7 @@ qemuDomainChangeGraphics(virQEMUDriverPtr driver, int ret = -1; if (!olddev) { - virReportError(VIR_ERR_INTERNAL_ERROR, + virReportError(VIR_ERR_DEVICE_MISSING, _("cannot find existing graphics device to modify of " "type '%s'"), type); goto cleanup; @@ -4809,7 +4809,7 @@ int qemuDomainDetachControllerDevice(virQEMUDriverPtr driver, if ((idx = virDomainControllerFind(vm->def, dev->data.controller->type, dev->data.controller->idx)) < 0) { - virReportError(VIR_ERR_OPERATION_FAILED, + virReportError(VIR_ERR_DEVICE_MISSING, _("controller %s:%d not found"), virDomainControllerTypeToString(dev->data.controller->type), dev->data.controller->idx); @@ -5038,18 +5038,18 @@ int qemuDomainDetachHostDevice(virQEMUDriverPtr driver, if (idx < 0) { switch (subsys->type) { case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI: - virReportError(VIR_ERR_OPERATION_FAILED, + virReportError(VIR_ERR_DEVICE_MISSING, _("host pci device %.4x:%.2x:%.2x.%.1x not found"), pcisrc->addr.domain, pcisrc->addr.bus, pcisrc->addr.slot, pcisrc->addr.function); break; case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_USB: if (usbsrc->bus && usbsrc->device) { - virReportError(VIR_ERR_OPERATION_FAILED, + virReportError(VIR_ERR_DEVICE_MISSING, _("host usb device %03d.%03d not found"), usbsrc->bus, usbsrc->device); } else { - virReportError(VIR_ERR_OPERATION_FAILED, + virReportError(VIR_ERR_DEVICE_MISSING, _("host usb device vendor=0x%.4x product=0x%.4x not found"), usbsrc->vendor, usbsrc->product); } @@ -5058,13 +5058,13 @@ int qemuDomainDetachHostDevice(virQEMUDriverPtr driver, if (scsisrc->protocol == VIR_DOMAIN_HOSTDEV_SCSI_PROTOCOL_TYPE_ISCSI) { virDomainHostdevSubsysSCSIiSCSIPtr iscsisrc = &scsisrc->u.iscsi; - virReportError(VIR_ERR_OPERATION_FAILED, + virReportError(VIR_ERR_DEVICE_MISSING, _("host scsi iSCSI path %s not found"), iscsisrc->src->path); } else { virDomainHostdevSubsysSCSIHostPtr scsihostsrc = &scsisrc->u.host; - virReportError(VIR_ERR_OPERATION_FAILED, + virReportError(VIR_ERR_DEVICE_MISSING, _("host scsi device %s:%u:%u.%llu not found"), scsihostsrc->adapter, scsihostsrc->bus, scsihostsrc->target, scsihostsrc->unit); @@ -5102,7 +5102,7 @@ qemuDomainDetachShmemDevice(virQEMUDriverPtr driver, qemuDomainObjPrivatePtr priv = vm->privateData; if ((idx = virDomainShmemDefFind(vm->def, dev)) < 0) { - virReportError(VIR_ERR_OPERATION_INVALID, + virReportError(VIR_ERR_DEVICE_MISSING, _("model '%s' shmem device not present " "in domain configuration"), virDomainShmemModelTypeToString(dev->model)); @@ -5161,7 +5161,7 @@ qemuDomainDetachWatchdog(virQEMUDriverPtr driver, watchdog->model == dev->model && watchdog->action == dev->action && virDomainDeviceInfoAddressIsEqual(&dev->info, &watchdog->info))) { - virReportError(VIR_ERR_OPERATION_INVALID, + virReportError(VIR_ERR_DEVICE_MISSING, _("model '%s' watchdog device not present " "in domain configuration"), virDomainWatchdogModelTypeToString(watchdog->model)); @@ -5434,7 +5434,7 @@ int qemuDomainDetachChrDevice(virQEMUDriverPtr driver, char *devstr = NULL; if (!(tmpChr = virDomainChrFind(vmdef, chr))) { - virReportError(VIR_ERR_OPERATION_INVALID, + virReportError(VIR_ERR_DEVICE_MISSING, _("chr type '%s' device not present " "in domain configuration"), virDomainChrDeviceTypeToString(chr->deviceType)); @@ -5483,7 +5483,7 @@ qemuDomainDetachRNGDevice(virQEMUDriverPtr driver, int ret = -1; if ((idx = virDomainRNGFind(vm->def, rng)) < 0) { - virReportError(VIR_ERR_OPERATION_INVALID, + virReportError(VIR_ERR_DEVICE_MISSING, _("model '%s' RNG device not present " "in domain configuration"), virDomainRNGBackendTypeToString(rng->model)); @@ -5528,7 +5528,7 @@ qemuDomainDetachMemoryDevice(virQEMUDriverPtr driver, qemuDomainMemoryDeviceAlignSize(vm->def, memdef); if ((idx = virDomainMemoryFindByDef(vm->def, memdef)) < 0) { - virReportError(VIR_ERR_OPERATION_INVALID, + virReportError(VIR_ERR_DEVICE_MISSING, _("model '%s' memory device not present " "in the domain configuration"), virDomainMemoryModelTypeToString(memdef->model)); -- 2.14.3

On 01/22/2018 11:24 PM, Chen Hanxiao wrote:
From: Chen Hanxiao <chenhanxiao@gmail.com>
Modify OPERATION_FAILED error codes to use DEVICE_MISSING instead.
I'll modify this one to: Modify OPERATION_FAILED and INTERNAL_ERROR error codes to use DEVICE_MISSING instead for failures associated with the inability to find the device. This makes it easier for consumers to key off the error code rather than the error message. No need to post another series - just let me know if you're fine with the adjusted text...
Signed-off-by: Chen Hanxiao <chenhanxiao@gmail.com> --- v3: modify virDomainNetFindIdx to use VIR_ERR_DEVICE_MISSING
src/conf/domain_conf.c | 8 ++++---- src/qemu/qemu_hotplug.c | 24 ++++++++++++------------ 2 files changed, 16 insertions(+), 16 deletions(-)
Reviewed-by: John Ferlan <jferlan@redhat.com> John

At 2018-01-31 23:33:35, "John Ferlan" <jferlan@redhat.com> wrote:
On 01/22/2018 11:24 PM, Chen Hanxiao wrote:
From: Chen Hanxiao <chenhanxiao@gmail.com>
Modify OPERATION_FAILED error codes to use DEVICE_MISSING instead.
I'll modify this one to:
Modify OPERATION_FAILED and INTERNAL_ERROR error codes to use DEVICE_MISSING instead for failures associated with the inability to find the device. This makes it easier for consumers to key off the error code rather than the error message.
No need to post another series - just let me know if you're fine with the adjusted text...
Thanks for this adjustment. Regards, - Chen

From: Chen Hanxiao <chenhanxiao@gmail.com> Modify OPERATION_FAILED error codes to use DEVICE_MISSING instead. Signed-off-by: Chen Hanxiao <chenhanxiao@gmail.com> --- src/qemu/qemu_driver.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index a203c9297..10eebd61c 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -8172,7 +8172,7 @@ qemuDomainDetachDeviceConfig(virDomainDefPtr vmdef, case VIR_DOMAIN_DEVICE_HOSTDEV: { hostdev = dev->data.hostdev; if ((idx = virDomainHostdevFind(vmdef, hostdev, &det_hostdev)) < 0) { - virReportError(VIR_ERR_INVALID_ARG, "%s", + virReportError(VIR_ERR_DEVICE_MISSING, "%s", _("device not present in domain configuration")); return -1; } @@ -8184,7 +8184,7 @@ qemuDomainDetachDeviceConfig(virDomainDefPtr vmdef, case VIR_DOMAIN_DEVICE_LEASE: lease = dev->data.lease; if (!(det_lease = virDomainLeaseRemove(vmdef, lease))) { - virReportError(VIR_ERR_INVALID_ARG, + virReportError(VIR_ERR_DEVICE_MISSING, _("Lease %s in lockspace %s does not exist"), lease->key, NULLSTR(lease->lockspace)); return -1; @@ -8196,7 +8196,7 @@ qemuDomainDetachDeviceConfig(virDomainDefPtr vmdef, cont = dev->data.controller; if ((idx = virDomainControllerFind(vmdef, cont->type, cont->idx)) < 0) { - virReportError(VIR_ERR_INVALID_ARG, "%s", + virReportError(VIR_ERR_DEVICE_MISSING, "%s", _("device not present in domain configuration")); return -1; } @@ -8218,7 +8218,7 @@ qemuDomainDetachDeviceConfig(virDomainDefPtr vmdef, fs = dev->data.fs; idx = virDomainFSIndexByName(vmdef, fs->dst); if (idx < 0) { - virReportError(VIR_ERR_OPERATION_FAILED, "%s", + virReportError(VIR_ERR_DEVICE_MISSING, "%s", _("no matching filesystem device was found")); return -1; } @@ -8229,7 +8229,7 @@ qemuDomainDetachDeviceConfig(virDomainDefPtr vmdef, case VIR_DOMAIN_DEVICE_RNG: if ((idx = virDomainRNGFind(vmdef, dev->data.rng)) < 0) { - virReportError(VIR_ERR_OPERATION_FAILED, "%s", + virReportError(VIR_ERR_DEVICE_MISSING, "%s", _("no matching RNG device was found")); return -1; } @@ -8240,7 +8240,7 @@ qemuDomainDetachDeviceConfig(virDomainDefPtr vmdef, case VIR_DOMAIN_DEVICE_MEMORY: if ((idx = virDomainMemoryFindInactiveByDef(vmdef, dev->data.memory)) < 0) { - virReportError(VIR_ERR_OPERATION_FAILED, "%s", + virReportError(VIR_ERR_DEVICE_MISSING, "%s", _("matching memory device was not found")); return -1; } @@ -8252,7 +8252,7 @@ qemuDomainDetachDeviceConfig(virDomainDefPtr vmdef, case VIR_DOMAIN_DEVICE_REDIRDEV: if ((idx = virDomainRedirdevDefFind(vmdef, dev->data.redirdev)) < 0) { - virReportError(VIR_ERR_OPERATION_FAILED, "%s", + virReportError(VIR_ERR_DEVICE_MISSING, "%s", _("no matching redirdev was not found")); return -1; } @@ -8262,7 +8262,7 @@ qemuDomainDetachDeviceConfig(virDomainDefPtr vmdef, case VIR_DOMAIN_DEVICE_SHMEM: if ((idx = virDomainShmemDefFind(vmdef, dev->data.shmem)) < 0) { - virReportError(VIR_ERR_OPERATION_FAILED, "%s", + virReportError(VIR_ERR_DEVICE_MISSING, "%s", _("matching shmem device was not found")); return -1; } @@ -8273,7 +8273,7 @@ qemuDomainDetachDeviceConfig(virDomainDefPtr vmdef, case VIR_DOMAIN_DEVICE_WATCHDOG: if (!vmdef->watchdog) { - virReportError(VIR_ERR_OPERATION_FAILED, "%s", + virReportError(VIR_ERR_DEVICE_MISSING, "%s", _("domain has no watchdog")); return -1; } @@ -8283,7 +8283,7 @@ qemuDomainDetachDeviceConfig(virDomainDefPtr vmdef, case VIR_DOMAIN_DEVICE_INPUT: if ((idx = virDomainInputDefFind(vmdef, dev->data.input)) < 0) { - virReportError(VIR_ERR_OPERATION_FAILED, "%s", + virReportError(VIR_ERR_DEVICE_MISSING, "%s", _("matching input device not found")); return -1; } -- 2.14.3

Let's alter the commit message to be more similar to patch 3/5, e.g.: qemu: Use VIR_ERR_DEVICE_MISSING for various coldplug messages On 01/22/2018 11:24 PM, Chen Hanxiao wrote:
From: Chen Hanxiao <chenhanxiao@gmail.com>
Modify OPERATION_FAILED error codes to use DEVICE_MISSING instead.
Changing this to: Use the DEVICE_MISSING error code when helpers fail to find the requested device. This makes it easier for consumers to key off the error code rather than the error message. ... again no need to post an update, I can make the adjustment...
Signed-off-by: Chen Hanxiao <chenhanxiao@gmail.com> --- src/qemu/qemu_driver.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index a203c9297..10eebd61c 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -8172,7 +8172,7 @@ qemuDomainDetachDeviceConfig(virDomainDefPtr vmdef, case VIR_DOMAIN_DEVICE_HOSTDEV: {
Any specific reason you didn't alter the VIR_DOMAIN_DEVICE_DISK error code as well? I can do that for you before pushing. Reviewed-by: John Ferlan <jferlan@redhat.com> John [...]

At 2018-01-31 23:34:55, "John Ferlan" <jferlan@redhat.com> wrote:
Let's alter the commit message to be more similar to patch 3/5, e.g.:
qemu: Use VIR_ERR_DEVICE_MISSING for various coldplug messages
On 01/22/2018 11:24 PM, Chen Hanxiao wrote:
From: Chen Hanxiao <chenhanxiao@gmail.com>
Modify OPERATION_FAILED error codes to use DEVICE_MISSING instead.
Changing this to:
Use the DEVICE_MISSING error code when helpers fail to find the requested device. This makes it easier for consumers to key off the error code rather than the error message.
...
again no need to post an update, I can make the adjustment...
Signed-off-by: Chen Hanxiao <chenhanxiao@gmail.com> --- src/qemu/qemu_driver.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index a203c9297..10eebd61c 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -8172,7 +8172,7 @@ qemuDomainDetachDeviceConfig(virDomainDefPtr vmdef, case VIR_DOMAIN_DEVICE_HOSTDEV: {
Any specific reason you didn't alter the VIR_DOMAIN_DEVICE_DISK error code as well? I can do that for you before pushing.
Ahh, my fault. Thanks for your help. Regards, - Chen

From: Chen Hanxiao <chenhanxiao@gmail.com> Signed-off-by: Chen Hanxiao <chenhanxiao@gmail.com> --- docs/news.xml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/news.xml b/docs/news.xml index b4d980624..5798f42d8 100644 --- a/docs/news.xml +++ b/docs/news.xml @@ -37,6 +37,11 @@ <section title="New features"> </section> <section title="Improvements"> + <change> + <summary> + qemu: Use VIR_ERR_DEVICE_MISSING for various hotplug/detach messages. + </summary> + </change> </section> <section title="Bug fixes"> </section> -- 2.14.3

On 01/22/2018 11:24 PM, Chen Hanxiao wrote:
From: Chen Hanxiao <chenhanxiao@gmail.com>
Signed-off-by: Chen Hanxiao <chenhanxiao@gmail.com> --- docs/news.xml | 5 +++++ 1 file changed, 5 insertions(+)
diff --git a/docs/news.xml b/docs/news.xml index b4d980624..5798f42d8 100644 --- a/docs/news.xml +++ b/docs/news.xml @@ -37,6 +37,11 @@ <section title="New features"> </section> <section title="Improvements"> + <change> + <summary> + qemu: Use VIR_ERR_DEVICE_MISSING for various hotplug/detach messages. + </summary> + </change>
This is in the wrong place, but I assume that's because of git am picking the wrong place since news.xml has probably changed since you wrote the patch... I'll move it to the proper place before pushing as well. Reviewed-by: John Ferlan <jferlan@redhat.com> John
</section> <section title="Bug fixes"> </section>
participants (2)
-
Chen Hanxiao
-
John Ferlan