From nobody Sun Feb 8 05:27:14 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1570704892; cv=none; d=zoho.com; s=zohoarc; b=Upu9eFZmsfZfw8JoSkI6J3DFpjubXABn/kzNDZDpGXvKnJzlq2z21x2AWfsFWKqc/E0xaoYzwgocU5JORqYuE6KulezP1GR0XD5mfgSs1kGv8SOzj5b/59iI69DE3N/Ekbf59stWtc9WFsGEnbN/2HQiJgyKeVfL42IZ5CdR6Cw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1570704892; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=DmmN+MtSZMfJDQpUd4vQsxXe345/TOGdwc92SlYycgs=; b=UHqqG8hvEniZSTPM4xLJQXVaGL3j47MagM0Eq/JGVMvns2dA7Wlh3njwnoBk72lAXrP+YSYw6WSuPZB44YfB7u0rqblPySKwqqukL75yA9mYp8dNMNPI5ZwXHyoXdF0HeQleYzrfi/LALKpUL9qkApWQxeC7tA5L+2rRqjAcXcg= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1570704892347665.8660699983739; Thu, 10 Oct 2019 03:54:52 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id CC5F23086E26; Thu, 10 Oct 2019 10:54:50 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A29A05D6A5; Thu, 10 Oct 2019 10:54:50 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 5EA914EE7E; Thu, 10 Oct 2019 10:54:50 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x9AAsnv4010611 for ; Thu, 10 Oct 2019 06:54:49 -0400 Received: by smtp.corp.redhat.com (Postfix) id DB0ED5C553; Thu, 10 Oct 2019 10:54:49 +0000 (UTC) Received: from dhcp-16-231.lcy.redhat.com (unknown [10.42.16.231]) by smtp.corp.redhat.com (Postfix) with ESMTP id DDE325C231; Thu, 10 Oct 2019 10:54:42 +0000 (UTC) From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Date: Thu, 10 Oct 2019 11:54:13 +0100 Message-Id: <20191010105413.4091-20-berrange@redhat.com> In-Reply-To: <20191010105413.4091-1-berrange@redhat.com> References: <20191010105413.4091-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v3 19/19] build: remove use of usleep gnulib module in favour of g_usleep X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.44]); Thu, 10 Oct 2019 10:54:51 +0000 (UTC) The usleep function was missing on older mingw versions, but we can rely on it existing everywhere these days. It may only support times upto 1 second in duration though, so we'll prefer to use g_usleep instead. The commandhelper program is not changed since that can't link to glib. Fortunately it doesn't need to build on Windows platforms either. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: J=C3=A1n Tomko --- bootstrap.conf | 1 - src/hyperv/hyperv_driver.c | 2 +- src/hyperv/hyperv_wmi.c | 4 ++-- src/locking/lock_daemon.c | 2 +- src/locking/lock_driver_sanlock.c | 2 +- src/lxc/lxc_controller.c | 2 +- src/lxc/lxc_driver.c | 2 +- src/lxc/lxc_process.c | 2 +- src/network/bridge_driver.c | 2 +- src/nwfilter/nwfilter_dhcpsnoop.c | 4 ++-- src/nwfilter/nwfilter_learnipaddr.c | 2 +- src/qemu/qemu_monitor_json.c | 2 +- src/qemu/qemu_process.c | 2 +- src/qemu/qemu_tpm.c | 2 +- src/rpc/virnetsocket.c | 2 +- src/security/security_manager.c | 2 +- src/storage/storage_util.c | 4 ++-- src/util/vircgroup.c | 2 +- src/util/virfile.c | 2 +- src/util/virnetdev.c | 2 +- src/util/virnetdevip.c | 2 +- src/util/virnetdevmacvlan.c | 2 +- src/util/virnetdevvportprofile.c | 2 +- src/util/virpci.c | 8 ++++---- src/util/virprocess.c | 4 ++-- src/util/virtime.c | 2 +- src/vbox/vbox_common.c | 2 +- tests/commandtest.c | 6 +++--- tests/eventtest.c | 4 ++-- tests/fdstreamtest.c | 4 ++-- tools/virsh-domain.c | 2 +- 31 files changed, 41 insertions(+), 42 deletions(-) diff --git a/bootstrap.conf b/bootstrap.conf index 241dce50c2..1b5a68b873 100644 --- a/bootstrap.conf +++ b/bootstrap.conf @@ -90,7 +90,6 @@ timegm ttyname_r uname unsetenv -usleep verify vsnprintf waitpid diff --git a/src/hyperv/hyperv_driver.c b/src/hyperv/hyperv_driver.c index 0e2c6c55ef..ceaf528dd3 100644 --- a/src/hyperv/hyperv_driver.c +++ b/src/hyperv/hyperv_driver.c @@ -1415,7 +1415,7 @@ hypervDomainSendKey(virDomainPtr domain, unsigned int= codeset, =20 /* simulate holdtime by sleeping */ if (holdtime > 0) - usleep(holdtime * 1000); + g_usleep(holdtime * 1000); =20 /* release the keys */ for (i =3D 0; i < nkeycodes; i++) { diff --git a/src/hyperv/hyperv_wmi.c b/src/hyperv/hyperv_wmi.c index 0f39bd4431..c2c1f082e1 100644 --- a/src/hyperv/hyperv_wmi.c +++ b/src/hyperv/hyperv_wmi.c @@ -909,7 +909,7 @@ hypervInvokeMethod(hypervPrivate *priv, hypervInvokePar= amsListPtr params, case MSVM_CONCRETEJOB_JOBSTATE_SHUTTING_DOWN: hypervFreeObject(priv, (hypervObject *)job); job =3D NULL; - usleep(100 * 1000); /* sleep 100 ms */ + g_usleep(100 * 1000); /* sleep 100 ms */ timeout -=3D 100; continue; case MSVM_CONCRETEJOB_JOBSTATE_COMPLETED: @@ -1418,7 +1418,7 @@ hypervInvokeMsvmComputerSystemRequestStateChange(virD= omainPtr domain, hypervFreeObject(priv, (hypervObject *)concreteJob); concreteJob =3D NULL; =20 - usleep(100 * 1000); + g_usleep(100 * 1000); continue; =20 case MSVM_CONCRETEJOB_JOBSTATE_COMPLETED: diff --git a/src/locking/lock_daemon.c b/src/locking/lock_daemon.c index a5a3a97e99..c12cb4ea0f 100644 --- a/src/locking/lock_daemon.c +++ b/src/locking/lock_daemon.c @@ -657,7 +657,7 @@ virLockDaemonClientFree(void *opaque) VIR_WARN("Failed to kill off pid %lld", (unsigned long long)priv->clientPid); } - usleep(200 * 1000); + g_usleep(200 * 1000); } } } diff --git a/src/locking/lock_driver_sanlock.c b/src/locking/lock_driver_sa= nlock.c index 85a23c7642..7ebd63913e 100644 --- a/src/locking/lock_driver_sanlock.c +++ b/src/locking/lock_driver_sanlock.c @@ -376,7 +376,7 @@ virLockManagerSanlockSetupLockspace(virLockManagerSanlo= ckDriverPtr driver) #else /* fall back to polling */ VIR_DEBUG("Sleeping for %dms", LOCKSPACE_SLEEP); - usleep(LOCKSPACE_SLEEP * 1000); + g_usleep(LOCKSPACE_SLEEP * 1000); #endif VIR_DEBUG("Retrying to add lockspace (left %d)", retries); goto retry; diff --git a/src/lxc/lxc_controller.c b/src/lxc/lxc_controller.c index 37851bf284..9097655b4d 100644 --- a/src/lxc/lxc_controller.c +++ b/src/lxc/lxc_controller.c @@ -574,7 +574,7 @@ static int virLXCControllerAppendNBDPids(virLXCControll= erPtr ctrl, while (!virFileExists(pidpath)) { /* wait for 100ms before checking again, but don't do it for ever = */ if (errno =3D=3D ENOENT && loops < 10) { - usleep(100 * 1000); + g_usleep(100 * 1000); loops++; } else { virReportSystemError(errno, diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c index a69589e50c..c0bbeb09e8 100644 --- a/src/lxc/lxc_driver.c +++ b/src/lxc/lxc_driver.c @@ -2965,7 +2965,7 @@ static int lxcFreezeContainer(virDomainObjPtr vm) * decide that the freezing has been complete only with * the state actually transit to "FROZEN". */ - usleep(check_interval * 1000); + g_usleep(check_interval * 1000); =20 r =3D virCgroupGetFreezerState(priv->cgroup, &state); =20 diff --git a/src/lxc/lxc_process.c b/src/lxc/lxc_process.c index cbdc7b1268..318b4c1653 100644 --- a/src/lxc/lxc_process.c +++ b/src/lxc/lxc_process.c @@ -1095,7 +1095,7 @@ virLXCProcessReadLogOutputData(virDomainObjPtr vm, goto cleanup; } =20 - usleep(100*1000); + g_usleep(100*1000); retries--; } =20 diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c index c05157c3ca..d10665efa3 100644 --- a/src/network/bridge_driver.c +++ b/src/network/bridge_driver.c @@ -1034,7 +1034,7 @@ networkKillDaemon(pid_t pid, * than modifications to domains, this seems a reasonable * tradeoff in exchange for less code disruption. */ - usleep(20 * 1000); + g_usleep(20 * 1000); } VIR_WARN("Timed out waiting after SIG%s to %s process %d " "(network '%s')", diff --git a/src/nwfilter/nwfilter_dhcpsnoop.c b/src/nwfilter/nwfilter_dhcp= snoop.c index 2af8cfdd32..c82457989e 100644 --- a/src/nwfilter/nwfilter_dhcpsnoop.c +++ b/src/nwfilter/nwfilter_dhcpsnoop.c @@ -1273,7 +1273,7 @@ virNWFilterSnoopRatePenalty(virNWFilterSnoopPcapConfP= tr pc, unsigned long long now; =20 if (virTimeMillisNowRaw(&now) < 0) { - usleep(PCAP_FLOOD_TIMEOUT_MS); /* 1 ms */ + g_usleep(PCAP_FLOOD_TIMEOUT_MS); /* 1 ms */ pc->penaltyTimeoutAbs =3D 0; } else { /* don't listen to the fd for 1 ms */ @@ -2010,7 +2010,7 @@ virNWFilterSnoopJoinThreads(void) while (virAtomicIntGet(&virNWFilterSnoopState.nThreads) !=3D 0) { VIR_WARN("Waiting for snooping threads to terminate: %u", virAtomicIntGet(&virNWFilterSnoopState.nThreads)); - usleep(1000 * 1000); + g_usleep(1000 * 1000); } } =20 diff --git a/src/nwfilter/nwfilter_learnipaddr.c b/src/nwfilter/nwfilter_le= arnipaddr.c index cd66e3ea7d..34b8d7fcd9 100644 --- a/src/nwfilter/nwfilter_learnipaddr.c +++ b/src/nwfilter/nwfilter_learnipaddr.c @@ -812,7 +812,7 @@ virNWFilterLearnThreadsTerminate(bool allowNewThreads) threadsTerminate =3D true; =20 while (virHashSize(pendingLearnReq) !=3D 0) - usleep((PKT_TIMEOUT_MS * 1000) / 3); + g_usleep((PKT_TIMEOUT_MS * 1000) / 3); =20 if (allowNewThreads) threadsTerminate =3D false; diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index a6facdc09b..dbc32acb5e 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -1650,7 +1650,7 @@ qemuMonitorJSONStartCPUs(qemuMonitorPtr mon) =20 virJSONValueFree(reply); reply =3D NULL; - usleep(250000); + g_usleep(250000); } while (++i <=3D timeout); =20 virJSONValueFree(cmd); diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 3b45b2f641..c6fac01ada 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -7611,7 +7611,7 @@ void qemuProcessStop(virQEMUDriverPtr driver, retry: if ((ret =3D qemuRemoveCgroup(vm)) < 0) { if (ret =3D=3D -EBUSY && (retries++ < 5)) { - usleep(200*1000); + g_usleep(200*1000); goto retry; } VIR_WARN("Failed to remove cgroup for %s", diff --git a/src/qemu/qemu_tpm.c b/src/qemu/qemu_tpm.c index 1d68803a28..31fdfa995f 100644 --- a/src/qemu/qemu_tpm.c +++ b/src/qemu/qemu_tpm.c @@ -884,7 +884,7 @@ qemuExtTPMStartEmulator(virQEMUDriverPtr driver, rc =3D qemuTPMEmulatorGetPid(cfg->swtpmStateDir, shortName, &pid); if (rc < 0) { timeout -=3D 50; - usleep(50 * 1000); + g_usleep(50 * 1000); continue; } if (rc =3D=3D 0 && pid =3D=3D (pid_t)-1) diff --git a/src/rpc/virnetsocket.c b/src/rpc/virnetsocket.c index a469907779..bd5fa96751 100644 --- a/src/rpc/virnetsocket.c +++ b/src/rpc/virnetsocket.c @@ -749,7 +749,7 @@ int virNetSocketNewConnectUNIX(const char *path, daemonLaunched =3D true; } =20 - usleep(10000); + g_usleep(10000); } =20 localAddr.len =3D sizeof(localAddr.data); diff --git a/src/security/security_manager.c b/src/security/security_manage= r.c index 7c905f0785..7f187c9068 100644 --- a/src/security/security_manager.c +++ b/src/security/security_manager.c @@ -1349,7 +1349,7 @@ virSecurityManagerMetadataLock(virSecurityManagerPtr = mgr ATTRIBUTE_UNUSED, if (retries && (errno =3D=3D EACCES || errno =3D=3D EAGAIN= )) { /* File is locked. Try again. */ retries--; - usleep(1000); + g_usleep(1000); continue; } else { virReportSystemError(errno, diff --git a/src/storage/storage_util.c b/src/storage/storage_util.c index 6165dd43b2..be084119f4 100644 --- a/src/storage/storage_util.c +++ b/src/storage/storage_util.c @@ -1940,7 +1940,7 @@ virStorageBackendStablePath(virStoragePoolObjPtr pool, if (virDirOpenQuiet(&dh, def->target.path) < 0) { opentries++; if (loop && errno =3D=3D ENOENT && opentries < 50) { - usleep(100 * 1000); + g_usleep(100 * 1000); goto reopen; } virReportSystemError(errno, @@ -1975,7 +1975,7 @@ virStorageBackendStablePath(virStoragePoolObjPtr pool, } =20 if (!direrr && loop && ++retry < 100) { - usleep(100 * 1000); + g_usleep(100 * 1000); goto retry; } =20 diff --git a/src/util/vircgroup.c b/src/util/vircgroup.c index 4f9d80666d..70d41c4ba5 100644 --- a/src/util/vircgroup.c +++ b/src/util/vircgroup.c @@ -2656,7 +2656,7 @@ virCgroupKillPainfully(virCgroupPtr group) if (ret <=3D 0) break; =20 - usleep(200 * 1000); + g_usleep(200 * 1000); } VIR_DEBUG("Complete %d", ret); return ret; diff --git a/src/util/virfile.c b/src/util/virfile.c index bb844c64e5..dead335c62 100644 --- a/src/util/virfile.c +++ b/src/util/virfile.c @@ -4387,7 +4387,7 @@ virFileWaitForExists(const char *path, if (tries =3D=3D 0 || errno !=3D ENOENT) return -1; =20 - usleep(ms * 1000); + g_usleep(ms * 1000); } =20 return 0; diff --git a/src/util/virnetdev.c b/src/util/virnetdev.c index 5c0e9723b9..5fef0b79aa 100644 --- a/src/util/virnetdev.c +++ b/src/util/virnetdev.c @@ -2304,7 +2304,7 @@ virNetDevSetNetConfig(const char *linkdev, int vf, * wait, then upcoming operations on the VF may fail. */ while (retries-- > 0 && !virNetDevExists(linkdev)) - usleep(1000); + g_usleep(1000); } =20 if (pfDevOrig && setMACrc =3D=3D 0) { diff --git a/src/util/virnetdevip.c b/src/util/virnetdevip.c index e2009fd829..e9d1ce0831 100644 --- a/src/util/virnetdevip.c +++ b/src/util/virnetdevip.c @@ -465,7 +465,7 @@ virNetDevIPWaitDadFinish(virSocketAddrPtr *addrs, size_= t count) /* Parse response. */ dad =3D virNetDevIPParseDadStatus(resp, recvbuflen, addrs, count); if (dad) - usleep(1000 * 10); + g_usleep(1000 * 10); } /* Check timeout. */ if (dad) { diff --git a/src/util/virnetdevmacvlan.c b/src/util/virnetdevmacvlan.c index e8a9b052b6..efd81c3aa0 100644 --- a/src/util/virnetdevmacvlan.c +++ b/src/util/virnetdevmacvlan.c @@ -404,7 +404,7 @@ virNetDevMacVLanTapOpen(const char *ifname, tapfd[i] =3D fd; } else if (retries-- > 0) { /* may need to wait for udev to be done */ - usleep(20000); + g_usleep(20000); } else { /* However, if haven't succeeded, quit. */ virReportSystemError(errno, diff --git a/src/util/virnetdevvportprofile.c b/src/util/virnetdevvportprof= ile.c index a5ecd783f2..048f891920 100644 --- a/src/util/virnetdevvportprofile.c +++ b/src/util/virnetdevvportprofile.c @@ -999,7 +999,7 @@ virNetDevVPortProfileOpCommon(const char *ifname, int i= findex, break; } =20 - usleep(STATUS_POLL_INTERVL_USEC); + g_usleep(STATUS_POLL_INTERVL_USEC); } =20 if (status =3D=3D PORT_PROFILE_RESPONSE_INPROGRESS) { diff --git a/src/util/virpci.c b/src/util/virpci.c index ee78151e74..9b828b7781 100644 --- a/src/util/virpci.c +++ b/src/util/virpci.c @@ -833,11 +833,11 @@ virPCIDeviceTrySecondaryBusReset(virPCIDevicePtr dev, virPCIDeviceWrite16(parent, parentfd, PCI_BRIDGE_CONTROL, ctl | PCI_BRIDGE_CTL_RESET); =20 - usleep(200 * 1000); /* sleep 200ms */ + g_usleep(200 * 1000); /* sleep 200ms */ =20 virPCIDeviceWrite16(parent, parentfd, PCI_BRIDGE_CONTROL, ctl); =20 - usleep(200 * 1000); /* sleep 200ms */ + g_usleep(200 * 1000); /* sleep 200ms */ =20 if (virPCIDeviceWrite(dev, cfgfd, 0, config_space, PCI_CONF_LEN) < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, @@ -881,12 +881,12 @@ virPCIDeviceTryPowerManagementReset(virPCIDevicePtr d= ev, int cfgfd) virPCIDeviceWrite32(dev, cfgfd, dev->pci_pm_cap_pos + PCI_PM_CTRL, ctl | PCI_PM_CTRL_STATE_D3hot); =20 - usleep(10 * 1000); /* sleep 10ms */ + g_usleep(10 * 1000); /* sleep 10ms */ =20 virPCIDeviceWrite32(dev, cfgfd, dev->pci_pm_cap_pos + PCI_PM_CTRL, ctl | PCI_PM_CTRL_STATE_D0); =20 - usleep(10 * 1000); /* sleep 10ms */ + g_usleep(10 * 1000); /* sleep 10ms */ =20 if (virPCIDeviceWrite(dev, cfgfd, 0, &config_space[0], PCI_CONF_LEN) <= 0) { virReportError(VIR_ERR_INTERNAL_ERROR, diff --git a/src/util/virprocess.c b/src/util/virprocess.c index 66834d37d3..b1544af730 100644 --- a/src/util/virprocess.c +++ b/src/util/virprocess.c @@ -177,7 +177,7 @@ virProcessAbort(pid_t pid) } else if (ret =3D=3D 0) { VIR_DEBUG("trying SIGTERM to child process %d", pid); kill(pid, SIGTERM); - usleep(10 * 1000); + g_usleep(10 * 1000); while ((ret =3D waitpid(pid, &status, WNOHANG)) =3D=3D -1 && errno =3D=3D EINTR); if (ret =3D=3D pid) { @@ -399,7 +399,7 @@ virProcessKillPainfullyDelay(pid_t pid, bool force, uns= igned int extradelay) goto cleanup; /* process is dead */ } =20 - usleep(200 * 1000); + g_usleep(200 * 1000); } =20 virReportSystemError(EBUSY, diff --git a/src/util/virtime.c b/src/util/virtime.c index 86993e4e8d..6f978d7c64 100644 --- a/src/util/virtime.c +++ b/src/util/virtime.c @@ -448,6 +448,6 @@ virTimeBackOffWait(virTimeBackOffVar *var) =20 VIR_DEBUG("sleeping for %llu ms", next); =20 - usleep(next * 1000); + g_usleep(next * 1000); return 1; } diff --git a/src/vbox/vbox_common.c b/src/vbox/vbox_common.c index d3b8fb625f..748133933c 100644 --- a/src/vbox/vbox_common.c +++ b/src/vbox/vbox_common.c @@ -7932,7 +7932,7 @@ vboxDomainSendKey(virDomainPtr dom, /* since VBOX does not support holdtime, simulate it by sleeping and then sending the release key scancodes */ if (holdtime > 0) - usleep(holdtime * 1000); + g_usleep(holdtime * 1000); =20 rc =3D gVBoxAPI.UIKeyboard.PutScancodes(keyboard, nkeycodes, keyUpCode= s, &codesStored); diff --git a/tests/commandtest.c b/tests/commandtest.c index 2aaddef3d1..2ec3434f1e 100644 --- a/tests/commandtest.c +++ b/tests/commandtest.c @@ -262,7 +262,7 @@ static int test4(const void *unused ATTRIBUTE_UNUSED) goto cleanup; } while (kill(pid, 0) !=3D -1) - usleep(100*1000); + g_usleep(100*1000); =20 ret =3D checkoutput("test4", NULL); =20 @@ -751,7 +751,7 @@ static int test18(const void *unused ATTRIBUTE_UNUSED) } =20 while (kill(pid, SIGINT) !=3D -1) - usleep(100*1000); + g_usleep(100*1000); =20 ret =3D 0; =20 @@ -1052,7 +1052,7 @@ static int test25(const void *unused ATTRIBUTE_UNUSED) goto cleanup; } =20 - usleep(10 * 1000); + g_usleep(10 * 1000); } else { break; } diff --git a/tests/eventtest.c b/tests/eventtest.c index f426469d21..f04b416ad2 100644 --- a/tests/eventtest.c +++ b/tests/eventtest.c @@ -382,7 +382,7 @@ mymain(void) startJob(); pthread_mutex_unlock(&eventThreadMutex); sched_yield(); - usleep(100 * 1000); + g_usleep(100 * 1000); pthread_mutex_lock(&eventThreadMutex); virEventPollRemoveHandle(handles[1].watch); if (finishJob("Interrupted during poll", -1, -1) !=3D EXIT_SUCCESS) @@ -448,7 +448,7 @@ mymain(void) startJob(); pthread_mutex_unlock(&eventThreadMutex); sched_yield(); - usleep(100 * 1000); + g_usleep(100 * 1000); pthread_mutex_lock(&eventThreadMutex); virEventPollRemoveTimeout(timers[1].timer); if (finishJob("Interrupted during poll", -1, -1) !=3D EXIT_SUCCESS) diff --git a/tests/fdstreamtest.c b/tests/fdstreamtest.c index 054c405cec..98519e6266 100644 --- a/tests/fdstreamtest.c +++ b/tests/fdstreamtest.c @@ -101,7 +101,7 @@ static int testFDStreamReadCommon(const char *scratchdi= r, bool blocking) got =3D st->driver->streamRecv(st, buf + offset, want); if (got < 0) { if (got =3D=3D -2 && !blocking) { - usleep(20 * 1000); + g_usleep(20 * 1000); goto reread; } virFilePrintf(stderr, "Failed to read stream: %s\n", @@ -222,7 +222,7 @@ static int testFDStreamWriteCommon(const char *scratchd= ir, bool blocking) got =3D st->driver->streamSend(st, pattern + offset, want); if (got < 0) { if (got =3D=3D -2 && !blocking) { - usleep(20 * 1000); + g_usleep(20 * 1000); goto rewrite; } if (i =3D=3D 9 && diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c index fbfdc09c0d..c2e7c2b227 100644 --- a/tools/virsh-domain.c +++ b/tools/virsh-domain.c @@ -1945,7 +1945,7 @@ virshBlockJobWait(virshBlockJobWaitDataPtr data) break; } =20 - usleep(500 * 1000); + g_usleep(500 * 1000); } =20 /* print 100% completed */ --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list