[PATCH] qemu: Jump to cleanup label on umount failure

Jim Fehlig jfehlig at suse.com
Mon Feb 6 18:08:03 UTC 2023


Similar to other error paths in qemuDomainUnshareNamespace(), jump to
the cleanup label on umount error instead of directly returning -1.

Signed-off-by: Jim Fehlig <jfehlig at suse.com>
---

I noticed this while looking at a bug report containing the error. ATM I'm not
sure why the umount failed, but have asked for more info in the bug

https://bugzilla.opensuse.org/show_bug.cgi?id=1207889

 src/qemu/qemu_namespace.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/qemu/qemu_namespace.c b/src/qemu/qemu_namespace.c
index 5769a4dfe0..833313d5a6 100644
--- a/src/qemu/qemu_namespace.c
+++ b/src/qemu/qemu_namespace.c
@@ -779,7 +779,7 @@ qemuDomainUnshareNamespace(virQEMUDriverConfig *cfg,
 #if defined(__linux__)
     if (umount("/dev") < 0) {
         virReportSystemError(errno, "%s", _("failed to umount devfs on /dev"));
-        return -1;
+        goto cleanup;
     }
 #endif /* !defined(__linux__) */
 
-- 
2.39.1



More information about the libvir-list mailing list