From nobody Fri Apr 26 09:04:01 2024 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; dkim=fail; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1568235953; cv=none; d=zoho.com; s=zohoarc; b=Elc9Tiu49n9nE5LnWu6PCs2VBvvIK+ai4/POtlgIg+ihb2Sfopn7Kaf+xwULA9nXBMxY8ySnu7wJRIuFYEBqE9RtvvF4I5RbiiUUKNKfpU9hJb2Qriewx8aQHlC1NhQDKqrIQk+T5rIdKQbOyDysJjcOIUX6ip/KHwtINZNeNA8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1568235953; h=Content-Type:Content-Transfer-Encoding:Cc: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:ARC-Authentication-Results; bh=ic2oDn1CNkoDfJrG0RfoCyp8AXHFNuTG3X2/WiDMb+0=; b=gl8HWGmBVqqMLoshYWO3trg6ike+w2+wGGUW5HqJFf2wqiPoQvy9/dlO7MTfS5CwQ65RxvQF5KGq6ii5EeSQL8KVaBzfWLSMIEACxRvPW9n9z8285Hem1xgBP52G9VvYhSdNGaDvt35XQKOmfkZS45Dx3O4gDN7o4719YiPYGO8= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail 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 1568235953168911.8762525955351; Wed, 11 Sep 2019 14:05:53 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E7E8C3082E90; Wed, 11 Sep 2019 21:05:50 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9FF201001B0B; Wed, 11 Sep 2019 21:05: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 E7313180BA9A; Wed, 11 Sep 2019 21:05:47 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x8BL5kfM027160 for ; Wed, 11 Sep 2019 17:05:46 -0400 Received: by smtp.corp.redhat.com (Postfix) id F28F85D704; Wed, 11 Sep 2019 21:05:45 +0000 (UTC) Received: from mx1.redhat.com (ext-mx05.extmail.prod.ext.phx2.redhat.com [10.5.110.29]) by smtp.corp.redhat.com (Postfix) with ESMTPS id ED6985D6D0 for ; Wed, 11 Sep 2019 21:05:43 +0000 (UTC) Received: from mail-qt1-f194.google.com (mail-qt1-f194.google.com [209.85.160.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 293A63DE04 for ; Wed, 11 Sep 2019 21:05:42 +0000 (UTC) Received: by mail-qt1-f194.google.com with SMTP id r15so27056544qtn.12 for ; Wed, 11 Sep 2019 14:05:42 -0700 (PDT) Received: from rekt.ibmuc.com ([2804:431:c7c6:2859:7136:a26f:ae4f:69fe]) by smtp.gmail.com with ESMTPSA id r55sm13927141qtj.86.2019.09.11.14.05.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Sep 2019 14:05:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Op3z2h/5llhZTQiSVBvXO5Vf1RemeVRFbneMYhtTr5Q=; b=qliwgVNJrb53yMrCpcnlZhSPRWPtVPFIWxAeg2rMpoT0XY4xMkOq4iH20LPcSP+eoy 3d9BlCBlsqPIPiNTX/cEVUbmflyNonemZic0OysYB9U8hReRnB+cvEx9Dj1IG54y86Sb B09WtsQnRcdAe7XOiErwpgATaCH8WnZRicVxmwWVVN1M5ePY0qdh8oP+RWLJQFQD0zRc fgffXgVndTBJaXeEmYJJIjaTZNrLhpoWAf14UCo44v+4JP747x+hO8ghPfuINEriavQA 5UV1S46LeDNIF+8iWQ8spXjh47UhCqlArrNr2D5UxSaNBWhHX+1wYol/agvUya+8KBLg Aplw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Op3z2h/5llhZTQiSVBvXO5Vf1RemeVRFbneMYhtTr5Q=; b=TST/zMpAO0soI4/pxTGxGXDfPjuJTwSmsUPxrzd5GtOPayHq9MM70VqefxAL4KSecJ ax2p207HPLn9AGqYocvnOJPnzmerJzMMHMR4U3krPAhgFJk1GD8DvufzZuRElsuRPJPk LGhnG6nOI1FN4buGHwh2+/W8xNzFIBG1ot19dG7qTgaQa3vDkegt2GSOgubDfhfe8RlS GICBm9nB+LsUwmF+2Z1JU6uHzLT0oOTZpEECj0+uR2BYWi6fpNM6KghKl+kY8KqavipV Icsr9zM/4EvLL6SreLjA/bGvxPqSP6rKjXioOB4TtLJOD+17BVteZbtY3F9jHG4vREOr ZSDg== X-Gm-Message-State: APjAAAU32iQ5irwI3VhVdfD4e+7Uf/ah0H2YMsyvkbN7MLfhaAkIWMCf bnpUqVVmtBQ7lqiJeYRy4CG0tnkE X-Google-Smtp-Source: APXvYqwCVzWGNA5F/QERCE95gwUVCFl0NRd7RfTMB71P2c9OvF397p8c5xYkI3s9UWcr1HNg52Z0Rw== X-Received: by 2002:ac8:460d:: with SMTP id p13mr37818457qtn.378.1568235941306; Wed, 11 Sep 2019 14:05:41 -0700 (PDT) From: Daniel Henrique Barboza To: libvir-list@redhat.com Date: Wed, 11 Sep 2019 18:05:27 -0300 Message-Id: <20190911210529.11766-2-danielhb413@gmail.com> In-Reply-To: <20190911210529.11766-1-danielhb413@gmail.com> References: <20190911210529.11766-1-danielhb413@gmail.com> MIME-Version: 1.0 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Wed, 11 Sep 2019 21:05:42 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Wed, 11 Sep 2019 21:05:42 +0000 (UTC) for IP:'209.85.160.194' DOMAIN:'mail-qt1-f194.google.com' HELO:'mail-qt1-f194.google.com' FROM:'danielhb413@gmail.com' RCPT:'' X-RedHat-Spam-Score: 0.153 (DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS) 209.85.160.194 mail-qt1-f194.google.com 209.85.160.194 mail-qt1-f194.google.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.29 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Cc: Daniel Henrique Barboza Subject: [libvirt] [PATCH v2 1/3] qemu: use a bigger unplug timeout for PPC64 guests 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-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.46]); Wed, 11 Sep 2019 21:05:51 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" For some architectures and setups, device removal can take longer than the default 5 seconds. This results in commands such as 'virsh setvcpus' to fire timeout messages even if the operation were successful in the guest, confusing the user. This patch sets a new 10 seconds unplug timeout for PPC64 guests. All other archs will keep the default 5 seconds timeout. Instead of putting 'if PPC64' conditionals inside qemu_hotplug.c to set the new timeout value, a new QEMU driver attribute 'unplugTimeout' was added. The timeout value is set during qemuStateInitialize only once. All qemu_hotplug.c functions that uses the timeout have easy access to a qemu_driver object, thus the change to use unplugTimeout is straightforward. The now unused 'qemuDomainRemoveDeviceWaitTime' global can't be simply erased from qemu_hotplug.c though. Next patch will remove it properly. Signed-off-by: Daniel Henrique Barboza --- src/qemu/qemu_conf.h | 3 +++ src/qemu/qemu_driver.c | 11 +++++++++++ src/qemu/qemu_hotplug.c | 11 ++++++----- tests/qemuhotplugtest.c | 2 +- 4 files changed, 21 insertions(+), 6 deletions(-) diff --git a/src/qemu/qemu_conf.h b/src/qemu/qemu_conf.h index 8473d6d4ca..edda1421d0 100644 --- a/src/qemu/qemu_conf.h +++ b/src/qemu/qemu_conf.h @@ -296,6 +296,9 @@ struct _virQEMUDriver { =20 /* Immutable pointer, self-locking APIs */ virHashAtomicPtr migrationErrors; + + /* Immutable value */ + unsigned int unplugTimeout; }; =20 virQEMUDriverConfigPtr virQEMUDriverConfigNew(bool privileged); diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 1e041a8bac..2ebe22ee79 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -134,6 +134,13 @@ VIR_LOG_INIT("qemu.qemu_driver"); =20 #define QEMU_NB_BANDWIDTH_PARAM 7 =20 +/* Timeout in miliseconds for device removal. PPC64 domains + * can experience a bigger delay in unplug operations during + * heavy guest activity (vcpu being the most notable case), thus + * the timeout for PPC64 is also bigger. */ +#define QEMU_UNPLUG_TIMEOUT 5000 +#define QEMU_UNPLUG_TIMEOUT_PPC64 10000 + static void qemuProcessEventHandler(void *data, void *opaque); =20 static int qemuStateCleanup(void); @@ -1095,6 +1102,10 @@ qemuStateInitialize(bool privileged, if (!qemu_driver->workerPool) goto error; =20 + qemu_driver->unplugTimeout =3D QEMU_UNPLUG_TIMEOUT; + if (ARCH_IS_PPC64(qemu_driver->caps->host.arch)) + qemu_driver->unplugTimeout =3D QEMU_UNPLUG_TIMEOUT_PPC64; + qemuProcessReconnectAll(qemu_driver); =20 qemuAutostartDomains(qemu_driver); diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index bd8868b0f7..4088cc5e8e 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -5237,7 +5237,8 @@ qemuDomainResetDeviceRemoval(virDomainObjPtr vm) * - we failed to reliably wait for the event and thus use fallback b= ehavior */ static int -qemuDomainWaitForDeviceRemoval(virDomainObjPtr vm) +qemuDomainWaitForDeviceRemoval(virQEMUDriverPtr driver, + virDomainObjPtr vm) { qemuDomainObjPrivatePtr priv =3D vm->privateData; unsigned long long until; @@ -5245,7 +5246,7 @@ qemuDomainWaitForDeviceRemoval(virDomainObjPtr vm) =20 if (virTimeMillisNow(&until) < 0) return 1; - until +=3D qemuDomainRemoveDeviceWaitTime; + until +=3D driver->unplugTimeout; =20 while (priv->unplug.alias) { if ((rc =3D virDomainObjWaitUntil(vm, until)) =3D=3D 1) @@ -5701,7 +5702,7 @@ qemuDomainDetachDeviceChr(virQEMUDriverPtr driver, } else if (async) { ret =3D 0; } else { - if ((ret =3D qemuDomainWaitForDeviceRemoval(vm)) =3D=3D 1) + if ((ret =3D qemuDomainWaitForDeviceRemoval(driver, vm)) =3D=3D 1) ret =3D qemuDomainRemoveChrDevice(driver, vm, tmpChr, true); } =20 @@ -6001,7 +6002,7 @@ qemuDomainDetachDeviceLive(virDomainObjPtr vm, if (async) { ret =3D 0; } else { - if ((ret =3D qemuDomainWaitForDeviceRemoval(vm)) =3D=3D 1) + if ((ret =3D qemuDomainWaitForDeviceRemoval(driver, vm)) =3D=3D 1) ret =3D qemuDomainRemoveDevice(driver, vm, &detach); } =20 @@ -6107,7 +6108,7 @@ qemuDomainHotplugDelVcpu(virQEMUDriverPtr driver, goto cleanup; } =20 - if ((rc =3D qemuDomainWaitForDeviceRemoval(vm)) <=3D 0) { + if ((rc =3D qemuDomainWaitForDeviceRemoval(driver, vm)) <=3D 0) { if (rc =3D=3D 0) virReportError(VIR_ERR_OPERATION_FAILED, "%s", _("vcpu unplug request timed out")); diff --git a/tests/qemuhotplugtest.c b/tests/qemuhotplugtest.c index 3c177c6622..da6258991d 100644 --- a/tests/qemuhotplugtest.c +++ b/tests/qemuhotplugtest.c @@ -645,7 +645,7 @@ mymain(void) driver.hostdevMgr =3D virHostdevManagerGetDefault(); =20 /* wait only 100ms for DEVICE_DELETED event */ - qemuDomainRemoveDeviceWaitTime =3D 100; + driver.unplugTimeout =3D 100; =20 #define DO_TEST(file, ACTION, dev, fial, kep, ...) \ do { \ --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri Apr 26 09:04:01 2024 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; dkim=fail; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1568235967; cv=none; d=zoho.com; s=zohoarc; b=d1ZTF6S7dmC+H5riRMoZucYyVmmVxSkPyAsup4hl8tGR4IqeRffSax9apMBCsV4O4cSudri+4nasIjd2grpRjZgD1X7BQvhBX58LXCH6koNbALoJiuQqEYnew9domj1ganBeItjaT8qassEi9cC3hPdrfmeCmC2j9x/5UwASuy0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1568235967; h=Content-Type:Content-Transfer-Encoding:Cc: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:ARC-Authentication-Results; bh=VoJFdL1uWhdvEsYtoQs2PqQ8zpUflUZdrgfa2GRELsE=; b=jSZrtKtanllEVyGFpxmfINljTZq2mCO1BFiE9iFFPUYp323uymAM+VCaHsIKxeDIzHj61WVLBOICFv1CheRvksE0jQDh5BCEUkY2Y66UQjmIGlu67PcnNDfQIFjXLyDaM0VC4JXR/jErjuIqc7qJA2wllUAfGhz//Exvii7lGv4= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail 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 1568235967837913.7669676284762; Wed, 11 Sep 2019 14:06:07 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id BCFB43DE31; Wed, 11 Sep 2019 21:06:05 +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 927065C258; Wed, 11 Sep 2019 21:06:05 +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 4BCB8E205; Wed, 11 Sep 2019 21:06:05 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x8BL5mYR027179 for ; Wed, 11 Sep 2019 17:05:48 -0400 Received: by smtp.corp.redhat.com (Postfix) id 5C2CE5DD78; Wed, 11 Sep 2019 21:05:48 +0000 (UTC) Received: from mx1.redhat.com (ext-mx27.extmail.prod.ext.phx2.redhat.com [10.5.110.68]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 548A35DA5B for ; Wed, 11 Sep 2019 21:05:44 +0000 (UTC) Received: from mail-qk1-f176.google.com (mail-qk1-f176.google.com [209.85.222.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B0063A37187 for ; Wed, 11 Sep 2019 21:05:43 +0000 (UTC) Received: by mail-qk1-f176.google.com with SMTP id i78so22263177qke.11 for ; Wed, 11 Sep 2019 14:05:43 -0700 (PDT) Received: from rekt.ibmuc.com ([2804:431:c7c6:2859:7136:a26f:ae4f:69fe]) by smtp.gmail.com with ESMTPSA id r55sm13927141qtj.86.2019.09.11.14.05.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Sep 2019 14:05:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=9kXZ4nYLhGHyAKVr4fxQRi/pS8nMoM/RTlV1Kz8ttIk=; b=fG/xKmeM5zxPqljbRu7TUKV0eXLiMOdL4xGLZ4XsiCboa5PsRCz019rqIzkLmuzLiH b3/3/dZesrUDPJ3ycEz+JNtMt6xHDwmvZE3y9cePjk+zymMc03e0dMi/rEFenyaFCZbw aRKx8V2Q4Xwha5m1rd5FKgQ0DEkG/USoK9J7E3DNdUEnjopKK/CAGn7cfnv8jkhPwwNB PlrjOSP33cgeexCiza1iiG4Ga51Br7BavZoK6FzOeKXp0s4H2Ezt7MVyPMA4aDqaUi1i namj+CljzDGKf0iqSK3DJjGYnNHz14T4qRjvQ+/RsWazuJG2qlkL14n3hSwx0wgbbWIj Vv7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=9kXZ4nYLhGHyAKVr4fxQRi/pS8nMoM/RTlV1Kz8ttIk=; b=sdxzs2aEKGEJHNr2WhwRE3WWVoYXEA53aHutACSKnSVH0w4f2wh3v7nDRX3GEGwoib FN7ztQamGswNSJdwOUwl+YTOtho1/1039gKWcNoMjtVZpvLttcX9GfNZtKinz4d43ZjZ oTiCvyN1wjYvlwnlgL2tLYq61D6b2wiZilYGRuchP7XaAn7kxgMxu3x4aFENSnV0XIBE DnVnoxhTSsIx3LAFvciRiY6raRksyIJEdPMHPvROX/9y7gCaaWG2wW87uTQSCe1UBsJ0 49P52ydg2DwmLgb0d3CNKbQGO2mBUgBpw/txHkBO+5AOsKSalJ0+zi0/O+sQzd6BIxam 9GEQ== X-Gm-Message-State: APjAAAWWxKX6geEMIBl8JrPZysQemLaMvsgFD/DYG5mjFeYegm76/jXx 0ZNo8zKXIYaf1VUAutY0iihAA/75+c4= X-Google-Smtp-Source: APXvYqyhcTmSrDt15i3KVmMj22Hl3m35lMhWX78SYFtEiixOUKqkw+cf1/OBWQ1YzwLSLbHwQWocVg== X-Received: by 2002:a05:620a:12a3:: with SMTP id x3mr19989349qki.379.1568235942875; Wed, 11 Sep 2019 14:05:42 -0700 (PDT) From: Daniel Henrique Barboza To: libvir-list@redhat.com Date: Wed, 11 Sep 2019 18:05:28 -0300 Message-Id: <20190911210529.11766-3-danielhb413@gmail.com> In-Reply-To: <20190911210529.11766-1-danielhb413@gmail.com> References: <20190911210529.11766-1-danielhb413@gmail.com> MIME-Version: 1.0 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.68]); Wed, 11 Sep 2019 21:05:43 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.68]); Wed, 11 Sep 2019 21:05:43 +0000 (UTC) for IP:'209.85.222.176' DOMAIN:'mail-qk1-f176.google.com' HELO:'mail-qk1-f176.google.com' FROM:'danielhb413@gmail.com' RCPT:'' X-RedHat-Spam-Score: 0.15 (DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS) 209.85.222.176 mail-qk1-f176.google.com 209.85.222.176 mail-qk1-f176.google.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.68 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Cc: Daniel Henrique Barboza Subject: [libvirt] [PATCH v2 2/3] qemu: Remove qemu_hotplugpriv.h and qemuDomainRemoveDeviceWaitTime 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-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.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Wed, 11 Sep 2019 21:06:06 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" qemu_hotplugpriv.h is a header file created to share a global variable called 'qemuDomainRemoveDeviceWaitTime', declared in qemu_hotplug.c, to other files that would want to change the timeout value (currently, only tests/qemuhotplugtest.c). Previous patch deprecated the variable, using qemu_driver->unplugTimeout to set the timeout instead. This means that the header file is now unused, and can be safely discarded. Signed-off-by: Daniel Henrique Barboza --- src/qemu/Makefile.inc.am | 1 - src/qemu/qemu_hotplug.c | 5 ----- src/qemu/qemu_hotplugpriv.h | 32 -------------------------------- tests/qemuhotplugtest.c | 1 - 4 files changed, 39 deletions(-) delete mode 100644 src/qemu/qemu_hotplugpriv.h diff --git a/src/qemu/Makefile.inc.am b/src/qemu/Makefile.inc.am index 48fd0332ec..5f2198f6a5 100644 --- a/src/qemu/Makefile.inc.am +++ b/src/qemu/Makefile.inc.am @@ -29,7 +29,6 @@ QEMU_DRIVER_SOURCES =3D \ qemu/qemu_hostdev.h \ qemu/qemu_hotplug.c \ qemu/qemu_hotplug.h \ - qemu/qemu_hotplugpriv.h \ qemu/qemu_conf.c \ qemu/qemu_conf.h \ qemu/qemu_process.c \ diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index 4088cc5e8e..d3a3e25f08 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -23,8 +23,6 @@ #include =20 #include "qemu_hotplug.h" -#define LIBVIRT_QEMU_HOTPLUGPRIV_H_ALLOW -#include "qemu_hotplugpriv.h" #include "qemu_alias.h" #include "qemu_capabilities.h" #include "qemu_domain.h" @@ -63,9 +61,6 @@ VIR_LOG_INIT("qemu.qemu_hotplug"); =20 #define CHANGE_MEDIA_TIMEOUT 5000 =20 -/* Wait up to 5 seconds for device removal to finish. */ -unsigned long long qemuDomainRemoveDeviceWaitTime =3D 1000ull * 5; - =20 static void qemuDomainResetDeviceRemoval(virDomainObjPtr vm); diff --git a/src/qemu/qemu_hotplugpriv.h b/src/qemu/qemu_hotplugpriv.h deleted file mode 100644 index a5c443ba85..0000000000 --- a/src/qemu/qemu_hotplugpriv.h +++ /dev/null @@ -1,32 +0,0 @@ -/* - * qemu_hotplugpriv.h: private declarations for QEMU device hotplug manage= ment - * - * Copyright (C) 2013 Red Hat, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library. If not, see - * . - * - */ - -#ifndef LIBVIRT_QEMU_HOTPLUGPRIV_H_ALLOW -# error "qemu_hotplugpriv.h may only be included by qemu_hotplug.c or test= suites" -#endif /* LIBVIRT_QEMU_HOTPLUGPRIV_H_ALLOW */ - -#pragma once - -/* - * This header file should never be used outside unit tests. - */ - -extern unsigned long long qemuDomainRemoveDeviceWaitTime; diff --git a/tests/qemuhotplugtest.c b/tests/qemuhotplugtest.c index da6258991d..03ff32e37e 100644 --- a/tests/qemuhotplugtest.c +++ b/tests/qemuhotplugtest.c @@ -23,7 +23,6 @@ #include "qemu/qemu_conf.h" #include "qemu/qemu_hotplug.h" #define LIBVIRT_QEMU_HOTPLUGPRIV_H_ALLOW -#include "qemu/qemu_hotplugpriv.h" #include "qemumonitortestutils.h" #include "testutils.h" #include "testutilsqemu.h" --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri Apr 26 09:04:01 2024 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; dkim=fail; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1568235953; cv=none; d=zoho.com; s=zohoarc; b=a+j3RZZbILsxmj0BHJaVBZqYFuHW8bbl2Ait22/ESdt6FULXWN0Awy5oczk3BHUk5aQzN9add8Bv0gWnN631fij6+GWympgIvJhI+kJdeu3/vxkL21aKqquVGTbNhfTdthRgGj8A5qTGJRxTWmJcPEqAhflqWmZk+Ow+2rykI/g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1568235953; h=Content-Type:Content-Transfer-Encoding:Cc: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:ARC-Authentication-Results; bh=aEQ8Ddw3nWUTsULWhkS/g4gASRs5m4ltswOMU+s0+UA=; b=brboaRCPSdNfOgJy9QEFvz2edoUQPSYv/kNs1v0BhjY1enhTYnWxQrppOhXjJtOqw/9SVqHus+fc8pwuP2nP6MzihnSW5fOWF1t7TsOktrjA2km81eEDT+vnzAbmu/ke4k84IB8eeS8M45RQWUBevzeiLrtpZwJf8eVrTO3ZpUM= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail 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 1568235953851629.0321255859233; Wed, 11 Sep 2019 14:05:53 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 780901DAD; Wed, 11 Sep 2019 21:05:51 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A5CCF60920; Wed, 11 Sep 2019 21:05: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 F218D1802220; Wed, 11 Sep 2019 21:05:47 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x8BL5kWJ027161 for ; Wed, 11 Sep 2019 17:05:46 -0400 Received: by smtp.corp.redhat.com (Postfix) id F346D5D6D0; Wed, 11 Sep 2019 21:05:45 +0000 (UTC) Received: from mx1.redhat.com (ext-mx12.extmail.prod.ext.phx2.redhat.com [10.5.110.41]) by smtp.corp.redhat.com (Postfix) with ESMTPS id EC9765D6A9 for ; Wed, 11 Sep 2019 21:05:45 +0000 (UTC) Received: from mail-qk1-f173.google.com (mail-qk1-f173.google.com [209.85.222.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id EB4663091755 for ; Wed, 11 Sep 2019 21:05:44 +0000 (UTC) Received: by mail-qk1-f173.google.com with SMTP id z67so22231370qkb.12 for ; Wed, 11 Sep 2019 14:05:44 -0700 (PDT) Received: from rekt.ibmuc.com ([2804:431:c7c6:2859:7136:a26f:ae4f:69fe]) by smtp.gmail.com with ESMTPSA id r55sm13927141qtj.86.2019.09.11.14.05.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Sep 2019 14:05:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=NOy1YEklA9MnB/7pQVJVFAYA2hWNkZw/AmvLkfGoq4Q=; b=WzNdlvhkdLBWJNTes69m6TKYLLnvyEW6tzAOKbQPRpQdvSAA8NXlybIWpJcs3bwxYT 7T2US39N+Oj8bFiDxteV5Lpt+qu7takUVmXQif+Ej5nbMzZJwUSXAqutQlSUzauZBSEB EzAfjANdi9fjk2Vk82KDogSIjTaUdK8ur6DXbOqvZy3CiZnMhWSih9S3HdxcNsCVmYUg c5fza5DHirTI4UkNnNJw03B7nkUpc3wVpEbNrC2VVPRuxJEUALAL+hBVFR5LDt8EVTTh Gm87bzrbfHNpsNinTTnn/kzM9FoNOfAoF7dbubO44wZ/hF8f8CwOYYrJeqaks/TUSsXw R2vQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=NOy1YEklA9MnB/7pQVJVFAYA2hWNkZw/AmvLkfGoq4Q=; b=Ygj27TzLmEpj5Ss9fNHPwiYBqC5D7XSzt8OeLVTuJokzQDVGB0YdDvWGy7hrs7Rr15 RrHRa7WOV29DMLlhoVhCL2ewxGgGjscEb/864c/PwSbusb3ixzzm7b05HjGk+GhyaMHS gIWT2mkhK/YA58O0IlG9dmCtCXQion2QIdHSGIR6XQ5xApMf8o1tn1zJeQJindpQLvkh YD0UW6MtY9Q4nteiqsISMarioiMtNK0TrSGSDDHCveQZ/ZOyjwttx5hS7x8YFNGxN88X eKw2ttLGqYo652UAVqKoJd6kEueDTnHkme8o+E5C56ZaYJGTsvDrEiSSLRM9W4uvQzdr uY7w== X-Gm-Message-State: APjAAAXzYABAf4KkbRzWM4eur44nPIlzqvQ1KKO+C0ADtqtliHKZBA6O Hp/hs8AKIIB6AvYsfMQOIFCSuU38i/U= X-Google-Smtp-Source: APXvYqyqzVVv4snA0J/CWpoAZWEOJ62ZCJtg9DMweY1ScVceSOSgNbNzyp5SMjAYDy9g9TcPJjI1zw== X-Received: by 2002:a37:804:: with SMTP id 4mr6779954qki.97.1568235944169; Wed, 11 Sep 2019 14:05:44 -0700 (PDT) From: Daniel Henrique Barboza To: libvir-list@redhat.com Date: Wed, 11 Sep 2019 18:05:29 -0300 Message-Id: <20190911210529.11766-4-danielhb413@gmail.com> In-Reply-To: <20190911210529.11766-1-danielhb413@gmail.com> References: <20190911210529.11766-1-danielhb413@gmail.com> MIME-Version: 1.0 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.41]); Wed, 11 Sep 2019 21:05:45 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.41]); Wed, 11 Sep 2019 21:05:45 +0000 (UTC) for IP:'209.85.222.173' DOMAIN:'mail-qk1-f173.google.com' HELO:'mail-qk1-f173.google.com' FROM:'danielhb413@gmail.com' RCPT:'' X-RedHat-Spam-Score: 0.15 (DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS) 209.85.222.173 mail-qk1-f173.google.com 209.85.222.173 mail-qk1-f173.google.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.41 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Cc: Daniel Henrique Barboza Subject: [libvirt] [PATCH v2 3/3] qemu_hotplug: make setvcpus timeout error message user-friendlier 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-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.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.71]); Wed, 11 Sep 2019 21:05:52 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" The current 'setvcpus' timeout message requires a deeper understanding of QEMU/Libvirt internals to proper react to it. One who knows how setvcpus unplug work (it is an asynchronous operation between QEMU and guest that Libvirt can't know for sure if it failed, unless an explicit error happened during the timeout period) will read the message and not assume a failed operation. But the regular user, most often than not, will read it and believe that the unplug operation failed. This leads to situations where the user isn't exactly relieved when accessing the guest and seeing that the unplug operation worked. Instead, the user feel mislead by the timeout message setvcpus threw. Changing the timeout message to let the user know that the unplug status is not known, and manual inspection in the guest is required, is not a silver bullet. But it gives a more realistic expectation of what happened, as best as we can tell from Libvirt side anyways. Signed-off-by: Daniel Henrique Barboza --- src/qemu/qemu_hotplug.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index d3a3e25f08..53051807d7 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -6105,8 +6105,9 @@ qemuDomainHotplugDelVcpu(virQEMUDriverPtr driver, =20 if ((rc =3D qemuDomainWaitForDeviceRemoval(driver, vm)) <=3D 0) { if (rc =3D=3D 0) - virReportError(VIR_ERR_OPERATION_FAILED, "%s", - _("vcpu unplug request timed out")); + virReportError(VIR_ERR_OPERATION_TIMEOUT, "%s", + _("vcpu unplug request timed out. Unplug result= " + "must be manually inspected in the domain")); =20 goto cleanup; } --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list