[libvirt PATCH] qemu_hotplug: Report VIR_ERR_DEVICE_MISSING when device is not found

Lee Yarwood posted 1 patch 2 years, 10 months ago
Test syntax-check failed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/20210614101837.459979-1-lyarwood@redhat.com
src/qemu/qemu_hotplug.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
[libvirt PATCH] qemu_hotplug: Report VIR_ERR_DEVICE_MISSING when device is not found
Posted by Lee Yarwood 2 years, 10 months ago
126db34a81bc9f9f9710408f88cceaa1e34bbbd7 had previously switched various
flows over to this from VIR_ERR_OPERATION_FAILED.

This change simply does the same for qemuDomainDetachPrepDisk,
qemuDomainDetachPrepInput and qemuDomainDetachPrepVsock to allow
management apps to centralise their error handling on just
VIR_ERR_DEVICE_MISSING for missing devices during a detach.
---
 src/qemu/qemu_hotplug.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
index 0640cdd9f7..68bd92cf13 100644
--- a/src/qemu/qemu_hotplug.c
+++ b/src/qemu/qemu_hotplug.c
@@ -5322,7 +5322,7 @@ qemuDomainDetachPrepDisk(virDomainObj *vm,
     int idx;
 
     if ((idx = qemuFindDisk(vm->def, match->dst)) < 0) {
-        virReportError(VIR_ERR_OPERATION_FAILED,
+        virReportError(VIR_ERR_DEVICE_MISSING,
                        _("disk %s not found"), match->dst);
         return -1;
     }
@@ -5819,7 +5819,7 @@ qemuDomainDetachPrepInput(virDomainObj *vm,
     int idx;
 
     if ((idx = virDomainInputDefFind(vm->def, match)) < 0) {
-        virReportError(VIR_ERR_OPERATION_FAILED, "%s",
+        virReportError(VIR_ERR_DEVICE_MISSING, "%s",
                        _("matching input device not found"));
         return -1;
     }
@@ -5855,7 +5855,7 @@ qemuDomainDetachPrepVsock(virDomainObj *vm,
     *detach = vsock = vm->def->vsock;
     if (!vsock ||
         !virDomainVsockDefEquals(match, vsock)) {
-        virReportError(VIR_ERR_OPERATION_FAILED, "%s",
+        virReportError(VIR_ERR_DEVICE_MISSING, "%s",
                        _("matching vsock device not found"));
         return -1;
     }
-- 
2.31.1

Re: [libvirt PATCH] qemu_hotplug: Report VIR_ERR_DEVICE_MISSING when device is not found
Posted by Peter Krempa 2 years, 10 months ago
On Mon, Jun 14, 2021 at 11:18:37 +0100, Lee Yarwood wrote:
> 126db34a81bc9f9f9710408f88cceaa1e34bbbd7 had previously switched various
> flows over to this from VIR_ERR_OPERATION_FAILED.
> 
> This change simply does the same for qemuDomainDetachPrepDisk,
> qemuDomainDetachPrepInput and qemuDomainDetachPrepVsock to allow
> management apps to centralise their error handling on just
> VIR_ERR_DEVICE_MISSING for missing devices during a detach.

The patch looks good but you didn't include your certification of
agreement with the developer certificate of origin (Sign-off).

I can add it without the need to re-send if you agree and reply with the
sign-off.

Re: [libvirt PATCH] qemu_hotplug: Report VIR_ERR_DEVICE_MISSING when device is not found
Posted by Lee Yarwood 2 years, 10 months ago
On Tue, 15 Jun 2021 at 09:28, Peter Krempa <pkrempa@redhat.com> wrote:
>
> On Mon, Jun 14, 2021 at 11:18:37 +0100, Lee Yarwood wrote:
> > 126db34a81bc9f9f9710408f88cceaa1e34bbbd7 had previously switched various
> > flows over to this from VIR_ERR_OPERATION_FAILED.
> >
> > This change simply does the same for qemuDomainDetachPrepDisk,
> > qemuDomainDetachPrepInput and qemuDomainDetachPrepVsock to allow
> > management apps to centralise their error handling on just
> > VIR_ERR_DEVICE_MISSING for missing devices during a detach.
>
> The patch looks good but you didn't include your certification of
> agreement with the developer certificate of origin (Sign-off).
>
> I can add it without the need to re-send if you agree and reply with the
> sign-off.

ACK apologies.

Signed-off-by: Lee Yarwood <lyarwood@redhat.com>