From nobody Fri May 3 01:43:09 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) client-ip=205.139.110.61; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 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=1594818647; cv=none; d=zohomail.com; s=zohoarc; b=PvOE6BVQb7WUG0IUj4fpacQo1cM5ID/yjI9/jj7nwEtSQ9wSC1y5e7XIB0Ku5pHWwx+j0V3Az6tCFdVNhazZXeo5fhzDNzICt/PGpCJWua2zwzc8PdMlKLh9Ms9UVvxoAsAfBaIkCXhttbf9hcuIife6jPeKtIzEnvR/7ePR5Jo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1594818647; 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=ajLePsgaPGvK0TooRf2hK1o47Aj8B3Hc1OFGLivuGmc=; b=K1KqSXV6POiftJmOe6pDGfKCeI6BVYprgDldPwLqhnkG8IMqd7rNZJ9LtHEkeqz2GPP9JqqUeymWAikhDB9ezwXO3q+dH90yQkXPqPkwW5fYPkL3tLUNxb5IQrf3DA8gTi/QNLYf4rqkj69s9am/NsC0peL+ZGBffHEmvRrZTl0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) by mx.zohomail.com with SMTPS id 1594818647079173.32638772219366; Wed, 15 Jul 2020 06:10:47 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-504-dyhvotyJM8-h34vvwIMZoA-1; Wed, 15 Jul 2020 09:10:43 -0400 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id AFEF61009441; Wed, 15 Jul 2020 13:10:36 +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 912C878A56; Wed, 15 Jul 2020 13:10:36 +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 C3A4E18006D3; Wed, 15 Jul 2020 13:10:35 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 06FDAIc8005714 for ; Wed, 15 Jul 2020 09:10:18 -0400 Received: by smtp.corp.redhat.com (Postfix) id 90F4360C84; Wed, 15 Jul 2020 13:10:18 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.29]) by smtp.corp.redhat.com (Postfix) with ESMTP id C7C2B610AF for ; Wed, 15 Jul 2020 13:10:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1594818645; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=ajLePsgaPGvK0TooRf2hK1o47Aj8B3Hc1OFGLivuGmc=; b=N+Y4QspwpwlRmhn3ysH9EB3MLeNLj487tkrbHIQ2eBjcQ6i3706F5Lhx/61kEbLZHvzDSJ m625PXaj1eK1Gtz4MQmlO5qNnhpztk62pdMq7x97PFsWDFusVZYOR8Ng7B9030SZl2i866 3uIQHkvxenDu28uOGYzQ5Wfb0DA1bbE= X-MC-Unique: dyhvotyJM8-h34vvwIMZoA-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 01/10] virDomainSetBlockThreshold: Document values of '@dev' better Date: Wed, 15 Jul 2020 15:10:03 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com 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: , 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-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Mention where to obtain the index and how it's treated. Signed-off-by: Peter Krempa Reviewed-by: Eric Blake --- src/libvirt-domain.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/libvirt-domain.c b/src/libvirt-domain.c index fe4dab7cdf..ba30d18f65 100644 --- a/src/libvirt-domain.c +++ b/src/libvirt-domain.c @@ -12371,6 +12371,12 @@ int virDomainGetGuestInfo(virDomainPtr domain, * level is unset once the event fires. The event might not be delivered a= t all * if libvirtd was not running at the moment when the threshold was reache= d. * + * @dev can either be a disk target name (vda, sda) or disk target with in= dex ( + * vda[4]). Without the index the top image in the backing chain will have= the + * threshold set. The index corresponds to the 'index' attribute reported = in the + * live VM XML for 'backingStore' or 'source' elements of a disk. If index= is + * given the threshold is set for the corresponding image. + * * Hypervisors report the last written sector of an image in the bulk stat= s API * (virConnectGetAllDomainStats/virDomainListGetStats) as * "block..allocation" in the VIR_DOMAIN_STATS_BLOCK group. The curre= nt --=20 2.26.2 From nobody Fri May 3 01:43:09 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) client-ip=205.139.110.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 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=1594818648; cv=none; d=zohomail.com; s=zohoarc; b=lZ+kFT/MVG5IyrvqE4iHDB3K3LLmS/HXF1emHYn7TWZecxsCm2T5C+V9PmopYhSI/D9l+s8vj7YKg8gXS9r4lcvoIALveBYLTtgEN/2T2YD+GIKjAa3cxpBvFRVnT1j+F2iZ80fxy1PeRuLXkQhA+y2mGZkTo5QAhFBX5ldPlx4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1594818648; 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=AnJjEgD7q/4vJPilVzcZ1j7OmcL/kVt2acoaSkrFwUs=; b=KFdq2ufMwnHZSy/u2ywEZMKJfj2aieOuK1aIriSdyPmrKwZt1OKoitbUpuI+yTzlxE1Idm53gn4YZ0cbeWiJHaUsjrXA+oe94pQeDAC/5WMOaKCd5KxBlY75BczDDZL1rrvXbbJ2BEHUNo94RrI0R8VxBcKIU5oFajSvxByuD7I= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by mx.zohomail.com with SMTPS id 1594818648457544.6316982212794; Wed, 15 Jul 2020 06:10:48 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-294-fkV-SXjiOKKdaV-NVpt57w-1; Wed, 15 Jul 2020 09:10:44 -0400 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id 25F631009457; Wed, 15 Jul 2020 13:10:39 +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 045B578A5C; Wed, 15 Jul 2020 13:10:39 +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 C546694F19; Wed, 15 Jul 2020 13:10:38 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 06FDAJnF005727 for ; Wed, 15 Jul 2020 09:10:19 -0400 Received: by smtp.corp.redhat.com (Postfix) id CAAB160C84; Wed, 15 Jul 2020 13:10:19 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.29]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3C15B610AF for ; Wed, 15 Jul 2020 13:10:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1594818647; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=AnJjEgD7q/4vJPilVzcZ1j7OmcL/kVt2acoaSkrFwUs=; b=Yv0JNN/xBo0eMzCnCkLdci383rfF3BRGTRLydz+15EkmqCajQ9LGIPxZrjXGUKUBoLO7/t ktxH2DsMWPDBW8nDGz/7JG/w13COLXFPUprImxfGnyrGG30mmD5ifzj2/A2Qs/3BSNslYG Fic21FC2twwIMlRCK0hvz7PDtwEAR40= X-MC-Unique: fkV-SXjiOKKdaV-NVpt57w-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 02/10] qemuDomainDiskBackingStoreGetName: Remove unused argument Date: Wed, 15 Jul 2020 15:10:04 +0200 Message-Id: <5cad8616c4e933840f41bc2388b2a4fcea06d0cc.1594818495.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com 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: , 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-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Signed-off-by: Peter Krempa Reviewed-by: Eric Blake --- src/qemu/qemu_domain.c | 1 - src/qemu/qemu_domain.h | 1 - src/qemu/qemu_process.c | 2 +- 3 files changed, 1 insertion(+), 3 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 4a2daffc0a..3d136a6b8a 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -11515,7 +11515,6 @@ qemuDomainDiskLookupByNodename(virDomainDefPtr def, */ char * qemuDomainDiskBackingStoreGetName(virDomainDiskDefPtr disk, - virStorageSourcePtr src G_GNUC_UNUSED, unsigned int idx) { char *ret =3D NULL; diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h index e524fd0002..6944b37ff7 100644 --- a/src/qemu/qemu_domain.h +++ b/src/qemu/qemu_domain.h @@ -963,7 +963,6 @@ virDomainDiskDefPtr qemuDomainDiskLookupByNodename(virD= omainDefPtr def, unsigned int *idx); char *qemuDomainDiskBackingStoreGetName(virDomainDiskDefPtr disk, - virStorageSourcePtr src, unsigned int idx); virStorageSourcePtr qemuDomainGetStorageSourceByDevstr(const char *devstr, diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 70fc24b993..2ee778c606 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -1514,7 +1514,7 @@ qemuProcessHandleBlockThreshold(qemuMonitorPtr mon G_= GNUC_UNUSED, if (virStorageSourceIsLocalStorage(src)) path =3D src->path; - if ((dev =3D qemuDomainDiskBackingStoreGetName(disk, src, idx))) + if ((dev =3D qemuDomainDiskBackingStoreGetName(disk, idx))) event =3D virDomainEventBlockThresholdNewFromObj(vm, dev, path, threshold, exce= ss); } --=20 2.26.2 From nobody Fri May 3 01:43:09 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) client-ip=207.211.31.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 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=1594818634; cv=none; d=zohomail.com; s=zohoarc; b=F2nF7tFE/qsl/+r+FFDXJYT/aflePnmjcENfhFnuYpEA4yV8t0EpZ+5zctjqJshyb1jkd1by+9UU6CCu11l2nt35Sa8LupA34E/PSmo/JidqYVh+8yA5lfopny0Fdri/18TdJdzZ9G1Dcbw9g47C9++SjLv/Ii2OJRqfgyrGexU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1594818634; 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=lE+MGKcVYOmsP4Eh/wbSQ7XmmN2Er9KANM4MJsW+Y44=; b=XLqFbfpmA2QjOIENlgId6NohqV0V3qSd4jidwFVvlYG0AMMtPKH7rmBvzW3PlQVA57wWVGwToQR2s0MvYsmkASXdqBdhxnLwm25DnuR7qvCVhnl53HGm0IX9Hr+uEvpfuc9s+UQA+jSdZd2oFkUwzs4g+AIRQ02+4bOGbyylVyQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by mx.zohomail.com with SMTPS id 1594818634344133.8523699297657; Wed, 15 Jul 2020 06:10:34 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-77-_RNfOXiCPsWSzKVqS3Qlvg-1; Wed, 15 Jul 2020 09:10:31 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 6056019200C0; Wed, 15 Jul 2020 13:10:25 +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 3488A610AF; Wed, 15 Jul 2020 13:10: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 95A3C94EFD; Wed, 15 Jul 2020 13:10:23 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 06FDAKfo005738 for ; Wed, 15 Jul 2020 09:10:20 -0400 Received: by smtp.corp.redhat.com (Postfix) id DE2EC19079; Wed, 15 Jul 2020 13:10:20 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.29]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3858760C84 for ; Wed, 15 Jul 2020 13:10:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1594818633; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=lE+MGKcVYOmsP4Eh/wbSQ7XmmN2Er9KANM4MJsW+Y44=; b=gVA9SbQkPatr/teBIoth4y8qW9JKjIRv0feAJ8sy5aOUBkYeEwPexHDKpI9fxbw1jYWxcu cPfL6NjkbjWSAfMH8MHYwS3Nnu2SISOCbGIVNcALkRsg6+24rNF3odTGTdqF4EXn6hbojm GCZISX3hhwRWW67uCeka6Nq6jTQNfwk= X-MC-Unique: _RNfOXiCPsWSzKVqS3Qlvg-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 03/10] qemuDomainDiskBackingStoreGetName: Eliminate temp variable Date: Wed, 15 Jul 2020 15:10:05 +0200 Message-Id: <93f8d1eb88b83592d8e4d23a0eef63a0de9b6f5d.1594818495.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com 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: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" We can return the formatted string directly. Signed-off-by: Peter Krempa Reviewed-by: Eric Blake --- src/qemu/qemu_domain.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 3d136a6b8a..cfdd9270da 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -11517,14 +11517,10 @@ char * qemuDomainDiskBackingStoreGetName(virDomainDiskDefPtr disk, unsigned int idx) { - char *ret =3D NULL; - if (idx) - ret =3D g_strdup_printf("%s[%d]", disk->dst, idx); + return g_strdup_printf("%s[%d]", disk->dst, idx); else - ret =3D g_strdup(disk->dst); - - return ret; + return g_strdup(disk->dst); } --=20 2.26.2 From nobody Fri May 3 01:43:09 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) client-ip=205.139.110.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 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=1594818634; cv=none; d=zohomail.com; s=zohoarc; b=JfvZATZ0J3xjlfBmW2MZWZ055nAUYCFURPCZNS/Ywo1lCP+QuaOC1kdS69rz8cW9vevqWxfXhy/Ajg/kPQYZMvab9RXngqIAE42rR0xjpspxJdsgYrb2wcJCZgMW4bXq3GJvsykXuoQoT+ElqLSkb9Fvh/XNLC1BVetQKfRwEa4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1594818634; 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=Kd+HfepIf195bKLujSv365wO+WAohSvqk3RgbXQ+zLQ=; b=CCvS4wu2cmsrOTXIBLPXJ9GvUFPaInuS+ZP8dQQDsuZhHqSh7rWLDBeIkYQ5M48Jy4G/cOZ6BUJmposbsNeL2fhFe4lKqoen5VwMkbMUdtWzgWy82Iy56R1iBCrppKEfwAWaeewPwAjfD0H/IZCZ8GjXrIgIvj1+VJukQjUV5HI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by mx.zohomail.com with SMTPS id 1594818634183348.18091006493523; Wed, 15 Jul 2020 06:10:34 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-236-D7fRu3UNOrWGKWdzoeY7IQ-1; Wed, 15 Jul 2020 09:10:30 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A320910059AA; Wed, 15 Jul 2020 13:10:24 +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 5EA326842F; Wed, 15 Jul 2020 13:10:24 +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 DD30D1809561; Wed, 15 Jul 2020 13:10:23 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 06FDAM6U005750 for ; Wed, 15 Jul 2020 09:10:22 -0400 Received: by smtp.corp.redhat.com (Postfix) id 0FCF860C84; Wed, 15 Jul 2020 13:10:22 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.29]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5EAD961982 for ; Wed, 15 Jul 2020 13:10:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1594818633; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=Kd+HfepIf195bKLujSv365wO+WAohSvqk3RgbXQ+zLQ=; b=VtsQ+lC+6EDMebsahX9m3sEMdiY7a3PdvgzequlzS4DA1l6pWQP5SMBiyJRrvl/q9/Hqfp aZbAkAr32e0C3b+JozN2jz0b9+kedEW/0FlAGS2fV01OX1E8QFUxF70eCMsDHckzVHyaxK GZp/6eJMUZm2kTWbfmyvuThaQzzEUUQ= X-MC-Unique: D7fRu3UNOrWGKWdzoeY7IQ-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 04/10] qemuProcessHandleBlockThreshold: Report correct indexes Date: Wed, 15 Jul 2020 15:10:06 +0200 Message-Id: <1d94cd8c868862ed9e89a5ce9bffe263223044e8.1594818495.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com 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: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" The index returned by qemuDomainDiskLookupByNodename is the position in the backing chain rather than the index we report in the XML. Since with -blockdev they differ now and additionally the disk source also has an index we need to fix the 'threshold' evens we report: 1) If it's the top level image we must always trigger the event without any suffix as we did until now 2) We must report the correct index 3) We must report the correct index also for the top level image, when blockdev is used. This means that we need to potentially emit 2 events, one for the device without the index and then when blockdev is used and the top level image has an idex we must do it also with the index. This will fix it for blockdev cases, while also not removing previous semantics. https://bugzilla.redhat.com/show_bug.cgi?id=3D1857204 Signed-off-by: Peter Krempa Reviewed-by: Eric Blake --- src/qemu/qemu_process.c | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 2ee778c606..9b6dc8e68b 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -1497,10 +1497,10 @@ qemuProcessHandleBlockThreshold(qemuMonitorPtr mon = G_GNUC_UNUSED, void *opaque) { virQEMUDriverPtr driver =3D opaque; - virObjectEventPtr event =3D NULL; + virObjectEventPtr eventSource =3D NULL; + virObjectEventPtr eventDevice =3D NULL; virDomainDiskDefPtr disk; virStorageSourcePtr src; - unsigned int idx; const char *path =3D NULL; virObjectLock(vm); @@ -1509,18 +1509,28 @@ qemuProcessHandleBlockThreshold(qemuMonitorPtr mon = G_GNUC_UNUSED, "threshold '%llu' exceeded by '%llu'", nodename, vm, vm->def->name, threshold, excess); - if ((disk =3D qemuDomainDiskLookupByNodename(vm->def, nodename, &src, = &idx))) { - g_autofree char *dev =3D NULL; + if ((disk =3D qemuDomainDiskLookupByNodename(vm->def, nodename, &src, = NULL))) { if (virStorageSourceIsLocalStorage(src)) path =3D src->path; - if ((dev =3D qemuDomainDiskBackingStoreGetName(disk, idx))) - event =3D virDomainEventBlockThresholdNewFromObj(vm, dev, path, - threshold, exce= ss); + if (src =3D=3D disk->src) { + g_autofree char *dev =3D qemuDomainDiskBackingStoreGetName(dis= k, 0); + + eventDevice =3D virDomainEventBlockThresholdNewFromObj(vm, dev= , path, + threshold= , excess); + } + + if (src->id !=3D 0) { + g_autofree char *dev =3D qemuDomainDiskBackingStoreGetName(dis= k, src->id); + + eventSource =3D virDomainEventBlockThresholdNewFromObj(vm, dev= , path, + threshold= , excess); + } } virObjectUnlock(vm); - virObjectEventStateQueue(driver->domainEventState, event); + virObjectEventStateQueue(driver->domainEventState, eventDevice); + virObjectEventStateQueue(driver->domainEventState, eventSource); return 0; } --=20 2.26.2 From nobody Fri May 3 01:43:09 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 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=1594818655; cv=none; d=zohomail.com; s=zohoarc; b=ivc3PNfT4Ny0oqcP3oJ+Pr511PEb+lOxwuu7VTUWZqBEk3OWRmymayya4xxSzizswz2ceY5HffSChxIRzsH14r/sy2BP5yB3xpyuBbkp2kB9OCUovsJA2nzP1EGclP5i1tbXJG63yjNtBIgNyUIbqe/a9uo23PFQPxJe/flIQQ4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1594818655; 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=v2Rh6JbeeruArli3uIvZk1S3okktfPKjxJx5j3VI/CQ=; b=V74o49KqTWxbZSe2rSSk9HGmITXRoMAuUX/kSWJ7Dk4ex3GIoGJmsOy3VHrgCWBo90hlHm82cN78349JezI3pWwHcVHrNY5++sPo+cQHyvtWxOv1QgCUY3c6P8txheq/tUgCh/wzjDfIPSE7SfT7akJtweBzYZhheCip1weTFAY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 15948186557244.4834750473828535; Wed, 15 Jul 2020 06:10:55 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-427-Hhzer-zjMx6xh9xavnuFJA-1; Wed, 15 Jul 2020 09:10:52 -0400 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id 222A7107ACCA; Wed, 15 Jul 2020 13:10:46 +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 0327178A53; Wed, 15 Jul 2020 13:10:46 +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 C1F8518005C5; Wed, 15 Jul 2020 13:10:45 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 06FDANUJ005756 for ; Wed, 15 Jul 2020 09:10:23 -0400 Received: by smtp.corp.redhat.com (Postfix) id 1B33E19079; Wed, 15 Jul 2020 13:10:23 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.29]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7A81470100 for ; Wed, 15 Jul 2020 13:10:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1594818654; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=v2Rh6JbeeruArli3uIvZk1S3okktfPKjxJx5j3VI/CQ=; b=ISn9xIOYeXFoLNc9sMXKirDHzdetQrCxUw351HfQ9asXeVy89Z1Lf4djpqHqjP2F8nTVfZ u7Z14WdIHmTXmtu+TEFZXpcyh8v825MnLFtBmRVgmft72lxcoWfOv7v0fHIKN5JEaIuuMw CfOUkYrM3ZAY9WtLeLddHTGKhdh+AL0= X-MC-Unique: Hhzer-zjMx6xh9xavnuFJA-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 05/10] virDomainSetBlockThreshold: Clarify values of @dev the event is fired for Date: Wed, 15 Jul 2020 15:10:07 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com 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: , 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-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Top level image may get two events, one with the disk target (vda) and one with disk target with index (vda[3]) if the top level image has an index. Signed-off-by: Peter Krempa Reviewed-by: Eric Blake --- src/libvirt-domain.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/libvirt-domain.c b/src/libvirt-domain.c index ba30d18f65..6c5ff5b0db 100644 --- a/src/libvirt-domain.c +++ b/src/libvirt-domain.c @@ -12370,6 +12370,10 @@ int virDomainGetGuestInfo(virDomainPtr domain, * described by @dev is written beyond the set threshold level. The thresh= old * level is unset once the event fires. The event might not be delivered a= t all * if libvirtd was not running at the moment when the threshold was reache= d. + * Note that if the threshold level is reached for a top level image the e= vent + * is emitted for @dev corresponding to the disk target, and may also be r= eported + * with @dev corresponding to the disk target with an index corresponding = to the + * 'index' attribute of 'source' in the live VM XML if the atribute is pre= sent. * * @dev can either be a disk target name (vda, sda) or disk target with in= dex ( * vda[4]). Without the index the top image in the backing chain will have= the --=20 2.26.2 From nobody Fri May 3 01:43:09 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 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=1594818645; cv=none; d=zohomail.com; s=zohoarc; b=DIweEGSL0ufjJ0E7USAfnQcpVSmA08a8ZcE16gsdHAN1SQNI0PDOSLy5TvvpGQajSqnJ9n7ktYnERtuTqWO5bkLv7FhTI4oaBjUP4EZwEfyE2VQdKSxvEl/Qf/t0ihLo6Z4M5KNw1pTxwaIGWh6a6E4qJTeOpV3Zxy8D7rGM1tk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1594818645; 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=SZE8yGlG9zb4rDTkeg5aaKOhkfEL4KfeftoMu6COx1w=; b=iZuGa5d32D4/PNRI7lcdJ4D1EpsC5F5HoRlJFokWtdrSEhkgTUK4HI0swDomOZ3UEcKXOR+aYRtURXVrN98iE1ds67WXjHBm1Cp2uF7gWAZhpN3coQEjdsDv7wKdVwKFypUpj6am5fSGm/w/LYWOv4jTjUgIDh3z3LVxTQmNPEc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 1594818645321743.4098520168278; Wed, 15 Jul 2020 06:10:45 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-287-5KQf5t8UOJOlZH4uMMmoTg-1; Wed, 15 Jul 2020 09:10:42 -0400 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id B165C800C64; Wed, 15 Jul 2020 13:10:36 +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 9023979CF3; Wed, 15 Jul 2020 13:10:36 +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 6F7D894F15; Wed, 15 Jul 2020 13:10:35 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 06FDAOXb005775 for ; Wed, 15 Jul 2020 09:10:24 -0400 Received: by smtp.corp.redhat.com (Postfix) id D4EB819079; Wed, 15 Jul 2020 13:10:24 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.29]) by smtp.corp.redhat.com (Postfix) with ESMTP id A9A2061983 for ; Wed, 15 Jul 2020 13:10:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1594818644; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=SZE8yGlG9zb4rDTkeg5aaKOhkfEL4KfeftoMu6COx1w=; b=J6aqIwNL/3IMOO5cvoixd9S3WeDimevNqIju1R4RJNKsZxqk5gucWs3QQKxFaimdtGpuTb QTG5CfwaMhLlrP9sSssi7IOrQ5WlihLle8j8jheKc3DjcAeaGwu3rpBJ/yPb0nraHH45ob jA2DUGuoXtVeZ5+fpJIcuNv7LoFw8lQ= X-MC-Unique: 5KQf5t8UOJOlZH4uMMmoTg-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 06/10] qemuDomainDiskLookupByNodename: Remove unused 'idx' Date: Wed, 15 Jul 2020 15:10:08 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com 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: , 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-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" All callers pass NULL as the value. Remove the argument. Signed-off-by: Peter Krempa Reviewed-by: Eric Blake --- src/qemu/qemu_domain.c | 12 ++---------- src/qemu/qemu_domain.h | 3 +-- src/qemu/qemu_process.c | 4 ++-- 3 files changed, 5 insertions(+), 14 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index cfdd9270da..64bd52c51f 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -11469,7 +11469,6 @@ qemuDomainNamespaceTeardownInput(virDomainObjPtr vm, * @def: domain definition to look for the disk * @nodename: block backend node name to find * @src: filled with the specific backing store element if provided - * @idx: index of @src in the backing chain, if provided * * Looks up the disk in the domain via @nodename and returns its definitio= n. * Optionally fills @src and @idx if provided with the specific backing ch= ain @@ -11478,24 +11477,17 @@ qemuDomainNamespaceTeardownInput(virDomainObjPtr = vm, virDomainDiskDefPtr qemuDomainDiskLookupByNodename(virDomainDefPtr def, const char *nodename, - virStorageSourcePtr *src, - unsigned int *idx) + virStorageSourcePtr *src) { size_t i; - unsigned int srcindex; virStorageSourcePtr tmp =3D NULL; - if (!idx) - idx =3D &srcindex; - if (src) *src =3D NULL; - *idx =3D 0; - for (i =3D 0; i < def->ndisks; i++) { if ((tmp =3D virStorageSourceFindByNodeName(def->disks[i]->src, - nodename, idx))) { + nodename, NULL))) { if (src) *src =3D tmp; diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h index 6944b37ff7..d75fbc0af3 100644 --- a/src/qemu/qemu_domain.h +++ b/src/qemu/qemu_domain.h @@ -959,8 +959,7 @@ int qemuDomainNamespaceTeardownInput(virDomainObjPtr vm, virDomainDiskDefPtr qemuDomainDiskLookupByNodename(virDomainDefPtr def, const char *nodename, - virStorageSourcePtr *sr= c, - unsigned int *idx); + virStorageSourcePtr *sr= c); char *qemuDomainDiskBackingStoreGetName(virDomainDiskDefPtr disk, unsigned int idx); diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 9b6dc8e68b..580abb0fb4 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -880,7 +880,7 @@ qemuProcessHandleIOError(qemuMonitorPtr mon G_GNUC_UNUS= ED, if (diskAlias) disk =3D qemuProcessFindDomainDiskByAliasOrQOM(vm, diskAlias, NULL= ); else if (nodename) - disk =3D qemuDomainDiskLookupByNodename(vm->def, nodename, NULL, N= ULL); + disk =3D qemuDomainDiskLookupByNodename(vm->def, nodename, NULL); else disk =3D NULL; @@ -1509,7 +1509,7 @@ qemuProcessHandleBlockThreshold(qemuMonitorPtr mon G_= GNUC_UNUSED, "threshold '%llu' exceeded by '%llu'", nodename, vm, vm->def->name, threshold, excess); - if ((disk =3D qemuDomainDiskLookupByNodename(vm->def, nodename, &src, = NULL))) { + if ((disk =3D qemuDomainDiskLookupByNodename(vm->def, nodename, &src))= ) { if (virStorageSourceIsLocalStorage(src)) path =3D src->path; --=20 2.26.2 From nobody Fri May 3 01:43:09 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) client-ip=205.139.110.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 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=1594818660; cv=none; d=zohomail.com; s=zohoarc; b=SSBZpH5niODGdHdmKZ8N2RAQcjPYI6PCnSXXEKcnqS0/m4Dk6R/cbzSJ8SYofIlgCuhfGk+ZVreNbA+qirESuzAK4fE9XP79CdpT6jMJfv0VwWLyi1emC93/oXP+rPyS4t4ilii+O/7bCTA7Hl0Fx9BY0ZAk/TctUDBhqIl/PR8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1594818660; 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=tZ42E9SthPe+IhHDWD1wn8bpkG6YPUCubVWAi+HeMb8=; b=CkCDAwDxjV6cH5kms1uQMfEQMMBjDgCfTF6edMOG+G31Wt7r+PkwhdSoYMwORWlcihkAHiAYJPRZYNFGXl7fVvUykfrPWDWh/cKT9vZ5p4G9XcDOtPYWa28ayt3ukqWnknysqSULUarBkTbaE8uOmoQPFkE+8V2U8+T+5yKUwuc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by mx.zohomail.com with SMTPS id 1594818660955691.8897378211191; Wed, 15 Jul 2020 06:11:00 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-204-N6-BTm-GMeK-1--JBYbUrg-1; Wed, 15 Jul 2020 09:10:54 -0400 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id 8105F19200E6; Wed, 15 Jul 2020 13:10:48 +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 5FA5110013C3; Wed, 15 Jul 2020 13:10:48 +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 2D0C21800B70; Wed, 15 Jul 2020 13:10:48 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 06FDAQqk005781 for ; Wed, 15 Jul 2020 09:10:26 -0400 Received: by smtp.corp.redhat.com (Postfix) id 1BEB560BF4; Wed, 15 Jul 2020 13:10:26 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.29]) by smtp.corp.redhat.com (Postfix) with ESMTP id 62B2019079 for ; Wed, 15 Jul 2020 13:10:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1594818659; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=tZ42E9SthPe+IhHDWD1wn8bpkG6YPUCubVWAi+HeMb8=; b=KBMKxtRqgILuc6HWhXNjOu/LjYbKJkWklUX9qb06YH5gqWWWFGs6+yR/PCFLMK7Fo/fAyz kO1JWGGNUEuC+c/OccW01DdK5sVLJJXB2uhTy3cFcY6s5pQQ/nqKBOGkyWtfcTypvyt4vQ mOEX9fZeH2TMK55EZ5KpsoPhn8nqPcg= X-MC-Unique: N6-BTm-GMeK-1--JBYbUrg-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 07/10] virStorageSourceFindByNodeName: Remove unused 'idx' argument Date: Wed, 15 Jul 2020 15:10:09 +0200 Message-Id: <222f08120787bc3497e8df5f01296edd59e01fbc.1594818495.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com 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: , 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-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" None of the callers actually use it. Signed-off-by: Peter Krempa Reviewed-by: Eric Blake --- src/qemu/qemu_domain.c | 9 ++++----- src/util/virstoragefile.c | 16 +++------------- src/util/virstoragefile.h | 3 +-- 3 files changed, 8 insertions(+), 20 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 64bd52c51f..ed7ec77ed4 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -2498,15 +2498,15 @@ qemuDomainObjPrivateXMLParseBlockjobNodename(qemuBl= ockJobDataPtr job, return; if (job->disk && - (*src =3D virStorageSourceFindByNodeName(job->disk->src, nodename,= NULL))) + (*src =3D virStorageSourceFindByNodeName(job->disk->src, nodename)= )) return; if (job->chain && - (*src =3D virStorageSourceFindByNodeName(job->chain, nodename, NUL= L))) + (*src =3D virStorageSourceFindByNodeName(job->chain, nodename))) return; if (job->mirrorChain && - (*src =3D virStorageSourceFindByNodeName(job->mirrorChain, nodenam= e, NULL))) + (*src =3D virStorageSourceFindByNodeName(job->mirrorChain, nodenam= e))) return; /* the node was in the XML but was not found in the job definitions */ @@ -11486,8 +11486,7 @@ qemuDomainDiskLookupByNodename(virDomainDefPtr def, *src =3D NULL; for (i =3D 0; i < def->ndisks; i++) { - if ((tmp =3D virStorageSourceFindByNodeName(def->disks[i]->src, - nodename, NULL))) { + if ((tmp =3D virStorageSourceFindByNodeName(def->disks[i]->src, no= dename))) { if (src) *src =3D tmp; diff --git a/src/util/virstoragefile.c b/src/util/virstoragefile.c index 274883c4bd..00d8e16ef9 100644 --- a/src/util/virstoragefile.c +++ b/src/util/virstoragefile.c @@ -4589,33 +4589,23 @@ virStorageSourceIsRelative(virStorageSourcePtr src) * virStorageSourceFindByNodeName: * @top: backing chain top * @nodeName: node name to find in backing chain - * @index: if provided the index in the backing chain * * Looks up the given storage source in the backing chain and returns the - * pointer to it. If @index is passed then it's filled by the index in the - * backing chain. On failure NULL is returned and no error is reported. + * pointer to it. + * On failure NULL is returned and no error is reported. */ virStorageSourcePtr virStorageSourceFindByNodeName(virStorageSourcePtr top, - const char *nodeName, - unsigned int *idx) + const char *nodeName) { virStorageSourcePtr tmp; - if (idx) - *idx =3D 0; - for (tmp =3D top; virStorageSourceIsBacking(tmp); tmp =3D tmp->backing= Store) { if ((tmp->nodeformat && STREQ(tmp->nodeformat, nodeName)) || (tmp->nodestorage && STREQ(tmp->nodestorage, nodeName))) return tmp; - - if (idx) - (*idx)++; } - if (idx) - *idx =3D 0; return NULL; } diff --git a/src/util/virstoragefile.h b/src/util/virstoragefile.h index c68bdc9680..f73b3ee005 100644 --- a/src/util/virstoragefile.h +++ b/src/util/virstoragefile.h @@ -526,8 +526,7 @@ bool virStorageSourceIsRelative(virStorageSourcePtr src= ); virStorageSourcePtr virStorageSourceFindByNodeName(virStorageSourcePtr top, - const char *nodeName, - unsigned int *index) + const char *nodeName) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); void --=20 2.26.2 From nobody Fri May 3 01:43:09 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 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=1594818645; cv=none; d=zohomail.com; s=zohoarc; b=eg4TKcI8S+bwiOrA8Pv8kTo0xxxTgqqMRkf2hl5EcykjbS7uvSbzx3xWQSzCYraVbbNekXKOjoE4rEUmCkF6GJtV3wE71cqPP+vs3r4qwzblZQodegBYUz9TLsgDjvM5ZPYC9iwKZoeHyquhSfT+l551OxSR+mVWWSrVGm6Yl3E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1594818645; 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=QaxXaI8CAH4aFnJRGJpRsRfAaqEX37mNWsGZsaIse6k=; b=ha4VNhx+KagZqpzUwiVWBpM1zxQeQ9rm/+px89WdqhL5FrK9LehmiNMuOn9W6zxAJ6Kv4muA7WjcvxxUrBs262yq+Lua3ztNEeEaeh9jOe/nDnjagR2b3A09cZMj4w+Kv4O+qTvK/5WFniOUbWtkGloEKgCWJlSqqEpvx5QM3kY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 1594818645333326.3354348985754; Wed, 15 Jul 2020 06:10:45 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-41-RvUN02zXO6insRyru4BTZw-1; Wed, 15 Jul 2020 09:10:41 -0400 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id DE7F91009444; Wed, 15 Jul 2020 13:10:35 +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 BF2B178A50; Wed, 15 Jul 2020 13:10:35 +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 8785394F17; Wed, 15 Jul 2020 13:10:35 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 06FDARiY005797 for ; Wed, 15 Jul 2020 09:10:27 -0400 Received: by smtp.corp.redhat.com (Postfix) id 3012019079; Wed, 15 Jul 2020 13:10:27 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.29]) by smtp.corp.redhat.com (Postfix) with ESMTP id 84D4260BF4 for ; Wed, 15 Jul 2020 13:10:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1594818644; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=QaxXaI8CAH4aFnJRGJpRsRfAaqEX37mNWsGZsaIse6k=; b=dpIulY2glTPeMfggKxDgXM3kQItbtISiJ4SKdiQrNJbT72FCMKhU9MpyM55MRsKtj/zgPk z87u0WQAVZwL2jyuXma1UxHnMiGepCl2tZjM9/Mq6F/om7lusONYtUBiRIKh03hhDtPZvO Lk/JV6mqBd5ZUMrCNeF1qy2gOGQRIto= X-MC-Unique: RvUN02zXO6insRyru4BTZw-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 08/10] qemuDomainDiskLookupByNodename: Look also for 'mirror' node names Date: Wed, 15 Jul 2020 15:10:10 +0200 Message-Id: <0add14d8f79ee4f9fccbc69852eb726877e7f24c.1594818495.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com 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: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" When doing a block copy, there is another chain of images attached to a disk. Consider them as well when looking up a disk using nodename. Signed-off-by: Peter Krempa Reviewed-by: Eric Blake --- src/qemu/qemu_domain.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index ed7ec77ed4..18fd445e30 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -11492,6 +11492,14 @@ qemuDomainDiskLookupByNodename(virDomainDefPtr def, return def->disks[i]; } + + if (def->disks[i]->mirror && + (tmp =3D virStorageSourceFindByNodeName(def->disks[i]->mirror,= nodename))) { + if (src) + *src =3D tmp; + + return def->disks[i]; + } } return NULL; --=20 2.26.2 From nobody Fri May 3 01:43:09 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) client-ip=207.211.31.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 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=1594818650; cv=none; d=zohomail.com; s=zohoarc; b=hGyVaJOGZaGN3AxRnDZmOZU7HEOlwuSey9CNLLOeK+DYrY3dJW5fi8fA0g3i3jMPzA2iLgGnNP4w8aEOgoAXVpzY47t1Rbxn+g7Yw0nnoAJ2MHxwVOr/A7YrQ7/X8yjNFgIuvK8yff7Exvi/wgZUr55kFBc+Tm8Ibe+QwUclc0k= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1594818650; 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=T3xXqyVQY8d2K4YMuKyH7MwtP0VGWZiKnF0IpJeijLc=; b=gkgtKSD+0WzUSqeukZObLO4/Cur4saJ55zJ52A5XWFSfYUsD75dmGOBilr/vzozZQ10nw5c/ybPlF4QYmIzotBwPOQRnpnGyqoKYZ8LFyKE2w5ltukIbBhk+1SK9IkKwD1FFx1fCMRv3SKQgDwQAqzxx39zIRo5zUogRQUy5jAE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by mx.zohomail.com with SMTPS id 159481865038644.40421628757326; Wed, 15 Jul 2020 06:10:50 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-245-canD1S2aOd2qMwftlrf2cw-1; Wed, 15 Jul 2020 09:10:47 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 261181009446; Wed, 15 Jul 2020 13:10:40 +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 E635A610AF; Wed, 15 Jul 2020 13:10:39 +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 A8C221806B0C; Wed, 15 Jul 2020 13:10:39 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 06FDAVox005819 for ; Wed, 15 Jul 2020 09:10:31 -0400 Received: by smtp.corp.redhat.com (Postfix) id 5465961982; Wed, 15 Jul 2020 13:10:31 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.29]) by smtp.corp.redhat.com (Postfix) with ESMTP id AE69719079 for ; Wed, 15 Jul 2020 13:10:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1594818649; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=T3xXqyVQY8d2K4YMuKyH7MwtP0VGWZiKnF0IpJeijLc=; b=Yi/S8kwyU6JJaBL5R6h7Nehnz4J2CKD8Q7RtarWcWYDJa8mglDhOkvPVKVhAr0K0dij63q dz4EGT51WD32agvA0QgG552XzW8oR9mbI68UR/6YUtxqDszjmZXAsDGIDdxcqhlAJ00Evm 7sUtAfLYwG7PpnsXcVJn7jXA/VEnBDs= X-MC-Unique: canD1S2aOd2qMwftlrf2cw-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 09/10] qemuDomainGetStorageSourceByDevstr: Look also in 'mirror' chain Date: Wed, 15 Jul 2020 15:10:11 +0200 Message-Id: <7772c07e2adada6edb8a329f5846c93d9fa05329.1594818495.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com 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: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" A disk can have a mirror, look also in it's backing chain. Signed-off-by: Peter Krempa Reviewed-by: Eric Blake --- src/qemu/qemu_domain.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 18fd445e30..ebf18a546e 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -11553,11 +11553,16 @@ qemuDomainGetStorageSourceByDevstr(const char *de= vstr, } if (idx =3D=3D 0) - src =3D disk->src; - else - src =3D virStorageFileChainLookup(disk->src, NULL, NULL, idx, NULL= ); + return disk->src; + + if ((src =3D virStorageFileChainLookup(disk->src, NULL, NULL, idx, NUL= L))) + return src; - return src; + if (disk->mirror && + (src =3D virStorageFileChainLookup(disk->mirror, NULL, NULL, idx, = NULL))) + return src; + + return NULL; } --=20 2.26.2 From nobody Fri May 3 01:43:09 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) client-ip=205.139.110.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 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=1594818652; cv=none; d=zohomail.com; s=zohoarc; b=EQ7UfOn4N2+qgxPpdmF+xNW7otNsujqrKBIadopq84zjOblHXbsIr5Jk3ne5eHKKJUpFKT+1aMMc5UBhCr90NhQaPh53KWgvJSHh4dcYhb00yqa3gZXT1bz25uaBM2j4sI4CbwMnsQ4UpH08V37o7f4Ue9ImshGM45bfDRk15K0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1594818652; 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=PHbwdmIfYUaEi90WscPrYTqQQI7ykb5cktuPvNRx/2M=; b=AFGiyQdjZGCtp+McXe/MQpZYfY4hf3cEY5fVliFfSnbirUZ4iuhCTJnXErH7xp/J66MmDeVE08VMj1O8XkEn925za0a5BXheorRtBa8Kc585aSmx4p0yk4EV3oy4y8zwRC4bxl/jNJzNQGjf9LIxJQzgLH5sC4UPT6wC8FrT4zI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by mx.zohomail.com with SMTPS id 1594818652624520.4535210794966; Wed, 15 Jul 2020 06:10:52 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-222-8jy_B7NCOPyx9spEXBXvLw-1; Wed, 15 Jul 2020 09:10:49 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 66435800400; Wed, 15 Jul 2020 13:10:42 +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 411B82DE98; Wed, 15 Jul 2020 13:10:42 +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 124DC94F1B; Wed, 15 Jul 2020 13:10:42 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 06FDAbAN005839 for ; Wed, 15 Jul 2020 09:10:37 -0400 Received: by smtp.corp.redhat.com (Postfix) id 6884860BF4; Wed, 15 Jul 2020 13:10:37 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.29]) by smtp.corp.redhat.com (Postfix) with ESMTP id BD7866FEFD for ; Wed, 15 Jul 2020 13:10:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1594818651; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=PHbwdmIfYUaEi90WscPrYTqQQI7ykb5cktuPvNRx/2M=; b=UAFMITM8amTAP9fmGwyZw489Cg0BYq8UmYOmjbqYJjP4bObfBTEzLMq8mplBzcALkBPzTB 1pKBe3sSAGoJGmJDymMunarf4N3KOL+iaJdBmkEZhmkNeqqiiU68PmuWUu0hmNkH4pgfZc nkaByxtfpPPeYJShZ57QJrFO1GHQmhg= X-MC-Unique: 8jy_B7NCOPyx9spEXBXvLw-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 10/10] virDomainSetBlockThreshold: Mention that the event can be registered for Date: Wed, 15 Jul 2020 15:10:12 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com 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: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" The infrastructure supports setting the threshold also for the . Mention it in the docs. https://bugzilla.redhat.com/show_bug.cgi?id=3D1807741 Signed-off-by: Peter Krempa Reviewed-by: Eric Blake --- src/libvirt-domain.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/libvirt-domain.c b/src/libvirt-domain.c index 6c5ff5b0db..a4e73d5480 100644 --- a/src/libvirt-domain.c +++ b/src/libvirt-domain.c @@ -12381,6 +12381,9 @@ int virDomainGetGuestInfo(virDomainPtr domain, * live VM XML for 'backingStore' or 'source' elements of a disk. If index= is * given the threshold is set for the corresponding image. * + * Note that the threshold event can be registered also for destinations o= f a + * 'virDomainBlockCopy' destination by using the 'index' of the 'mirror' s= ource. + * * Hypervisors report the last written sector of an image in the bulk stat= s API * (virConnectGetAllDomainStats/virDomainListGetStats) as * "block..allocation" in the VIR_DOMAIN_STATS_BLOCK group. The curre= nt --=20 2.26.2