From nobody Wed May 8 22:07:57 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=1566164780; cv=none; d=zoho.com; s=zohoarc; b=jmhV7G69lZ3nl9xRaTHsPlL4bNqwnTxNhD86wgyPlibLkncbkpc8o5HUiTyOuJ6LsEi3xZnxinfScw/HIjV7CzNQ2C7gGojiJ5QBy3zEi9t1cKTZzsxM5oPiuqOPT/+CvYuG6RW1zjlf1RCi1cpD2+9YOFhVKSRns8f+nIY+sgw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1566164780; 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=cC4RgQ+sZj/dv9vmvKWY/51OKF0pqqP2Vn7Ni5LHYb4=; b=XrhvYw8diWzCB+ZkLCPxRx+T8jstebJyElZehiduWlNS9oCLprMg8aCF1hSq9rHQCrE8L/2PkZ0FDQjjk0zgGhMLoA0JYEXVaauIeLcbYj/IhlgBOnDrb75UGeowrJGJhgkEBk/20S2TtfxEDffhO0Pc72PK1t1Af6dRDf58ZII= 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 1566164780231960.8390590057472; Sun, 18 Aug 2019 14:46:20 -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 EEB0C30821EC; Sun, 18 Aug 2019 21:46:18 +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 6296C871D8; Sun, 18 Aug 2019 21:46:18 +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 D40E918005B9; Sun, 18 Aug 2019 21:46:17 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x7ILjmJR007896 for ; Sun, 18 Aug 2019 17:45:48 -0400 Received: by smtp.corp.redhat.com (Postfix) id 2A1241001B1D; Sun, 18 Aug 2019 21:45:48 +0000 (UTC) Received: from mx1.redhat.com (ext-mx06.extmail.prod.ext.phx2.redhat.com [10.5.110.30]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 237B01001B11 for ; Sun, 18 Aug 2019 21:45:45 +0000 (UTC) Received: from mail-qk1-f181.google.com (mail-qk1-f181.google.com [209.85.222.181]) (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 C47693B74C for ; Sun, 18 Aug 2019 21:45:44 +0000 (UTC) Received: by mail-qk1-f181.google.com with SMTP id p13so9020037qkg.13 for ; Sun, 18 Aug 2019 14:45:44 -0700 (PDT) Received: from rekt.ibmuc.com ([2804:431:c7c7:f4cc:257f:4df:592:a35]) by smtp.gmail.com with ESMTPSA id s64sm6191302qke.125.2019.08.18.14.45.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 18 Aug 2019 14:45: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=VyjaPrvWKYu/jmknsfya0pmP5qd7CETfPF6kIkDaqFg=; b=LqiJHwTQsFXVVZCYSy1bhCISV3yJSCNPt3E+g41ke7uiiOIu3d1nPw5zUTGDEweGLs 8nie4VrxUBHpu/opr4NZDjmKsz2P+b10UZ019BCNHsOgD1WqQRDz5gSzj9RgJCGUbLQ7 RoeDRelIufhXF5kHR1h+xfr+0oqGcPDzirJgJLIQeEkQksLecXEOuDM4Drnc4EbP2gZF yf/vcAO0dO2VZBBnD4wyLRALc1tK7Xn49A6xAOgvPfsHY2xjIzVBZflIH/UM6BvZgiU4 tfgEQ/+vhlweKqhCRqyLd4pUjAAt05MHzDiA3saxf8stOImjfVGRljNMqRHDfpyQ5y89 i8sQ== 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=VyjaPrvWKYu/jmknsfya0pmP5qd7CETfPF6kIkDaqFg=; b=tPDkl8kwbgRjvPmfycbzeGvmLeyxIb5mNCuhkbYnLiFHKGhkR6N0+zYdGVcij8AeqV 7unlF8VAzPhWcv+GHRb/B4XMJ6J8JUCx7fWhFqoyLI5vBzUmuWRFV0+a+vD/tDbkbTHK 2ACwT84kxF79B+64vqqvbc8hsNA9id3sDW9npaDiDgPaR4lrWbqvlblPefYlEQou13LF TNhn5PnpxuPUcZAS85CqXxbVs1Eo23tat9k66riUEYDDiYPhFNctOVU2utNWbhGKl1gR 8R8r4SbIIWoxDNSdzE9gvQRvT19+BRiKxOGZHGaDZGlGHUYDNaD0NhQuHJnO4zxoiNhb vsog== X-Gm-Message-State: APjAAAVBGpuoO5AlCL4fGtEHfV33qQBbc6aItJkOUg5vfTCUF+kaJHAs 0B/Y4Br8i9npkEe1OOuIH3HFmBNh X-Google-Smtp-Source: APXvYqwtr0IYYWOR0uOZU08/lr6oEbC3j9rl52lyy3eBOAWc/uyk73Uw0wmCdjKx/7jR+T/KidA6Cg== X-Received: by 2002:a05:620a:1109:: with SMTP id o9mr16413697qkk.324.1566164743988; Sun, 18 Aug 2019 14:45:43 -0700 (PDT) From: Daniel Henrique Barboza To: libvir-list@redhat.com Date: Sun, 18 Aug 2019 18:45:29 -0300 Message-Id: <20190818214531.1104-2-danielhb413@gmail.com> In-Reply-To: <20190818214531.1104-1-danielhb413@gmail.com> References: <20190818214531.1104-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.30]); Sun, 18 Aug 2019 21:45:44 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Sun, 18 Aug 2019 21:45:44 +0000 (UTC) for IP:'209.85.222.181' DOMAIN:'mail-qk1-f181.google.com' HELO:'mail-qk1-f181.google.com' FROM:'danielhb413@gmail.com' RCPT:'' X-RedHat-Spam-Score: 0.151 (DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS) 209.85.222.181 mail-qk1-f181.google.com 209.85.222.181 mail-qk1-f181.google.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.30 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com Cc: Daniel Henrique Barboza Subject: [libvirt] [PATCH v1 1/3] adding unplug_timeout QEMU conf 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.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.47]); Sun, 18 Aug 2019 21:46:19 +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 actual operation happened in the guest, causing confusion for the user. This patch adds a new qemu.conf parameter called 'unplug_timeout' to handle these cases. If left unset, the current default timeout is used. To avoid user 'experimentation' with small timeouts, the current timeout is also the minimal value allowed. Signed-off-by: Daniel Henrique Barboza --- src/qemu/libvirtd_qemu.aug | 3 +++ src/qemu/qemu.conf | 4 ++++ src/qemu/qemu_conf.c | 26 ++++++++++++++++++++++++++ src/qemu/qemu_conf.h | 5 +++++ src/qemu/qemu_driver.c | 2 ++ src/qemu/test_libvirtd_qemu.aug.in | 1 + 6 files changed, 41 insertions(+) diff --git a/src/qemu/libvirtd_qemu.aug b/src/qemu/libvirtd_qemu.aug index 2a99a0c55f..3bf94c9235 100644 --- a/src/qemu/libvirtd_qemu.aug +++ b/src/qemu/libvirtd_qemu.aug @@ -130,6 +130,8 @@ module Libvirtd_qemu =3D =20 let capability_filters_entry =3D str_array_entry "capability_filters" =20 + let unplug_timeout_entry =3D int_entry "unplug_timeout" + (* Each entry in the config is one of the following ... *) let entry =3D default_tls_entry | vnc_entry @@ -152,6 +154,7 @@ module Libvirtd_qemu =3D | nbd_entry | swtpm_entry | capability_filters_entry + | unplug_timeout_entry =20 let comment =3D [ label "#comment" . del /#[ \t]*/ "# " . store /([^ \= t\n][^\n]*)?/ . del /\n/ "\n" ] let empty =3D [ label "#empty" . eol ] diff --git a/src/qemu/qemu.conf b/src/qemu/qemu.conf index 8cabeccacb..c6d0f0940c 100644 --- a/src/qemu/qemu.conf +++ b/src/qemu/qemu.conf @@ -847,3 +847,7 @@ # may change across versions. # #capability_filters =3D [ "capname" ] + +# Timeout, in seconds, for unplug operations. Default and minimal value +# is 5. +#unplug_timeout =3D 5 diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c index 2953893337..83d4ac8310 100644 --- a/src/qemu/qemu_conf.c +++ b/src/qemu/qemu_conf.c @@ -69,6 +69,8 @@ VIR_LOG_INIT("qemu.qemu_conf"); #define QEMU_MIGRATION_PORT_MIN 49152 #define QEMU_MIGRATION_PORT_MAX 49215 =20 +#define QEMU_UNPLUG_TIMEOUT 5 + static virClassPtr virQEMUDriverConfigClass; static void virQEMUDriverConfigDispose(void *obj); =20 @@ -298,6 +300,8 @@ virQEMUDriverConfigPtr virQEMUDriverConfigNew(bool priv= ileged) cfg->glusterDebugLevel =3D 4; cfg->stdioLogD =3D true; =20 + cfg->unplugTimeout =3D QEMU_UNPLUG_TIMEOUT; + if (!(cfg->namespaces =3D virBitmapNew(QEMU_DOMAIN_NS_LAST))) goto error; =20 @@ -1009,6 +1013,24 @@ virQEMUDriverConfigLoadCapsFiltersEntry(virQEMUDrive= rConfigPtr cfg, } =20 =20 +static int +virQEMUDriverConfigLoadUnplugTimeoutEntry(virQEMUDriverConfigPtr cfg, + virConfPtr conf) +{ + if (virConfGetValueUInt(conf, "unplug_timeout", &cfg->unplugTimeout) <= 0) + return -1; + + if (cfg->unplugTimeout < QEMU_UNPLUG_TIMEOUT) { + virReportError(VIR_ERR_INTERNAL_ERROR, + _("unplug_timeout: value must be greater " + "than or equal to %d"), QEMU_UNPLUG_TIMEOUT); + return -1; + } + + return 0; +} + + int virQEMUDriverConfigLoadFile(virQEMUDriverConfigPtr cfg, const char *filename, bool privileged) @@ -1081,6 +1103,10 @@ int virQEMUDriverConfigLoadFile(virQEMUDriverConfigP= tr cfg, if (virQEMUDriverConfigLoadCapsFiltersEntry(cfg, conf) < 0) goto cleanup; =20 + if (virQEMUDriverConfigLoadUnplugTimeoutEntry(cfg, conf) < 0) + goto cleanup; + + ret =3D 0; =20 cleanup: diff --git a/src/qemu/qemu_conf.h b/src/qemu/qemu_conf.h index 0cbddd7a9c..29824e4e35 100644 --- a/src/qemu/qemu_conf.h +++ b/src/qemu/qemu_conf.h @@ -214,6 +214,8 @@ struct _virQEMUDriverConfig { gid_t swtpm_group; =20 char **capabilityfilters; + + unsigned int unplugTimeout; }; =20 /* Main driver state */ @@ -294,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 11f97dbc65..5e86d4cfe6 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -1078,6 +1078,8 @@ qemuStateInitialize(bool privileged, if (!qemu_driver->workerPool) goto error; =20 + qemu_driver->unplugTimeout =3D cfg->unplugTimeout * 1000ul; + qemuProcessReconnectAll(qemu_driver); =20 qemuAutostartDomains(qemu_driver); diff --git a/src/qemu/test_libvirtd_qemu.aug.in b/src/qemu/test_libvirtd_qe= mu.aug.in index 9f81759cb5..a1cd48f1ee 100644 --- a/src/qemu/test_libvirtd_qemu.aug.in +++ b/src/qemu/test_libvirtd_qemu.aug.in @@ -109,3 +109,4 @@ module Test_libvirtd_qemu =3D { "capability_filters" { "1" =3D "capname" } } +unplug_timeout =3D 5 --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Wed May 8 22:07:57 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=1566164790; cv=none; d=zoho.com; s=zohoarc; b=AHqege5pFQe+4HoTJvcGrYDG067Wh7VlHoiK1o2mTQ19jT5m0A+1FumVbQ/jItZiLcEdT5W0TC8d7I2WTyw+6iqwdPPW9luCBvq6y7GZoeaJvLVqwJc6NMC/FLYrxqfXaOxJMdt9M1u7157nNAJwjWfmD1xjIhOrDxGisNF4al0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1566164790; 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=pb/SseLJoxZWO01Tr/o4wnjKYnpyslXiijuiMQWezYs=; b=fDsBAjA4DThr1YUr6dNPDlQoKtJqjbfx6BR6TZ9NBBOt/KPd5NdIMUIyNRyA1Cj55P6VNcnqY87SPgIz8V8dd7FVkhuRfC19DDBVZ3SVnX0/t7vEAK3harE2zoZskrAYYlW9P3uhUWT1+99n/lNBydJYljqp5Qknl/ux36W438o= 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 1566164790120661.2634910095833; Sun, 18 Aug 2019 14:46:30 -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 C21BD5859E; Sun, 18 Aug 2019 21:46:28 +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 9C0321CD; Sun, 18 Aug 2019 21:46:28 +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 65BB7180124D; Sun, 18 Aug 2019 21:46:28 +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 x7ILjnEI007907 for ; Sun, 18 Aug 2019 17:45:49 -0400 Received: by smtp.corp.redhat.com (Postfix) id F3E631D1; Sun, 18 Aug 2019 21:45:48 +0000 (UTC) Received: from mx1.redhat.com (ext-mx19.extmail.prod.ext.phx2.redhat.com [10.5.110.48]) by smtp.corp.redhat.com (Postfix) with ESMTPS id ED84E1C0 for ; Sun, 18 Aug 2019 21:45:46 +0000 (UTC) Received: from mail-qk1-f196.google.com (mail-qk1-f196.google.com [209.85.222.196]) (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 0DFFA307D88C for ; Sun, 18 Aug 2019 21:45:46 +0000 (UTC) Received: by mail-qk1-f196.google.com with SMTP id u190so9085907qkh.5 for ; Sun, 18 Aug 2019 14:45:46 -0700 (PDT) Received: from rekt.ibmuc.com ([2804:431:c7c7:f4cc:257f:4df:592:a35]) by smtp.gmail.com with ESMTPSA id s64sm6191302qke.125.2019.08.18.14.45.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 18 Aug 2019 14:45:44 -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=E5JGVxrxhK6aGbwfMXbwWVRqquY4Vd57bFbfIZx71GU=; b=e724qZpeTlFAb+I8URV8pqX29/ki/jN14ICG9HFhBJRQYpGGa0MDD3ht8ydatBoScN yykTJo5efUQhrfq4a4j73M9gnPcO4DLbsuX2hKDkrDr+2i4Dj5GjkYwAeNFM7SfIfYba DWPVdtKuHHRWXtMTn+VMLtWTYKGDX5y0/67Wx0+AII4tke6lSOYAPfAAVDCAy6w5nTVK AqzHrr9LzHFo5Ks83nLI47Mh8cOsSsqP+YFRUTOwN7anxJ1QBKkiN6PHwbtrO7+FfMH8 hnyLVfZc9cPWbb1oG5WBNMJhKaREOJwNQbMRSQSPt2W7j0Ndy2Z+bGSrOcWglKVl1h0O uOUQ== 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=E5JGVxrxhK6aGbwfMXbwWVRqquY4Vd57bFbfIZx71GU=; b=JaFnvAxTaYD64bCNp9lR74gowHsmXncm5ZJvOHWP+MUqzkBCRo9UKgSyQH7lkLu7tZ cjuf9grw9WP1jUHZOhzHLFi4MJnrJdmzxz+ED7UER+EnaD4JeG2CyC0Yja8pfJHDQozV Z+roqwJ/a5sXoB9XixLQ41rlP0Dp8Lx7LdXrXI4nrQC2k85Z359UzUNCZZGp7npDiTAl vmd/07zj8qL6A4+wHDijfpC+Gda6IIWCd5vlAQbYE+tWZ753Zv2v9iBpF78VtTwTbJ2L ahWKMxNbNlTDuqZ7wLxC54s4gq9uICT6CYS2GJEIgIDjKWCzd31Blyrh3/fawwi6psSR iOiQ== X-Gm-Message-State: APjAAAUGIrsYFe+g5IX4FzOZ5isRN/pN5S7MmHx9WQO09bAK5V6JCcAG bt8Ki2zJMG0CXXRRy0bOhoqkl2B9 X-Google-Smtp-Source: APXvYqxRpXqcY/cxvPsvXf0cII6Ecr8nKwcL/jkHKm/qOW+INc6NSasQc5URTGxEPlkEVxEh/a2L9Q== X-Received: by 2002:a05:620a:1325:: with SMTP id p5mr18210447qkj.325.1566164745270; Sun, 18 Aug 2019 14:45:45 -0700 (PDT) From: Daniel Henrique Barboza To: libvir-list@redhat.com Date: Sun, 18 Aug 2019 18:45:30 -0300 Message-Id: <20190818214531.1104-3-danielhb413@gmail.com> In-Reply-To: <20190818214531.1104-1-danielhb413@gmail.com> References: <20190818214531.1104-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.48]); Sun, 18 Aug 2019 21:45:46 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.48]); Sun, 18 Aug 2019 21:45:46 +0000 (UTC) for IP:'209.85.222.196' DOMAIN:'mail-qk1-f196.google.com' HELO:'mail-qk1-f196.google.com' FROM:'danielhb413@gmail.com' RCPT:'' X-RedHat-Spam-Score: -0.088 (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.196 mail-qk1-f196.google.com 209.85.222.196 mail-qk1-f196.google.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.48 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Cc: Daniel Henrique Barboza Subject: [libvirt] [PATCH v1 2/3] qemu_hotplug: use qemu_driver->unplugTimeout in device removal 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.5.16 (mx1.redhat.com [10.5.110.39]); Sun, 18 Aug 2019 21:46:29 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" qemuDomainResetDeviceRemoval() uses a global variable called 'qemuDomainRemoveDeviceWaitTime', hardcoded to 5000, to use as timeout value for virDomainObjWaitUntil(). This timeout value can now be set by the user, via 'unplug_timeout' in qemu.conf, and it is stored in the QEMUDriver object. Signed-off-by: Daniel Henrique Barboza --- src/qemu/qemu_hotplug.c | 10 +++++----- tests/qemuhotplugtest.c | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index d8be63b71c..04a888863c 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -5135,7 +5135,7 @@ 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; @@ -5143,7 +5143,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) @@ -5599,7 +5599,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 @@ -5899,7 +5899,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 @@ -6005,7 +6005,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 6ad67c8902..5e9fc48975 100644 --- a/tests/qemuhotplugtest.c +++ b/tests/qemuhotplugtest.c @@ -622,7 +622,7 @@ mymain(void) return EXIT_FAILURE; =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 Wed May 8 22:07:57 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=1566164787; cv=none; d=zoho.com; s=zohoarc; b=SwrZe293sE/mq7k4C6eed/7pqa4Wr76WxF79NEShLPCgq81tbHPXc/e+cfWWbU/cHFCBajnXbHHQL3ZwVfeP8xoVrvGjJFmybK/0lRj8PpEyGvblHtMIZwycSt9yhEh1cMf/cFMILc72bRp9k9jzYg6AYfgA5eEuEbAYQpKuQ+E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1566164787; 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=mv6LGR4yxampfheek3wdJ9hKgtw9A/hmeV5pa7i7m10=; b=evLRhhqKe+lzoZBJGGTyvfL2gUSvEusELcl6n2x2UEW9F+kRrxjmB6y/JgT/DNY5Aj3tbVGO8LuxVE+LxdPclWX/wgq2uKiYYzM+GTZW/9+E7SjaBt9Vh5BB5hlsk7sm/13Pch6VHVzEi/GLhyPCx9R/anmQyXToyx5xjKi8dtA= 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 1566164787458372.13428535377057; Sun, 18 Aug 2019 14:46:27 -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 06FB63082D9E; Sun, 18 Aug 2019 21:46:26 +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 78B841001B20; Sun, 18 Aug 2019 21:46:25 +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 3BCB518005C7; Sun, 18 Aug 2019 21:46:25 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x7ILjmht007901 for ; Sun, 18 Aug 2019 17:45:48 -0400 Received: by smtp.corp.redhat.com (Postfix) id 76E061001B1D; Sun, 18 Aug 2019 21:45:48 +0000 (UTC) Received: from mx1.redhat.com (ext-mx10.extmail.prod.ext.phx2.redhat.com [10.5.110.39]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 71D541001B11 for ; Sun, 18 Aug 2019 21:45:48 +0000 (UTC) Received: from mail-qk1-f196.google.com (mail-qk1-f196.google.com [209.85.222.196]) (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 4F4DB5945B for ; Sun, 18 Aug 2019 21:45:47 +0000 (UTC) Received: by mail-qk1-f196.google.com with SMTP id d23so9142774qko.3 for ; Sun, 18 Aug 2019 14:45:47 -0700 (PDT) Received: from rekt.ibmuc.com ([2804:431:c7c7:f4cc:257f:4df:592:a35]) by smtp.gmail.com with ESMTPSA id s64sm6191302qke.125.2019.08.18.14.45.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 18 Aug 2019 14:45:46 -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=0QeEAxdYFcQyaXSsk5GNmxRThmC7qPpo/+YiY6y30PI=; b=qBdHqs3s8zIHxczCr4fES9YxEU6PGc32ytTDBExsMqui59Pc4EMt0/WUfcUk8N+imL MK3JOVuwug2p7SSnVoeC19TZ49z0+I2+l8BxsoT7s/amk4DxHThX+g7HwUKsHUagyoY1 CUYHIuIMldRwXeOImUlAaKwR8Ent11TUF/qnz5t6Jsn8ByzARqCua7Y97fQCPLi8zdHx BtIc0i5l63jr39/k2xbHs/Gwx7Z/tjtvrglhmj1lFSl4AN3L2n0mhEDiH8NTP/0IPQfq qhQGhhKI4yH8TIC4b5P+MIj8Wkjfu/r9b177KqATkfyttC3KqB8q4NaYhdp8YPd0DY/X Ez3g== 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=0QeEAxdYFcQyaXSsk5GNmxRThmC7qPpo/+YiY6y30PI=; b=GzgDGwLfvpUVYwgBw0jLlOW+BofKq+ejy9Knlhr2PfwahhSAP351fbVlV2OA8RL6MU nRyPo6NPyr6CS3ij6WSDqV29xxIfZffpv4zXJQBv8cZ0JL/kbxGqGKGFWUUkJ/TsdA4/ aAQCWpxE+wOqER+evBE5JJy5vmH+LVj9Yhz0aEAEBr0UhZDPXmD2iMe2jPCghBoLvpZq EnSXOZcoD2OwkL6Spm2KXpXfOjmYe8cld9rXErZDq9h1TYkR++CIO95HQ3nmde6BHj69 WWMAxTvmfWm4B+IznGXVY7VXs2v/boPPpan3cgLakz7MvPYv4g+aMyl3p5Xfv+yTA5Hf JsZA== X-Gm-Message-State: APjAAAVvf9kQjMy1drSnxGNAx5csUey4br9PnAwaLIuy9+y6I+PiB20W ZKxYVe9c4R6PDTmm2gmEvPKxNOb1 X-Google-Smtp-Source: APXvYqwShCNIJaY2Fzz0AYCgf0iXnGsQiPzOZ5XfIIfvRutAdkvgCMfk8ANHmUZBF9/+ncAtaddPCg== X-Received: by 2002:a37:96c7:: with SMTP id y190mr17795000qkd.111.1566164746504; Sun, 18 Aug 2019 14:45:46 -0700 (PDT) From: Daniel Henrique Barboza To: libvir-list@redhat.com Date: Sun, 18 Aug 2019 18:45:31 -0300 Message-Id: <20190818214531.1104-4-danielhb413@gmail.com> In-Reply-To: <20190818214531.1104-1-danielhb413@gmail.com> References: <20190818214531.1104-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.39]); Sun, 18 Aug 2019 21:45:47 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Sun, 18 Aug 2019 21:45:47 +0000 (UTC) for IP:'209.85.222.196' DOMAIN:'mail-qk1-f196.google.com' HELO:'mail-qk1-f196.google.com' FROM:'danielhb413@gmail.com' RCPT:'' X-RedHat-Spam-Score: -0.088 (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.196 mail-qk1-f196.google.com 209.85.222.196 mail-qk1-f196.google.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.39 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com Cc: Daniel Henrique Barboza Subject: [libvirt] [PATCH v1 3/3] qemu: Remove qemu_hotplugpriv.h 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]); Sun, 18 Aug 2019 21:46:26 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" This 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 patches deprecated the variable, using qemu_driver->unplugTimeout to set the timeout instead, including qemuhotplugtest.c. 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 30a9751cfd..2b5584302f 100644 --- a/src/qemu/Makefile.inc.am +++ b/src/qemu/Makefile.inc.am @@ -27,7 +27,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 04a888863c..454044d04e 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 5e9fc48975..796459d73d 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