From nobody Wed May 8 05:35:36 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; 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=virtuozzo.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1542027801651545.8310777297753; Mon, 12 Nov 2018 05:03:21 -0800 (PST) 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 153C9307DAAA; Mon, 12 Nov 2018 13:03:19 +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 C0B33608F7; Mon, 12 Nov 2018 13:03: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 75E5C181A86C; Mon, 12 Nov 2018 13:03:18 +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 wACCwaub012320 for ; Mon, 12 Nov 2018 07:58:36 -0500 Received: by smtp.corp.redhat.com (Postfix) id 527C95D757; Mon, 12 Nov 2018 12:58:36 +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 4BB475D739 for ; Mon, 12 Nov 2018 12:58:33 +0000 (UTC) Received: from relay.sw.ru (relay.sw.ru [185.231.240.75]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C98E12D80E for ; Mon, 12 Nov 2018 12:58:30 +0000 (UTC) Received: from [10.94.3.220] (helo=dim-vz7.qa.sw.ru) by relay.sw.ru with esmtp (Exim 4.90_1) (envelope-from ) id 1gMBnP-0006cB-Iz for libvir-list@redhat.com; Mon, 12 Nov 2018 15:58:27 +0300 From: Nikolay Shirokovskiy To: libvir-list@redhat.com Date: Mon, 12 Nov 2018 15:58:18 +0300 Message-Id: <1542027499-555916-2-git-send-email-nshirokovskiy@virtuozzo.com> In-Reply-To: <1542027499-555916-1-git-send-email-nshirokovskiy@virtuozzo.com> References: <1542027499-555916-1-git-send-email-nshirokovskiy@virtuozzo.com> X-Greylist: Sender passed SPF test, ACL 238 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Mon, 12 Nov 2018 12:58:31 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Mon, 12 Nov 2018 12:58:31 +0000 (UTC) for IP:'185.231.240.75' DOMAIN:'relay.sw.ru' HELO:'relay.sw.ru' FROM:'nshirokovskiy@virtuozzo.com' RCPT:'' X-RedHat-Spam-Score: -0.001 (SPF_PASS) 185.231.240.75 relay.sw.ru 185.231.240.75 relay.sw.ru X-Scanned-By: MIMEDefang 2.78 on 10.5.110.30 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 1/2] qemu: don't log error for missing optional sources on stats 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: , MIME-Version: 1.0 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.42]); Mon, 12 Nov 2018 13:03:20 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Every time we call all domain stats for inactive domain with unavailable source we get error message in logs. It's a bit noisy. While it's arguable whether we need such message or not for mandatory disks we would like not to see messages for optional disks. Let's filter at least for cases of local files. Fixing other cases would require passing flag down the stack to .backendInit of storage which is ugly. Stats for active domain are fine because we either drop disks with unavailable sources or clean source which is handled by virStorageSourceIsEmpty in qemuDomainGetStatsOneBlockFallback. We have these logs for successful stats since 25aa7035d which in turn fixes 596a13713 which added substantial stats for offline disks. Signed-off-by: Nikolay Shirokovskiy --- src/qemu/qemu_driver.c | 5 +++++ src/qemu/qemu_process.c | 9 +++++++++ src/qemu/qemu_process.h | 2 ++ 3 files changed, 16 insertions(+) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index a52e249..72e4cfe 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -20290,6 +20290,11 @@ qemuDomainGetStatsBlockExportDisk(virDomainDiskDef= Ptr disk, const char *backendstoragealias; int ret =3D -1; =20 + if (!virDomainObjIsActive(dom) && + qemuProcessMissingLocalOptionalDisk(disk)) + return qemuDomainGetStatsBlockExportHeader(disk, disk->src, *recor= dnr, + records, nrecords); + for (n =3D disk->src; virStorageSourceIsBacking(n); n =3D n->backingSt= ore) { if (blockdev) { frontendalias =3D QEMU_DOMAIN_DISK_PRIVATE(disk)->qomName; diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 9cf9718..802274e 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -6070,6 +6070,15 @@ qemuProcessPrepareSEVGuestInput(virDomainObjPtr vm) } =20 =20 +bool +qemuProcessMissingLocalOptionalDisk(virDomainDiskDefPtr disk) +{ + return disk->startupPolicy =3D=3D VIR_DOMAIN_STARTUP_POLICY_OPTIONAL && + virStorageSourceIsLocalStorage(disk->src) && disk->src->path && + !virFileExists(disk->src->path); +} + + static int qemuProcessPrepareHostStorage(virQEMUDriverPtr driver, virDomainObjPtr vm, diff --git a/src/qemu/qemu_process.h b/src/qemu/qemu_process.h index 2037467..52d396d 100644 --- a/src/qemu/qemu_process.h +++ b/src/qemu/qemu_process.h @@ -214,4 +214,6 @@ int qemuProcessStartManagedPRDaemon(virDomainObjPtr vm); =20 void qemuProcessKillManagedPRDaemon(virDomainObjPtr vm); =20 +bool qemuProcessMissingLocalOptionalDisk(virDomainDiskDefPtr disk); + #endif /* __QEMU_PROCESS_H__ */ --=20 1.8.3.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Wed May 8 05:35:36 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; 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=virtuozzo.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1542027800930431.4535060898173; Mon, 12 Nov 2018 05:03:20 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8F294307DAA1; Mon, 12 Nov 2018 13:03: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 59A4B5D9D6; Mon, 12 Nov 2018 13:03: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 CAAA2181A133; Mon, 12 Nov 2018 13:03:17 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id wACCwa9E012327 for ; Mon, 12 Nov 2018 07:58:36 -0500 Received: by smtp.corp.redhat.com (Postfix) id 5CA78608F8; Mon, 12 Nov 2018 12:58:36 +0000 (UTC) Received: from mx1.redhat.com (ext-mx08.extmail.prod.ext.phx2.redhat.com [10.5.110.32]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 47D0E608F7 for ; Mon, 12 Nov 2018 12:58:33 +0000 (UTC) Received: from relay.sw.ru (relay.sw.ru [185.231.240.75]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id CA641C04B2F3 for ; Mon, 12 Nov 2018 12:58:30 +0000 (UTC) Received: from [10.94.3.220] (helo=dim-vz7.qa.sw.ru) by relay.sw.ru with esmtp (Exim 4.90_1) (envelope-from ) id 1gMBnP-0006cB-Qx for libvir-list@redhat.com; Mon, 12 Nov 2018 15:58:27 +0300 From: Nikolay Shirokovskiy To: libvir-list@redhat.com Date: Mon, 12 Nov 2018 15:58:19 +0300 Message-Id: <1542027499-555916-3-git-send-email-nshirokovskiy@virtuozzo.com> In-Reply-To: <1542027499-555916-1-git-send-email-nshirokovskiy@virtuozzo.com> References: <1542027499-555916-1-git-send-email-nshirokovskiy@virtuozzo.com> X-Greylist: Sender passed SPF test, ACL 238 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Mon, 12 Nov 2018 12:58:31 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Mon, 12 Nov 2018 12:58:31 +0000 (UTC) for IP:'185.231.240.75' DOMAIN:'relay.sw.ru' HELO:'relay.sw.ru' FROM:'nshirokovskiy@virtuozzo.com' RCPT:'' X-RedHat-Spam-Score: -0.001 (SPF_PASS) 185.231.240.75 relay.sw.ru 185.231.240.75 relay.sw.ru X-Scanned-By: MIMEDefang 2.78 on 10.5.110.32 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 2/2] qemu: don't log error for missing optional sources on start 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: , MIME-Version: 1.0 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.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.42]); Mon, 12 Nov 2018 13:03:19 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Because missing optional source is not error. The patch address only local files. Fixing other cases is a bit ugly. Signed-off-by: Nikolay Shirokovskiy --- src/qemu/qemu_process.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 802274e..5e04bf9 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -6100,7 +6100,8 @@ qemuProcessPrepareHostStorage(virQEMUDriverPtr driver, if (!blockdev) virStorageSourceBackingStoreClear(disk->src); =20 - if (qemuDomainDetermineDiskChain(driver, vm, disk, true) >=3D 0) + if (!qemuProcessMissingLocalOptionalDisk(disk) && + qemuDomainDetermineDiskChain(driver, vm, disk, true) >=3D 0) continue; =20 if (qemuDomainCheckDiskStartupPolicy(driver, vm, idx, cold_boot) >= =3D 0) --=20 1.8.3.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list