]> xenbits.xensource.com Git - libvirt.git/commitdiff
bhyve: don't fail on busy tap devices
authorRoman Bogorodskiy <bogorodskiy@gmail.com>
Sun, 23 Mar 2014 09:44:41 +0000 (13:44 +0400)
committerRoman Bogorodskiy <bogorodskiy@gmail.com>
Tue, 25 Mar 2014 16:47:32 +0000 (20:47 +0400)
We use virBhyveTapGetRealDeviceName() to map network interface name
to a real device path, trying to open possible devices and getting
names by ioctl.

Make it skip devices that fail to open with EBUSY because they're
most likely already used by other VMs.

src/bhyve/bhyve_command.c

index a15d345a586e9d0685cffa980f11af4257faa411..42b71fbc467e1e96a7f1b9fdd9b5f8536081e3da 100644 (file)
@@ -69,6 +69,10 @@ virBhyveTapGetRealDeviceName(char *name)
                 goto cleanup;
             }
             if ((fd = open(devpath, O_RDWR)) < 0) {
+                if (errno == EBUSY) {
+                    VIR_FREE(devpath);
+                    continue;
+                }
                 virReportSystemError(errno, _("Unable to open '%s'"), devpath);
                 goto cleanup;
             }