From nobody Wed Mar 12 17:24:11 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=pass; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org ARC-Seal: i=1; a=rsa-sha256; t=1741413670; cv=none; d=zohomail.com; s=zohoarc; b=nbaP4kxrdJIYFzgCszNw2LH7idgAVSAzDG54F5LLa00S1zQ0kUM5CLuL6aYMkIZ0r5HMAoqCHK0pUvjZ2xHhxzB9sLI+jAqNzX8/j1qUh/B1cwsKISPznOzfjIV6dVGzcCa+xuwlJzIzC/QPDOziwMTjLJEER+OJiabn10iNdwY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1741413670; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To; bh=jT+8H55GSObUVycTIpofuc2VkNUqWX7k2IRhfUpO+bE=; b=iRpxx+OoCtwaQD08lBnc9elYg0NZlSNc+yGLzDA0b9hsjSIKxVirzAy8Spgt98n76KEFFnrujy3SF6M6W4IuMvC82UHnRtmoIo+549UNHfpJwrmouNWcI71VF/cUBdm95v/NB2G254mwxyO/3qKCc4drKxs/zQE/CAmsM/hHvwk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1741413670103332.3248678157544; Fri, 7 Mar 2025 22:01:10 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 996) id 5D63F954; Sat, 8 Mar 2025 01:01:09 -0500 (EST) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 264E01AFC; Sat, 8 Mar 2025 00:58:16 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 996) id C50FC1A34; Sat, 8 Mar 2025 00:58:09 -0500 (EST) Received: from mail-pl1-f181.google.com (mail-pl1-f181.google.com [209.85.214.181]) (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 D5259196E for ; Sat, 8 Mar 2025 00:57:54 -0500 (EST) Received: by mail-pl1-f181.google.com with SMTP id d9443c01a7336-2239c066347so47250855ad.2 for ; Fri, 07 Mar 2025 21:57:54 -0800 (PST) Received: from localhost ([157.82.205.237]) by smtp.gmail.com with UTF8SMTPSA id d9443c01a7336-224109ea390sm40022705ad.69.2025.03.07.21.57.52 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 07 Mar 2025 21:57:53 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3,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=daynix-com.20230601.gappssmtp.com; s=20230601; t=1741413474; x=1742018274; darn=lists.libvirt.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=jT+8H55GSObUVycTIpofuc2VkNUqWX7k2IRhfUpO+bE=; b=QQvzVdeMIqrX81Me4jd76P3AJVuE/uAUyETAeffH40ZYizWnzkgTTHBNbcnufneAt4 YTAZUBeiKCQkM44BDJ9zeuqnuLOgAmy6wT+ksOuQJlF6FxUYEl+mReMLDxm9snwUn1xi acV00xCCDt5ZABNBg1AnHtSlL8Vb5Wlo5FfqRXTV8ZfPWxA35O9HnQ0GSvP2oXENTHR4 RQm/EirVgqAifdtRaPoRwJWVIrEH4GjNtYyAr5Gq61iqOjH/TncfDBurRsTjDGPHchTc FtuYIT5hbfVYkxx0bpW50yXcW/xfMMunFHo/or8Cy6djhRxMxznxK6OKe8t6l2iwFrhg qjBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741413474; x=1742018274; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=jT+8H55GSObUVycTIpofuc2VkNUqWX7k2IRhfUpO+bE=; b=QXUz1I9XmWvO1ObE793qPfekz4BfU6dcGMxXiIuYc9WyBtue3hP1cGv2CxzDTACe2S hiSX8kCVzn5GQfwECMbEhp8xd40QmwigAufR+P4UW33nubxfeYLiJAQQkq7J8pDm8GdY DQwTn7N6d8icr9UC5qjXjfQ5eojk+B5yATQt4Ax2pMgXATf6h7d3hI5CoRC13MOJJLPZ n6bASoFNioRhGi4HVb9MN/W/my5eLm76LksEdbpFXU9KLisQCUOAzObmdmakI4TZ+mP8 GSRIVgBttS4/jgj/DCXyu4kj/e4yysG1pw82ayTzOh24NP3iHw+p/INKxtW1SZTP7cLY iZ+A== X-Gm-Message-State: AOJu0YxDpvb91kx6ZhA1Xe1TBRwim4v/J8gtQ2HChW/zvdVqqhjNlIRs Hx4rjILYjdZX37mcXPjZWCjT0sJvAiID20YIFx1jL6KfTr6zAILU1FIxXtFR6Cw= X-Gm-Gg: ASbGncvj7/B0BDIjDq2A+lD2M7WQiKIqdDqcfl7LUZXeOq4YjHLeltAEqmbcQwiiRsN edRDbdNOvM/OI/cmAeJGDPCEc1pgcBdlUtoxJw1dK+CLtMgjt4IyvjBTrFedG187QBaZenrWy1I +UXqmb0BXENaUUg4e81XQBvAztfjsFE1i48wPc0C1EvQlhucL6cd0oqf5Pm1NB1WkPG7GA9Wmhd Md32ryGIu9giGQWyAPkkCcDTrRiJkRUfoHViHCzZuW307tx9Mg+ITdI7G41Nk5eehCBicBMpVTF 9AYNlU+yXlElnVcwDrS7IKN0Tf/3W8hezN/eFBjzAiX5LvqP X-Google-Smtp-Source: AGHT+IFlMffhQFw5/3hN5OGU58CKHwiW3todD24AtypR0RF/tp9TtwbZfazC+tKfcdaPxFvxb0alZg== X-Received: by 2002:a17:903:283:b0:21f:6a36:7bf3 with SMTP id d9443c01a7336-224288974admr112123825ad.12.1741413473764; Fri, 07 Mar 2025 21:57:53 -0800 (PST) From: Akihiko Odaki Date: Sat, 08 Mar 2025 14:57:41 +0900 Subject: [PATCH 2/3] qemu: Replace usb-storage with usb-bot MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250308-bot-v1-2-600943c95844@daynix.com> References: <20250308-bot-v1-0-600943c95844@daynix.com> In-Reply-To: <20250308-bot-v1-0-600943c95844@daynix.com> To: devel@lists.libvirt.org X-Mailer: b4 0.14.2 Message-ID-Hash: QKQ3KP7J4BFK3VGZ5NUCH6XPDDNKAUFO X-Message-ID-Hash: QKQ3KP7J4BFK3VGZ5NUCH6XPDDNKAUFO X-MailFrom: akihiko.odaki@daynix.com X-Mailman-Rule-Hits: nonmember-moderation 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 CC: devel@daynix.com, Akihiko Odaki 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: pass (identity @daynix-com.20230601.gappssmtp.com) X-ZM-MESSAGEID: 1741413671564019000 usb-storage is a compound device that automatically creates a USB mass storage device and a SCSI device as its backend. Unfortunately it lacks some configuration options that are usually present with a SCSI device, and cannot represent CD-ROM in particular. Replace usb-storage with usb-bot, which can be combined with a manually created SCSI device. libvirt will configure the SCSI device in a way identical with how QEMU does for usb-storage except that now it respects a configuration option to represent CD-ROM. Resolves: https://gitlab.com/libvirt/libvirt/-/issues/368 Signed-off-by: Akihiko Odaki --- src/qemu/qemu_alias.c | 3 +- src/qemu/qemu_capabilities.c | 2 +- src/qemu/qemu_command.c | 55 ++++++++++++++++++= ++-- src/qemu/qemu_command.h | 5 ++ src/qemu/qemu_hotplug.c | 34 ++++++++++--- src/qemu/qemu_validate.c | 4 +- tests/qemuhotplugtest.c | 8 +++- .../qemuxmlconfdata/disk-cache.x86_64-latest.args | 3 +- .../disk-cdrom-bus-other.x86_64-latest.args | 3 +- .../disk-device-removable.x86_64-latest.args | 3 +- .../disk-usb-device.x86_64-latest.args | 3 +- 11 files changed, 102 insertions(+), 21 deletions(-) diff --git a/src/qemu/qemu_alias.c b/src/qemu/qemu_alias.c index 3e6bced4a88538a040dd8a65f40dc9f7f56b8ec9..64986368d0588f7778c8e3a09ae= 3169c1961b456 100644 --- a/src/qemu/qemu_alias.c +++ b/src/qemu/qemu_alias.c @@ -267,8 +267,7 @@ qemuAssignDeviceDiskAlias(virDomainDef *def, break; =20 case VIR_DOMAIN_DISK_BUS_USB: - diskPriv->qomName =3D g_strdup_printf("/machine/peripheral/%s/= %s.0/legacy[0]", - disk->info.alias, disk->in= fo.alias); + diskPriv->qomName =3D g_strconcat("scsi", disk->info.alias, NU= LL); break; =20 case VIR_DOMAIN_DISK_BUS_XEN: diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 2c7f9cfe994c45dd3bbecc9cd9fff51889adfb0f..b253cb407e8334320cc8ecd49d2= 8d2481d82e9b4 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -6477,7 +6477,7 @@ virQEMUCapsFillDomainDeviceDiskCaps(virQEMUCaps *qemu= Caps, VIR_DOMAIN_DISK_BUS_VIRTIO, /* VIR_DOMAIN_DISK_BUS_SD */); =20 - if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_USB_STORAGE)) + if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_USB_BOT)) VIR_DOMAIN_CAPS_ENUM_SET(disk->bus, VIR_DOMAIN_DISK_BUS_USB); =20 if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_ICH9_AHCI)) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 0ad73af335974a236341fa85d02c83f14af08934..29db916e70804ec482392c078a2= 80904a992eaf3 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -1611,6 +1611,31 @@ qemuBuildIothreadMappingProps(GSList *iothreads) return g_steal_pointer(&ret); } =20 +int +qemuBuildDiskBusProps(const virDomainDef *def, + const virDomainDiskDef *disk, + virJSONValue **propsRet) +{ + g_autoptr(virJSONValue) props =3D NULL; + + *propsRet =3D NULL; + + if (disk->bus !=3D VIR_DOMAIN_DISK_BUS_USB) + return 0; + + if (virJSONValueObjectAdd(&props, + "s:driver", "usb-bot", + "s:id", disk->info.alias, + NULL) < 0) + return -1; + + if (qemuBuildDeviceAddressProps(props, def, &disk->info) < 0) + return -1; + + *propsRet =3D g_steal_pointer(&props); + + return 0; +} =20 virJSONValue * qemuBuildDiskDeviceProps(const virDomainDef *def, @@ -1619,6 +1644,7 @@ qemuBuildDiskDeviceProps(const virDomainDef *def, { g_autoptr(virJSONValue) props =3D NULL; const char *driver =3D NULL; + g_autofree char *usbBusId =3D NULL; g_autofree char *scsiVPDDeviceId =3D NULL; virTristateSwitch shareRW =3D VIR_TRISTATE_SWITCH_ABSENT; g_autofree char *chardev =3D NULL; @@ -1637,6 +1663,7 @@ qemuBuildDiskDeviceProps(const virDomainDef *def, const char *rpolicy =3D NULL; const char *model =3D NULL; const char *product =3D NULL; + const char *id =3D disk->info.alias; =20 switch (disk->bus) { case VIR_DOMAIN_DISK_BUS_IDE: @@ -1650,6 +1677,17 @@ qemuBuildDiskDeviceProps(const virDomainDef *def, =20 break; =20 + case VIR_DOMAIN_DISK_BUS_USB: + usbBusId =3D g_strconcat(disk->info.alias, ".0", NULL); + if (virJSONValueObjectAdd(&props, + "s:bus", usbBusId, + "u:scsi-id", 0, + "u:lun", 0, + NULL) < 0) + return NULL; + + id =3D QEMU_DOMAIN_DISK_PRIVATE(disk)->qomName; + G_GNUC_FALLTHROUGH; case VIR_DOMAIN_DISK_BUS_SCSI: if (disk->device =3D=3D VIR_DOMAIN_DISK_DEVICE_LUN) { driver =3D "scsi-block"; @@ -1719,8 +1757,6 @@ qemuBuildDiskDeviceProps(const virDomainDef *def, } break; =20 - case VIR_DOMAIN_DISK_BUS_USB: - driver =3D "usb-storage"; =20 if (disk->removable =3D=3D VIR_TRISTATE_SWITCH_ABSENT) removable =3D VIR_TRISTATE_SWITCH_OFF; @@ -1755,7 +1791,8 @@ qemuBuildDiskDeviceProps(const virDomainDef *def, if (disk->info.type =3D=3D VIR_DOMAIN_DEVICE_ADDRESS_TYPE_DRIVE) disk->info.addr.drive.diskbus =3D disk->bus; =20 - if (qemuBuildDeviceAddressProps(props, def, &disk->info) < 0) + if (disk->bus !=3D VIR_DOMAIN_DISK_BUS_USB && + qemuBuildDeviceAddressProps(props, def, &disk->info) < 0) return NULL; =20 if (disk->src->shared) @@ -1816,7 +1853,7 @@ qemuBuildDiskDeviceProps(const virDomainDef *def, "T:share-rw", shareRW, "S:drive", drive, "S:chardev", chardev, - "s:id", disk->info.alias, + "s:id", id, "p:bootindex", bootindex, "S:loadparm", bootLoadparm, "p:logical_block_size", logical_block_size, @@ -2110,6 +2147,16 @@ qemuBuildDiskCommandLine(virCommand *cmd, if (qemuCommandAddExtDevice(cmd, &disk->info, def, qemuCaps) < 0) return -1; =20 + if (qemuBuildDiskBusProps(def, disk, &devprops) < 0) + return -1; + + if (devprops) { + if (qemuBuildDeviceCommandlineFromJSON(cmd, devprops, def, qemuCap= s) < 0) + return -1; + + g_clear_pointer(&devprops, virJSONValueFree); + } + if (!(devprops =3D qemuBuildDiskDeviceProps(def, disk, qemuCaps))) return -1; =20 diff --git a/src/qemu/qemu_command.h b/src/qemu/qemu_command.h index 76c514b5f744c60e433f0d8d8760a8730c886eed..48b8ed8ac58d005503c8bdb7e25= 5af097a548fd9 100644 --- a/src/qemu/qemu_command.h +++ b/src/qemu/qemu_command.h @@ -116,6 +116,11 @@ qemuBlockStorageSourceChainData * qemuBuildStorageSourceChainAttachPrepareBlockdevTop(virStorageSource *top, virStorageSource *back= ingStore); =20 +int +qemuBuildDiskBusProps(const virDomainDef *def, + const virDomainDiskDef *disk, + virJSONValue **propsRet); + virJSONValue * qemuBuildDiskDeviceProps(const virDomainDef *def, virDomainDiskDef *disk, diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index 28ca321c5c194678d25d67aa02ec82c13175f4f5..cfbaf195bd0a8991c8902795560= bda3ee85e42bc 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -31,6 +31,7 @@ #include "qemu_command.h" #include "qemu_hostdev.h" #include "qemu_interface.h" +#include "qemu_monitor_json.h" #include "qemu_passt.h" #include "qemu_process.h" #include "qemu_security.h" @@ -709,8 +710,10 @@ qemuDomainAttachDiskGeneric(virDomainObj *vm, { g_autoptr(qemuBlockStorageSourceChainData) data =3D NULL; qemuDomainObjPrivate *priv =3D vm->privateData; + g_autoptr(virJSONValue) busprops =3D NULL; g_autoptr(virJSONValue) devprops =3D NULL; bool extensionDeviceAttached =3D false; + bool busAdded =3D false; int rc; g_autoptr(qemuSnapshotDiskContext) transientDiskSnapshotCtxt =3D NULL; bool origReadonly =3D disk->src->readonly; @@ -766,6 +769,9 @@ qemuDomainAttachDiskGeneric(virDomainObj *vm, } } =20 + if (qemuBuildDiskBusProps(vm->def, disk, &busprops) < 0) + goto rollback; + if (!(devprops =3D qemuBuildDiskDeviceProps(vm->def, disk, priv->qemuC= aps))) goto rollback; =20 @@ -775,16 +781,20 @@ qemuDomainAttachDiskGeneric(virDomainObj *vm, if ((rc =3D qemuDomainAttachExtensionDevice(priv->mon, &disk->info)) = =3D=3D 0) extensionDeviceAttached =3D true; =20 + if (rc =3D=3D 0 && busprops && + (rc =3D qemuMonitorAddDeviceProps(priv->mon, &busprops)) =3D=3D 0) + busAdded =3D true; + if (rc =3D=3D 0) rc =3D qemuMonitorAddDeviceProps(priv->mon, &devprops); =20 - /* Setup throttling of disk via block_set_io_throttle QMP command. This - * is a hack until the 'throttle' blockdev driver will support modific= ation - * of the trhottle group. See also qemuProcessSetupDiskThrottlingBlock= dev. - * As there isn't anything sane to do if this fails, let's just return - * success. - */ if (rc =3D=3D 0) { + /* Setup throttling of disk via block_set_io_throttle QMP command.= This + * is a hack until the 'throttle' blockdev driver will support mod= ification + * of the trhottle group. See also qemuProcessSetupDiskThrottlingB= lockdev. + * As there isn't anything sane to do if this fails, let's just re= turn + * success. + */ qemuDomainDiskPrivate *diskPriv =3D QEMU_DOMAIN_DISK_PRIVATE(disk); g_autoptr(GHashTable) blockinfo =3D NULL; =20 @@ -801,6 +811,15 @@ qemuDomainAttachDiskGeneric(virDomainObj *vm, qemuProcessRefreshDiskProps(disk, diskinfo); } } + + if (disk->bus =3D=3D VIR_DOMAIN_DISK_BUS_USB) { + qemuMonitorJSONObjectProperty prop =3D { + .type =3D QEMU_MONITOR_OBJECT_PROPERTY_BOOLEAN, + .val.b =3D true, + }; + + rc =3D qemuMonitorJSONSetObjectProperty(priv->mon, disk->info.= alias, "attached", &prop); + } } =20 qemuDomainObjExitMonitor(vm); @@ -814,6 +833,9 @@ qemuDomainAttachDiskGeneric(virDomainObj *vm, if (qemuDomainObjEnterMonitorAsync(vm, asyncJob) < 0) return -1; =20 + if (busAdded) + ignore_value(qemuMonitorDelDevice(priv->mon, disk->info.alias)); + if (extensionDeviceAttached) ignore_value(qemuDomainDetachExtensionDevice(priv->mon, &disk->inf= o)); =20 diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c index f3ef1be660b1cbbfe8ed5643baf2e9f4a63cf60d..f9ec3a7c076c3755e1c3ddf3c63= aeeb7ed576f2b 100644 --- a/src/qemu/qemu_validate.c +++ b/src/qemu/qemu_validate.c @@ -3146,9 +3146,9 @@ qemuValidateDomainDeviceDefDiskFrontend(const virDoma= inDiskDef *disk, break; =20 case VIR_DOMAIN_DISK_BUS_USB: - if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_USB_STORAGE)) { + if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_USB_BOT)) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("This QEMU doesn't support '-device usb-stora= ge'")); + _("This QEMU doesn't support '-device usb-bot'"= )); return -1; } =20 diff --git a/tests/qemuhotplugtest.c b/tests/qemuhotplugtest.c index d2a1f5acf1c17236f0cc038fda43e4f3052cc28b..96ab222836f2594ce7dbd88236e= bfe704c18838b 100644 --- a/tests/qemuhotplugtest.c +++ b/tests/qemuhotplugtest.c @@ -590,7 +590,9 @@ mymain(void) DO_TEST_ATTACH("x86_64", "base-live", "disk-usb", false, true, "blockdev-add", QMP_OK, "device_add", QMP_OK, - "query-block", QMP_EMPTY_ARRAY); + "device_add", QMP_OK, + "query-block", QMP_EMPTY_ARRAY, + "qom-set", QMP_OK); DO_TEST_DETACH("x86_64", "base-live", "disk-usb", true, true, "device_del", QMP_OK); DO_TEST_DETACH("x86_64", "base-live", "disk-usb", false, false, @@ -746,7 +748,9 @@ mymain(void) DO_TEST_ATTACH("x86_64", "base-live", "cdrom-usb", false, true, "blockdev-add", QMP_OK, "device_add", QMP_OK, - "query-block", QMP_EMPTY_ARRAY); + "device_add", QMP_OK, + "query-block", QMP_EMPTY_ARRAY, + "qom-set", QMP_OK); DO_TEST_DETACH("x86_64", "base-live", "cdrom-usb", true, true, "device_del", QMP_OK); DO_TEST_DETACH("x86_64", "base-live", "cdrom-usb", false, false, diff --git a/tests/qemuxmlconfdata/disk-cache.x86_64-latest.args b/tests/qe= muxmlconfdata/disk-cache.x86_64-latest.args index 27be6441774b13dc0c491328431aed6ccd3eddaa..206f8ab9ca46008ff1895730159= 838aa7dd1e018 100644 --- a/tests/qemuxmlconfdata/disk-cache.x86_64-latest.args +++ b/tests/qemuxmlconfdata/disk-cache.x86_64-latest.args @@ -42,7 +42,8 @@ XDG_CONFIG_HOME=3D/var/lib/libvirt/qemu/domain--1-QEMUGue= st1/.config \ -device '{"driver":"virtio-blk-pci","bus":"pci.0","addr":"0x3","drive":"li= bvirt-2-format","id":"virtio-disk0","write-cache":"off"}' \ -blockdev '{"driver":"host_device","filename":"/dev/HostVG/QEMUGuest1","no= de-name":"libvirt-1-storage","auto-read-only":true,"discard":"unmap","cache= ":{"direct":true,"no-flush":false}}' \ -blockdev '{"node-name":"libvirt-1-format","read-only":false,"cache":{"dir= ect":true,"no-flush":false},"driver":"qcow2","file":"libvirt-1-storage"}' \ --device '{"driver":"usb-storage","bus":"usb.0","port":"1","drive":"libvirt= -1-format","id":"usb-disk1","removable":false,"write-cache":"off"}' \ +-device '{"driver":"usb-bot","id":"usb-disk1","bus":"usb.0","port":"1"}' \ +-device '{"bus":"usb-disk1.0","scsi-id":0,"lun":0,"driver":"scsi-hd","devi= ce_id":"drive-usb-disk1","drive":"libvirt-1-format","id":"scsiusb-disk1","w= rite-cache":"off"}' \ -audiodev '{"id":"audio1","driver":"none"}' \ -sandbox on,obsolete=3Ddeny,elevateprivileges=3Ddeny,spawn=3Ddeny,resource= control=3Ddeny \ -msg timestamp=3Don diff --git a/tests/qemuxmlconfdata/disk-cdrom-bus-other.x86_64-latest.args = b/tests/qemuxmlconfdata/disk-cdrom-bus-other.x86_64-latest.args index e1406af663625bbb1c27203450bc0135af3861e7..8e5c60ac1ec185d1b717b3b22ce= b07b721b54846 100644 --- a/tests/qemuxmlconfdata/disk-cdrom-bus-other.x86_64-latest.args +++ b/tests/qemuxmlconfdata/disk-cdrom-bus-other.x86_64-latest.args @@ -28,7 +28,8 @@ XDG_CONFIG_HOME=3D/var/lib/libvirt/qemu/domain--1-QEMUGue= st1/.config \ -boot strict=3Don \ -device '{"driver":"piix3-usb-uhci","id":"usb","bus":"pci.0","addr":"0x1.0= x2"}' \ -blockdev '{"driver":"file","filename":"/root/boot.iso","node-name":"libvi= rt-1-storage","read-only":true}' \ --device '{"driver":"usb-storage","bus":"usb.0","port":"1","drive":"libvirt= -1-storage","id":"usb-disk0","removable":false}' \ +-device '{"driver":"usb-bot","id":"usb-disk0","bus":"usb.0","port":"1"}' \ +-device '{"bus":"usb-disk0.0","scsi-id":0,"lun":0,"driver":"scsi-cd","devi= ce_id":"drive-usb-disk0","drive":"libvirt-1-storage","id":"scsiusb-disk0"}'= \ -audiodev '{"id":"audio1","driver":"none"}' \ -sandbox on,obsolete=3Ddeny,elevateprivileges=3Ddeny,spawn=3Ddeny,resource= control=3Ddeny \ -msg timestamp=3Don diff --git a/tests/qemuxmlconfdata/disk-device-removable.x86_64-latest.args= b/tests/qemuxmlconfdata/disk-device-removable.x86_64-latest.args index e0701f4bd25d79b60dc4f9294a603d0a7cd9f0b1..d9b259bc59cc54b10ede57e696e= 553b3d5f2ef06 100644 --- a/tests/qemuxmlconfdata/disk-device-removable.x86_64-latest.args +++ b/tests/qemuxmlconfdata/disk-device-removable.x86_64-latest.args @@ -31,7 +31,8 @@ XDG_CONFIG_HOME=3D/var/lib/libvirt/qemu/domain--1-QEMUGue= st1/.config \ -blockdev '{"driver":"host_device","filename":"/dev/HostVG/QEMUGuest1","no= de-name":"libvirt-3-storage","read-only":false}' \ -device '{"driver":"ide-hd","bus":"ide.0","unit":0,"drive":"libvirt-3-stor= age","id":"ide0-0-0","bootindex":1}' \ -blockdev '{"driver":"file","filename":"/tmp/usbdisk.img","node-name":"lib= virt-2-storage","read-only":false}' \ --device '{"driver":"usb-storage","bus":"usb.0","port":"1","drive":"libvirt= -2-storage","id":"usb-disk0","removable":true}' \ +-device '{"driver":"usb-bot","id":"usb-disk0","bus":"usb.0","port":"1"}' \ +-device '{"bus":"usb-disk0.0","scsi-id":0,"lun":0,"driver":"scsi-hd","devi= ce_id":"drive-usb-disk0","drive":"libvirt-2-storage","id":"scsiusb-disk0","= removable":true}' \ -blockdev '{"driver":"file","filename":"/tmp/scsidisk.img","node-name":"li= bvirt-1-storage","read-only":false}' \ -device '{"driver":"scsi-hd","bus":"scsi0.0","channel":0,"scsi-id":0,"lun"= :1,"device_id":"drive-scsi0-0-0-1","drive":"libvirt-1-storage","id":"scsi0-= 0-0-1","removable":true}' \ -audiodev '{"id":"audio1","driver":"none"}' \ diff --git a/tests/qemuxmlconfdata/disk-usb-device.x86_64-latest.args b/tes= ts/qemuxmlconfdata/disk-usb-device.x86_64-latest.args index 0fd7e755b1384227b63d6a080bd6af947596ae06..534780faf1a34af1a60dcca4dc7= 1f91943267ea9 100644 --- a/tests/qemuxmlconfdata/disk-usb-device.x86_64-latest.args +++ b/tests/qemuxmlconfdata/disk-usb-device.x86_64-latest.args @@ -30,7 +30,8 @@ XDG_CONFIG_HOME=3D/var/lib/libvirt/qemu/domain--1-QEMUGue= st1/.config \ -blockdev '{"driver":"host_device","filename":"/dev/HostVG/QEMUGuest1","no= de-name":"libvirt-2-storage","read-only":false}' \ -device '{"driver":"ide-hd","bus":"ide.0","unit":0,"drive":"libvirt-2-stor= age","id":"ide0-0-0","bootindex":1}' \ -blockdev '{"driver":"file","filename":"/tmp/usbdisk.img","node-name":"lib= virt-1-storage","read-only":false}' \ --device '{"driver":"usb-storage","bus":"usb.0","port":"1","drive":"libvirt= -1-storage","id":"usb-disk0","removable":false}' \ +-device '{"driver":"usb-bot","id":"usb-disk0","bus":"usb.0","port":"1"}' \ +-device '{"bus":"usb-disk0.0","scsi-id":0,"lun":0,"driver":"scsi-hd","devi= ce_id":"drive-usb-disk0","drive":"libvirt-1-storage","id":"scsiusb-disk0"}'= \ -audiodev '{"id":"audio1","driver":"none"}' \ -device '{"driver":"virtio-balloon-pci","id":"balloon0","bus":"pci.0","add= r":"0x2"}' \ -sandbox on,obsolete=3Ddeny,elevateprivileges=3Ddeny,spawn=3Ddeny,resource= control=3Ddeny \ --=20 2.48.1