From nobody Wed Mar 12 12:40:49 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1740570532878651.7081055031161; Wed, 26 Feb 2025 03:48:52 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 996) id 2F08F163E; Wed, 26 Feb 2025 06:48:52 -0500 (EST) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 4CF5B1619; Wed, 26 Feb 2025 06:48:33 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 996) id 3A56F160B; Wed, 26 Feb 2025 06:48:29 -0500 (EST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id B785E14B6 for ; Wed, 26 Feb 2025 06:48:28 -0500 (EST) Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-553-5Od1YXnPMO2B51cVijhw9A-1; Wed, 26 Feb 2025 06:48:27 -0500 Received: from mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.40]) (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 mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 671D11800878 for ; Wed, 26 Feb 2025 11:48:26 +0000 (UTC) Received: from speedmetal.lan (unknown [10.45.242.48]) by mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 90DDC19560AB for ; Wed, 26 Feb 2025 11:48:25 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED,SPF_HELO_NONE autolearn=unavailable autolearn_force=no version=3.4.4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1740570508; h=from:from: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; bh=eiu61l6UOj/Fv+uXdx/Es+Isj05xpIeRTU1kPQDqox8=; b=FS9Wx358VDS1N8ILSKdwo2VSdgba4D6GJoctH59PIIkbmROncHcyI3KyY30TvkFG45T1nE dwrlZE3fM3pYDyhh1PBrthvj2AnsgFI/u9nrxvgsAHAWYSFf0dLydEvctwr5U17z1qQbXg og2Ebba8DlQngi/LNDPZS1cRhwMvqUk= X-MC-Unique: 5Od1YXnPMO2B51cVijhw9A-1 X-Mimecast-MFC-AGG-ID: 5Od1YXnPMO2B51cVijhw9A_1740570506 From: Peter Krempa To: devel@lists.libvirt.org Subject: [PATCH] qemu: Report disk bus as reported by agent in virDomainGetGuestInfo Date: Wed, 26 Feb 2025 12:48:23 +0100 Message-ID: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.40 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: Ju7oNSAX9-b5IjZ9g9ed23n_u1J4ENJPaydh8H8Hf3s_1740570506 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: 2UITRCCWJG7NQUUY537X3MKIGIUWV32X X-Message-ID-Hash: 2UITRCCWJG7NQUUY537X3MKIGIUWV32X X-MailFrom: pkrempa@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1; header-match-config-2; header-match-config-3; header-match-devel.lists.libvirt.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header X-Mailman-Version: 3.2.2 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1740570534261019000 Content-Type: text/plain; charset="utf-8" KubeVirt decided to report this to the users. In order to allow them to use proper APIs expose the field as well. Resolves: https://issues.redhat.com/browse/RHEL-80688 Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- docs/manpages/virsh.rst | 1 + src/libvirt-domain.c | 1 + src/qemu/qemu_driver.c | 9 +++++++++ 3 files changed, 11 insertions(+) diff --git a/docs/manpages/virsh.rst b/docs/manpages/virsh.rst index f159c40631..baced15dec 100644 --- a/docs/manpages/virsh.rst +++ b/docs/manpages/virsh.rst @@ -2999,6 +2999,7 @@ returned: * ``disk..serial`` - optional disk serial number * ``disk..alias`` - the device alias of the disk (e.g. sda) * ``disk..guest_alias`` - optional alias assigned to the disk +* ``disk..guest_bus`` - bus type as reported by the guest *--interface* returns: * ``if.count`` - the number of interfaces defined on this domain diff --git a/src/libvirt-domain.c b/src/libvirt-domain.c index ae15ab1e5a..05101756a1 100644 --- a/src/libvirt-domain.c +++ b/src/libvirt-domain.c @@ -13273,6 +13273,7 @@ virDomainSetVcpu(virDomainPtr domain, * "disk..alias" - the device alias of the disk (e.g. sda) * "disk..guest_alias" - optional alias assigned to the disk, on= Linux * this is a name assigned by device mapper + * "disk..guest_bus" - disk bus as reported by the guest OS * * VIR_DOMAIN_GUEST_INFO_HOSTNAME: * Returns information about the hostname of the domain. The typed diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 3b8b2c0a1e..86b945d9b9 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -19278,6 +19278,15 @@ qemuAgentDiskInfoFormatParams(qemuAgentDiskInfo **= info, param_name, diskdef->dst) < 0) return; } + + if (address->bus_type) { + g_snprintf(param_name, VIR_TYPED_PARAM_FIELD_LENGTH, + "disk.%zu.guest_bus", i); + + if (virTypedParamsAddString(params, nparams, maxparams, + param_name, address->bus_type)= < 0) + return; + } } if (info[i]->alias) { --=20 2.48.1