From nobody Mon Feb 9 16:53:53 2026 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=1698234006; cv=none; d=zohomail.com; s=zohoarc; b=ASGFm9lRGZiFCQaQxvTOze2TJXYPFcoD+xG3sBlOqS3Hs+WMH+kYXjdXoMUU209cmhROIM3GjiGYzLz3wS6me9/nIcrDMGF8+1JktlsahlRwr2cXaPxyNfhwQ6D0mOLLJhEDIw0/qKsArOPZ5Vi4GHHZrLruh4HuVu7AeiBNynA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1698234006; 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=QeOCzcj4B/zkcQxvsrXED0/m1bDMy4rfPltkjxwn1mc=; b=ZwOt0khoDpGYA9eBgVtWM2rCpwy3H3nFEBf9D7P3vJ0QnWwKqio8/9H5d0f57EG91Rr2tOLWSRtcnPvLx+ePFPXqr9mMdYaR2+uZG6ihY9GavbeYnnoX1qx6Fw5Y6dL2xM367aLYQmz1NAOwGW4lzg251qlXjZpXr/hzesf0p+4= 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 1698234006220661.450395579227; Wed, 25 Oct 2023 04:40: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.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-462-fDeN2y0_Oi6X4u0alZJXzg-1; Wed, 25 Oct 2023 07:39:57 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id D52C2185A70C; Wed, 25 Oct 2023 11:39:47 +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 BE13F1C060AE; Wed, 25 Oct 2023 11:39:47 +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 369DF194658C; Wed, 25 Oct 2023 11:39:47 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 21E8319466F2 for ; Wed, 25 Oct 2023 11:39:46 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id F2EBD492BFC; Wed, 25 Oct 2023 11:39:45 +0000 (UTC) Received: from speedmetal.lan (unknown [10.45.242.14]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7F45C492BFB for ; Wed, 25 Oct 2023 11:39:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1698234005; 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=QeOCzcj4B/zkcQxvsrXED0/m1bDMy4rfPltkjxwn1mc=; b=ZhqOIQw5XbfOPyHmHH7LBN4BIqNJm0S3nLBMKNi92HkTCRhddwvYJLCOjzfrm0eXogqFxE 6LnqaFLAfzEIkox6FC9bbm4eQKyTz3tFMxoUw/PGdm4Ub20t1akTlYWyfTHDlhZ7K88DZK K9Eyug74682qm3/aKtdm09WHkPbdCJQ= X-MC-Unique: fDeN2y0_Oi6X4u0alZJXzg-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 03/22] qemuBuildDriveSourceStr: Absorb only use of qemuDiskSourceGetProps Date: Wed, 25 Oct 2023 13:39:13 +0200 Message-ID: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.10 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: 1698234007372100002 Content-Type: text/plain; charset="utf-8" 'qemuBuildDriveSourceStr' used to build the legacy -drive commandline for SD cards is the only user of qemuDiskSourceGetProps. Move the helper directly inline. Signed-off-by: Peter Krempa --- src/qemu/qemu_command.c | 39 +++++++++++---------------------------- 1 file changed, 11 insertions(+), 28 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index ba21976956..dbef8d0068 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -1572,30 +1572,6 @@ qemuDiskBusIsSD(int bus) } -/** - * qemuDiskSourceGetProps: - * @src: disk source struct - * - * Returns the disk source struct wrapped so that it can be used as disk s= ource - * directly by converting it from json. - */ -static virJSONValue * -qemuDiskSourceGetProps(virStorageSource *src) -{ - g_autoptr(virJSONValue) props =3D NULL; - virJSONValue *ret =3D NULL; - - if (!(props =3D qemuBlockStorageSourceGetBackendProps(src, - QEMU_BLOCK_STORAGE= _SOURCE_BACKEND_PROPS_LEGACY))) - return NULL; - - if (virJSONValueObjectAdd(&ret, "a:file", &props, NULL) < 0) - return NULL; - - return ret; -} - - static int qemuBuildDriveSourceStr(virDomainDiskDef *disk, virBuffer *buf) @@ -1603,7 +1579,6 @@ qemuBuildDriveSourceStr(virDomainDiskDef *disk, virStorageType actualType =3D virStorageSourceGetActualType(disk->src); qemuDomainStorageSourcePrivate *srcpriv =3D QEMU_DOMAIN_STORAGE_SOURCE= _PRIVATE(disk->src); qemuDomainSecretInfo **encinfo =3D NULL; - g_autoptr(virJSONValue) srcprops =3D NULL; bool rawluks =3D false; if (srcpriv) @@ -1624,14 +1599,22 @@ qemuBuildDriveSourceStr(virDomainDiskDef *disk, virQEMUBuildBufferEscapeComma(buf, disk->src->path); break; - case VIR_STORAGE_TYPE_NETWORK: - if (!(srcprops =3D qemuDiskSourceGetProps(disk->src))) + case VIR_STORAGE_TYPE_NETWORK: { + g_autoptr(virJSONValue) props =3D NULL; + g_autoptr(virJSONValue) wrap =3D NULL; + + if (!(props =3D qemuBlockStorageSourceGetBackendProps(disk->src, + QEMU_BLOCK_STO= RAGE_SOURCE_BACKEND_PROPS_LEGACY))) return -1; - if (virQEMUBuildCommandLineJSON(srcprops, buf, NULL, + if (virJSONValueObjectAdd(&wrap, "a:file", &props, NULL) < 0) + return -1; + + if (virQEMUBuildCommandLineJSON(wrap, buf, NULL, virQEMUBuildCommandLineJSONArrayNu= mbered) < 0) return -1; break; + } case VIR_STORAGE_TYPE_VOLUME: case VIR_STORAGE_TYPE_NVME: --=20 2.41.0