From nobody Sun Dec 14 06:21:59 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=pass(p=reject dis=none) header.from=lists.libvirt.org ARC-Seal: i=1; a=rsa-sha256; t=1750709184; cv=none; d=zohomail.com; s=zohoarc; b=CDlBnYBU8TK75LbX/tEkJw8e9qEMfq2BoYaD1YVeezvDVtK1vdP2q8xittL+XZWElTINSRGjuKsShUdGSILd7n4yTXVSxWGAXYZWR7BWSXrkI2f/bdgkyhQEquBP5RJ21tiS1iSID3qggYgJKcAGSa3d9etPVTt01tMhGKVflM0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1750709184; 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:Reply-To:Reply-To:References:Subject:Subject:To:To:Message-Id:Cc; bh=HwUQDyfe1S14g4rZlxZrFdGYhNHctA+DlK8kvSXGRhM=; b=SJXOzDMvHj/V0LN486AuGXLo/EPDbLmexMnC2NS98P7hiROv6MZxbir0eioz+SKVv80a4Trd8mAPF88tj6FQXyrdGLtayzh4bKqucUtdEnzDgYwNxfMSzOhBLxpzWRKjRJrnO7S+paeI4PvusOPUQXpzdP4CsQ7zut7JtN8zf7w= ARC-Authentication-Results: i=1; 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=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1750709184580896.3621590968497; Mon, 23 Jun 2025 13:06:24 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 996) id AF6A9B0D; Mon, 23 Jun 2025 16:06:23 -0400 (EDT) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id E768511EF; Mon, 23 Jun 2025 16:00:06 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 3FDBB11D4; Mon, 23 Jun 2025 16:00:00 -0400 (EDT) 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 E87731282 for ; Mon, 23 Jun 2025 15:59:37 -0400 (EDT) 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-543-1nbEylxJNryx5P43fMoedA-1; Mon, 23 Jun 2025 15:59:34 -0400 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 2240F1800268 for ; Mon, 23 Jun 2025 19:59:34 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.45.242.5]) by mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 5774619560A3 for ; Mon, 23 Jun 2025 19:59:33 +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, 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=1750708777; 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: in-reply-to:in-reply-to:references:references; bh=Q/CGnvj1niWzdOCVTZBnjPmpmv4KTNf9tSul9kCUIn4=; b=g85hunApe/gFYtT+paQbA5+wGwpEOeHWlvhay/izl3MYZ5ZtrhXzoe3kFN3Sf1cEr71ZYW jwG4XqECqSmNR9s6d8rVz6Lc36QMOsvjqjpMu6mycpiK5BCfyRQh9BnXhXFl0rZl6kj2/F qVXqc4JVj2GVosfTPMDNhS1S3ZUO/3Q= X-MC-Unique: 1nbEylxJNryx5P43fMoedA-1 X-Mimecast-MFC-AGG-ID: 1nbEylxJNryx5P43fMoedA_1750708774 To: devel@lists.libvirt.org Subject: [PATCH v2 10/13] qemuBuildDeviceAddresDriveProps: Prepare for 'drive' address for usb-bot disks Date: Mon, 23 Jun 2025 21:59:15 +0200 Message-ID: <93ce75116da546eb7891110fb6ea186f889336d6.1750705681.git.pkrempa@redhat.com> In-Reply-To: References: 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: ug59a172yyTgzxupMVTNeOoFP4BudIYf4klPJ_3f6Zo_1750708774 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: 4WQQ4G7KOJQFCDQ4UZFGZG6V4AOQORO6 X-Message-ID-Hash: 4WQQ4G7KOJQFCDQ4UZFGZG6V4AOQORO6 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: From: Peter Krempa via Devel Reply-To: Peter Krempa X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1750709186348116600 Content-Type: text/plain; charset="utf-8" From: Peter Krempa While the 'usb-storage' based disks use the USB address directly, with 'usb-bot' the USB address is on the "controller" part of the device and the 'scsi-hd/cd' device will use a 'drive' address from qemu's PoV. Since we do not want to expose the 'usb-bot' as explicit controller to preserve compatibility with existing configs we plan to upgrade implement the formatter for 'drive' address when the "diskbus" property is VIR_DOMAIN_DISK_BUS_USB. Signed-off-by: Peter Krempa Reviewed-by: Jiri Denemark --- src/qemu/qemu_command.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 4de6016784..910242a389 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -545,8 +545,21 @@ qemuBuildDeviceAddresDriveProps(virJSONValue *props, return -1; break; - case VIR_DOMAIN_DISK_BUS_VIRTIO: case VIR_DOMAIN_DISK_BUS_USB: + /* Device info with type VIR_DOMAIN_DEVICE_ADDRESS_TYPE_DRIVE and + * VIR_DOMAIN_DISK_BUS_USB diskbus is an internal representation + * for the device address for 'usb-bot'. */ + bus =3D g_strdup_printf("%s.0", info->alias); + + if (virJSONValueObjectAdd(&props, + "s:bus", bus, + "u:scsi-id", info->addr.drive.target, + "u:lun", info->addr.drive.unit, + NULL) < 0) + return -1; + break; + + case VIR_DOMAIN_DISK_BUS_VIRTIO: case VIR_DOMAIN_DISK_BUS_XEN: case VIR_DOMAIN_DISK_BUS_UML: case VIR_DOMAIN_DISK_BUS_SD: --=20 2.49.0