From nobody Sun Feb 8 20:53:37 2026 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 --- 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