From: Michal Privoznik Date: Wed, 8 Apr 2026 11:57:37 +0000 (+0200) Subject: virnetdevmacvlan: Drop udev busy loop from virNetDevMacVLanTapOpen() X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e52ca27026c08d1bee48fcb63ec717ef96d7911e;p=thirdparty%2Flibvirt.git virnetdevmacvlan: Drop udev busy loop from virNetDevMacVLanTapOpen() Now that after previous commit the wait for udev to settle down is done right after device creation, there's no need to have additional wait in virNetDevMacVLanTapOpen(). It's effectively a dead code. Remove it. Tested-by: Johannes Segitz Reviewed-by: Laine Stump Signed-off-by: Michal Privoznik --- diff --git a/src/util/virnetdevmacvlan.c b/src/util/virnetdevmacvlan.c index e7e27b57fd..c981afad5a 100644 --- a/src/util/virnetdevmacvlan.c +++ b/src/util/virnetdevmacvlan.c @@ -160,7 +160,6 @@ virNetDevMacVLanTapOpen(const char *ifname, int *tapfd, size_t tapfdSize) { - int retries = 10; int ret = -1; int ifindex; size_t i = 0; @@ -174,20 +173,13 @@ virNetDevMacVLanTapOpen(const char *ifname, for (i = 0; i < tapfdSize; i++) { int fd = -1; - while (fd < 0) { - if ((fd = open(tapname, O_RDWR)) >= 0) { - tapfd[i] = fd; - } else if (retries-- > 0) { - /* may need to wait for udev to be done */ - g_usleep(20000); - } else { - /* However, if haven't succeeded, quit. */ - virReportSystemError(errno, - _("cannot open macvtap tap device %1$s"), - tapname); - goto cleanup; - } + if ((fd = open(tapname, O_RDWR)) < 0) { + virReportSystemError(errno, + _("cannot open macvtap tap device %1$s"), + tapname); + goto cleanup; } + tapfd[i] = fd; } ret = 0;