From: Roman Bogorodskiy Date: Sun, 23 Mar 2014 09:44:41 +0000 (+0400) Subject: bhyve: don't fail on busy tap devices X-Git-Tag: v1.2.3-rc1~20 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=425eeed8c4f3d5566be52ccb481d9557bcb019fa;p=thirdparty%2Flibvirt.git bhyve: don't fail on busy tap devices 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. --- diff --git a/src/bhyve/bhyve_command.c b/src/bhyve/bhyve_command.c index a15d345a58..42b71fbc46 100644 --- a/src/bhyve/bhyve_command.c +++ b/src/bhyve/bhyve_command.c @@ -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; }