]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu_namespace: Move umount() call into #fdef __linux__
authorMichal Privoznik <mprivozn@redhat.com>
Thu, 5 Jan 2023 15:23:58 +0000 (16:23 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Thu, 5 Jan 2023 15:46:55 +0000 (16:46 +0100)
In a recent commit I've introduced an umount() call. But the
function where the call lives is compiled on all OSes, not just
Linux. But umount() is Linux specific. Other OSes have unmount
(FreeBSD), or maybe something else. But since namespaces are
Linux specific, we can wrap the call in #ifdef __linux__ and not
care about other OSes.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
src/qemu/qemu_namespace.c

index fc348c043edd2189e8d21d2ed6c1abfac6836173..5769a4dfe0f6ef5ee34ec902ad3f4432574c6470 100644 (file)
@@ -776,10 +776,12 @@ qemuDomainUnshareNamespace(virQEMUDriverConfig *cfg,
             goto cleanup;
     }
 
+#if defined(__linux__)
     if (umount("/dev") < 0) {
         virReportSystemError(errno, "%s", _("failed to umount devfs on /dev"));
         return -1;
     }
+#endif /* !defined(__linux__) */
 
     if (virFileMoveMount(devPath, "/dev") < 0)
         goto cleanup;