From nobody Tue May 21 05:15:37 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 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=1697468537; cv=none; d=zohomail.com; s=zohoarc; b=i8cnvaUgzauuQzbNGURN8RCxY1DwYg1OsLYM4kA56vpFtQPV0VDsZaveJyBAVMhLPra30mn/gc41osMXYqJgGcE7Pa1I3KQaiDUVYSutMnBX/6fFN0gpDNYPVVkuN5gj9ryjOCJ2eWs2eYi9jQqep8GH9/MaO++HKNWHWd5sBcM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1697468537; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=Q48D9n3WrwIgWHj/8gr+D/SqvoQ6azPqpkjWrc+5oB0=; b=ECX3GlYZSICdfYtsvl6H/B1+eNfJYFp8RONohkqKmxXzCElOotYp3MKyg2U1TJ3sAZH/94sMuNPfPXdWyN+or5UqH6tr7zYFVIHkGD7uxQAcCHTRlSK4CLupIJNHUAM5B6/mwrmj5+vhpZbeJqEDCFbk2gIkBOFlXPR0hDyA8PQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 169746853709564.17113433265911; Mon, 16 Oct 2023 08:02:17 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-504-ULjdUor4NpCFsQ-BxcV8wQ-1; Mon, 16 Oct 2023 11:02:12 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 5A598185AD39; Mon, 16 Oct 2023 15:02:04 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 44EDB1005B8E; Mon, 16 Oct 2023 15:02:04 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 22B0A1946588; Mon, 16 Oct 2023 15:02:04 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id DD8921946587 for ; Mon, 16 Oct 2023 15:02:01 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id BFD1240C6F7F; Mon, 16 Oct 2023 15:02:01 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.45.242.10]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4519140C6F79 for ; Mon, 16 Oct 2023 15:02:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1697468536; 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=Q48D9n3WrwIgWHj/8gr+D/SqvoQ6azPqpkjWrc+5oB0=; b=hZozV1cKmAqaC0m4uosYaKsd82UcWFrjZUXXA7xpeMd6qh7FLfYnWwnMiXRDkPichbbHxs zJzfmknD8zwfU1cVxHLB0lZ8ahBrY+nBHdJaUxC8i3863tmU0TTZ838DEBhL7o8OjWIvps +yJHHuqRJ8Aer0HvNO8a38u+yn61nAA= X-MC-Unique: ULjdUor4NpCFsQ-BxcV8wQ-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 01/31] qemu: domain: Identify blockjobs by storage nodename in VM status XML Date: Mon, 16 Oct 2023 17:01:28 +0200 Message-ID: <9899e86e154eadf1fd57fabe30c5c0d44ab1371a.1697468414.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.2 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1697468537922100001 Content-Type: text/plain; charset="utf-8" Use the node name of the storage access driver to identify the block job volumes. This will prepare the blockjob code to the possibility that the format layer may be missing. Our lookup code can find either of them, thus we can safely switch. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_domain.c | 8 ++++---- tests/qemustatusxml2xmldata/blockjob-blockdev-in.xml | 12 ++++++------ 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index eec7bed28b..918b5a14e1 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -2288,13 +2288,13 @@ qemuDomainPrivateBlockJobFormatCommit(qemuBlockJobD= ata *job, g_auto(virBuffer) disabledBitmapsBuf =3D VIR_BUFFER_INIT_CHILD(buf); if (job->data.commit.base) - virBufferAsprintf(buf, "\n", job->data.commit.b= ase->nodeformat); + virBufferAsprintf(buf, "\n", job->data.commit.b= ase->nodestorage); if (job->data.commit.top) - virBufferAsprintf(buf, "\n", job->data.commit.to= p->nodeformat); + virBufferAsprintf(buf, "\n", job->data.commit.to= p->nodestorage); if (job->data.commit.topparent) - virBufferAsprintf(buf, "\n", job->data.com= mit.topparent->nodeformat); + virBufferAsprintf(buf, "\n", job->data.com= mit.topparent->nodestorage); if (job->data.commit.deleteCommittedImages) virBufferAddLit(buf, "\n"); @@ -2357,7 +2357,7 @@ qemuDomainObjPrivateXMLFormatBlockjobIterator(void *p= ayload, switch ((qemuBlockJobType) job->type) { case QEMU_BLOCKJOB_TYPE_PULL: if (job->data.pull.base) - virBufferAsprintf(&childBuf, "\n", job-= >data.pull.base->nodeformat); + virBufferAsprintf(&childBuf, "\n", job-= >data.pull.base->nodestorage); break; case QEMU_BLOCKJOB_TYPE_COMMIT: diff --git a/tests/qemustatusxml2xmldata/blockjob-blockdev-in.xml b/tests/q= emustatusxml2xmldata/blockjob-blockdev-in.xml index b62b3149c2..380ef053d2 100644 --- a/tests/qemustatusxml2xmldata/blockjob-blockdev-in.xml +++ b/tests/qemustatusxml2xmldata/blockjob-blockdev-in.xml @@ -238,14 +238,14 @@ - - - + + + - - + + @@ -301,7 +301,7 @@ - + --=20 2.41.0 From nobody Tue May 21 05:15:37 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 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=1697468535; cv=none; d=zohomail.com; s=zohoarc; b=nOgZ+3RTjsaJs69+si5PSZ1TZ+iHqA0fOsehF8LJuyN6Vna3JWdEn3BuVK3LDhtneB7N0uVkA8hO+DXVf74eaVHY5ngvl1oVXbGB2qbwsCrBjFy5PViuSQIuqZ1UP8aSrDZ/Skda9VLcOL1gkEEgU/ZOGUPOq7H5H41nuV4hpAU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1697468535; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=3GGcslNFlcbaNfi78wdcGTbu0jHirKgss1XlVsUENks=; b=bU5a8qr8Pf6ZmPDZZs9MzLJXD+Prfq7IxzezvXsChJqijaAKlKX2umcWiL54uuRduLg0uLzSiTQMopj3yLn8N1cOyNh/1vrOB1rgNCbKjgRGPwFwulrdrlnzlXa863FAKNdTboYePce03mxFr2m/DB1LpI4B4maIWOYTIvqhxaQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1697468535746937.8460759311165; Mon, 16 Oct 2023 08:02:15 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-622-5_-8It57NkWvwWS34K-SVw-1; Mon, 16 Oct 2023 11:02:09 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 6F4A63C1E9E5; Mon, 16 Oct 2023 15:02:03 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5550DC15BBC; Mon, 16 Oct 2023 15:02:03 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 289D21946588; Mon, 16 Oct 2023 15:02:03 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 9FF531946588 for ; Mon, 16 Oct 2023 15:02:02 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 9155C40C6CA0; Mon, 16 Oct 2023 15:02:02 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.45.242.10]) by smtp.corp.redhat.com (Postfix) with ESMTP id 17C4F40C6F79 for ; Mon, 16 Oct 2023 15:02:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1697468534; 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=3GGcslNFlcbaNfi78wdcGTbu0jHirKgss1XlVsUENks=; b=Z24UqdNt2JfYeijWklarYaQjBhdB+VJst7FDCTRE7NVb2zuqEvFuI84n1uYfIEw6fWGQog 3X8oIUfMk9jaoK2GOU1zLhend8c1gIPKz6OKn/7mHyA2aZSGSbIoO191hfatK2zBrg2mqk WLS2N3gpE3OMx93fChSY6+55YZdi1K0= X-MC-Unique: 5_-8It57NkWvwWS34K-SVw-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 02/31] qemu: block: Refactor logic in qemuBlockStorageSourceGetBlockdevProps Date: Mon, 16 Oct 2023 17:01:29 +0200 Message-ID: <3ff23a5df65d080aabcedaa4ad6ed76a2304908d.1697468414.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.2 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.8 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1697468537923100002 Content-Type: text/plain; charset="utf-8" Restructure the conditions so that we can use virJSONValueObjectAdd with a clearer logic for backing store control. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_block.c | 46 ++++++++++++++++++++++--------------------- 1 file changed, 24 insertions(+), 22 deletions(-) diff --git a/src/qemu/qemu_block.c b/src/qemu/qemu_block.c index 7e870baa2f..9b6d901e8c 100644 --- a/src/qemu/qemu_block.c +++ b/src/qemu/qemu_block.c @@ -1309,39 +1309,41 @@ qemuBlockStorageSourceGetBlockdevProps(virStorageSo= urce *src, virStorageSource *backingStore) { g_autoptr(virJSONValue) props =3D NULL; + const char *backingFormatterStr =3D NULL; + const char *backingNodename =3D NULL; const char *storagenode =3D src->nodestorage; if (qemuBlockStorageSourceNeedsStorageSliceLayer(src)) storagenode =3D src->sliceStorage->nodename; - if (!(props =3D qemuBlockStorageSourceGetBlockdevFormatProps(src))) - return NULL; - - if (virJSONValueObjectAppendString(props, "file", storagenode) < 0) + if (virStorageSourceIsBacking(backingStore) && + src->format < VIR_STORAGE_FILE_BACKING) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("storage format '%1$s' does not support backing s= tore"), + virStorageFileFormatTypeToString(src->format)); return NULL; + } - if (backingStore) { - if (src->format >=3D VIR_STORAGE_FILE_BACKING) { - if (virStorageSourceIsBacking(backingStore)) { - if (virJSONValueObjectAppendString(props, "backing", - backingStore->nodeforma= t) < 0) - return NULL; - } else { - /* chain is terminated, indicate that no detection should = happen - * in qemu */ - if (virJSONValueObjectAppendNull(props, "backing") < 0) - return NULL; - } + if (backingStore && + src->format >=3D VIR_STORAGE_FILE_BACKING) { + if (virStorageSourceIsBacking(backingStore)) { + backingFormatterStr =3D "s:backing"; + backingNodename =3D backingStore->nodeformat; } else { - if (virStorageSourceIsBacking(backingStore)) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("storage format '%1$s' does not support b= acking store"), - virStorageFileFormatTypeToString(src->forma= t)); - return NULL; - } + /* chain is terminated, indicate that no detection should happ= en in qemu */ + backingFormatterStr =3D "n:backing"; } } + if (!(props =3D qemuBlockStorageSourceGetBlockdevFormatProps(src))) + return NULL; + + if (virJSONValueObjectAdd(&props, + "s:file", storagenode, + backingFormatterStr, backingNodename, + NULL) < 0) + return 0; + return g_steal_pointer(&props); } --=20 2.41.0 From nobody Tue May 21 05:15:37 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 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=1697468553; cv=none; d=zohomail.com; s=zohoarc; b=a2CGxzptpHJFWIhq7/3iAnsM2R9b8aqx+I/P4aqLcBBPi4LEb2CFXHlMUeCqWBpg7wd9rKgaiHamMi5hiZZwSpoiGwPKp0PRQHB7yXCBeo5jqD/vsYRRGDsrWtqvMHoTR8YzlKOhOVxGLwj0p14UJysElSdLNWM6MexE8OK0TtE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1697468553; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=VmYJ/awyWvno/nls//GXOw+aGWOMdLCDsGlAXlxjvUc=; b=Gbh5HxL0Qzu7VUvCIhRvIQvPCYbRIRlQkn5N9+NFfmKnOQImTZPMu6m/f48HBeWvJO59As7S1mEVzhITMOtJO52LWhYlOy/+JMUbeSXh5H+QOsj4CqffZGTU7elMLCdwLJapqA1KHsNQngMOoJDETFPqEhR/t92MZtRvAzwxPAk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1697468553362604.7081002924238; Mon, 16 Oct 2023 08:02:33 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-610-2ZhTwROYNJ6w34Azvs62uA-1; Mon, 16 Oct 2023 11:02:21 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id D86268E8C8B; Mon, 16 Oct 2023 15:02:04 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id C4BEC10B7C8E; Mon, 16 Oct 2023 15:02:04 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 6813019465BC; Mon, 16 Oct 2023 15:02:04 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 7DF4F1946588 for ; Mon, 16 Oct 2023 15:02:03 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 6F32F40C6CA3; Mon, 16 Oct 2023 15:02:03 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.45.242.10]) by smtp.corp.redhat.com (Postfix) with ESMTP id E02A240C6F79 for ; Mon, 16 Oct 2023 15:02:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1697468552; 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=VmYJ/awyWvno/nls//GXOw+aGWOMdLCDsGlAXlxjvUc=; b=W8VKrnIwJ7Jt2rtpQe86dtjFOW2FA2f/QPLdi3+0TFc/jIUDJRkIvN7lXOKHjV0ubQ8eHw KDyP07EkiWkbhoZmfbhudRkOaLwc+Zrw6m5LoJdXGgch/2JqhXJgE0Xnaek/kkMTwK3oSZ vOAVM6f0NtPT8oDJaadondw8lbb4i70= X-MC-Unique: 2ZhTwROYNJ6w34Azvs62uA-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 03/31] qemu: block: Rename qemuBlockStorageSourceGetBlockdevProps Date: Mon, 16 Oct 2023 17:01:30 +0200 Message-ID: <58a50392319ea368fba4685d72cc0adbde852f69.1697468414.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.2 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1697468553963100001 Content-Type: text/plain; charset="utf-8" Use qemuBlockStorageSourceGetFormatProps as it formats the properties of the 'format' driver in qemu. Adjust the comment which was hinting otherwise. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_block.c | 16 +++++++--------- src/qemu/qemu_block.h | 4 ++-- tests/qemublocktest.c | 2 +- 3 files changed, 10 insertions(+), 12 deletions(-) diff --git a/src/qemu/qemu_block.c b/src/qemu/qemu_block.c index 9b6d901e8c..07bc8ede76 100644 --- a/src/qemu/qemu_block.c +++ b/src/qemu/qemu_block.c @@ -1295,18 +1295,17 @@ qemuBlockStorageSourceGetBlockdevFormatProps(virSto= rageSource *src) /** - * qemuBlockStorageSourceGetBlockdevProps: + * qemuBlockStorageSourceGetFormatProps: * * @src: storage source to format * @backingStore: a storage source to use as backing of @src * - * Formats @src into a JSON object which can be used with blockdev-add or - * -blockdev. The formatted object contains both the storage and format la= yer - * in nested form including link to the backing chain layer if necessary. + * Formats properties of @src related to the format blockdev driver in qemu + * into a JSON object which can be used with blockdev-add or -blockdev. */ virJSONValue * -qemuBlockStorageSourceGetBlockdevProps(virStorageSource *src, - virStorageSource *backingStore) +qemuBlockStorageSourceGetFormatProps(virStorageSource *src, + virStorageSource *backingStore) { g_autoptr(virJSONValue) props =3D NULL; const char *backingFormatterStr =3D NULL; @@ -1434,8 +1433,7 @@ qemuBlockStorageSourceAttachPrepareBlockdev(virStorag= eSource *src, data =3D g_new0(qemuBlockStorageSourceAttachData, 1); - if (!(data->formatProps =3D qemuBlockStorageSourceGetBlockdevProps(src, - backi= ngStore)) || + if (!(data->formatProps =3D qemuBlockStorageSourceGetFormatProps(src, = backingStore)) || !(data->storageProps =3D qemuBlockStorageSourceGetBackendProps(src, backe= ndpropsflags))) return NULL; @@ -3049,7 +3047,7 @@ qemuBlockReopenFormatMon(qemuMonitor *mon, g_autoptr(virJSONValue) srcprops =3D NULL; g_autoptr(virJSONValue) reopenoptions =3D virJSONValueNewArray(); - if (!(srcprops =3D qemuBlockStorageSourceGetBlockdevProps(src, src->ba= ckingStore))) + if (!(srcprops =3D qemuBlockStorageSourceGetFormatProps(src, src->back= ingStore))) return -1; if (virJSONValueArrayAppend(reopenoptions, &srcprops) < 0) diff --git a/src/qemu/qemu_block.h b/src/qemu/qemu_block.h index 530d88d28e..cf5eaf87f3 100644 --- a/src/qemu/qemu_block.h +++ b/src/qemu/qemu_block.h @@ -57,8 +57,8 @@ virURI * qemuBlockStorageSourceGetURI(virStorageSource *src); virJSONValue * -qemuBlockStorageSourceGetBlockdevProps(virStorageSource *src, - virStorageSource *backingStore); +qemuBlockStorageSourceGetFormatProps(virStorageSource *src, + virStorageSource *backingStore); virJSONValue * qemuBlockStorageGetCopyOnReadProps(virDomainDiskDef *disk); diff --git a/tests/qemublocktest.c b/tests/qemublocktest.c index 8bad69e7ac..edfe7719c8 100644 --- a/tests/qemublocktest.c +++ b/tests/qemublocktest.c @@ -301,7 +301,7 @@ testQemuDiskXMLToProps(const void *opaque) qemuDomainPrepareDiskSourceData(disk, n); - if (!(formatProps =3D qemuBlockStorageSourceGetBlockdevProps(n, n-= >backingStore)) || + if (!(formatProps =3D qemuBlockStorageSourceGetFormatProps(n, n->b= ackingStore)) || !(storageSrcOnlyProps =3D qemuBlockStorageSourceGetBackendProp= s(n, backendpropsflagstarget)) || !(storageProps =3D qemuBlockStorageSourceGetBackendProps(n, ba= ckendpropsflagsnormal)) || !(backingstore =3D qemuBlockGetBackingStoreString(n, true))) { --=20 2.41.0 From nobody Tue May 21 05:15:37 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 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=1697468539; cv=none; d=zohomail.com; s=zohoarc; b=dQJ2whHrBWCirgZsfAGNjMIKiG/d9HzOG1HvMNyYke6+PW1cMJqGTAfBfBzcB+W6GD2WlGGQika3J3jIl8oQYzJ6h+fnq0QJji/BnWAfDi1qpX3rSJ4X42nYFAVLc/Tv/sdRjb9zwhXRWTIXMHPDMTpmYK4mLfgXkVx4Jzphcmw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1697468539; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=lThFpVahVT4H/FvFzukMgXGrkZ1ykRL718BGb1WImmQ=; b=VFjlUwahDeLwpoMdvfOI0rU3LyXDMKdndGVZCMVnmo+5fMpiAteWr/aut4wfZaqZjlJZD4rSZpkAkUyRqHNV2Fo9CBIbtQus/sy+DaaFSI+9e8AurCnHX5yyzAF76+BQnZvCUoID+SH+2dBapsraFlZ6xKELuLlIOei1udI+f9Q= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1697468539220212.80149843214406; Mon, 16 Oct 2023 08:02:19 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-26-w_USmfTcN46IfS1ciIQ-EA-1; Mon, 16 Oct 2023 11:02:12 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 3E03A81DA98; Mon, 16 Oct 2023 15:02:05 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 28D9E40C6F79; Mon, 16 Oct 2023 15:02:05 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 9ED14194658F; Mon, 16 Oct 2023 15:02:04 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 5B14719465B9 for ; Mon, 16 Oct 2023 15:02:04 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 4983440C6F7F; Mon, 16 Oct 2023 15:02:04 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.45.242.10]) by smtp.corp.redhat.com (Postfix) with ESMTP id BE41E40C6F79 for ; Mon, 16 Oct 2023 15:02:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1697468538; 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=lThFpVahVT4H/FvFzukMgXGrkZ1ykRL718BGb1WImmQ=; b=F34eF54V5ykq05VaUvQ69TfOZblcRwHC0cIJ1zvMwkrGP/mqzCu57CnqBRkdf66Iq/w1XQ P0PRRI2WeoZKp2Z9kdXjbO96KD5pNT+X+il/nPtCk30/LVsx9Ev7YVbTHbTpW46c0c0lAO C2BxPnzoXiHF1ABiolf5T4IrYb1I52Q= X-MC-Unique: w_USmfTcN46IfS1ciIQ-EA-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 04/31] qemu: block: Add accessors for protocol/storage node names Date: Mon, 16 Oct 2023 17:01:31 +0200 Message-ID: <513be6789b73394f7770cc6dfec67faa876c5fb1.1697468414.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.2 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.2 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1697468539962100005 Content-Type: text/plain; charset="utf-8" Introduce a set of accessors, which return node names based on semantics. This will allow to us to modify how we setup the backing chain in cases when e.g. the format driver can be omitted, without breaking all the code. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_block.c | 48 +++++++++++++++++++++++++++++++++++++++++++ src/qemu/qemu_block.h | 11 ++++++++++ 2 files changed, 59 insertions(+) diff --git a/src/qemu/qemu_block.c b/src/qemu/qemu_block.c index 07bc8ede76..0c9460f678 100644 --- a/src/qemu/qemu_block.c +++ b/src/qemu/qemu_block.c @@ -52,6 +52,54 @@ qemuBlockNodeNameValidate(const char *nn) } +/** + * qemuBlockStorageSourceSetStorageNodename: + * @src: virStorageSource to set the storage nodename + * @nodename: The node name to set (stolen) + * + * Sets @nodename as the storage node name of @src. Using NULL @nodename c= lears + * the nodename. @src takes ownership of @nodename. + */ +void +qemuBlockStorageSourceSetStorageNodename(virStorageSource *src, + char *nodename) +{ + g_free(src->nodestorage); + src->nodestorage =3D nodename; +} + + +/** + * qemuBlockStorageSourceGetEffectiveStorageNodename: + * @src: virStorageSource to get the effective nodename of + * + * Gets the nodename that exposes the storage corresponding to @src, witho= ut + * the format driver applied. This function always returns a name. + */ +const char * +qemuBlockStorageSourceGetEffectiveStorageNodename(virStorageSource *src) +{ + if (src->sliceStorage && + src->sliceStorage->nodename) + return src->sliceStorage->nodename; + + return src->nodestorage; +} + + +/** + * qemuBlockStorageSourceGetStorageNodename: + * @src: virStorageSource to get the effective nodename of + * + * Gets the nodename corresponding to the real backing storage format laye= r. + */ +const char * +qemuBlockStorageSourceGetStorageNodename(virStorageSource *src) +{ + return src->nodestorage; +} + + /** * qemuBlockStorageSourceSupportsConcurrentAccess: * @src: disk storage source diff --git a/src/qemu/qemu_block.h b/src/qemu/qemu_block.h index cf5eaf87f3..ecc5711dcd 100644 --- a/src/qemu/qemu_block.h +++ b/src/qemu/qemu_block.h @@ -26,6 +26,17 @@ #include "virjson.h" #include "viruri.h" +void +qemuBlockStorageSourceSetStorageNodename(virStorageSource *src, + char *nodename); + +const char * +qemuBlockStorageSourceGetEffectiveStorageNodename(virStorageSource *src); + +const char * +qemuBlockStorageSourceGetStorageNodename(virStorageSource *src); + + typedef struct qemuBlockNodeNameBackingChainData qemuBlockNodeNameBackingC= hainData; struct qemuBlockNodeNameBackingChainData { char *qemufilename; /* name of the image from qemu */ --=20 2.41.0 From nobody Tue May 21 05:15:37 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 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=1697468564; cv=none; d=zohomail.com; s=zohoarc; b=HtW9H+/QuZw3S3daUv+7Ksw0oGEHeUeFA6Zwx70stM+yeh+V9flgFK3Mqre8K02bMxze9OWSg47B4hyCwyDE/ZhJfvFmq/VihkwRldievCHYhUj3NbosIgzAmExBBkPzkROhTQASQLuGVb0B7TmReteeavg8EOPyMjDLZMnYZjQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1697468564; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=789lCwvlqNdSSBzB16qEi05mLWJG690m/caZ5/p9wAw=; b=KTLoBBeWxENyTEouVnhgTpf4jDkSBn8z4e6WJ6e4TIcwlG+dTb/2I9Yi4PI0thtvBwn1J9UOfVt7tLYiisM3TUd7XXhyhh1grlqB+dl3yBNIoeBzaantfqsk46V5ymstvKHUShLXeUTU5qs6mLjVhgIz7gzk38es08hDcCg9JAw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1697468564737524.1592719553743; Mon, 16 Oct 2023 08:02:44 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-492-qs03JgZCMYa7wBpTbxCBXw-1; Mon, 16 Oct 2023 11:02:27 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 8BFCB8E8C72; Mon, 16 Oct 2023 15:02:06 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 787241102E14; Mon, 16 Oct 2023 15:02:06 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 6A0ED1946588; Mon, 16 Oct 2023 15:02:06 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 360E61946587 for ; Mon, 16 Oct 2023 15:02:05 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 2445E40C6CA3; Mon, 16 Oct 2023 15:02:05 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.45.242.10]) by smtp.corp.redhat.com (Postfix) with ESMTP id A27BB40C6CA0 for ; Mon, 16 Oct 2023 15:02:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1697468563; 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=789lCwvlqNdSSBzB16qEi05mLWJG690m/caZ5/p9wAw=; b=XIHF5i2jOomvdUCAxJ0mVXotF+jBsk4mt6XQe6q3jSrcmCmKdx7MIKff91UsJDM4/nf15D R30vLzw/u/iJnlYJB1WcK+nm6DvqqchIkx0Sb73oQyWrgIjro73r6OKeqpOKQxUjw1u2kI dmgFsK/PSBzom0JedNa2UhfdvSr6ecY= X-MC-Unique: qs03JgZCMYa7wBpTbxCBXw-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 05/31] tests: Use 'storage' layer nodename accessors in tests Date: Mon, 16 Oct 2023 17:01:32 +0200 Message-ID: <5f309ec9d17c348493a212865262fc2dbdfc55a2.1697468414.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.2 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1697468566211100001 Content-Type: text/plain; charset="utf-8" Convert all places in tests to use the 'storage' layer nodename accessors instead of (virStorageSource)->nodestorage. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- tests/qemublocktest.c | 4 ++-- tests/qemumonitorjsontest.c | 2 +- tests/qemuxml2argvtest.c | 3 ++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/tests/qemublocktest.c b/tests/qemublocktest.c index edfe7719c8..9a72a67ce2 100644 --- a/tests/qemublocktest.c +++ b/tests/qemublocktest.c @@ -233,7 +233,7 @@ testQemuDiskXMLToJSONFakeSecrets(virStorageSource *src) srcpriv->secinfo->username =3D g_strdup(src->auth->username); srcpriv->secinfo->alias =3D g_strdup_printf("%s-secalias", - NULLSTR(src->nodestorage= )); + NULLSTR(qemuBlockStorage= SourceGetStorageNodename(src))); } if (src->encryption) { @@ -667,7 +667,7 @@ testQemuBackupIncrementalBitmapCalculateGetFakeImage(si= ze_t idx) ret->type =3D VIR_STORAGE_TYPE_FILE; ret->format =3D VIR_STORAGE_FILE_QCOW2; ret->path =3D g_strdup_printf("/image%zu", idx); - ret->nodestorage =3D g_strdup_printf("libvirt-%zu-storage", idx); + qemuBlockStorageSourceSetStorageNodename(ret, g_strdup_printf("libvirt-= %zu-storage", idx)); ret->nodeformat =3D g_strdup_printf("libvirt-%zu-format", idx); return ret; diff --git a/tests/qemumonitorjsontest.c b/tests/qemumonitorjsontest.c index 2e7b661db4..6b82e3841b 100644 --- a/tests/qemumonitorjsontest.c +++ b/tests/qemumonitorjsontest.c @@ -2601,7 +2601,7 @@ testQemuMonitorJSONBlockdevReopen(const void *opaque) src->format =3D VIR_STORAGE_FILE_QCOW2; src->readonly =3D true; src->nodeformat =3D g_strdup("test node"); - src->nodestorage =3D g_strdup("backing nodename"); + qemuBlockStorageSourceSetStorageNodename(src, g_strdup("backing nodena= me")); src->backingStore =3D virStorageSourceNew(); if (qemuMonitorTestAddItem(test, "blockdev-reopen", "{\"return\":{}}")= < 0) diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index a454dcb205..48058cb924 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -12,6 +12,7 @@ # include "internal.h" # include "viralloc.h" # include "viridentity.h" +# include "qemu/qemu_block.h" # include "qemu/qemu_capabilities.h" # include "qemu/qemu_domain.h" # include "qemu/qemu_migration.h" @@ -338,7 +339,7 @@ testCompareXMLToArgvCreateArgs(virQEMUDriver *drv, srcpriv =3D qemuDomainStorageSourcePrivateFetch(src); - srcpriv->fdpass =3D qemuFDPassNew(src->nodestorage, pr= iv); + srcpriv->fdpass =3D qemuFDPassNew(qemuBlockStorageSour= ceGetStorageNodename(src), priv); qemuFDPassAddFD(srcpriv->fdpass, &fd, "-vdpa"); } } --=20 2.41.0 From nobody Tue May 21 05:15:37 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 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=1697468546; cv=none; d=zohomail.com; s=zohoarc; b=XVXhh6j5h21vh+mTkXka7dpru4qu1HAjaxDnhw9ZoSyWJJqMhFvVjbhixSzSd3AdOvIIniF7XWgRqbFibFmeCcmM+mr3Jl7fu4ArsYBIvUMFWORMMSQbjYBRKGANZ+2JE/yyIhfZ6vhlGAqSZSrfPrsO6OIMA19emFaS6rw5pAg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1697468545; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=UJfFvk8o1+K1Mevj0LP4BjYVy2Q1p0Kj6E9n8mANlng=; b=KJHqCbwUBK0GbrSZUyzsYxu6Aqhclc52lJxsZTJD3qs/vg3BhkpkNBDZOExqKcWK/xp/KLIAHTTTy6u0eRT1llnmuWgqfXHtCprRAbuI0ybTScYJIai5hry+TA0p2c3yiFlF65WkQIqhn1aTSitc8wveiNGRVbVvJAnB47m1lf8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1697468545991775.8337001234821; Mon, 16 Oct 2023 08:02:25 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-503-P4t8ijazM5mSOIRhyK4U-A-1; Mon, 16 Oct 2023 11:02:15 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 901B21C07827; Mon, 16 Oct 2023 15:02:07 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2CDDC1C060B1; Mon, 16 Oct 2023 15:02:07 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id D6F2419465A4; Mon, 16 Oct 2023 15:02:06 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 209821946587 for ; Mon, 16 Oct 2023 15:02:06 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 021CC40C6CA0; Mon, 16 Oct 2023 15:02:06 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.45.242.10]) by smtp.corp.redhat.com (Postfix) with ESMTP id 76C9740C6CA3 for ; Mon, 16 Oct 2023 15:02:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1697468544; 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=UJfFvk8o1+K1Mevj0LP4BjYVy2Q1p0Kj6E9n8mANlng=; b=VdWY9e7BKW+eQ4BDd7UbjA+yBoI1dCvvW+lLoRGr8peWvl+IwsNv/m5U5m1Uefj0ZYMIWg NoMebWswKkTSB4I3MJqW3eLyWf3Jyc05t/VMiVX6vpIzPyT11/jlRKemfrVwunBF2tCvQz AfAt8fl/pi+c+KWK6gOJu1dVo3Yiw0w= X-MC-Unique: P4t8ijazM5mSOIRhyK4U-A-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 06/31] qemuDomainVirStorageSourceFindByNodeName: Use proper accessor Date: Mon, 16 Oct 2023 17:01:33 +0200 Message-ID: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.2 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.7 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1697468548193100001 Content-Type: text/plain; charset="utf-8" The lookup by nodename requires the proper storage nodename which we use also in status XML. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_domain.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 918b5a14e1..f891defa91 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -2812,8 +2812,10 @@ qemuDomainVirStorageSourceFindByNodeName(virStorageS= ource *top, virStorageSource *tmp; for (tmp =3D top; virStorageSourceIsBacking(tmp); tmp =3D tmp->backing= Store) { + const char *nodestorage =3D qemuBlockStorageSourceGetStorageNodena= me(tmp); + if ((tmp->nodeformat && STREQ(tmp->nodeformat, nodeName)) || - (tmp->nodestorage && STREQ(tmp->nodestorage, nodeName))) + (nodestorage && STREQ(nodestorage, nodeName))) return tmp; } --=20 2.41.0 From nobody Tue May 21 05:15:37 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 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=1697468770; cv=none; d=zohomail.com; s=zohoarc; b=ChTA/5yoS1GlVjU8sZ5f3wyx2zkQyEqVlDYXn0Io3SZTR4l8iM3lxjso5vU1eMCYPLYL/CTAeji9wWbV4tB8AjsQXahQZWCqlIFEOZDqGP6qd0pYAKvyq21JXGYWRsrl+0KG1rc5/ilUQ6fUOwOM854LUb0Z9M+bWEXWwEN9/30= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1697468770; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=U90+5mQjVT/Be/GykvMhN88pJC8zcy/9VXD+qdMlvBY=; b=WTKIDaHYqrh9YZ7vOk7Fe2hneBmfCQstqjy3aT4oHkoZD2aYn5u1BFT1bw2qEiHpVfrHWc0i/xYgcktOK2wMEf6FSLrIduOHN2OFZ+Izvx6I7bXOCMxPrxI6AeR+C4Vppk8resVybh7T9S9B5B7Z/Eq6Q0T9Bb1zGr0lUvnywpg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1697468770729365.60844816024417; Mon, 16 Oct 2023 08:06:10 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-614-IS9p5B2YPcW7kziqHWw33A-1; Mon, 16 Oct 2023 11:02:27 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 181BC1875056; Mon, 16 Oct 2023 15:02:08 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id BB3BE63F51; Mon, 16 Oct 2023 15:02:07 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id A15B21946588; Mon, 16 Oct 2023 15:02:07 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 150DF1946587 for ; Mon, 16 Oct 2023 15:02:07 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 0353A40C6F7F; Mon, 16 Oct 2023 15:02:07 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.45.242.10]) by smtp.corp.redhat.com (Postfix) with ESMTP id 677C440C6F79 for ; Mon, 16 Oct 2023 15:02:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1697468769; 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=U90+5mQjVT/Be/GykvMhN88pJC8zcy/9VXD+qdMlvBY=; b=fOAVAhMecqwv7cAY1tSg9ToSNdwxHTI/KA3NlFTJ6HCGu8FTRV/J51ug+IEvUsAO5Ix8CA A8NW+Lr0yrKZQZ4fHXOfOIRlJ5QEZH0dJAM8zPaFlgOGrv3U9WSfJbdI3GLcyj25h8YIQl d/fLnCJ10byKMPOVhgHSUT37bSYpzf4= X-MC-Unique: IS9p5B2YPcW7kziqHWw33A-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 07/31] qemu: block: Use proper accessors for image formatting/creation code Date: Mon, 16 Oct 2023 17:01:34 +0200 Message-ID: <007514c9cd1c8f2ca3008c00ec652a6fd874ca71.1697468414.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.2 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.5 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1697468771582100001 Content-Type: text/plain; charset="utf-8" Use 'qemuBlockStorageSourceGetEffectiveStorageNodename' in all the JSON props formatters for setting up a 'blockdev-create' job of a format layer. In case of the blockjob name designator we're okay to use just the storage layer nodename as that serves only to find the appropriate entry. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_block.c | 10 +++++----- src/qemu/qemu_blockjob.c | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/qemu/qemu_block.c b/src/qemu/qemu_block.c index 0c9460f678..a98caa330e 100644 --- a/src/qemu/qemu_block.c +++ b/src/qemu/qemu_block.c @@ -2078,7 +2078,7 @@ qemuBlockStorageSourceCreateGetFormatPropsGeneric(vir= StorageSource *src, if (virJSONValueObjectAdd(&props, "s:driver", driver, - "s:file", src->nodestorage, + "s:file", qemuBlockStorageSourceGetEffective= StorageNodename(src), "U:size", src->capacity, NULL) < 0) return -1; @@ -2143,7 +2143,7 @@ qemuBlockStorageSourceCreateGetFormatPropsLUKS(virSto= rageSource *src, if (virJSONValueObjectAdd(&luksprops, "s:driver", "luks", - "s:file", src->nodestorage, + "s:file", qemuBlockStorageSourceGetEffective= StorageNodename(src), "U:size", src->capacity, NULL) < 0) return -1; @@ -2200,7 +2200,7 @@ qemuBlockStorageSourceCreateGetFormatPropsQcow2(virSt= orageSource *src, if (virJSONValueObjectAdd(&qcow2props, "s:driver", "qcow2", - "s:file", src->nodestorage, + "s:file", qemuBlockStorageSourceGetEffective= StorageNodename(src), "U:size", src->capacity, "S:version", qcow2version, "P:cluster-size", src->clusterSize, @@ -2226,7 +2226,7 @@ qemuBlockStorageSourceCreateGetFormatPropsQcow(virSto= rageSource *src, if (virJSONValueObjectAdd(&qcowprops, "s:driver", "qcow", - "s:file", src->nodestorage, + "s:file", qemuBlockStorageSourceGetEffective= StorageNodename(src), "U:size", src->capacity, NULL) < 0) return -1; @@ -2249,7 +2249,7 @@ qemuBlockStorageSourceCreateGetFormatPropsQed(virStor= ageSource *src, if (virJSONValueObjectAdd(&qedprops, "s:driver", "qed", - "s:file", src->nodestorage, + "s:file", qemuBlockStorageSourceGetEffective= StorageNodename(src), "U:size", src->capacity, NULL) < 0) return -1; diff --git a/src/qemu/qemu_blockjob.c b/src/qemu/qemu_blockjob.c index f1d22df59f..25ac74d6c4 100644 --- a/src/qemu/qemu_blockjob.c +++ b/src/qemu/qemu_blockjob.c @@ -312,7 +312,7 @@ qemuBlockJobNewCreate(virDomainObj *vm, const char *nodename =3D src->nodeformat; if (storage) - nodename =3D src->nodestorage; + nodename =3D qemuBlockStorageSourceGetStorageNodename(src); jobname =3D g_strdup_printf("create-%s", nodename); --=20 2.41.0 From nobody Tue May 21 05:15:37 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 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=1697468584; cv=none; d=zohomail.com; s=zohoarc; b=B6BbQDblNCylFBKrhP9p9Ao2wPvm0NnWZBLHw3qsJPdVavIEROQ1dxj7bTY5PpxDYePTmUdAK24gS5mjsOKzRJykJrnKxWssV8QnVaYwFj2WOJn8vljMPlCS0EuEKDNpvQeCBpMguo2CsVRn+nyNAH+wdiq6xQ8faWSv8wC7q/4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1697468584; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=0jlAvMX1lz+AHr+P1Q3t++WMOVyg5ODuZg6fzlkLZzk=; b=bOiPlizHaUsG6lhC39c2PtBVfyvgmltpwh9EhYyZWVIjPnuLwyQLE5mofvxwU0WTJVmx0eqJczVU00DYZVIbkalqhsjJf+6jxl0ItYQGvSq9JpzALfPxJqLjIkgWKH9BXxyyFh0FM5CprrB9jpUKJ8ZIepSY2tFftIAKFftivLg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1697468584544170.19969173237018; Mon, 16 Oct 2023 08:03:04 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-668-VM1UWyQeM9qjQvBrR1QoPA-1; Mon, 16 Oct 2023 11:02:29 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 4423E858285; Mon, 16 Oct 2023 15:02:09 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2BFBD8C7; Mon, 16 Oct 2023 15:02:09 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 1A19F1946588; Mon, 16 Oct 2023 15:02:09 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id F24D119465A2 for ; Mon, 16 Oct 2023 15:02:07 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id D470E40C6CA3; Mon, 16 Oct 2023 15:02:07 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.45.242.10]) by smtp.corp.redhat.com (Postfix) with ESMTP id 550CE40C6CA0 for ; Mon, 16 Oct 2023 15:02:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1697468583; 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=0jlAvMX1lz+AHr+P1Q3t++WMOVyg5ODuZg6fzlkLZzk=; b=OrBpQ0jGTOi0IIpM27u4q/g+K2LzZj/YnXaWez6UywQGlH5DK77EGqxAigH2anGZBLlCn/ MUUmJuSHnlwUcPZksp7q31My1/DyJa0hfrE7A5cVbqZcth1loKBXVLpgoPXkLn4nG6/Eoo Avt08ppZPcl6eWjS48LtO0QXFq4iuyQ= X-MC-Unique: VM1UWyQeM9qjQvBrR1QoPA-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 08/31] qemu: domain: Convert the status XML code for 'storage' nodenames to new accessors Date: Mon, 16 Oct 2023 17:01:35 +0200 Message-ID: <0d164fa81838758b93e39112a54860d6071803c4.1697468414.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.2 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1697468586357100002 Content-Type: text/plain; charset="utf-8" Use the new accessors in the private XML formatters and parsers and the recovery code. Specifically in all instances we use the proper (not effective) storage nodename. In the virStorageSource private data it is what we need to store. In blockjobs status XML it simply serves us to find the appropriate 'virStorageSource' struct so using the storage layer node name is simpler. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_domain.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index f891defa91..78dc99d243 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -2000,7 +2000,7 @@ qemuStorageSourcePrivateDataParse(xmlXPathContextPtr = ctxt, int enccount; xmlNodePtr nbdkitnode =3D NULL; - src->nodestorage =3D virXPathString("string(./nodenames/nodename[@type= =3D'storage']/@name)", ctxt); + qemuBlockStorageSourceSetStorageNodename(src, virXPathString("string(.= /nodenames/nodename[@type=3D'storage']/@name)", ctxt)); src->nodeformat =3D virXPathString("string(./nodenames/nodename[@type= =3D'format']/@name)", ctxt); src->tlsAlias =3D virXPathString("string(./objects/TLSx509/@alias)", c= txt); @@ -2111,7 +2111,7 @@ qemuStorageSourcePrivateDataFormat(virStorageSource *= src, g_auto(virBuffer) objectsChildBuf =3D VIR_BUFFER_INIT_CHILD(buf); g_auto(virBuffer) fdsetsChildBuf =3D VIR_BUFFER_INIT_CHILD(buf); - virBufferEscapeString(&nodenamesChildBuf, "\n", src->nodestorage); + virBufferEscapeString(&nodenamesChildBuf, "\n", qemuBlockStorageSourceGetStorageNodename(src)); virBufferEscapeString(&nodenamesChildBuf, "\n", src->nodeformat); if (src->sliceStorage) @@ -2288,13 +2288,16 @@ qemuDomainPrivateBlockJobFormatCommit(qemuBlockJobD= ata *job, g_auto(virBuffer) disabledBitmapsBuf =3D VIR_BUFFER_INIT_CHILD(buf); if (job->data.commit.base) - virBufferAsprintf(buf, "\n", job->data.commit.b= ase->nodestorage); + virBufferAsprintf(buf, "\n", + qemuBlockStorageSourceGetStorageNodename(job->da= ta.commit.base)); if (job->data.commit.top) - virBufferAsprintf(buf, "\n", job->data.commit.to= p->nodestorage); + virBufferAsprintf(buf, "\n", + qemuBlockStorageSourceGetStorageNodename(job->da= ta.commit.top)); if (job->data.commit.topparent) - virBufferAsprintf(buf, "\n", job->data.com= mit.topparent->nodestorage); + virBufferAsprintf(buf, "\n", + qemuBlockStorageSourceGetStorageNodename(job->da= ta.commit.topparent)); if (job->data.commit.deleteCommittedImages) virBufferAddLit(buf, "\n"); @@ -2357,7 +2360,8 @@ qemuDomainObjPrivateXMLFormatBlockjobIterator(void *p= ayload, switch ((qemuBlockJobType) job->type) { case QEMU_BLOCKJOB_TYPE_PULL: if (job->data.pull.base) - virBufferAsprintf(&childBuf, "\n", job-= >data.pull.base->nodestorage); + virBufferAsprintf(&childBuf, "\n", + qemuBlockStorageSourceGetStorageNodename= (job->data.pull.base)); break; case QEMU_BLOCKJOB_TYPE_COMMIT: @@ -6060,8 +6064,8 @@ qemuDomainDeviceHostdevDefPostParseRestoreBackendAlia= s(virDomainHostdevDef *host return -1; } - if (!src->nodestorage) - src->nodestorage =3D g_strdup_printf("libvirt-%s-backend", hostdev= ->info->alias); + if (!qemuBlockStorageSourceGetStorageNodename(src)) + qemuBlockStorageSourceSetStorageNodename(src, g_strdup_printf("lib= virt-%s-backend", hostdev->info->alias)); return 0; } --=20 2.41.0 From nobody Tue May 21 05:15:37 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 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=1697468567; cv=none; d=zohomail.com; s=zohoarc; b=XK6sJIXjpHOOm8uZuE6tWKL2ExjDKVbnIyZKi0fJMmFX1P22FDDhKJpB6wAatW2K86i5dRxO4f2jnjhqUNerwyNG/dFLfP8J2ZqvFvRvw1qgkbO6C1UJv/6wuUlbiCVGp7VNMxVgatm9w8/HAFO9+2rqdUr9qLQZjSVDdcniY/I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1697468567; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=f2EWqbpQ/qhXw0tlOiHfflE6jFj29AJZxwFDSr7JdKM=; b=I/bMdt1FAT3knVvciiXgDsoKjzcpWTGXEuw9+5u/w+cXRPuYMd62OZ+BPwdGbOnyGmoMqX/fCf7nw51qRbT2rSf+auVBnEyaymc4UEcP9oi6zhF9kLKNAaXN3qkAjVF4EF80r+c1B5ynCKSDSelViwzk1REEi3i0z1lrJlGqykg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1697468567609526.3017504915283; Mon, 16 Oct 2023 08:02:47 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-453-gAUDa8jfNhmgt8kDR8LveQ-1; Mon, 16 Oct 2023 11:02:38 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 8249E862F50; Mon, 16 Oct 2023 15:02:10 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6EA3B25C9; Mon, 16 Oct 2023 15:02:10 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 605311946588; Mon, 16 Oct 2023 15:02:10 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id D7FCE1946588 for ; Mon, 16 Oct 2023 15:02:08 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id ABDB740C6F79; Mon, 16 Oct 2023 15:02:08 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.45.242.10]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2E56F40C6CA0 for ; Mon, 16 Oct 2023 15:02:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1697468566; 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=f2EWqbpQ/qhXw0tlOiHfflE6jFj29AJZxwFDSr7JdKM=; b=ZmrwBdZiDkezDqCMbOwBVjrsIFu1WQK29Ze2CPnqYT9lNkLN+ce7cEhcchI4KuV08Jq/g0 +RGLViADYAAXI3tGBkxrAG2JT2N3MxPwO3OVDVUClbJYI5Igh5m6zL3Erj2oPRQYGT9L+y jjVz9sWZ46cvng7T+JWujOjqyn3rfRQ= X-MC-Unique: gAUDa8jfNhmgt8kDR8LveQ-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 09/31] qemu: block: Convert disk 'storage' backend JSON props generator to new accessors Date: Mon, 16 Oct 2023 17:01:36 +0200 Message-ID: <54aaeafaaf1a37f5e7522d72d67d0e684bcd78f0.1697468414.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.2 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1697468568225100003 Content-Type: text/plain; charset="utf-8" We need to use the 'effective' storage nodename (one which includes the optional storage slice 'raw' intermediate layer) in the code which formats the 'format' layer props. All other cases need the real storage driver nodename as they either generate the 'storage' layer props, or the storage slice, which refers to the proper storage backend. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_block.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/qemu/qemu_block.c b/src/qemu/qemu_block.c index a98caa330e..1fc36569a9 100644 --- a/src/qemu/qemu_block.c +++ b/src/qemu/qemu_block.c @@ -1060,8 +1060,10 @@ qemuBlockStorageSourceGetBackendProps(virStorageSour= ce *src, return NULL; if (!onlytarget) { - if (qemuBlockNodeNameValidate(src->nodestorage) < 0 || - virJSONValueObjectAdd(&fileprops, "S:node-name", src->nodestor= age, NULL) < 0) + if (qemuBlockNodeNameValidate(qemuBlockStorageSourceGetStorageNode= name(src)) < 0 || + virJSONValueObjectAdd(&fileprops, + "S:node-name", qemuBlockStorageSourceGet= StorageNodename(src), + NULL) < 0) return NULL; if (!legacy) { @@ -1358,10 +1360,6 @@ qemuBlockStorageSourceGetFormatProps(virStorageSourc= e *src, g_autoptr(virJSONValue) props =3D NULL; const char *backingFormatterStr =3D NULL; const char *backingNodename =3D NULL; - const char *storagenode =3D src->nodestorage; - - if (qemuBlockStorageSourceNeedsStorageSliceLayer(src)) - storagenode =3D src->sliceStorage->nodename; if (virStorageSourceIsBacking(backingStore) && src->format < VIR_STORAGE_FILE_BACKING) { @@ -1386,7 +1384,7 @@ qemuBlockStorageSourceGetFormatProps(virStorageSource= *src, return NULL; if (virJSONValueObjectAdd(&props, - "s:file", storagenode, + "s:file", qemuBlockStorageSourceGetEffective= StorageNodename(src), backingFormatterStr, backingNodename, NULL) < 0) return 0; @@ -1408,7 +1406,7 @@ qemuBlockStorageSourceGetBlockdevStorageSliceProps(vi= rStorageSource *src) "s:node-name", src->sliceStorage->nodename, "U:offset", src->sliceStorage->offset, "U:size", src->sliceStorage->size, - "s:file", src->nodestorage, + "s:file", qemuBlockStorageSourceGetStorageNo= dename(src), "b:auto-read-only", true, "s:discard", "unmap", NULL) < 0) --=20 2.41.0 From nobody Tue May 21 05:15:37 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 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=1697468568; cv=none; d=zohomail.com; s=zohoarc; b=etnZgTt4MzF2bjAueFdl3v69ikALDAdcvdI2oHEtsxBoEV58PHsE/d0jRZD6wtX38vJ7BbEnvJsxbg//cyJBbc6FLoRP9So8mBdTda2PCozWm97zZRcl3/4aqTDxc3DgW+vf728GED7jSqJznhkGrr/JNe6EzPUp4kZJX+qTxeM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1697468568; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=ZebDME9yP0kkuO6hQtiRm1WIEbpYGm5r+otL45HHS/M=; b=PS9JwePUn/SGt1OAe9bEwswH8TFP/wV1SfbtebamOXZg5L5C3YVqYVwxavVfKlRHkUdO/J8X8M6wxQ8P+AfeNsfcU0JWwoArEKjyt3rORzsubGecAY2ENg778o7NNc9f7Eac8hVB4SbOZsr4HBccrnWiMsB72RBEfuGHZj2gv9g= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1697468568925729.3707078448883; Mon, 16 Oct 2023 08:02:48 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-463-KM1sZ2rUNuiJjWR20eHtJQ-1; Mon, 16 Oct 2023 11:02:38 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 14527855320; Mon, 16 Oct 2023 15:02:11 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id F19FE201EAD1; Mon, 16 Oct 2023 15:02:10 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id E22A6194658C; Mon, 16 Oct 2023 15:02:10 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id BA6531946587 for ; Mon, 16 Oct 2023 15:02:09 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 9C42540C6CA3; Mon, 16 Oct 2023 15:02:09 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.45.242.10]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0853F40C6F79 for ; Mon, 16 Oct 2023 15:02:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1697468568; 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=ZebDME9yP0kkuO6hQtiRm1WIEbpYGm5r+otL45HHS/M=; b=XRYEVCvkJJCTVU2BGk/sNY8mkLT1yDKz/zFgwBanRcKfSL3920XXHbBN4gIye/NpL8vn6S r3qRBDXupl6tZDGVEA5iStJHvSqAH6Ej6PZfwitzknVO8zLtPFYoqVTCEx7l3PATxSaV5d /BGONOuSy3KcP98cLAiXbwwJ8hGKwMc= X-MC-Unique: KM1sZ2rUNuiJjWR20eHtJQ-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 10/31] qemu: domain: Rework assignment of 'storage' nodenames to use new accessors Date: Mon, 16 Oct 2023 17:01:37 +0200 Message-ID: <97439ebef60e8d072bcc53656367913eebfa7a2f.1697468414.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.2 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1697468570242100005 Content-Type: text/plain; charset="utf-8" Refactor the code which assigns the 'storage' layer nodenames for disks. scsi hostdevs and pflash backend. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_domain.c | 25 ++++++++++++++----------- src/qemu/qemu_migration.c | 2 +- 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 78dc99d243..885c5ee96b 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -11143,7 +11143,10 @@ qemuDomainPrepareStorageSourceBlockdevNodename(vir= DomainDiskDef *disk, qemuDomainObjPrivate *priv, virQEMUDriverConfig *cfg) { - src->nodestorage =3D g_strdup_printf("%s-storage", nodenameprefix); + char *nodestorage =3D g_strdup_printf("%s-storage", nodenameprefix); + + /* qemuBlockStorageSourceSetStorageNodename steals 'nodestorage' */ + qemuBlockStorageSourceSetStorageNodename(src, nodestorage); src->nodeformat =3D g_strdup_printf("%s-format", nodenameprefix); if (qemuBlockStorageSourceNeedsStorageSliceLayer(src)) @@ -11162,18 +11165,17 @@ qemuDomainPrepareStorageSourceBlockdevNodename(vi= rDomainDiskDef *disk, src->nodeformat) < = 0) return -1; - if (!qemuDomainPrepareStorageSourceNbdkit(src, cfg, src->nodestorage, = priv)) { + if (!qemuDomainPrepareStorageSourceNbdkit(src, cfg, nodestorage, priv)= ) { /* If we're using nbdkit to serve the storage source, we don't pass * authentication secrets to qemu, but will pass them to nbdkit in= stead */ - if (qemuDomainSecretStorageSourcePrepareAuth(priv, src, - src->nodestorage) < 0) + if (qemuDomainSecretStorageSourcePrepareAuth(priv, src, nodestorag= e) < 0) return -1; } - if (qemuDomainPrepareStorageSourcePR(src, priv, src->nodestorage) < 0) + if (qemuDomainPrepareStorageSourcePR(src, priv, nodestorage) < 0) return -1; - if (qemuDomainPrepareStorageSourceTLS(src, cfg, src->nodestorage, + if (qemuDomainPrepareStorageSourceTLS(src, cfg, nodestorage, priv) < 0) return -1; @@ -11297,12 +11299,14 @@ qemuDomainPrepareHostdevSCSI(virDomainHostdevDef = *hostdev, } if (src) { - const char *backendalias =3D hostdev->info->alias; + char *backendalias; src->readonly =3D hostdev->readonly; src->id =3D qemuDomainStorageIDNew(priv); - src->nodestorage =3D g_strdup_printf("libvirt-%d-backend", src->id= ); - backendalias =3D src->nodestorage; + backendalias =3D g_strdup_printf("libvirt-%d-backend", src->id); + + /* 'src' takes ownership of 'backendalias' */ + qemuBlockStorageSourceSetStorageNodename(src, backendalias); if (src->auth) { virSecretUsageType usageType =3D VIR_SECRET_USAGE_TYPE_ISCSI; @@ -11695,8 +11699,7 @@ qemuDomainInitializePflashStorageSource(virDomainOb= j *vm, pflash0->readonly =3D false; virTristateBoolToBool(def->os.loader->readonly, &pflash0->readonly); pflash0->nodeformat =3D g_strdup("libvirt-pflash0-format"); - pflash0->nodestorage =3D g_strdup("libvirt-pflash0-storage"); - + qemuBlockStorageSourceSetStorageNodename(pflash0, g_strdup("libvirt-pf= lash0-storage")); if (def->os.loader->nvram) { if (qemuDomainPrepareStorageSourceBlockdevNodename(NULL, diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index 011482c2b5..7d08df1fc5 100644 --- a/src/qemu/qemu_migration.c +++ b/src/qemu/qemu_migration.c @@ -1011,7 +1011,7 @@ qemuMigrationSrcNBDStorageCopyBlockdevPrepareSource(v= irDomainDiskDef *disk, copysrc->tlsAlias =3D g_strdup(tlsAlias); copysrc->tlsHostname =3D g_strdup(tlsHostname); - copysrc->nodestorage =3D g_strdup_printf("migration-%s-storage", disk-= >dst); + qemuBlockStorageSourceSetStorageNodename(copysrc, g_strdup_printf("mig= ration-%s-storage", disk->dst)); copysrc->nodeformat =3D g_strdup_printf("migration-%s-format", disk->d= st); return g_steal_pointer(©src); --=20 2.41.0 From nobody Tue May 21 05:15:37 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 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=1697468782; cv=none; d=zohomail.com; s=zohoarc; b=B0wl1V/YRvZTiM1Q3xoT/BZWMrwfqc0U+3+f0S3W7vFLZ0Dsdd4Mi6XLYyCaXIcnW6ETni9Q9pNSrBazzu58gKkb+r/5q1t1DVov39ScjyyN2JD/7hvwltVIgh1qNgeqPuN7dcQbEoHEPiZ+lvpO2CpMz+/WlSl1I9qPEg7qfSE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1697468782; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=pzwh6V6v/GsMTnTbKB6EMiHjd3ITxrzhP2nr8MqiiN0=; b=KQbfTOSHsuzXySEZYmaVFVEGNfMQA+8SvmpcBQVL3hkb1BAsuSK3O4wg6KQ7xJrE4p4J00MLumTn/uE/zagpicMHlP8KjRvKOIzED8vr2Kab8A6QKXXaxzSi0AVc5ksreDz3jmD8WqGAGg/a8dYFYkJtzzdTB7Lz7nFvZSKVOFw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1697468782580754.1696588615583; Mon, 16 Oct 2023 08:06:22 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-369-Iwnd9JNGPzCmW6L2VrSYJQ-1; Mon, 16 Oct 2023 11:02:32 -0400 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id CF07285A5BA; Mon, 16 Oct 2023 15:02:11 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id B70DB492BEE; Mon, 16 Oct 2023 15:02:11 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 955651946588; Mon, 16 Oct 2023 15:02:11 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 9222F19465A4 for ; Mon, 16 Oct 2023 15:02:10 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 82EBF40C6F7F; Mon, 16 Oct 2023 15:02:10 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.45.242.10]) by smtp.corp.redhat.com (Postfix) with ESMTP id F139640C6CA3 for ; Mon, 16 Oct 2023 15:02:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1697468781; 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=pzwh6V6v/GsMTnTbKB6EMiHjd3ITxrzhP2nr8MqiiN0=; b=OlrAftAjE2AL5EUQogYmZ8o3ERFFTy5KuHkmucnUQc+1pG3cADH8+IzLUxMuMpdOWCZvxs 1pidBN4ocRwPwb7Q1FDUhIcDhyhp0vxnR/LwgNJb9GxiW8dnBe/+6LtJIB+HdQwuwz1pJm 6LIhqyavQa5QXonHUiLV8/dRrJGL85M= X-MC-Unique: Iwnd9JNGPzCmW6L2VrSYJQ-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 11/31] qemu: Refactor storage backend attach/detach setup code to use 'storage' nodename accessors Date: Mon, 16 Oct 2023 17:01:38 +0200 Message-ID: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.2 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.9 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1697468783458100001 Content-Type: text/plain; charset="utf-8" Refactor the code settin up data structures used to attach/detach disks and SCSI hostdevs. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_block.c | 7 ++++--- src/qemu/qemu_command.c | 6 +++--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/qemu/qemu_block.c b/src/qemu/qemu_block.c index 1fc36569a9..7355cb0b5e 100644 --- a/src/qemu/qemu_block.c +++ b/src/qemu/qemu_block.c @@ -1484,7 +1484,7 @@ qemuBlockStorageSourceAttachPrepareBlockdev(virStorag= eSource *src, backe= ndpropsflags))) return NULL; - data->storageNodeName =3D src->nodestorage; + data->storageNodeName =3D qemuBlockStorageSourceGetStorageNodename(src= ); data->formatNodeName =3D src->nodeformat; if (qemuBlockStorageSourceNeedsStorageSliceLayer(src)) { @@ -1705,7 +1705,7 @@ qemuBlockStorageSourceDetachPrepare(virStorageSource = *src) data->formatNodeName =3D src->nodeformat; data->formatAttached =3D true; - data->storageNodeName =3D src->nodestorage; + data->storageNodeName =3D qemuBlockStorageSourceGetStorageNodename(src= ); data->storageAttached =3D true; /* 'raw' format doesn't need the extra 'raw' layer when slicing, thus @@ -1899,7 +1899,8 @@ qemuBlockStorageSourceDetachOneBlockdev(virDomainObj = *vm, ret =3D qemuMonitorBlockdevDel(qemuDomainGetMonitor(vm), src->nodeform= at); if (ret =3D=3D 0) - ret =3D qemuMonitorBlockdevDel(qemuDomainGetMonitor(vm), src->node= storage); + ret =3D qemuMonitorBlockdevDel(qemuDomainGetMonitor(vm), + qemuBlockStorageSourceGetStorageNoden= ame(src)); qemuDomainObjExitMonitor(vm); diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 8a7b80719f..40de712c61 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -5049,7 +5049,7 @@ qemuBuildHostdevSCSIDetachPrepare(virDomainHostdevDef= *hostdev, } srcpriv =3D QEMU_DOMAIN_STORAGE_SOURCE_PRIVATE(src); - ret->storageNodeName =3D src->nodestorage; + ret->storageNodeName =3D qemuBlockStorageSourceGetStorageNodename(src); ret->storageAttached =3D true; if (srcpriv && srcpriv->secinfo) @@ -5083,8 +5083,8 @@ qemuBuildHostdevSCSIAttachPrepare(virDomainHostdevDef= *hostdev, return NULL; } - ret->storageNodeName =3D src->nodestorage; - *backendAlias =3D src->nodestorage; + ret->storageNodeName =3D qemuBlockStorageSourceGetStorageNodename(src); + *backendAlias =3D qemuBlockStorageSourceGetStorageNodename(src); if (!(ret->storageProps =3D qemuBlockStorageSourceGetBackendProps(src, QEMU_B= LOCK_STORAGE_SOURCE_BACKEND_PROPS_SKIP_UNMAP))) --=20 2.41.0 From nobody Tue May 21 05:15:37 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 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=1697468585; cv=none; d=zohomail.com; s=zohoarc; b=Y+wrlD0VUyo/IAxDj1GzmuPPGV/ARObdUG4hIwWw2Nf3eqpdBz64lvcL/xZzf6swFoei0G6aQpTfNagnfcn60Vg6GhaO9d8wMcQLVbMNPY1K8iLtrxri7E1HOwgaWB62cxGarBLVnHd9T3JuOOzPBZ6zmY+X0ktNNVV+IQObPpw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1697468585; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=4sdRo1f50A0+BXiME0qny0M0pwtsQ+xks7Wt2GkIV/4=; b=LocklXV3g77nFdWUiVcps+OVALnBcW5OPVRXqh/yksQy3SqSE/Fss0PoW476pJnzYk8x/YjnmhivGgRxRO6iksMebxPeSnR4r8SZUCCyrafCNACYZDMEPvHb+ZZwmxYD7X2sEjDNkHJWQc+nk/FqR1804jX5v88Hkd1F/vYJ9/g= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1697468585565707.2382504872525; Mon, 16 Oct 2023 08:03:05 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-517-90uCFmtUNoasraNnpwF8_w-1; Mon, 16 Oct 2023 11:02:53 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 59CCE3C2865E; Mon, 16 Oct 2023 15:02:13 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4487225C9; Mon, 16 Oct 2023 15:02:13 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 2637A1946588; Mon, 16 Oct 2023 15:02:13 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 7FDFE1946587 for ; Mon, 16 Oct 2023 15:02:11 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 721D140C6CA0; Mon, 16 Oct 2023 15:02:11 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.45.242.10]) by smtp.corp.redhat.com (Postfix) with ESMTP id EA41B40C6CA3 for ; Mon, 16 Oct 2023 15:02:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1697468584; 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=4sdRo1f50A0+BXiME0qny0M0pwtsQ+xks7Wt2GkIV/4=; b=iyUiLrANZD+w1p2G9RrmGxx2mI24tGf25hfG2mr2QvO+6DMqeTgm2o5DydhGU7JPUoySob vfb+WRkxzOqWutZJIyk0EUUhJQEqwy4KVahNPHJ/Z4rLAPteDtMzWsEAe/aThrnigH6ej8 9zuhgM/PqAt7iR/X0G1m9Xoh93dco+k= X-MC-Unique: 90uCFmtUNoasraNnpwF8_w-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 12/31] qemu: Refactor storage backend 'storage' layer helepr object setup Date: Mon, 16 Oct 2023 17:01:39 +0200 Message-ID: <2a93273d84b4ea25d31ae33e6b62033cdf82d265.1697468414.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.2 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1697468586355100001 Content-Type: text/plain; charset="utf-8" Use the new nodename accessors for any storage layer helper object. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_domain.c | 2 +- src/qemu/qemu_nbdkit.c | 4 ++-- src/qemu/qemu_process.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 885c5ee96b..1b2f09a316 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -11106,7 +11106,7 @@ qemuDomainPrepareStorageSourceFDs(virStorageSource = *src, srcpriv =3D qemuDomainStorageSourcePrivateFetch(src); - srcpriv->fdpass =3D qemuFDPassNew(src->nodestorage, priv); + srcpriv->fdpass =3D qemuFDPassNew(qemuBlockStorageSourceGetStorageNode= name(src), priv); for (i =3D 0; i < fdt->nfds; i++) { g_autofree char *idx =3D g_strdup_printf("%zu", i); diff --git a/src/qemu/qemu_nbdkit.c b/src/qemu/qemu_nbdkit.c index 3ad63cfaa0..85e61be44c 100644 --- a/src/qemu/qemu_nbdkit.c +++ b/src/qemu/qemu_nbdkit.c @@ -923,7 +923,7 @@ qemuNbdkitStopStorageSource(virStorageSource *src, if (priv && priv->nbdkitProcess && qemuNbdkitProcessStop(priv->nbdkitProcess, vm) < 0) - VIR_WARN("Unable to stop nbdkit for storage source '%s'", src-= >nodestorage); + VIR_WARN("Unable to stop nbdkit for storage source '%s'", qemu= BlockStorageSourceGetStorageNodename(src)); } } @@ -1173,7 +1173,7 @@ qemuNbdkitProcessStart(qemuNbdkitProcess *proc, logfd =3D qemuLogContextGetWriteFD(logContext); - VIR_DEBUG("starting nbdkit process for %s", proc->source->nodestorage); + VIR_DEBUG("starting nbdkit process for %s", qemuBlockStorageSourceGetS= torageNodename(proc->source)); virCommandSetErrorFD(cmd, &logfd); virCommandSetOutputFD(cmd, &logfd); virCommandSetPidFile(cmd, proc->pidfile); diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index ae0bb7bf80..63c0c62a46 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -6771,7 +6771,7 @@ qemuProcessPrepareHostStorageSourceVDPA(virStorageSou= rce *src, srcpriv =3D qemuDomainStorageSourcePrivateFetch(src); - srcpriv->fdpass =3D qemuFDPassNew(src->nodestorage, priv); + srcpriv->fdpass =3D qemuFDPassNew(qemuBlockStorageSourceGetStorageNode= name(src), priv); qemuFDPassAddFD(srcpriv->fdpass, &vdpafd, "-vdpa"); return 0; } --=20 2.41.0 From nobody Tue May 21 05:15:37 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 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=1697468554; cv=none; d=zohomail.com; s=zohoarc; b=jHeVS3lG//uvlYYGqgCoR0ep6zBN6MBcQpASj9yTGG+C+aUqObFC9PuoI38VCTGn5Va0N1cLzzQ3l7CPEAPN4U0WqSGpWxFlxnoe2RYmloaJX05O3eBDrQMqyP4/nbgdYz2uaMVfwt5VwgXVVNfIEB2Qy9n8MGsLPGbtgFJ6m8U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1697468554; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=ZMfYyDXVUiDblZ8a1pDj4m94lWTZ42IT7r0KW6Gii30=; b=bL50SFzolXO7ai7yEd8FtcvSHJ5+qBShpzfOHq8j7uX1i3LFG92wZuqCgHJ8JlnIvf7sE3UDi2BKmx0oDua8gQpeWrGXeF+l1BjOoW80UTarlhM7RFqh2O2vhF9N89IPYdVvyV4MHp8gPJ5EGMkk31NrE9cV8R13XH8Cc9JnStk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1697468554502562.4904417510633; Mon, 16 Oct 2023 08:02:34 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-216-24LE9QW_MUu5JH_SH8Sjxw-1; Mon, 16 Oct 2023 11:02:20 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id D2F78381AE43; Mon, 16 Oct 2023 15:02:13 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id BADD525C8; Mon, 16 Oct 2023 15:02:13 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 5D93719465B2; Mon, 16 Oct 2023 15:02:13 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 73E531946587 for ; Mon, 16 Oct 2023 15:02:12 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 667D440C6CA0; Mon, 16 Oct 2023 15:02:12 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.45.242.10]) by smtp.corp.redhat.com (Postfix) with ESMTP id CCC1940C6F7F for ; Mon, 16 Oct 2023 15:02:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1697468553; 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=ZMfYyDXVUiDblZ8a1pDj4m94lWTZ42IT7r0KW6Gii30=; b=Qcf9jTivDFayvUw8a5cnsRMaL3tGj6EHkh0MDPbzuRXIbVDk+dtBclOLAXLXU6CUoXCjOC FngNZtSX2N44SE1S+ydpuP6Xs7Fu2HrKQDGSEFEk+IlxakItguufYOaqB9cOpNj0mpcVaG taWeO4kM0Sv8jrrtaqyqeIYC1/UzqAY= X-MC-Unique: 24LE9QW_MUu5JH_SH8Sjxw-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 13/31] qemuDomainGetStatsBlockExportDisk: Use 'storage' node name accessors Date: Mon, 16 Oct 2023 17:01:40 +0200 Message-ID: <270bc76a2a6bd72a2e3e2adcdb7187dc3fc16fb7.1697468414.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.2 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1697468555949100003 Content-Type: text/plain; charset="utf-8" In all cases we want to probe stats from the 'storage' layer as we're interested in the 'threshold' value, which we set there. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_driver.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index f3c9730cd8..e2fe2016af 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -17349,7 +17349,7 @@ qemuDomainGetStatsBlockExportDisk(virDomainDiskDef = *disk, if (QEMU_DOMAIN_DISK_PRIVATE(disk)->qomName) { frontendalias =3D QEMU_DOMAIN_DISK_PRIVATE(disk)->qomName; backendalias =3D n->nodeformat; - backendstoragealias =3D n->nodestorage; + backendstoragealias =3D qemuBlockStorageSourceGetStorageNodena= me(n); } else { /* alias may be NULL if the VM is not running */ if (disk->info.alias && @@ -17408,7 +17408,7 @@ qemuDomainGetStatsBlockExportDisk(virDomainDiskDef = *disk, stats) < 0) return -1; - if (qemuDomainGetStatsBlockExportBackendStorage(disk->mirror->= nodestorage, + if (qemuDomainGetStatsBlockExportBackendStorage(qemuBlockStora= geSourceGetStorageNodename(disk->mirror), stats, *record= nr, params) < 0) return -1; @@ -17437,7 +17437,7 @@ qemuDomainGetStatsBlockExportDisk(virDomainDiskDef = *disk, stats) < 0) return -1; - if (qemuDomainGetStatsBlockExportBackendStorage(backup= disk->store->nodestorage, + if (qemuDomainGetStatsBlockExportBackendStorage(qemuBl= ockStorageSourceGetStorageNodename(backupdisk->store), stats,= *recordnr, params= ) < 0) return -1; --=20 2.41.0 From nobody Tue May 21 05:15:37 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 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=1697468589; cv=none; d=zohomail.com; s=zohoarc; b=EFqblXKMKR3YdgRyiP96EH9cc1SFrCaia0OdgSYLyixvvlVETO0HQ+vgIhjNyCHoHlSbG4uZjoHTO84FtfAWHjIHtoh0LZtLeTdCmIpk/CY+76YwYwlZRLw4ql1jAK4ayPU/xY+7wgEXv3zpVTXcgqznMsre9AxLcBxlAiGu/Vg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1697468589; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=jQeIuZKZPpFE7xG8Isggfb8Q6H8+Hput+VUpK2YRcYs=; b=PW7aCLiotGONbOPqZf4/T1QuVmdmV8C+x084LszRtLz1arLVMfo/O6jCarqd2JMZjXoFl7Z0LhUB4N+mBEY/RIJGOZndmKjUACUQaVVZM5nxziXJHydobywM3Jv3210/dHcYChJtvFUJVuj/m266Ktegvugawo1YG+yNXCsIxU4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1697468589593549.0083419713162; Mon, 16 Oct 2023 08:03:09 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-472-uX0shNJFMQyEUQg5uxRu-w-1; Mon, 16 Oct 2023 11:02:53 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id BC3F11C0BB62; Mon, 16 Oct 2023 15:02:14 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id A6EE563F45; Mon, 16 Oct 2023 15:02:14 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 961481946588; Mon, 16 Oct 2023 15:02:14 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 592DB1946588 for ; Mon, 16 Oct 2023 15:02:13 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 4798D40C6CA0; Mon, 16 Oct 2023 15:02:13 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.45.242.10]) by smtp.corp.redhat.com (Postfix) with ESMTP id B90C340C6F79 for ; Mon, 16 Oct 2023 15:02:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1697468588; 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=jQeIuZKZPpFE7xG8Isggfb8Q6H8+Hput+VUpK2YRcYs=; b=Uaigy6KmO+pMQUsXdlNu5ae/rIv/iTKIxBDF5tf5UJrykg+kG5b63UcSH27p1HCLHwvzw2 c9mFYrIvLTtPeAAcyDlqZ5fgJc2c8wXD7HV2TMwLocCBcYmeWIplR90IyiVnZ+Zp2gu059 4NZ6KvbgomcKMlLCK9rbeFMT7SmrAj4= X-MC-Unique: uX0shNJFMQyEUQg5uxRu-w-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 14/31] qemuDomainSetBlockThreshold: Use 'storage' node name accessor Date: Mon, 16 Oct 2023 17:01:41 +0200 Message-ID: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.2 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.5 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1697468590386100011 Content-Type: text/plain; charset="utf-8" We need to keep setting the block threshold on the real storage layer per semantics of the API. Use the appropriate accessor. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_driver.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index e2fe2016af..6d95711cbc 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -18682,7 +18682,7 @@ qemuDomainSetBlockThreshold(virDomainPtr dom, goto endjob; } - nodename =3D g_strdup(src->nodestorage); + nodename =3D g_strdup(qemuBlockStorageSourceGetStorageNodename(src)); qemuDomainObjEnterMonitor(vm); rc =3D qemuMonitorSetBlockThreshold(priv->mon, nodename, threshold); --=20 2.41.0 From nobody Tue May 21 05:15:37 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 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=1697468643; cv=none; d=zohomail.com; s=zohoarc; b=dpfhcIhRutjrqnZa03OLBqW8+LBxSxXY1EaLHAM576z9IZ6b06s5k3F+7D71KA2zzfQKLf9gxf1wPLM8XgSFr8awdImKVdoly2OZba0GKmaGrYYVBHm/F+CcazMD3/HINMnHPKpAKtNQfYvB3f2kJD4Y4P2i3TAA2T5oHcN7RKA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1697468643; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=j8ymu03HyERENuKpSjckckg1OjKMiySZJYDq/qvKHTw=; b=NVDtNYbOSvExCOVCG97NEYwtIGsxNOS31XQeyLj5MoBueBsLUAhI46Anj3b/NzMUOfcrf4eIpQzmqhcVhLd5QazzSaWzxaZk8eBz7z09t3S0FVzumahZ8cgHwkBlskB/TYMyRxEg+je8LlNqT+nVE1KrgETKdUk6fUhWFeegKAo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1697468643650425.00710031645224; Mon, 16 Oct 2023 08:04:03 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-612-jPAjKx-wP-uvfF6s-6j4ZQ-1; Mon, 16 Oct 2023 11:02:51 -0400 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id F19AC382136D; Mon, 16 Oct 2023 15:02:16 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id DDA6D492BFA; Mon, 16 Oct 2023 15:02:16 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id CE8541946587; Mon, 16 Oct 2023 15:02:16 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id E30011946597 for ; Mon, 16 Oct 2023 15:02:14 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id C3BB140C6CA3; Mon, 16 Oct 2023 15:02:14 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.45.242.10]) by smtp.corp.redhat.com (Postfix) with ESMTP id AA26840C6CA0 for ; Mon, 16 Oct 2023 15:02:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1697468642; 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=j8ymu03HyERENuKpSjckckg1OjKMiySZJYDq/qvKHTw=; b=gQY1w7+OjwqeqlkZ/9gPCESZrE49y9+gi9t+YGbGtlIG12uo6EMcJXstCQfSanLEEJthMM xMxfV5WYzBYO/Lb6VdSm9TayKow/WVhK0Owu1R9/pH6e8hrPxJnqV3Xi7Yhuum1b+Xf2cS FGKKXx051TQJ62VKNLL4dvN1MFSdl1o= X-MC-Unique: jPAjKx-wP-uvfF6s-6j4ZQ-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 15/31] conf: Rename 'nodestorage' field of virStorageSource to 'nodenamestorage' Date: Mon, 16 Oct 2023 17:01:42 +0200 Message-ID: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.2 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.10 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1697468644718100002 Content-Type: text/plain; charset="utf-8" While the name itself doesn't matter, this rename is done to prove that all places using 'nodestorage' were converted to the appropriate accessors. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/conf/storage_source_conf.c | 4 ++-- src/conf/storage_source_conf.h | 2 +- src/qemu/qemu_block.c | 8 ++++---- src/qemu/qemu_blockjob.c | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/conf/storage_source_conf.c b/src/conf/storage_source_conf.c index 61a433ab1f..ea171f9945 100644 --- a/src/conf/storage_source_conf.c +++ b/src/conf/storage_source_conf.c @@ -829,7 +829,7 @@ virStorageSourceCopy(const virStorageSource *src, def->snapshot =3D g_strdup(src->snapshot); def->configFile =3D g_strdup(src->configFile); def->nodeformat =3D g_strdup(src->nodeformat); - def->nodestorage =3D g_strdup(src->nodestorage); + def->nodenamestorage =3D g_strdup(src->nodenamestorage); def->compat =3D g_strdup(src->compat); def->tlsAlias =3D g_strdup(src->tlsAlias); def->tlsCertdir =3D g_strdup(src->tlsCertdir); @@ -1168,7 +1168,7 @@ virStorageSourceClear(virStorageSource *def) virStorageAuthDefFree(def->auth); virObjectUnref(def->privateData); - VIR_FREE(def->nodestorage); + VIR_FREE(def->nodenamestorage); VIR_FREE(def->nodeformat); virStorageSourceBackingStoreClear(def); diff --git a/src/conf/storage_source_conf.h b/src/conf/storage_source_conf.h index fc6c67f426..e9525c8f65 100644 --- a/src/conf/storage_source_conf.h +++ b/src/conf/storage_source_conf.h @@ -371,7 +371,7 @@ struct _virStorageSource { /* metadata that allows identifying given storage source */ char *nodeformat; /* name of the format handler object */ - char *nodestorage; /* name of the storage object */ + char *nodenamestorage; /* name of the storage object */ /* An optional setting to enable usage of TLS for the storage source */ virTristateBool haveTLS; diff --git a/src/qemu/qemu_block.c b/src/qemu/qemu_block.c index 7355cb0b5e..a2414dc2e3 100644 --- a/src/qemu/qemu_block.c +++ b/src/qemu/qemu_block.c @@ -64,8 +64,8 @@ void qemuBlockStorageSourceSetStorageNodename(virStorageSource *src, char *nodename) { - g_free(src->nodestorage); - src->nodestorage =3D nodename; + g_free(src->nodenamestorage); + src->nodenamestorage =3D nodename; } @@ -83,7 +83,7 @@ qemuBlockStorageSourceGetEffectiveStorageNodename(virStor= ageSource *src) src->sliceStorage->nodename) return src->sliceStorage->nodename; - return src->nodestorage; + return src->nodenamestorage; } @@ -96,7 +96,7 @@ qemuBlockStorageSourceGetEffectiveStorageNodename(virStor= ageSource *src) const char * qemuBlockStorageSourceGetStorageNodename(virStorageSource *src) { - return src->nodestorage; + return src->nodenamestorage; } diff --git a/src/qemu/qemu_blockjob.c b/src/qemu/qemu_blockjob.c index 25ac74d6c4..12f3d59df5 100644 --- a/src/qemu/qemu_blockjob.c +++ b/src/qemu/qemu_blockjob.c @@ -612,7 +612,7 @@ qemuBlockJobCleanStorageSourceRuntime(virStorageSource = *src) src->detected =3D false; VIR_FREE(src->relPath); VIR_FREE(src->backingStoreRaw); - VIR_FREE(src->nodestorage); + VIR_FREE(src->nodenamestorage); VIR_FREE(src->nodeformat); VIR_FREE(src->tlsAlias); VIR_FREE(src->tlsCertdir); --=20 2.41.0 From nobody Tue May 21 05:15:37 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 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=1697468576; cv=none; d=zohomail.com; s=zohoarc; b=PhG34+SC+D0yOgaNoTX9ImHCuQZltNWieWWQ5R+PuflOkbWCKoBje3qwlbqPGzSF7UpZy29fDTCuL44FJxQ+nGJtfEEV6dqP8KBO+qUAm6raM1QrFw1pr/KzZJSQH4PgjKdzD2wkXj6Qaqn493IM7kAgvnJnHtG01+L72DXOWUE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1697468576; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=9ejFReBsIMdLGppc0GGaLId3ZWV8mcJuqQoEr8QV2HI=; b=P8CkP9+hZ74/eXBuqHGnQlALgSLaCevzE9evGyxYVUbAHlz9bQS2LPUBOyY/zPKbCZ0VBJuN7wJSlGRefcvBKeqSlAi3TwMKXvXFa8DaLjVDn7KpyYNVM2pRs9h/3kO+yojYNY+usnXcuxXE13ncbtMFku4cjzYlZFMjbpbR8OM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1697468576637990.0779588990569; Mon, 16 Oct 2023 08:02:56 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-199-MtQqLRTvOQ2jZ0gak_r_1w-1; Mon, 16 Oct 2023 11:02:48 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 82F91280D215; Mon, 16 Oct 2023 15:02:17 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6B0BF25C8; Mon, 16 Oct 2023 15:02:17 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 1D72D19465A8; Mon, 16 Oct 2023 15:02:17 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id F09B01946587 for ; Mon, 16 Oct 2023 15:02:15 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id DF5AF40C6F7F; Mon, 16 Oct 2023 15:02:15 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.45.242.10]) by smtp.corp.redhat.com (Postfix) with ESMTP id 30B5940C6CA0 for ; Mon, 16 Oct 2023 15:02:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1697468575; 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=9ejFReBsIMdLGppc0GGaLId3ZWV8mcJuqQoEr8QV2HI=; b=DUvs/JUpvnkPQbPPpHYbnggSRYxg/WbKj90zNm6ZvoFRDy+8IpW+j203Za/ykfmXH7A6vS wem+6uR8GXFiciZnuoV8Aje1wVxC5wGgqzrYWx6NMYxsQiG2gQufmfFuuad5h3GdHpNmGJ I5tZJKkeeDSejkwbPfX/q/Un7caYaqA= X-MC-Unique: MtQqLRTvOQ2jZ0gak_r_1w-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 16/31] qemu: block: Add accessors for format layer node names Date: Mon, 16 Oct 2023 17:01:43 +0200 Message-ID: <365ec8761350814181051acc91842384110ceb14.1697468414.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.2 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1697468580296100001 Content-Type: text/plain; charset="utf-8" Introduce a set of accessors, which return node names based on semantics. This will allow to us to modify how we setup the backing chain in cases when e.g. the format driver can be omitted, without breaking all the code. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_block.c | 31 +++++++++++++++++++++++++++++++ src/qemu/qemu_block.h | 7 +++++++ 2 files changed, 38 insertions(+) diff --git a/src/qemu/qemu_block.c b/src/qemu/qemu_block.c index a2414dc2e3..cba1fb1c1e 100644 --- a/src/qemu/qemu_block.c +++ b/src/qemu/qemu_block.c @@ -69,6 +69,23 @@ qemuBlockStorageSourceSetStorageNodename(virStorageSourc= e *src, } +/** + * qemuBlockStorageSourceSetFormatNodename: + * @src: virStorageSource to set the format nodename + * @nodename: The node name to set (stolen) + * + * Sets @nodename as the format node name of @src. Using NULL @nodename cl= ears + * the nodename. @src takes ownership of @nodename. + */ +void +qemuBlockStorageSourceSetFormatNodename(virStorageSource *src, + char *nodename) +{ + g_free(src->nodeformat); + src->nodeformat =3D nodename; +} + + /** * qemuBlockStorageSourceGetEffectiveStorageNodename: * @src: virStorageSource to get the effective nodename of @@ -100,6 +117,20 @@ qemuBlockStorageSourceGetStorageNodename(virStorageSou= rce *src) } +/** + * qemuBlockStorageSourceGetFormatNodename: + * @src: virStorageSource to get the effective nodename of + * + * Gets the nodename corresponding to the format layer. Useful when access= ing + * format specific features. Returns NULL if there is no format layer. + */ +const char * +qemuBlockStorageSourceGetFormatNodename(virStorageSource *src) +{ + return src->nodeformat; +} + + /** * qemuBlockStorageSourceSupportsConcurrentAccess: * @src: disk storage source diff --git a/src/qemu/qemu_block.h b/src/qemu/qemu_block.h index ecc5711dcd..6ed0aa85b2 100644 --- a/src/qemu/qemu_block.h +++ b/src/qemu/qemu_block.h @@ -30,12 +30,19 @@ void qemuBlockStorageSourceSetStorageNodename(virStorageSource *src, char *nodename); +void +qemuBlockStorageSourceSetFormatNodename(virStorageSource *src, + char *nodename); + const char * qemuBlockStorageSourceGetEffectiveStorageNodename(virStorageSource *src); const char * qemuBlockStorageSourceGetStorageNodename(virStorageSource *src); +const char * +qemuBlockStorageSourceGetFormatNodename(virStorageSource *src); + typedef struct qemuBlockNodeNameBackingChainData qemuBlockNodeNameBackingC= hainData; struct qemuBlockNodeNameBackingChainData { --=20 2.41.0 From nobody Tue May 21 05:15:37 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 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=1697468767; cv=none; d=zohomail.com; s=zohoarc; b=UJcN1DckYXT8MnoYJJgJfXV5rdErVga+4LQH+12wKyz+YS93jDeBxMalPw1WFpLL4cFieWl6hU560r2ko80Hn2a540HePArXF6mEq21PDc9V09op87VJUmjNVP059w91hePZ98GIPgennzaN2eZh3XOLegVBW+yXNT+qWqf///4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1697468767; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=5mEMNv1bXWLkrY0Xuim5SxATT0vFVrtn3suLrC8JYYQ=; b=JDouqiDNh6Uf7pJZXgKjIcYMg07yeIWxpJ/kDhO8V3JClXeMys4NlvzZA01YwSVm2CU0+IRIecjO/V92Gdz8hrPM702hUbrBvz+CaIwQZrEBN5Wgs+czB0yGXXivQBdQfKCSfjrmrGB1hWVFC7lA+P3t/Au3pu9lKYsdeJyKAMQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1697468767395205.56461427240345; Mon, 16 Oct 2023 08:06:07 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-201-0X-nC7HfOqq2uee9bm2W_w-1; Mon, 16 Oct 2023 11:02:44 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 96AED18312CA; Mon, 16 Oct 2023 15:02:18 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 80DAD1C060AE; Mon, 16 Oct 2023 15:02:18 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 583B51946588; Mon, 16 Oct 2023 15:02:18 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id C8D98194658D for ; Mon, 16 Oct 2023 15:02:16 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id BB2AB40C6CA3; Mon, 16 Oct 2023 15:02:16 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.45.242.10]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4505640C6CA0 for ; Mon, 16 Oct 2023 15:02:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1697468766; 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=5mEMNv1bXWLkrY0Xuim5SxATT0vFVrtn3suLrC8JYYQ=; b=Q3iTzuoUDqgXCvi8mC4wDUPVpFxEejwB/UhQt393E5wG4BopgUq446HaKM8bBQctxRJeq0 lbzG6MxUMnxIRkAw/jMynPS/PdzWvdruV/ilQh3/O23cd5zU43MYhIC/TcyrTWNRUSgYp3 y58efGMoTgElfLD83oXgmXRE33lecNw= X-MC-Unique: 0X-nC7HfOqq2uee9bm2W_w-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 17/31] qemu: block: Add accessors for storage source effective nodename Date: Mon, 16 Oct 2023 17:01:44 +0200 Message-ID: <57be28cd9385bf2bfbfe5498a73f27cd223c6176.1697468414.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.2 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.7 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1697468769386100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_block.c | 14 ++++++++++++++ src/qemu/qemu_block.h | 3 +++ 2 files changed, 17 insertions(+) diff --git a/src/qemu/qemu_block.c b/src/qemu/qemu_block.c index cba1fb1c1e..10c2c0104b 100644 --- a/src/qemu/qemu_block.c +++ b/src/qemu/qemu_block.c @@ -86,6 +86,20 @@ qemuBlockStorageSourceSetFormatNodename(virStorageSource= *src, } +/** + * qemuBlockStorageSourceGetEffectiveNodename: + * @src: virStorageSource to get the effective nodename of + * + * Gets the nodename that exposes the guest visible data. This function al= ways + * returns a name. + */ +const char * +qemuBlockStorageSourceGetEffectiveNodename(virStorageSource *src) +{ + return src->nodeformat; +} + + /** * qemuBlockStorageSourceGetEffectiveStorageNodename: * @src: virStorageSource to get the effective nodename of diff --git a/src/qemu/qemu_block.h b/src/qemu/qemu_block.h index 6ed0aa85b2..7008a4e7da 100644 --- a/src/qemu/qemu_block.h +++ b/src/qemu/qemu_block.h @@ -43,6 +43,9 @@ qemuBlockStorageSourceGetStorageNodename(virStorageSource= *src); const char * qemuBlockStorageSourceGetFormatNodename(virStorageSource *src); +const char * +qemuBlockStorageSourceGetEffectiveNodename(virStorageSource *src); + typedef struct qemuBlockNodeNameBackingChainData qemuBlockNodeNameBackingC= hainData; struct qemuBlockNodeNameBackingChainData { --=20 2.41.0 From nobody Tue May 21 05:15:37 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 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=1697468587; cv=none; d=zohomail.com; s=zohoarc; b=W15g8zY5tBNf1sEP0leQZ6zRfAA3i+48osjbDeWJ3+ma+yrGAzmu3fShY+9XVWJLBi8VtONLFM22Ft/MKHkJucFYuoR9rH+cAvdjFD2eUfsglJlUq+bKfFwjVpot2h8x8wK9c72fH2RQw2oEw87pRv+IOOf2mql6ksAhIdsEvKk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1697468587; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=F8wvn5tZQ3O5hkWSiVqALsk5Kj0Cs4vgAnoi7rsUNTI=; b=k7ec40f/LN2p2RNSNAipO08CwVrzljOnS26Hp2rXRhpjKM105dg/5c70k/UoqrytNOaFGYVg6bcBtYQpzKA81ycntUG5IjbwGSLRVUoPVS6er1cFdIW36+IEd60C9V6UUr9w7Om367ThbRJctrpYY6K5RRvdLB9gCxbcZsxlCjI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1697468587000769.5754883274628; Mon, 16 Oct 2023 08:03:07 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-270-XTHogH09NUu-RHQaMdwGtA-1; Mon, 16 Oct 2023 11:02:57 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id D2BBA3823358; Mon, 16 Oct 2023 15:02:19 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id BB8DC1C060B0; Mon, 16 Oct 2023 15:02:19 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 8CB001946588; Mon, 16 Oct 2023 15:02:19 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 0E2E01946587 for ; Mon, 16 Oct 2023 15:02:18 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id E322540C6CA0; Mon, 16 Oct 2023 15:02:17 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.45.242.10]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2198040C6F79 for ; Mon, 16 Oct 2023 15:02:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1697468586; 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=F8wvn5tZQ3O5hkWSiVqALsk5Kj0Cs4vgAnoi7rsUNTI=; b=PMkgE+fE76rSkRBIoz4H7lLondRGpW6zZSge4S5GXG16gzL1pUutXP3o3gxvHz8Mhxuyri CacrZmomGJ5UvhYFSMq5ERBtFzuiHDK+xeZmzOrip929KUrZ0LZUvIwyj0yD11iwiE98Pn 5HNKyOpsDvz3QAh9hrxm+6mS/WtAd5Y= X-MC-Unique: XTHogH09NUu-RHQaMdwGtA-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 18/31] qemuBlockStorageSourceGetFormatProps: Use new frontend name accessor Date: Mon, 16 Oct 2023 17:01:45 +0200 Message-ID: <9076acf5e91ea52f45852a0a01f9dd6ad86df919.1697468414.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.2 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.7 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1697468588381100006 Content-Type: text/plain; charset="utf-8" Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_block.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qemu/qemu_block.c b/src/qemu/qemu_block.c index 10c2c0104b..0fa5b6e55d 100644 --- a/src/qemu/qemu_block.c +++ b/src/qemu/qemu_block.c @@ -1418,7 +1418,7 @@ qemuBlockStorageSourceGetFormatProps(virStorageSource= *src, src->format >=3D VIR_STORAGE_FILE_BACKING) { if (virStorageSourceIsBacking(backingStore)) { backingFormatterStr =3D "s:backing"; - backingNodename =3D backingStore->nodeformat; + backingNodename =3D qemuBlockStorageSourceGetEffectiveNodename= (backingStore); } else { /* chain is terminated, indicate that no detection should happ= en in qemu */ backingFormatterStr =3D "n:backing"; --=20 2.41.0 From nobody Tue May 21 05:15:37 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 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=1697468591; cv=none; d=zohomail.com; s=zohoarc; b=jXYfGx+KjkPNDSYOOJAsBchlYASds3R+XQfM3f/e2jU0+HqDMH4+x0Swm+yD1y+5IzL+LL/rReBmCNkc4XAwpdjJ8OgkS0jAZXGi+5ou/ngWZz8YrMgKz2zUQ6DGwKFdtdVNtovElQgxoJzh9sdj5QBJm8vbYl782YrzDg23hek= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1697468591; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=pAU012cCUPzwUpb5NopYPNqOVG1BuMkaIeemwVk+s5w=; b=J6LHXkH8gcEDHRLwusU463z9dO0k0Hsr3V5ruHvr9FWkbvPV7hloUX3EvnUZzL1pXdC3dFpMw3UrtjwN/iEGqeiLbmykI7G+cx0aWVHw/K1v10u2fFhF4ibneJyP2ptUW4OPmSHQnbq8hCHsm2rBFNVuSJUoSs3KEj5PNZVql8s= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1697468591406713.6969987964792; Mon, 16 Oct 2023 08:03:11 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-52-rleMHI3fMw6_2BiR6gfHdA-1; Mon, 16 Oct 2023 11:02:43 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 8DBB3280AA24; Mon, 16 Oct 2023 15:02:20 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 472F6111D3DC; Mon, 16 Oct 2023 15:02:20 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id BE0AE19465A8; Mon, 16 Oct 2023 15:02:19 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id E89731946587 for ; Mon, 16 Oct 2023 15:02:18 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id DA56940C6F79; Mon, 16 Oct 2023 15:02:18 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.45.242.10]) by smtp.corp.redhat.com (Postfix) with ESMTP id 48DCD40C6F7F for ; Mon, 16 Oct 2023 15:02:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1697468590; 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=pAU012cCUPzwUpb5NopYPNqOVG1BuMkaIeemwVk+s5w=; b=DADiXq2ZfkQ5DBUQ8tZUTjNtUNDjaztQ/hBWPLVF61W4Jd1GQf7h+J01I9AMrcWyvAmu+v kRbNHmdGu9d9/Rw/LwOfmWZ2KOUPZphEZ7xQr1jxh1Gn1hdd6OfTO6nkmpEHJbQdm8MsQ1 Jd9xsIwRn5lKO/U1PxzYD6UeYWgfA/8= X-MC-Unique: rleMHI3fMw6_2BiR6gfHdA-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 19/31] qemu: backup: Use format nodename accessors Date: Mon, 16 Oct 2023 17:01:46 +0200 Message-ID: <94a94a221f5b2eb4abc3220a6fa2d6ddf69c692c.1697468414.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.2 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1697468592370100015 Content-Type: text/plain; charset="utf-8" Both modified cases in this patch require the effective nodename as they deal with the data being backed up. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_backup.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/qemu/qemu_backup.c b/src/qemu/qemu_backup.c index e4db967e2c..857709b17e 100644 --- a/src/qemu/qemu_backup.c +++ b/src/qemu/qemu_backup.c @@ -335,9 +335,9 @@ qemuBackupDiskPrepareDataOnePush(virJSONValue *actions, syncmode =3D QEMU_MONITOR_TRANSACTION_BACKUP_SYNC_MODE_INCREMENTAL; if (qemuMonitorTransactionBackup(actions, - dd->domdisk->src->nodeformat, + qemuBlockStorageSourceGetEffectiveNod= ename(dd->domdisk->src), dd->blockjob->name, - dd->store->nodeformat, + qemuBlockStorageSourceGetEffectiveNod= ename(dd->store), dd->incrementalBitmap, syncmode) < 0) return -1; @@ -355,9 +355,9 @@ qemuBackupDiskPrepareDataOnePull(virJSONValue *actions, dd->backupdisk->exportbitmap =3D g_strdup(dd->incrementalBitmap); if (qemuMonitorTransactionBackup(actions, - dd->domdisk->src->nodeformat, + qemuBlockStorageSourceGetEffectiveNod= ename(dd->domdisk->src), dd->blockjob->name, - dd->store->nodeformat, + qemuBlockStorageSourceGetEffectiveNod= ename(dd->store), NULL, QEMU_MONITOR_TRANSACTION_BACKUP_SYNC_= MODE_NONE) < 0) return -1; --=20 2.41.0 From nobody Tue May 21 05:15:37 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 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=1697468587; cv=none; d=zohomail.com; s=zohoarc; b=PZWZM+YY5zOA8mtfmlAy1R0XHh7o9Z3rXkKKucBVbAM9WVp6nLLeEG+nYNfka+Ije9SyPL3JwU+SyRwro9UhThACcTfnEkSr0m91PL2Ir9PpN9DQXQEaBn/IKny80SuwBDyyekuqa+J8vNo+t+uL5wdqvIcFO3lZIslFCaYrE0s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1697468587; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=YqqltvXN1wLfMseiqCoJYr0LAEZ5cPCdByqg1fh6EW8=; b=btBmdH7wH5+6BVpACEf8PTvVZ1i6XsMxutJ+izq43c1HazjTe3mgOxM718zqO5wqd2pfLJi3QWoEMYjeiRab0cwfC/D/YAbSBXXGsBwpBpPN2IWwhG8lKqnPA1Ybdz81CzqoQM9kbPZASHjL9Sd1QPtZiw3X6XOgdGtdvVCbfUU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1697468587290455.9470878411746; Mon, 16 Oct 2023 08:03:07 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-503-Exg6CYDVNxaa5p22kob--g-1; Mon, 16 Oct 2023 11:02:45 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 4203A862F80; Mon, 16 Oct 2023 15:02:21 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 27CA3200A7A2; Mon, 16 Oct 2023 15:02:21 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 02CA91946589; Mon, 16 Oct 2023 15:02:21 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 074091946588 for ; Mon, 16 Oct 2023 15:02:20 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id EC4D840C6F7F; Mon, 16 Oct 2023 15:02:19 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.45.242.10]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3A76840C6CA0 for ; Mon, 16 Oct 2023 15:02:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1697468586; 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=YqqltvXN1wLfMseiqCoJYr0LAEZ5cPCdByqg1fh6EW8=; b=QMPrxtEhkbY53KUTSVxg/LDILuY2mK5IHGVm2R1Z0NH8pCzp+ZnDZk6F0tWXM8LpqjXMGF 0qHJCfbqVOGw9G5Ea1CwIk36VxbNCD/Os7J9oyGQRyeEbNdtcx47Cw0L8OVQ5UcEBBUhZa V95HhKizvPH2FSf3eL1mdNkNOKqvYKU= X-MC-Unique: Exg6CYDVNxaa5p22kob--g-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 20/31] qemu: blockjob: Use 'format' nodename accessors for job naming Date: Mon, 16 Oct 2023 17:01:47 +0200 Message-ID: <53e97febfb6fd3bd7cf0697adb37e804569f0a07.1697468414.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.2 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1697468588377100005 Content-Type: text/plain; charset="utf-8" Use the effective nodename for naming the job as we use that one now. It doesn't matter too much which one we pick, because it's used just for the name of the job, which we preserve in the status XML. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_blockjob.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/qemu/qemu_blockjob.c b/src/qemu/qemu_blockjob.c index 12f3d59df5..cb9948ae2a 100644 --- a/src/qemu/qemu_blockjob.c +++ b/src/qemu/qemu_blockjob.c @@ -252,7 +252,8 @@ qemuBlockJobDiskNewPull(virDomainObj *vm, unsigned int jobflags) { g_autoptr(qemuBlockJobData) job =3D NULL; - g_autofree char *jobname =3D g_strdup_printf("pull-%s-%s", disk->dst, = disk->src->nodeformat); + g_autofree char *jobname =3D g_strdup_printf("pull-%s-%s", disk->dst, + qemuBlockStorageSourceGetEf= fectiveNodename(disk->src)); if (!(job =3D qemuBlockJobDataNew(QEMU_BLOCKJOB_TYPE_PULL, jobname))) return NULL; @@ -278,7 +279,8 @@ qemuBlockJobDiskNewCommit(virDomainObj *vm, unsigned int jobflags) { g_autoptr(qemuBlockJobData) job =3D NULL; - g_autofree char *jobname =3D g_strdup_printf("commit-%s-%s", disk->dst= , top->nodeformat); + g_autofree char *jobname =3D g_strdup_printf("commit-%s-%s", disk->dst, + qemuBlockStorageSourceGetEf= fectiveNodename(top)); qemuBlockJobType jobtype =3D QEMU_BLOCKJOB_TYPE_COMMIT; if (topparent =3D=3D NULL) @@ -309,7 +311,7 @@ qemuBlockJobNewCreate(virDomainObj *vm, { g_autoptr(qemuBlockJobData) job =3D NULL; g_autofree char *jobname =3D NULL; - const char *nodename =3D src->nodeformat; + const char *nodename =3D qemuBlockStorageSourceGetEffectiveNodename(sr= c); if (storage) nodename =3D qemuBlockStorageSourceGetStorageNodename(src); @@ -340,7 +342,8 @@ qemuBlockJobDiskNewCopy(virDomainObj *vm, unsigned int jobflags) { g_autoptr(qemuBlockJobData) job =3D NULL; - g_autofree char *jobname =3D g_strdup_printf("copy-%s-%s", disk->dst, = disk->src->nodeformat); + g_autofree char *jobname =3D g_strdup_printf("copy-%s-%s", disk->dst, + qemuBlockStorageSourceGetEf= fectiveNodename(disk->src)); if (!(job =3D qemuBlockJobDataNew(QEMU_BLOCKJOB_TYPE_COPY, jobname))) return NULL; @@ -368,7 +371,8 @@ qemuBlockJobDiskNewBackup(virDomainObj *vm, g_autoptr(qemuBlockJobData) job =3D NULL; g_autofree char *jobname =3D NULL; - jobname =3D g_strdup_printf("backup-%s-%s", disk->dst, disk->src->node= format); + jobname =3D g_strdup_printf("backup-%s-%s", disk->dst, + qemuBlockStorageSourceGetEffectiveNodename(d= isk->src)); if (!(job =3D qemuBlockJobDataNew(QEMU_BLOCKJOB_TYPE_BACKUP, jobname))) return NULL; --=20 2.41.0 From nobody Tue May 21 05:15:37 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 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=1697468649; cv=none; d=zohomail.com; s=zohoarc; b=ShiC0uz/o5jsyF97u+6eEUZ9QcWEUDShr5wBzPeZ7fdPSD9synacA9ee6RO4o+2zGYzgTbmjC2BLbkX7+i68MQPVH7mfVIlkJ3VYQEg1lfH0Ctg18Q7umnKkVsCzVLcLW/HmmzXJ4bMz0DqmL3h22GpHhhVfoIY8oQ+0g/jLNtc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1697468649; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=vg2aO7MuDfWQzNrrIktsJGk2hlZ/LyOApi7LV2uWoP4=; b=EgKkGWEUuEbiMMhABR2MgLNdW3qGBtSwLsIquFf+bZ3dZypGw4xxMR4O54y9v++4f+rQNtsXKR6e3OIKSxMLfFqMPjEwj+LbPyJzbWkW4YnRcUu7gJyk4mJEBomOWPcryc119kj36SgBFpDmmsaJJo/jXdn2kuzSZwP3Ri2ujjo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1697468649186156.36229548455412; Mon, 16 Oct 2023 08:04:09 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-114-8vxrfvL3PoCrwa7mbdIITQ-1; Mon, 16 Oct 2023 11:02:53 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 235AB81D9E1; Mon, 16 Oct 2023 15:02:22 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0AD2A25C8; Mon, 16 Oct 2023 15:02:22 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id E22181946588; Mon, 16 Oct 2023 15:02:21 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 112161946587 for ; Mon, 16 Oct 2023 15:02:21 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 0624B40C6F79; Mon, 16 Oct 2023 15:02:21 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.45.242.10]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5319840C6CA3 for ; Mon, 16 Oct 2023 15:02:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1697468648; 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=vg2aO7MuDfWQzNrrIktsJGk2hlZ/LyOApi7LV2uWoP4=; b=OxXtfx5GNicX/W2a9+oECVoaouZf2wtdGsvte2uAI3uq46t8JeGzSKDYWCQ860/8I2PO5T ZG6JzBVz9+4XjQ2BtTbEzzVzXp/deWJBKEEFwss3w1/dIdDw7XSqIf7tMj0GS36JfYdl/R X6ET/RhTRk88KoxcN3uJYzX/zgx+TcY= X-MC-Unique: 8vxrfvL3PoCrwa7mbdIITQ-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 21/31] qemu: block: Use 'format' nodename accessors in '-blockdev' setup code Date: Mon, 16 Oct 2023 17:01:48 +0200 Message-ID: <86a3e0f99c2e7b4dce4ce78849a5ce2399efe551.1697468414.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.2 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1697468650724100012 Content-Type: text/plain; charset="utf-8" Convert the main -blockdev JSON object setup code to use the new accessors. In these we use mainly the real 'format' layer node name. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_block.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/qemu/qemu_block.c b/src/qemu/qemu_block.c index 0fa5b6e55d..852028f014 100644 --- a/src/qemu/qemu_block.c +++ b/src/qemu/qemu_block.c @@ -1282,7 +1282,7 @@ qemuBlockStorageSourceGetBlockdevFormatCommonProps(vi= rStorageSource *src) src->detect_ze= roes); g_autoptr(virJSONValue) props =3D NULL; - if (qemuBlockNodeNameValidate(src->nodeformat) < 0) + if (qemuBlockNodeNameValidate(qemuBlockStorageSourceGetFormatNodename(= src)) < 0) return NULL; if (src->discard) @@ -1296,7 +1296,7 @@ qemuBlockStorageSourceGetBlockdevFormatCommonProps(vi= rStorageSource *src) */ if (virJSONValueObjectAdd(&props, - "s:node-name", src->nodeformat, + "s:node-name", qemuBlockStorageSourceGetForm= atNodename(src), "b:read-only", src->readonly, "S:discard", discard, "S:detect-zeroes", detectZeroes, @@ -1530,7 +1530,7 @@ qemuBlockStorageSourceAttachPrepareBlockdev(virStorag= eSource *src, return NULL; data->storageNodeName =3D qemuBlockStorageSourceGetStorageNodename(src= ); - data->formatNodeName =3D src->nodeformat; + data->formatNodeName =3D qemuBlockStorageSourceGetFormatNodename(src); if (qemuBlockStorageSourceNeedsStorageSliceLayer(src)) { if (!(data->storageSliceProps =3D qemuBlockStorageSourceGetBlockde= vStorageSliceProps(src))) @@ -1748,7 +1748,7 @@ qemuBlockStorageSourceDetachPrepare(virStorageSource = *src) data =3D g_new0(qemuBlockStorageSourceAttachData, 1); - data->formatNodeName =3D src->nodeformat; + data->formatNodeName =3D qemuBlockStorageSourceGetFormatNodename(src); data->formatAttached =3D true; data->storageNodeName =3D qemuBlockStorageSourceGetStorageNodename(src= ); data->storageAttached =3D true; @@ -1941,7 +1941,8 @@ qemuBlockStorageSourceDetachOneBlockdev(virDomainObj = *vm, if (qemuDomainObjEnterMonitorAsync(vm, asyncJob) < 0) return -1; - ret =3D qemuMonitorBlockdevDel(qemuDomainGetMonitor(vm), src->nodeform= at); + ret =3D qemuMonitorBlockdevDel(qemuDomainGetMonitor(vm), + qemuBlockStorageSourceGetFormatNodename(s= rc)); if (ret =3D=3D 0) ret =3D qemuMonitorBlockdevDel(qemuDomainGetMonitor(vm), @@ -1959,8 +1960,8 @@ qemuBlockSnapshotAddBlockdev(virJSONValue *actions, virStorageSource *newsrc) { return qemuMonitorTransactionSnapshotBlockdev(actions, - disk->src->nodeformat, - newsrc->nodeformat); + qemuBlockStorageSourceGe= tEffectiveNodename(disk->src), + qemuBlockStorageSourceGe= tFormatNodename(newsrc)); } --=20 2.41.0 From nobody Tue May 21 05:15:37 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 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=1697468591; cv=none; d=zohomail.com; s=zohoarc; b=TRDJ4iCGIbBK6b85Z319wTBjgcDXJtSWqZLZJBNrpZ7CLWH+R9sOydrmrxCHbIpOimiIGuPDmRPpElsL43PRKswC7+wQeEMHMHdFtsmVQQjlqi+SGc3CwHlo/2Pw532hkokG2KTS2VO1MZ0MVsrLdwK6dofB6jrd4cPsR+0uPuo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1697468591; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=HIQSzfNRm5I1wh+2FLrIlKPIPs7kKgTeWJDxH/VBuQc=; b=W2Zj7QXB5fAx6dx0mxQs6Xnp6qmLWXQiB/azeyElV5Rzhsm7ccAfiAXUL3ryQaqQ2nOHjMll4sAW1d9eP5iwkdIbv+U87oQp/ckYQcfXzglYPBiN69Ab9MrDAyim/aWQEnQHRA+5zruGEiXjuNlim+FOsQE7dCt9maPk1DLwjpo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 169746859154546.96419060366782; Mon, 16 Oct 2023 08:03:11 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-584-a-LbbTJ8NyaqPeu_u_OQdg-1; Mon, 16 Oct 2023 11:03:00 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 5CA7E81DA0C; Mon, 16 Oct 2023 15:02:23 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 49FE31C060AE; Mon, 16 Oct 2023 15:02:23 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 3869A1946588; Mon, 16 Oct 2023 15:02:23 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 1CDB51946597 for ; Mon, 16 Oct 2023 15:02:22 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 09DAD40C6F79; Mon, 16 Oct 2023 15:02:22 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.45.242.10]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5BD6F40C6CA0 for ; Mon, 16 Oct 2023 15:02:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1697468590; 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=HIQSzfNRm5I1wh+2FLrIlKPIPs7kKgTeWJDxH/VBuQc=; b=duD5MdtWoQaTB3zRPNZYCAnniyF8krkgxtVmyeNlL7UviCEtRW7kOp+bB+Y1id1HutR3ah K62Bxnb+Y1dGNsu9X8GrmR9P7Mq2EIQip0JRwYpX9eZMUO4lCdjCz+DHC1aMflsPqStPwL vvCVx9aN6LoF8ZH9IwTJ3h8YaLWt5TY= X-MC-Unique: a-LbbTJ8NyaqPeu_u_OQdg-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 22/31] qemu: domain: Use 'format' layer node name accessors for nodename setup code Date: Mon, 16 Oct 2023 17:01:49 +0200 Message-ID: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.2 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.7 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1697468592406100016 Content-Type: text/plain; charset="utf-8" The code setting the nodenames needs to use the 'true' nodename of the format layer. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_domain.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 1b2f09a316..d8d3a17e55 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -2001,7 +2001,7 @@ qemuStorageSourcePrivateDataParse(xmlXPathContextPtr = ctxt, xmlNodePtr nbdkitnode =3D NULL; qemuBlockStorageSourceSetStorageNodename(src, virXPathString("string(.= /nodenames/nodename[@type=3D'storage']/@name)", ctxt)); - src->nodeformat =3D virXPathString("string(./nodenames/nodename[@type= =3D'format']/@name)", ctxt); + qemuBlockStorageSourceSetFormatNodename(src, virXPathString("string(./= nodenames/nodename[@type=3D'format']/@name)", ctxt)); src->tlsAlias =3D virXPathString("string(./objects/TLSx509/@alias)", c= txt); if (src->sliceStorage) @@ -2112,7 +2112,7 @@ qemuStorageSourcePrivateDataFormat(virStorageSource *= src, g_auto(virBuffer) fdsetsChildBuf =3D VIR_BUFFER_INIT_CHILD(buf); virBufferEscapeString(&nodenamesChildBuf, "\n", qemuBlockStorageSourceGetStorageNodename(src)); - virBufferEscapeString(&nodenamesChildBuf, "\n", src->nodeformat); + virBufferEscapeString(&nodenamesChildBuf, "\n", qemuBlockStorageSourceGetFormatNodename(src)); if (src->sliceStorage) virBufferEscapeString(&nodenamesChildBuf, "\n", @@ -2817,8 +2817,9 @@ qemuDomainVirStorageSourceFindByNodeName(virStorageSo= urce *top, for (tmp =3D top; virStorageSourceIsBacking(tmp); tmp =3D tmp->backing= Store) { const char *nodestorage =3D qemuBlockStorageSourceGetStorageNodena= me(tmp); + const char *nodeformat =3D qemuBlockStorageSourceGetFormatNodename= (tmp); - if ((tmp->nodeformat && STREQ(tmp->nodeformat, nodeName)) || + if ((nodeformat && STREQ(nodeformat, nodeName)) || (nodestorage && STREQ(nodestorage, nodeName))) return tmp; } @@ -11144,10 +11145,11 @@ qemuDomainPrepareStorageSourceBlockdevNodename(vi= rDomainDiskDef *disk, virQEMUDriverConfig *cfg) { char *nodestorage =3D g_strdup_printf("%s-storage", nodenameprefix); + char *nodeformat =3D g_strdup_printf("%s-format", nodenameprefix); /* qemuBlockStorageSourceSetStorageNodename steals 'nodestorage' */ qemuBlockStorageSourceSetStorageNodename(src, nodestorage); - src->nodeformat =3D g_strdup_printf("%s-format", nodenameprefix); + qemuBlockStorageSourceSetFormatNodename(src, nodeformat); if (qemuBlockStorageSourceNeedsStorageSliceLayer(src)) src->sliceStorage->nodename =3D g_strdup_printf("libvirt-%u-slice-= sto", src->id); @@ -11161,8 +11163,7 @@ qemuDomainPrepareStorageSourceBlockdevNodename(virD= omainDiskDef *disk, qemuDomainPrepareStorageSourceConfig(src, cfg); qemuDomainPrepareDiskSourceData(disk, src); - if (qemuDomainSecretStorageSourcePrepareEncryption(priv, src, - src->nodeformat) < = 0) + if (qemuDomainSecretStorageSourcePrepareEncryption(priv, src, nodeform= at) < 0) return -1; if (!qemuDomainPrepareStorageSourceNbdkit(src, cfg, nodestorage, priv)= ) { @@ -11698,7 +11699,7 @@ qemuDomainInitializePflashStorageSource(virDomainOb= j *vm, pflash0->path =3D g_strdup(def->os.loader->path); pflash0->readonly =3D false; virTristateBoolToBool(def->os.loader->readonly, &pflash0->readonly); - pflash0->nodeformat =3D g_strdup("libvirt-pflash0-format"); + qemuBlockStorageSourceSetFormatNodename(pflash0, g_strdup("libvirt-pfl= ash0-format")); qemuBlockStorageSourceSetStorageNodename(pflash0, g_strdup("libvirt-pf= lash0-storage")); if (def->os.loader->nvram) { --=20 2.41.0 From nobody Tue May 21 05:15:37 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 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=1697468645; cv=none; d=zohomail.com; s=zohoarc; b=SU0oSRsXDJR92Djeqf875gxxT/CiJM/0pajWxFC42X7Wtjmue7VxwEq/HZAKrPT91cHYi/FbyuFGnonpIk2JLfyBfqfxppgUHRsPvEA2MiH+69c7tM6l+Tg0lVzbtUY19SMlD6KIGA8bZN4EWyHbatMJcYD09AkOUF0qmjsQq2c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1697468645; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=01Eu5KzbWIE521u3k9KzKNLIHFFu5lJPF021pDAiJvk=; b=dSms6OLCGZ0D/SZqHUSjAn+e3VI751R7pCSTHeso055vRcaCoGO0mAKDSKSwKfIhPWCJaO7295mff5uK13VuKtGKLqaZGYx44hRKbfT+LMBmowqBqtSbAQKpCvuvwk2CaGBxFwAPAR8R4Hh2vEXRaKl47J4xJV66OFqUyJokD7s= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1697468645649182.16795257972842; Mon, 16 Oct 2023 08:04:05 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-601-ccvA06DAOdiz9r9SjTEIsg-1; Mon, 16 Oct 2023 11:02:53 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 495A03857B7D; Mon, 16 Oct 2023 15:02:24 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 30BC120296DB; Mon, 16 Oct 2023 15:02:24 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 25F9D194658F; Mon, 16 Oct 2023 15:02:24 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 1A3461946587 for ; Mon, 16 Oct 2023 15:02:23 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id F21B640C6F7F; Mon, 16 Oct 2023 15:02:22 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.45.242.10]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6C2E640C6F79 for ; Mon, 16 Oct 2023 15:02:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1697468644; 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=01Eu5KzbWIE521u3k9KzKNLIHFFu5lJPF021pDAiJvk=; b=Xk94QRBfrm6rDKcwv1TE8vJcHcQDoKxoiXZ3yrvSUFuqo0Qlry14xczS23l7xJ/iCgjgMJ kXXC3QK3FhwRIh9RZuBunLVtNE81HoqvN+ugypD1mGLpMZFQ3hz64eVFDkbBHZT0d0lVDg 9zeegh4qHkUhSosxgTd4d1SQJfml+0o= X-MC-Unique: ccvA06DAOdiz9r9SjTEIsg-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 23/31] tests: Use 'format' layer nodename accessors in test code Date: Mon, 16 Oct 2023 17:01:50 +0200 Message-ID: <0eeb610b0fd1267f908369cd5c3be445316692f1.1697468414.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.2 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1697468646682100006 Content-Type: text/plain; charset="utf-8" The test code cares mostly about the actual layer nodenames thus, appropriate accessors are used. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- tests/qemublocktest.c | 10 +++++----- tests/qemumonitorjsontest.c | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/qemublocktest.c b/tests/qemublocktest.c index 9a72a67ce2..addd646071 100644 --- a/tests/qemublocktest.c +++ b/tests/qemublocktest.c @@ -241,7 +241,7 @@ testQemuDiskXMLToJSONFakeSecrets(virStorageSource *src) srcpriv->encinfo[0] =3D g_new0(qemuDomainSecretInfo, 1); srcpriv->encinfo[0]->alias =3D g_strdup_printf("%s-encalias", - NULLSTR(src->nodeform= at)); + qemuBlockStorageSourc= eGetFormatNodename(src)); srcpriv->enccount =3D 1; } @@ -653,7 +653,7 @@ testQemuBitmapListPrint(const char *title, for (; next; next =3D next->next) { virStorageSource *src =3D next->data; - virBufferAsprintf(buf, "%s\n", src->nodeformat); + virBufferAsprintf(buf, "%s\n", qemuBlockStorageSourceGetFormatNode= name(src)); } } @@ -668,7 +668,7 @@ testQemuBackupIncrementalBitmapCalculateGetFakeImage(si= ze_t idx) ret->format =3D VIR_STORAGE_FILE_QCOW2; ret->path =3D g_strdup_printf("/image%zu", idx); qemuBlockStorageSourceSetStorageNodename(ret, g_strdup_printf("libvirt-= %zu-storage", idx)); - ret->nodeformat =3D g_strdup_printf("libvirt-%zu-format", idx); + qemuBlockStorageSourceSetFormatNodename(ret, g_strdup_printf("libvirt-%= zu-format", idx)); return ret; } @@ -741,7 +741,7 @@ testQemuBackupIncrementalBitmapCalculate(const void *op= aque) } target =3D virStorageSourceNew(); - target->nodeformat =3D g_strdup_printf("target_node"); + qemuBlockStorageSourceSetFormatNodename(target, g_strdup_printf("targe= t_node")); if (qemuBackupDiskPrepareOneBitmapsChain(data->chain, target, @@ -872,7 +872,7 @@ testQemuBlockBitmapBlockcopy(const void *opaque) g_autoptr(virStorageSource) fakemirror =3D virStorageSourceNew(); g_auto(virBuffer) buf =3D VIR_BUFFER_INITIALIZER; - fakemirror->nodeformat =3D g_strdup("mirror-format-node"); + qemuBlockStorageSourceSetFormatNodename(fakemirror, g_strdup("mirror-f= ormat-node")); expectpath =3D g_strdup_printf("%s/%s%s-out.json", abs_srcdir, blockcopyPrefix, data->name); diff --git a/tests/qemumonitorjsontest.c b/tests/qemumonitorjsontest.c index 6b82e3841b..6293b416bd 100644 --- a/tests/qemumonitorjsontest.c +++ b/tests/qemumonitorjsontest.c @@ -2600,7 +2600,7 @@ testQemuMonitorJSONBlockdevReopen(const void *opaque) src->format =3D VIR_STORAGE_FILE_QCOW2; src->readonly =3D true; - src->nodeformat =3D g_strdup("test node"); + qemuBlockStorageSourceSetFormatNodename(src, g_strdup("test node")); qemuBlockStorageSourceSetStorageNodename(src, g_strdup("backing nodena= me")); src->backingStore =3D virStorageSourceNew(); --=20 2.41.0 From nobody Tue May 21 05:15:37 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 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=1697468598; cv=none; d=zohomail.com; s=zohoarc; b=XFq8S794fcRx7UMGpNoQWH0k0SzTo0xv2vt8sbzoij08sJXbFSkNH1AAdk5vyhw73M7yJUg9Y+5c0HogxMZuZ08kT6GUeVitiCI4fyqsACw5M4s13lgzXOmdkfx0tBBHZ4H8ffB7sW70A7fhf9iXb/UDb6Edaec9FTLH4QSR6wM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1697468598; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=b2a+ci6qBrx+68xYpQnAAnXcI43dY//phxlFDmyVSvc=; b=HwqN/nFWatDElbkgOzLp/TwAgbsfzXvu5fm37ScrOgjO8BqBJqk1Vgxt8kN5y0Ce5fTjVphwXI3HNYfFxyN8vnjyEcgPMeNv83pJqmb7hMVa99caosIvcP45oZqrBniV9P21gdd9b5CRa6ouNQAXjgGjIt5lUmR1sMHjVaEEJco= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 16974685986751003.7036437707275; Mon, 16 Oct 2023 08:03:18 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-284-U2yuXop5N_Sx0XzY40g1uQ-1; Mon, 16 Oct 2023 11:02:57 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id AF88F8582AF; Mon, 16 Oct 2023 15:02:25 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 976DF25C8; Mon, 16 Oct 2023 15:02:25 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 78BDF194658C; Mon, 16 Oct 2023 15:02:25 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 079C21946587 for ; Mon, 16 Oct 2023 15:02:24 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id E928A40C6CA4; Mon, 16 Oct 2023 15:02:23 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.45.242.10]) by smtp.corp.redhat.com (Postfix) with ESMTP id 583FF40C6CA0 for ; Mon, 16 Oct 2023 15:02:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1697468597; 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=b2a+ci6qBrx+68xYpQnAAnXcI43dY//phxlFDmyVSvc=; b=ZB89ukp7kSNECyfBZ4hZJoZTVpqFJBqBe/BSJWQBFCu/2wvwpuf/XgJvD0tYocMDGYKnvk DGOOHNsEfm3EUZV4mvDeFUZBBwnhaH6GwnXFcRAh1IhWFzY3HuCOp1IuNxb9ie1FrdT94m tGcM/ftryHOCv+Dyv6HYw6fi0mCoflc= X-MC-Unique: U2yuXop5N_Sx0XzY40g1uQ-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 24/31] qemu: Convert disk backend setup code to use 'format' nodename accessors Date: Mon, 16 Oct 2023 17:01:51 +0200 Message-ID: <20c253571974db9cc480e8b2e7ebd1bd6f7928a8.1697468414.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.2 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1697468600416100001 Content-Type: text/plain; charset="utf-8" The disk backend setup code is concerned only about the effective nodename. Doing this conversion will also simplify further changes needed to drop the 'raw' layer in cases when it's not really needed. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_block.c | 6 +++--- src/qemu/qemu_domain.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/qemu/qemu_block.c b/src/qemu/qemu_block.c index 852028f014..4c1a711dd3 100644 --- a/src/qemu/qemu_block.c +++ b/src/qemu/qemu_block.c @@ -1980,7 +1980,7 @@ qemuBlockStorageGetCopyOnReadProps(virDomainDiskDef *= disk) ignore_value(virJSONValueObjectAdd(&ret, "s:driver", "copy-on-read", "s:node-name", priv->nodeCopyOnRead, - "s:file", disk->src->nodeformat, + "s:file", qemuBlockStorageSourceGet= EffectiveNodename(disk->src), "s:discard", "unmap", NULL)); @@ -2735,10 +2735,10 @@ qemuBlockStorageSourceCreateDetectSize(GHashTable *= blockNamedNodeData, { qemuBlockNamedNodeData *entry; - if (!(entry =3D virHashLookup(blockNamedNodeData, templ->nodeformat)))= { + if (!(entry =3D virHashLookup(blockNamedNodeData, qemuBlockStorageSour= ceGetEffectiveNodename(templ)))) { virReportError(VIR_ERR_INTERNAL_ERROR, _("failed to update capacity data for block node '%= 1$s'"), - templ->nodeformat); + qemuBlockStorageSourceGetEffectiveNodename(templ)); return -1; } diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index d8d3a17e55..995aa3f79c 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -7891,7 +7891,7 @@ qemuDomainDiskGetTopNodename(virDomainDiskDef *disk) if (disk->copy_on_read =3D=3D VIR_TRISTATE_SWITCH_ON) return priv->nodeCopyOnRead; - return disk->src->nodeformat; + return qemuBlockStorageSourceGetEffectiveNodename(disk->src); } --=20 2.41.0 From nobody Tue May 21 05:15:37 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 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=1697468644; cv=none; d=zohomail.com; s=zohoarc; b=HfChISqsx+2EGQNA73jzdDwa6Y8EYNhVlN2DDqsykA8vM2DKsTCNsGB0psxmdcZtfxw/KXiaqPdU+H+DosQ4dgZDEKgtZytA1/kq3Evoub3STC8zKIpiI8jzKESc8Osgw2VU+csCZbtHup+mqbAk1ru7nD14OQoM7sGbAXNNVMc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1697468644; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=O+TQULCVqDW38xMQVmN80avtQ7WgeEExl4EKOiHSkYo=; b=Wl6RiRF+cizG5VgmjYwVetiO6/WyqiJqBwfyNVh+p+tJP9pP/9Mt/34lhavTbWR7fIcQ54iwzvIND/z0HaafzSBcfJTpovYxr7VJJv7HmHiEOsxR3RCFKv+UIFjnWDxIxz5tHFIFxypxJHdyLUkxMHaWmC7zVf8wuaM3vhcuv8o= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1697468644629423.970065871213; Mon, 16 Oct 2023 08:04:04 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-672-YhNvBniLMwmof2RauG7Rtw-1; Mon, 16 Oct 2023 11:02:55 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A2C1B857D0C; Mon, 16 Oct 2023 15:02:26 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8BB94C15BBC; Mon, 16 Oct 2023 15:02:26 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 7DC8F1946588; Mon, 16 Oct 2023 15:02:26 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 191F81946588 for ; Mon, 16 Oct 2023 15:02:25 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 0889A40C6CA3; Mon, 16 Oct 2023 15:02:25 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.45.242.10]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4971040C6CA0 for ; Mon, 16 Oct 2023 15:02:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1697468643; 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=O+TQULCVqDW38xMQVmN80avtQ7WgeEExl4EKOiHSkYo=; b=CV/r7HyvZb3AC8nxmCgEFHY7nvAK07H/DaQ0g+3i1x+LMcJphYIY2hxpdBwJz046/o5WoQ 6iWF7kvVOrXvS72gihkTqyskRt5yAuUooQhDFRU8olkWGvZgJ+hD7KwU3jE4i+V0D7oZPh 3pJyCyxdEjWUNW5wKClDJ4K+cquqsqQ= X-MC-Unique: YhNvBniLMwmof2RauG7Rtw-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 25/31] qemu: driver: Convert disk stats code to use 'format' nodename accessors Date: Mon, 16 Oct 2023 17:01:52 +0200 Message-ID: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.2 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.8 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1697468646681100005 Content-Type: text/plain; charset="utf-8" I case of statistics we're interested in the statistics of the effective bitmap whatever it happens to be. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_driver.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 6d95711cbc..2d1d0bb3e2 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -9368,7 +9368,7 @@ qemuDomainBlocksStatsGather(virDomainObj *vm, /* capacity are reported only per node-name so we need to transfer= them */ if (disk && disk->src && - (capstats =3D virHashLookup(blockstats, disk->src->nodeformat)= )) { + (capstats =3D virHashLookup(blockstats, qemuBlockStorageSource= GetEffectiveNodename(disk->src)))) { (*retstats)->capacity =3D capstats->capacity; (*retstats)->physical =3D capstats->physical; (*retstats)->wr_highest_offset =3D capstats->wr_highest_offset; @@ -17348,7 +17348,7 @@ qemuDomainGetStatsBlockExportDisk(virDomainDiskDef = *disk, if (QEMU_DOMAIN_DISK_PRIVATE(disk)->qomName) { frontendalias =3D QEMU_DOMAIN_DISK_PRIVATE(disk)->qomName; - backendalias =3D n->nodeformat; + backendalias =3D qemuBlockStorageSourceGetEffectiveNodename(n); backendstoragealias =3D qemuBlockStorageSourceGetStorageNodena= me(n); } else { /* alias may be NULL if the VM is not running */ @@ -17402,7 +17402,7 @@ qemuDomainGetStatsBlockExportDisk(virDomainDiskDef = *disk, return -1; if (qemuDomainGetStatsOneBlock(driver, cfg, dom, params, - disk->mirror->nodeformat, + qemuBlockStorageSourceGetEffect= iveNodename(disk->mirror), disk->mirror, *recordnr, stats) < 0) @@ -17431,7 +17431,7 @@ qemuDomainGetStatsBlockExportDisk(virDomainDiskDef = *disk, return -1; if (qemuDomainGetStatsOneBlock(driver, cfg, dom, param= s, - backupdisk->store->node= format, + qemuBlockStorageSourceG= etEffectiveNodename(backupdisk->store), backupdisk->store, *recordnr, stats) < 0) --=20 2.41.0 From nobody Tue May 21 05:15:37 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 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=1697468579; cv=none; d=zohomail.com; s=zohoarc; b=l/Ta8PXV9BngySbjPGrq6UEvJLYfIXxpRYVvn7K0UG3vtAqzh93Eh6iMLKdJs/lm7z8ZCczqqjhmxoBriWMQM5Y2TbUAwgpVoPkSsFFgzA3ZYSjtCaXK4cPMsanMiC8VZOpBHUKmLi9yv9TaKjEfj39q1kI61RR6WCV0Bid7Mww= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1697468579; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=jDQtmdZ1lJZ2S7CepY/aIYJMK7ivuqy75Nxsz7k0hjA=; b=EJbIstuhK2BERqm059VtUzZC4pm1jfcYkQZIvZst6mQwt1m6rSlt2veQuZ3XMVLBzMo8DmA70Gw0QT08qBEn9RPH0KWvb1SLZ9a+GsNZAoeoL3UkQhwCKtkKASIglqnSZNDY/pX4k1v4jIITMRrEEKPX0TPIGLX+ZgIEidXZAwU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1697468579929753.2920030296793; Mon, 16 Oct 2023 08:02:59 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-338-qunJHdFINcKMg4qd0yICJw-1; Mon, 16 Oct 2023 11:02:51 -0400 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 068368E8C60; Mon, 16 Oct 2023 15:02:28 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id E322A492BEF; Mon, 16 Oct 2023 15:02:27 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id B7A541946588; Mon, 16 Oct 2023 15:02:27 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id ACB5919465A3 for ; Mon, 16 Oct 2023 15:02:26 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 9066140C6F7F; Mon, 16 Oct 2023 15:02:26 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.45.242.10]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6577F40C6F79 for ; Mon, 16 Oct 2023 15:02:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1697468578; 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=jDQtmdZ1lJZ2S7CepY/aIYJMK7ivuqy75Nxsz7k0hjA=; b=gEcMi5C+3IffipoqGI0q/SEVD8EpsOapaHKOGGuLLgBjmBmMDkqC5awBWGsinD1DZlBJO9 Q5wQWL6R23R2YY8Ys+FdWLkDelGfsCeToGx3OYVIWRn/ASwrBTwbZX3de4aiiuVFGRcOkh cf9hY9WU0jrO00bi8DQbfWi1H3a4jsA= X-MC-Unique: qunJHdFINcKMg4qd0yICJw-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 26/31] qemu: Use 'format' nodename accessors for block dirty bitmap operations Date: Mon, 16 Oct 2023 17:01:53 +0200 Message-ID: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.2 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.9 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1697468580296100002 Content-Type: text/plain; charset="utf-8" In most cases the bitmap operations are relevant only on qcow2 images thus the 'format' layer will be present. Although in certain specific cases temporary bitmaps can be created on top of other images as well, thus we use the 'effective' bitmap name in all cases for bitmap operations. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_block.c | 27 ++++++++++++++------------- src/qemu/qemu_blockjob.c | 4 ++-- src/qemu/qemu_checkpoint.c | 9 +++++---- src/qemu/qemu_driver.c | 7 ++++--- src/qemu/qemu_snapshot.c | 6 ++++-- 5 files changed, 29 insertions(+), 24 deletions(-) diff --git a/src/qemu/qemu_block.c b/src/qemu/qemu_block.c index 4c1a711dd3..edc8edcb70 100644 --- a/src/qemu/qemu_block.c +++ b/src/qemu/qemu_block.c @@ -2807,7 +2807,8 @@ qemuBlockNamedNodeDataGetBitmapByName(GHashTable *blo= ckNamedNodeData, qemuBlockNamedNodeData *nodedata; size_t i; - if (!(nodedata =3D virHashLookup(blockNamedNodeData, src->nodeformat))) + if (!(nodedata =3D virHashLookup(blockNamedNodeData, + qemuBlockStorageSourceGetEffectiveNoden= ame(src)))) return NULL; for (i =3D 0; i < nodedata->nbitmaps; i++) { @@ -2863,7 +2864,7 @@ qemuBlockGetBitmapMergeActionsGetBitmaps(virStorageSo= urce *topsrc, /* for now it doesn't make sense to consider bitmaps which are not pre= sent * in @topsrc as we can't recreate a bitmap for a layer if it's missin= g */ - if (!(entry =3D virHashLookup(blockNamedNodeData, topsrc->nodeformat))) + if (!(entry =3D virHashLookup(blockNamedNodeData, qemuBlockStorageSour= ceGetEffectiveNodename(topsrc)))) return NULL; for (i =3D 0; i < entry->nbitmaps; i++) { @@ -2972,7 +2973,7 @@ qemuBlockGetBitmapMergeActions(virStorageSource *tops= rc, granularity =3D bitmap->granularity; if (qemuMonitorTransactionBitmapMergeSourceAddBitmap(merge, - n->nodefo= rmat, + qemuBlock= StorageSourceGetEffectiveNodename(n), bitmap->n= ame) < 0) return -1; } @@ -2982,7 +2983,7 @@ qemuBlockGetBitmapMergeActions(virStorageSource *tops= rc, target, curbi= tmap))) { if (qemuMonitorTransactionBitmapAdd(act, - target->nodeformat, + qemuBlockStorageSourceGetE= ffectiveNodename(target), mergebitmapname, mergebitmappersistent, mergebitmapdisabled, @@ -2992,18 +2993,18 @@ qemuBlockGetBitmapMergeActions(virStorageSource *to= psrc, if (writebitmapsrc && qemuMonitorTransactionBitmapMergeSourceAddBitmap(merge, - writebitmapsr= c->nodeformat, + qemuBlockStor= ageSourceGetEffectiveNodename(writebitmapsrc), "libvirt-tmp-= activewrite") < 0) return -1; - if (qemuMonitorTransactionBitmapMerge(act, target->nodeformat, + if (qemuMonitorTransactionBitmapMerge(act, qemuBlockStorageSourceG= etEffectiveNodename(target), mergebitmapname, &merge) < 0) return -1; } done: if (writebitmapsrc && - qemuMonitorTransactionBitmapRemove(act, writebitmapsrc->nodeformat, + qemuMonitorTransactionBitmapRemove(act, qemuBlockStorageSourceGetE= ffectiveNodename(writebitmapsrc), "libvirt-tmp-activewrite") < 0) return -1; @@ -3578,8 +3579,8 @@ qemuBlockCommit(virDomainObj *vm, rc =3D qemuMonitorBlockCommit(priv->mon, qemuDomainDiskGetTopNodename(disk), job->name, - topSource->nodeformat, - baseSource->nodeformat, + qemuBlockStorageSourceGetEffectiveNodename= (topSource), + qemuBlockStorageSourceGetEffectiveNodename= (baseSource), backingPath, bandwidth, autofinalize); @@ -3663,7 +3664,7 @@ qemuBlockPivot(virDomainObj *vm, bitmapactions =3D virJSONValueNewArray(); if (qemuMonitorTransactionBitmapAdd(bitmapactions, - disk->mirror->nodeformat, + qemuBlockStorageSourceGetE= ffectiveNodename(disk->mirror), "libvirt-tmp-activewrite", false, false, @@ -3684,8 +3685,8 @@ qemuBlockPivot(virDomainObj *vm, reopenactions =3D virJSONValueNewArray(); if (qemuMonitorTransactionSnapshotBlockdev(reopenactions, - disk->mirror->b= ackingStore->nodeformat, - disk->mirror->n= odeformat)) + qemuBlockStorag= eSourceGetEffectiveNodename(disk->mirror->backingStore), + qemuBlockStorag= eSourceGetFormatNodename(disk->mirror))) return -1; } @@ -3696,7 +3697,7 @@ qemuBlockPivot(virDomainObj *vm, bitmapactions =3D virJSONValueNewArray(); if (qemuMonitorTransactionBitmapAdd(bitmapactions, - job->data.commit.base->nodefor= mat, + qemuBlockStorageSourceGetEffec= tiveNodename(job->data.commit.base), "libvirt-tmp-activewrite", false, false, diff --git a/src/qemu/qemu_blockjob.c b/src/qemu/qemu_blockjob.c index cb9948ae2a..0913a224e3 100644 --- a/src/qemu/qemu_blockjob.c +++ b/src/qemu/qemu_blockjob.c @@ -1301,7 +1301,7 @@ qemuBlockJobProcessEventFailedActiveCommit(virQEMUDri= ver *driver, return; qemuMonitorBitmapRemove(priv->mon, - disk->mirror->nodeformat, + qemuBlockStorageSourceGetEffectiveNodename(dis= k->mirror), "libvirt-tmp-activewrite"); qemuDomainObjExitMonitor(vm); @@ -1388,7 +1388,7 @@ qemuBlockJobProcessEventConcludedBackup(virQEMUDriver= *driver, if (job->data.backup.bitmap) qemuMonitorBitmapRemove(qemuDomainGetMonitor(vm), - job->disk->src->nodeformat, + qemuBlockStorageSourceGetEffectiveNodename= (job->disk->src), job->data.backup.bitmap); qemuDomainObjExitMonitor(vm); diff --git a/src/qemu/qemu_checkpoint.c b/src/qemu/qemu_checkpoint.c index 8449ed176a..ca58da8fcb 100644 --- a/src/qemu/qemu_checkpoint.c +++ b/src/qemu/qemu_checkpoint.c @@ -154,7 +154,7 @@ qemuCheckpointDiscardDiskBitmaps(virStorageSource *src, found =3D true; if (qemuMonitorTransactionBitmapRemove(actions, - n->nodeformat, + qemuBlockStorageSourceGetEf= fectiveNodename(n), bitmapdata->name) < 0) return -1; @@ -395,7 +395,8 @@ qemuCheckpointAddActions(virDomainObj *vm, chkdisk->type !=3D VIR_DOMAIN_CHECKPOINT_TYPE_BITMAP) continue; - if (qemuMonitorTransactionBitmapAdd(actions, domdisk->src->nodefor= mat, + if (qemuMonitorTransactionBitmapAdd(actions, + qemuBlockStorageSourceGetEffec= tiveNodename(domdisk->src), chkdisk->bitmap, true, false, = 0) < 0) return -1; } @@ -704,7 +705,7 @@ qemuCheckpointGetXMLDescUpdateSize(virDomainObj *vm, recoveractions =3D virJSONValueNewArray(); if (qemuMonitorTransactionBitmapRemove(recoveractions, - domdisk->src->nodeforma= t, + qemuBlockStorageSourceG= etEffectiveNodename(domdisk->src), "libvirt-tmp-size-xml")= < 0) goto endjob; } @@ -718,7 +719,7 @@ qemuCheckpointGetXMLDescUpdateSize(virDomainObj *vm, goto endjob; if (qemuMonitorTransactionBitmapRemove(cleanupactions, - domdisk->src->nodeformat, + qemuBlockStorageSourceGetEf= fectiveNodename(domdisk->src), "libvirt-tmp-size-xml") < 0) goto endjob; } diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 2d1d0bb3e2..b286d94ca1 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -13634,7 +13634,7 @@ qemuDomainBlockPullCommon(virDomainObj *vm, goto endjob; if (baseSource) { - nodebase =3D baseSource->nodeformat; + nodebase =3D qemuBlockStorageSourceGetEffectiveNodename(baseSource= ); if (!backingPath && !(backingPath =3D qemuBlockGetBackingStoreString(baseSource, f= alse))) goto endjob; @@ -13642,7 +13642,7 @@ qemuDomainBlockPullCommon(virDomainObj *vm, qemuDomainObjEnterMonitor(vm); ret =3D qemuMonitorBlockStream(priv->mon, - disk->src->nodeformat, + qemuBlockStorageSourceGetEffectiveNodenam= e(disk->src), job->name, nodebase, backingPath, @@ -14327,7 +14327,8 @@ qemuDomainBlockCopyCommon(virDomainObj *vm, ret =3D qemuMonitorBlockdevMirror(priv->mon, job->name, true, qemuDomainDiskGetTopNodename(disk), - mirror->nodeformat, bandwidth, + qemuBlockStorageSourceGetEffectiveNode= name(mirror), + bandwidth, granularity, buf_size, mirror_shallow, syncWrites); diff --git a/src/qemu/qemu_snapshot.c b/src/qemu/qemu_snapshot.c index e52d264826..1962ba4027 100644 --- a/src/qemu/qemu_snapshot.c +++ b/src/qemu/qemu_snapshot.c @@ -959,7 +959,8 @@ qemuSnapshotDiskBitmapsPropagate(qemuSnapshotDiskData *= dd, qemuBlockNamedNodeData *entry; size_t i; - if (!(entry =3D virHashLookup(blockNamedNodeData, dd->disk->src->nodef= ormat))) + if (!(entry =3D virHashLookup(blockNamedNodeData, + qemuBlockStorageSourceGetEffectiveNodename= (dd->disk->src)))) return 0; for (i =3D 0; i < entry->nbitmaps; i++) { @@ -969,7 +970,8 @@ qemuSnapshotDiskBitmapsPropagate(qemuSnapshotDiskData *= dd, if (!bitmap->persistent || !bitmap->recording || bitmap->inconsist= ent) continue; - if (qemuMonitorTransactionBitmapAdd(actions, dd->src->nodeformat, + if (qemuMonitorTransactionBitmapAdd(actions, + qemuBlockStorageSourceGetEffec= tiveNodename(dd->src), bitmap->name, true, false, bitmap->granularity) < 0) return -1; --=20 2.41.0 From nobody Tue May 21 05:15:37 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 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=1697468646; cv=none; d=zohomail.com; s=zohoarc; b=VP4DohjsjY+z+nWPSnndPnVm8y8tCdXBewCY2QfMIW2O7vm4p1zKUho4srynSMmWURXV/kgniA7dyxAvMOO9hysX89otkwq9Me6qCvOkdIUEnHS6cZIgxg5myhATvo1y1G137glg77y65sEKz2b+LVXyRxN8UlALD26rsVvYnis= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1697468646; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=vkShEDI6fVIR0xkfr3rrvlVU/EYJ0fZIPoGyiQzEe8M=; b=OIipfExU9+qat2TG9MxEqj98SnSXrurGExH8hW9RpzyLLIN+Z4UL9sLUTp0/dGBmflufdeMCpBGr5EhRX7HO5SX9TPQb80bA2WtmMwZ/ZqoI9lp+l2Etc1cOLO1ViYkdhDUauKc7fQGCv8dUjQb3pJec6+9Hwq3VWd75o7lEMBU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1697468646434199.57412197055487; Mon, 16 Oct 2023 08:04:06 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-515-GxNWZOFVMJG6_bhX0P3UqA-1; Mon, 16 Oct 2023 11:02:54 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 33D7210B0709; Mon, 16 Oct 2023 15:02:29 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1D2C91C060AE; Mon, 16 Oct 2023 15:02:29 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id F004F1946588; Mon, 16 Oct 2023 15:02:28 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 804651946588 for ; Mon, 16 Oct 2023 15:02:27 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 74EAE40C6F79; Mon, 16 Oct 2023 15:02:27 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.45.242.10]) by smtp.corp.redhat.com (Postfix) with ESMTP id E2E0040C6CA3 for ; Mon, 16 Oct 2023 15:02:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1697468645; 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=vkShEDI6fVIR0xkfr3rrvlVU/EYJ0fZIPoGyiQzEe8M=; b=enPG8sXCcBQUkdhNhcq8jkgQWoyHiuReyUQk7DhIvTb90KfVBWERvO90ZLKUfocAuJ8WSX fr5g48emGeIHwVWgU5VbYQoWS4asGtsiAnHktpcs+11Cf6jIWIFNVIr2yDLVu221ZI7bsO FOVYQbivL6Vvi01Taf0Gt9POL2UfZNw= X-MC-Unique: GxNWZOFVMJG6_bhX0P3UqA-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 27/31] qemu: command: Use 'format' nodename accessors for 'pflash' backend setup Date: Mon, 16 Oct 2023 17:01:54 +0200 Message-ID: <00057f6b27d621cd820bae18d2bc8e11f558fdda.1697468414.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.2 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.7 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1697468648784100009 Content-Type: text/plain; charset="utf-8" The frontend device needs to access the blocks directly so it cares about the effective nodename. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_command.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 40de712c61..d40d3a4e13 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -7032,9 +7032,11 @@ qemuBuildMachineCommandLine(virCommand *cmd, if (virDomainDefHasOldStyleUEFI(def)) { if (priv->pflash0) - virBufferAsprintf(&buf, ",pflash0=3D%s", priv->pflash0->nodefo= rmat); + virBufferAsprintf(&buf, ",pflash0=3D%s", + qemuBlockStorageSourceGetEffectiveNodename(p= riv->pflash0)); if (def->os.loader->nvram) - virBufferAsprintf(&buf, ",pflash1=3D%s", def->os.loader->nvram= ->nodeformat); + virBufferAsprintf(&buf, ",pflash1=3D%s", + qemuBlockStorageSourceGetEffectiveNodename(d= ef->os.loader->nvram)); } if (virDomainNumaHasHMAT(def->numa)) --=20 2.41.0 From nobody Tue May 21 05:15:37 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 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=1697468586; cv=none; d=zohomail.com; s=zohoarc; b=jYQrTJAlzSJRFdlfNobIKMtNal1xU094oKFk5F5MrEjGZRla0eME9GCqXtI+5lsdEF1s3OfdSb7U8wseETytIPohI0NF3ZT0wuevQa7yB/8ilj1QNYk/8ZAQDAkBB+895TDH29hW/jbNJbOa+nWPf8tRTJ+9qbIj17hofT6Rdls= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1697468586; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=VEe0TIUGaI8+yn0EX2NXHUG66IFY2ihecZVDhqDMfiU=; b=Fph+DUwPVdcjhazMkeh/aQqnT/RTulD0o10LjcK3l8zjSb0yv9Kqnd9IqMED/W+KjiINan0DsUNdFAeMyVpH6S/JbB9m0qSSfev+EqiPi5w1nDdB71iNWmgnBh5SdQFS1d4mBRHHC1Y83HRCbKkCPRD7qZ3amUrE3bY2YXM2MI4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1697468586893839.0307072298093; Mon, 16 Oct 2023 08:03:06 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-175-2wvRtYDoN9C04ZsT8Zei2g-1; Mon, 16 Oct 2023 11:02:46 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 5A9D28E8C78; Mon, 16 Oct 2023 15:02:30 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 456D463F51; Mon, 16 Oct 2023 15:02:30 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 33B1B1946589; Mon, 16 Oct 2023 15:02:30 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 4B0161946595 for ; Mon, 16 Oct 2023 15:02:29 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 3B43540C6CA6; Mon, 16 Oct 2023 15:02:29 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.45.242.10]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3B3C940C6CA0 for ; Mon, 16 Oct 2023 15:02:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1697468585; 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=VEe0TIUGaI8+yn0EX2NXHUG66IFY2ihecZVDhqDMfiU=; b=gVZ+ckJRVXeNv87zNKOanWgbKhua3pqYLEviGfMbaLMEQVCyCJMJJWjFcRid1z3Jgu1/f5 nJYipmaPf4vYMsP02b9dHrdiHay13Dr5KMA7umoqALmcQrFiUiWLOTBwZsZAuoqkqum74M G6k1jOMtZCLYh/3g5j/3boxYsj8heuo= X-MC-Unique: 2wvRtYDoN9C04ZsT8Zei2g-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 28/31] qemu: Convert migration setup code to use 'format' layer node name accessors Date: Mon, 16 Oct 2023 17:01:55 +0200 Message-ID: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.2 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.5 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1697468588402100007 Content-Type: text/plain; charset="utf-8" The blockjob, NBD export and setup of the cookie data all care about the effective nodename. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_block.c | 6 +++--- src/qemu/qemu_migration.c | 4 ++-- src/qemu/qemu_migration_cookie.c | 3 ++- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/qemu/qemu_block.c b/src/qemu/qemu_block.c index edc8edcb70..fa31028db3 100644 --- a/src/qemu/qemu_block.c +++ b/src/qemu/qemu_block.c @@ -3406,11 +3406,11 @@ qemuBlockExportAddNBD(virDomainObj *vm, const char *bitmaps[2] =3D { bitmap, NULL }; if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_BLOCK_EXPORT_ADD)) - return qemuMonitorNBDServerAdd(priv->mon, src->nodeformat, + return qemuMonitorNBDServerAdd(priv->mon, qemuBlockStorageSourceGe= tEffectiveNodename(src), exportname, writable, bitmap); - if (!(nbdprops =3D qemuBlockExportGetNBDProps(src->nodeformat, exportn= ame, - writable, bitmaps))) + if (!(nbdprops =3D qemuBlockExportGetNBDProps(qemuBlockStorageSourceGe= tEffectiveNodename(src), + exportname, writable, bitm= aps))) return -1; return qemuMonitorBlockExportAdd(priv->mon, &nbdprops); diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index 7d08df1fc5..949ef6d6d5 100644 --- a/src/qemu/qemu_migration.c +++ b/src/qemu/qemu_migration.c @@ -1012,7 +1012,7 @@ qemuMigrationSrcNBDStorageCopyBlockdevPrepareSource(v= irDomainDiskDef *disk, copysrc->tlsHostname =3D g_strdup(tlsHostname); qemuBlockStorageSourceSetStorageNodename(copysrc, g_strdup_printf("mig= ration-%s-storage", disk->dst)); - copysrc->nodeformat =3D g_strdup_printf("migration-%s-format", disk->d= st); + qemuBlockStorageSourceSetFormatNodename(copysrc, g_strdup_printf("migr= ation-%s-format", disk->dst)); return g_steal_pointer(©src); } @@ -1060,7 +1060,7 @@ qemuMigrationSrcNBDStorageCopyBlockdev(virDomainObj *= vm, if (mon_ret =3D=3D 0) mon_ret =3D qemuMonitorBlockdevMirror(qemuDomainGetMonitor(vm), di= skAlias, true, qemuDomainDiskGetTopNodename(d= isk), - copysrc->nodeformat, + qemuBlockStorageSourceGetEffec= tiveNodename(copysrc), mirror_speed, 0, 0, mirror_sha= llow, syncWrites); diff --git a/src/qemu/qemu_migration_cookie.c b/src/qemu/qemu_migration_coo= kie.c index 7f0b7a3412..ba146960d5 100644 --- a/src/qemu/qemu_migration_cookie.c +++ b/src/qemu/qemu_migration_cookie.c @@ -31,6 +31,7 @@ #include "qemu_domain.h" #include "qemu_migration_cookie.h" #include "qemu_migration_params.h" +#include "qemu_block.h" #define VIR_FROM_THIS VIR_FROM_QEMU @@ -507,7 +508,7 @@ qemuMigrationCookieAddNBD(qemuMigrationCookie *mig, virDomainDiskDef *disk =3D vm->def->disks[i]; qemuBlockStats *entry; - if (!(entry =3D virHashLookup(stats, disk->src->nodeformat))) + if (!(entry =3D virHashLookup(stats, qemuBlockStorageSourceGetEffe= ctiveNodename(disk->src)))) continue; mig->nbd->disks[mig->nbd->ndisks].target =3D g_strdup(disk->dst); --=20 2.41.0 From nobody Tue May 21 05:15:37 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 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=1697468648; cv=none; d=zohomail.com; s=zohoarc; b=Tznzt07hcHHEyHHOgG5qEnm7vJNSY5leL1V5HVDp5gb+8S7R0Vq9G+K4Gf6PzYMfmof6Vbnplqi9yztLYdAlrtZ4Lnzr8TOyUD3aKSgBVsRPyU9jvJ1wgmxswBz5MejAJlzQBwcINVt54V6gJyC/Pjlt00566wpCo5784WzJwoY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1697468648; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=N7Iyri2HNfQj8hJ9uFshk6M7FB9tjJSBEFg8EB9HORM=; b=ncJLn5anJqluyS/SJ9RTwF6/8zzPO+EEWwcivBZZjNmq+IOnU+5tar4IsCYjwO3nwr5dg9c5ow2XilHZqeinYAkcj6WJvUtkPQ1xwPcfneyTYy4pRdmLeIgfggbZgutqxupQ+pMKv3EbF8PlkX0vMQAiqBDxNVCU6dWL8Hnac2Y= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1697468648791363.0097716300105; Mon, 16 Oct 2023 08:04:08 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-648-DP9a8AWoNi-ij8xYIZTZjg-1; Mon, 16 Oct 2023 11:03:06 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A317E1029F49; Mon, 16 Oct 2023 15:02:32 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8EDDE1102E14; Mon, 16 Oct 2023 15:02:32 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 7DA3A194658C; Mon, 16 Oct 2023 15:02:32 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id BE7AF194658D for ; Mon, 16 Oct 2023 15:02:30 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 90D0840C6F7F; Mon, 16 Oct 2023 15:02:30 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.45.242.10]) by smtp.corp.redhat.com (Postfix) with ESMTP id F347040C6CA0 for ; Mon, 16 Oct 2023 15:02:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1697468647; 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=N7Iyri2HNfQj8hJ9uFshk6M7FB9tjJSBEFg8EB9HORM=; b=espfRzcJrbH6vBYZT9LbdA6mYEjRAa2eSC5cc/VZPK8kd6nyEQzbLFj73GTGzorIDGNOOX DEYuSL9cA35vKrltxUIR+2KrRahiEwyObfBpM5Il/fbtLRe+zv7ALlzZB407NAW45L6F95 zXvjoI88OdMssAupsUlVV64G285lEl0= X-MC-Unique: DP9a8AWoNi-ij8xYIZTZjg-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 29/31] qemu: migration: Use 'format' nodename accessors in dirty bitmap migration Date: Mon, 16 Oct 2023 17:01:56 +0200 Message-ID: <80890686c5541a8592b24f2c533134796a5b1272.1697468414.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.2 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1697468650692100011 Content-Type: text/plain; charset="utf-8" The persistent bitmaps are stored in the format layer, using 'effective' bitmap name is the most reasonable approach in this case. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_migration.c | 11 ++++++----- src/qemu/qemu_migration_cookie.c | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index 949ef6d6d5..76da981d08 100644 --- a/src/qemu/qemu_migration.c +++ b/src/qemu/qemu_migration.c @@ -2393,7 +2393,8 @@ qemuMigrationSrcBeginPhaseBlockDirtyBitmaps(qemuMigra= tionCookie *mig, qemuMigrationBlockDirtyBitmapsDisk *disk; GSList *bitmaps =3D NULL; virDomainDiskDef *diskdef =3D vm->def->disks[i]; - qemuBlockNamedNodeData *nodedata =3D virHashLookup(blockNamedNodeD= ata, diskdef->src->nodeformat); + qemuBlockNamedNodeData *nodedata =3D virHashLookup(blockNamedNodeD= ata, + qemuBlockStorageS= ourceGetEffectiveNodename(diskdef->src)); size_t j; if (!nodedata) @@ -4456,7 +4457,7 @@ qemuMigrationSrcRunPrepareBlockDirtyBitmapsMerge(virD= omainObj *vm, granularity =3D b->granularity; if (qemuMonitorTransactionBitmapMergeSourceAddBitmap(merge, - n->no= deformat, + qemuB= lockStorageSourceGetEffectiveNodename(n), b->na= me) < 0) return -1; } @@ -4465,19 +4466,19 @@ qemuMigrationSrcRunPrepareBlockDirtyBitmapsMerge(vi= rDomainObj *vm, bitmap->persistent =3D VIR_TRISTATE_BOOL_YES; if (qemuMonitorTransactionBitmapAdd(actions, - disk->disk->src->nodeforma= t, + qemuBlockStorageSourceGetE= ffectiveNodename(disk->disk->src), bitmap->sourcebitmap, false, false, granularity)= < 0) return -1; if (qemuMonitorTransactionBitmapMerge(actions, - disk->disk->src->nodefor= mat, + qemuBlockStorageSourceGe= tEffectiveNodename(disk->disk->src), bitmap->sourcebitmap, &merge) < 0) return -1; tmpbmp =3D g_new0(qemuDomainJobPrivateMigrateTempBitmap, 1); - tmpbmp->nodename =3D g_strdup(disk->disk->src->nodeformat); + tmpbmp->nodename =3D g_strdup(qemuBlockStorageSourceGetEffecti= veNodename(disk->disk->src)); tmpbmp->bitmapname =3D g_strdup(bitmap->sourcebitmap); tmpbitmaps =3D g_slist_prepend(tmpbitmaps, tmpbmp); } diff --git a/src/qemu/qemu_migration_cookie.c b/src/qemu/qemu_migration_coo= kie.c index ba146960d5..5505fdaf22 100644 --- a/src/qemu/qemu_migration_cookie.c +++ b/src/qemu/qemu_migration_cookie.c @@ -1573,7 +1573,7 @@ qemuMigrationCookieBlockDirtyBitmapsMatchDisks(virDom= ainDef *def, return -1; } - disk->nodename =3D disk->disk->src->nodeformat; + disk->nodename =3D qemuBlockStorageSourceGetEffectiveNodename(disk= ->disk->src); } return 0; --=20 2.41.0 From nobody Tue May 21 05:15:37 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 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=1697468590; cv=none; d=zohomail.com; s=zohoarc; b=mPW6/diqMP3PbjrivJYNtYKBP/MVT8VKUZnTos230WR9qW0mFHVCFHMfAva+eppVj2AkS0ZXMyh4I5/cL04uLiikoYl+BMCRfh5EZUbChVVpeIPdj7wBoNFTjkeJOpPMpvIpJ17e3+qBkGvrljHLUam91iNOxMpcnC/EmCl6etk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1697468590; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=oB4QShmpRQCqrKRlGL6OODrck9iANJPfnepYIMcf/rg=; b=CO1kUzuvcuSx+g8OYhmS2d5QqmbSBjZLj7nCxklUPHmmnfLF3iRRjE9d2ySiudssKQXwt/aicc2xwA5RJ62qmRMu8vTLouTKrgGM9PbVTY9iAaWGaqRFQ3S4zgnQqVdwpG0oZBP70QLxTsQ4kkhmLfIO7gaROkrlF/OP7jaVns0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1697468589940126.2013344221981; Mon, 16 Oct 2023 08:03:09 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-655-VAoxnjhjOSyn3AndLXJG9Q-1; Mon, 16 Oct 2023 11:02:59 -0400 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id E0824857AB1; Mon, 16 Oct 2023 15:02:33 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id C7735492BEE; Mon, 16 Oct 2023 15:02:33 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id B7CCB1946588; Mon, 16 Oct 2023 15:02:33 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 63B2C194658C for ; Mon, 16 Oct 2023 15:02:32 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 521FB40C6F7F; Mon, 16 Oct 2023 15:02:32 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.45.242.10]) by smtp.corp.redhat.com (Postfix) with ESMTP id A5F7740C6F79 for ; Mon, 16 Oct 2023 15:02:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1697468589; 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=oB4QShmpRQCqrKRlGL6OODrck9iANJPfnepYIMcf/rg=; b=GYHTkVFKxc/ziIXzn1rj9qTyMJUuk2OXdZDLI6DKHSoBHwtInUw+v0u7+1+i1/StSjJ06l GkGuyGHNz0Q8wUx8RUsyxcw91jEtyfQC+wruupI3+Hj54iCKhqbt5oJC6B5S2RP3QhjqKA 36tIar9JJjTaIW5JTt1VpoNNNdNYyt8= X-MC-Unique: VAoxnjhjOSyn3AndLXJG9Q-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 30/31] qemu: driver: Use 'format' nodename accessors for disk resize Date: Mon, 16 Oct 2023 17:01:57 +0200 Message-ID: <3f71c6629deed38983d535c024e5688cebfeacbf.1697468414.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.2 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.9 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1697468590400100012 Content-Type: text/plain; charset="utf-8" Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_driver.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index b286d94ca1..43d96739d5 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -9252,7 +9252,7 @@ qemuDomainBlockResize(virDomainPtr dom, } if (!qemuDiskBusIsSD(disk->bus)) { - nodename =3D disk->src->nodeformat; + nodename =3D qemuBlockStorageSourceGetEffectiveNodename(disk->src); } else { if (!(device =3D qemuAliasDiskDriveFromDisk(disk))) goto endjob; --=20 2.41.0 From nobody Tue May 21 05:15:37 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 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=1697468715; cv=none; d=zohomail.com; s=zohoarc; b=K/A8XUtN4ZS3vlvYMthKbXKLOEc67cGZuYfeTufyukuCEE3bD8oIrcDcmWXKshPaiWikqZCAaLjpWHIYrjNQDsZxfZjCMqoVTfgAkF/YsuPJjbYm5dFe1oWcmjEFs8JnHgM6UWplftUbqzpS+Amp+AHkaP7z/beQ2w/c34eMydg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1697468715; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=icesvONkxdz6Frv1z71XtNQ+/jD63UC2wx1QxyJrQGw=; b=gIOIr5sfms8AeoIwwvdVNrNco1y7cMkfiePrdq/w8l+tjczj5A7IS0OH6Wtob7yrShECgyzpKecgQKoW0dY5tGe2A1Kwc1lpibDmgVVvFlpx9Qu+SB/mfgPReSCdjbV/ujRuBOB13Hzm0NS5/viQ4o2Bdk3B4/6V2jiY1SY8J7c= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1697468715461183.62848501631163; Mon, 16 Oct 2023 08:05:15 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-690-rbArMINGOu25OQOL1UTMkQ-1; Mon, 16 Oct 2023 11:03:01 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 2C7F93C170AC; Mon, 16 Oct 2023 15:02:36 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 19AE963F53; Mon, 16 Oct 2023 15:02:36 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 09905194658F; Mon, 16 Oct 2023 15:02:36 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 86842194658F for ; Mon, 16 Oct 2023 15:02:34 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 675A540C6F7F; Mon, 16 Oct 2023 15:02:34 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.45.242.10]) by smtp.corp.redhat.com (Postfix) with ESMTP id CEF6640C6F79 for ; Mon, 16 Oct 2023 15:02:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1697468714; 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=icesvONkxdz6Frv1z71XtNQ+/jD63UC2wx1QxyJrQGw=; b=AS+keeKGMmTuY8PZwIW3SB4ovyMw/jOTJ7eo4xXit2jLtRpPvw9O2J9ip3oy82p18bULpS WLg9bC/hUAoekXpieD4k60TJ/56AExaU4ZITZ0dhTqvcPwbbr0fiK3w7e/DA8QaQM/fAct EtZpmxT6LNEYwnAWFMrrOcl8Rnacxvk= X-MC-Unique: rbArMINGOu25OQOL1UTMkQ-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 31/31] conf: Rename 'nodeformat' field of virStorageSource to 'nodenameformat' Date: Mon, 16 Oct 2023 17:01:58 +0200 Message-ID: <19288e90f77e1808a89da65c79bfa6787e8b60cb.1697468414.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.2 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.5 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1697468717288100001 Content-Type: text/plain; charset="utf-8" While the name itself doesn't matter, this rename is done to prove that all places using 'nodeformat' were converted to the appropriate accessors. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/conf/storage_source_conf.c | 4 ++-- src/conf/storage_source_conf.h | 2 +- src/qemu/qemu_block.c | 8 ++++---- src/qemu/qemu_blockjob.c | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/conf/storage_source_conf.c b/src/conf/storage_source_conf.c index ea171f9945..f974a521b1 100644 --- a/src/conf/storage_source_conf.c +++ b/src/conf/storage_source_conf.c @@ -828,7 +828,7 @@ virStorageSourceCopy(const virStorageSource *src, def->backingStoreRawFormat =3D src->backingStoreRawFormat; def->snapshot =3D g_strdup(src->snapshot); def->configFile =3D g_strdup(src->configFile); - def->nodeformat =3D g_strdup(src->nodeformat); + def->nodenameformat =3D g_strdup(src->nodenameformat); def->nodenamestorage =3D g_strdup(src->nodenamestorage); def->compat =3D g_strdup(src->compat); def->tlsAlias =3D g_strdup(src->tlsAlias); @@ -1169,7 +1169,7 @@ virStorageSourceClear(virStorageSource *def) virObjectUnref(def->privateData); VIR_FREE(def->nodenamestorage); - VIR_FREE(def->nodeformat); + VIR_FREE(def->nodenameformat); virStorageSourceBackingStoreClear(def); diff --git a/src/conf/storage_source_conf.h b/src/conf/storage_source_conf.h index e9525c8f65..5a9b03b610 100644 --- a/src/conf/storage_source_conf.h +++ b/src/conf/storage_source_conf.h @@ -370,7 +370,7 @@ struct _virStorageSource { virStorageFileFormat backingStoreRawFormat; /* metadata that allows identifying given storage source */ - char *nodeformat; /* name of the format handler object */ + char *nodenameformat; /* name of the format handler object */ char *nodenamestorage; /* name of the storage object */ /* An optional setting to enable usage of TLS for the storage source */ diff --git a/src/qemu/qemu_block.c b/src/qemu/qemu_block.c index fa31028db3..0d252552de 100644 --- a/src/qemu/qemu_block.c +++ b/src/qemu/qemu_block.c @@ -81,8 +81,8 @@ void qemuBlockStorageSourceSetFormatNodename(virStorageSource *src, char *nodename) { - g_free(src->nodeformat); - src->nodeformat =3D nodename; + g_free(src->nodenameformat); + src->nodenameformat =3D nodename; } @@ -96,7 +96,7 @@ qemuBlockStorageSourceSetFormatNodename(virStorageSource = *src, const char * qemuBlockStorageSourceGetEffectiveNodename(virStorageSource *src) { - return src->nodeformat; + return src->nodenameformat; } @@ -141,7 +141,7 @@ qemuBlockStorageSourceGetStorageNodename(virStorageSour= ce *src) const char * qemuBlockStorageSourceGetFormatNodename(virStorageSource *src) { - return src->nodeformat; + return src->nodenameformat; } diff --git a/src/qemu/qemu_blockjob.c b/src/qemu/qemu_blockjob.c index 0913a224e3..4b5b63d287 100644 --- a/src/qemu/qemu_blockjob.c +++ b/src/qemu/qemu_blockjob.c @@ -617,7 +617,7 @@ qemuBlockJobCleanStorageSourceRuntime(virStorageSource = *src) VIR_FREE(src->relPath); VIR_FREE(src->backingStoreRaw); VIR_FREE(src->nodenamestorage); - VIR_FREE(src->nodeformat); + VIR_FREE(src->nodenameformat); VIR_FREE(src->tlsAlias); VIR_FREE(src->tlsCertdir); } --=20 2.41.0