From nobody Thu Nov 14 07:02:33 2024 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=1632310625; cv=none; d=zohomail.com; s=zohoarc; b=hX0a2sXB0/7qFZd/+vRnt/NMlKqQYpqmw/LaRsDiFBFjV+HbJFstLvj/EepZ/0lXNwdshtDa5U2yA+7kanPNvL6YIzqIfGIBjOX7UowS5qmnb6WjuIlSI+RKVhCmgvbNtO6K6TV9ILPQxJ+lcg0p13/wTIx+s+bxGbPm2zPKsmg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1632310625; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=6rlDVPDKqgh0M0DstZspl+97qNrExpQwKSIddYdaqd4=; b=bE0FvQ/k2ROH7g2qMLFWphnqACKQ1PzveMziecaClqD4R8fpqqp3U+2EA6QT8LH9POVvkkTFY+R05zUnAbz2vtHS0uqBixPHJG1X/TvNYxnI4e3QWpYzRp/PYLVUDDXGCcuksJ1MnjPnRsq3mFCoinxR9GX1rDS5emzaK9YQuUc= 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 1632310625234716.5312729871237; Wed, 22 Sep 2021 04:37:05 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-81-ge0Xe9jnMfSOa7h8-TDaew-1; Wed, 22 Sep 2021 07:36:13 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 00B3084A5E4; Wed, 22 Sep 2021 11:36:08 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D45E860C9D; Wed, 22 Sep 2021 11:36:07 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 7B72C4EA38; Wed, 22 Sep 2021 11:36:07 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 18MBZir3006663 for ; Wed, 22 Sep 2021 07:35:44 -0400 Received: by smtp.corp.redhat.com (Postfix) id 7915560871; Wed, 22 Sep 2021 11:35:44 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.16]) by smtp.corp.redhat.com (Postfix) with ESMTP id C59B460843 for ; Wed, 22 Sep 2021 11:35:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1632310623; 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=6rlDVPDKqgh0M0DstZspl+97qNrExpQwKSIddYdaqd4=; b=YbOjC05XuKAQHqtSl+eNN/N+q5AFkifeocVS2TGa5+D1jwqa4a/svPxBHfvRgUDcJT+nQR tRzHQ62hN7qXn5ykqd5+vIyCg2/26XzVv1MkfdeBSFlhbfhORnQWks6wsjJQBGvEhWPuy1 q9iGmGJPSPpiKAVbiZXyNyz0q2ayzGE= X-MC-Unique: ge0Xe9jnMfSOa7h8-TDaew-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 05/12] qemu: domain: Always assume QEMU_CAPS_ISCSI_PASSWORD_SECRET Date: Wed, 22 Sep 2021 13:35:24 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com 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: 1632310627117100004 Content-Type: text/plain; charset="utf-8" QEMU supports the 'password-secret' parameter to pass a QCryptoSecret since 2.9. Remove the alternate plaintext logic. Unfortunately this had a ripple effect of removing qemuCaps from a lot of functions. Signed-off-by: Peter Krempa --- src/qemu/qemu_command.c | 23 ++- src/qemu/qemu_domain.c | 131 ++---------------- .../qemuxml2argvdata/disk-network-iscsi.args | 12 +- .../disk-network-source-auth.args | 3 +- .../disk-source-pool-mode.args | 4 +- .../luks-disks-source-qcow2.args | 5 +- tests/qemuxml2argvdata/luks-disks-source.args | 5 +- tests/qemuxml2argvdata/name-escape.args | 2 +- tests/qemuxml2argvtest.c | 3 +- 9 files changed, 43 insertions(+), 145 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 7a441b4a04..39659fe4f6 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -1194,8 +1194,7 @@ qemuDiskBusIsSD(int bus) * the legacy representation. */ static bool -qemuDiskSourceNeedsProps(virStorageSource *src, - virQEMUCaps *qemuCaps) +qemuDiskSourceNeedsProps(virStorageSource *src) { int actualType =3D virStorageSourceGetActualType(src); @@ -1209,8 +1208,7 @@ qemuDiskSourceNeedsProps(virStorageSource *src, return true; if (actualType =3D=3D VIR_STORAGE_TYPE_NETWORK && - src->protocol =3D=3D VIR_STORAGE_NET_PROTOCOL_ISCSI && - virQEMUCapsGet(qemuCaps, QEMU_CAPS_ISCSI_PASSWORD_SECRET)) + src->protocol =3D=3D VIR_STORAGE_NET_PROTOCOL_ISCSI) return true; if (actualType =3D=3D VIR_STORAGE_TYPE_NETWORK && @@ -1272,7 +1270,6 @@ qemuBuildDriveSourcePR(virBuffer *buf, static int qemuBuildDriveSourceStr(virDomainDiskDef *disk, - virQEMUCaps *qemuCaps, virBuffer *buf) { int actualType =3D virStorageSourceGetActualType(disk->src); @@ -1288,7 +1285,7 @@ qemuBuildDriveSourceStr(virDomainDiskDef *disk, encinfo =3D srcpriv->encinfo; } - if (qemuDiskSourceNeedsProps(disk->src, qemuCaps) && + if (qemuDiskSourceNeedsProps(disk->src) && !(srcprops =3D qemuDiskSourceGetProps(disk->src))) return -1; @@ -1469,7 +1466,7 @@ qemuBuildDriveStr(virDomainDiskDef *disk, int detect_zeroes =3D virDomainDiskGetDetectZeroesMode(disk->discard, disk->detect_zero= es); - if (qemuBuildDriveSourceStr(disk, qemuCaps, &opt) < 0) + if (qemuBuildDriveSourceStr(disk, &opt) < 0) return NULL; if (!qemuDiskBusIsSD(disk->bus)) { @@ -4556,8 +4553,7 @@ qemuBuildHubCommandLine(virCommand *cmd, static char * -qemuBuildSCSIiSCSIHostdevDrvStr(virDomainHostdevDef *dev, - virQEMUCaps *qemuCaps) +qemuBuildSCSIiSCSIHostdevDrvStr(virDomainHostdevDef *dev) { g_auto(virBuffer) buf =3D VIR_BUFFER_INITIALIZER; g_autofree char *netsource =3D NULL; @@ -4567,7 +4563,7 @@ qemuBuildSCSIiSCSIHostdevDrvStr(virDomainHostdevDef *= dev, qemuDomainStorageSourcePrivate *srcPriv =3D QEMU_DOMAIN_STORAGE_SOURCE_PRIVATE(iscsisrc->src); - if (qemuDiskSourceNeedsProps(iscsisrc->src, qemuCaps)) { + if (qemuDiskSourceNeedsProps(iscsisrc->src)) { if (!(srcprops =3D qemuDiskSourceGetProps(iscsisrc->src))) return NULL; if (!(netsource =3D virQEMUBuildDriveCommandlineFromJSON(srcprops)= )) @@ -4612,8 +4608,7 @@ qemuBuildSCSIVHostHostdevDevStr(const virDomainDef *d= ef, } static char * -qemuBuildSCSIHostdevDrvStr(virDomainHostdevDef *dev, - virQEMUCaps *qemuCaps) +qemuBuildSCSIHostdevDrvStr(virDomainHostdevDef *dev) { g_auto(virBuffer) buf =3D VIR_BUFFER_INITIALIZER; g_autofree char *source =3D NULL; @@ -4621,7 +4616,7 @@ qemuBuildSCSIHostdevDrvStr(virDomainHostdevDef *dev, virDomainHostdevSubsysSCSI *scsisrc =3D &dev->source.subsys.u.scsi; if (scsisrc->protocol =3D=3D VIR_DOMAIN_HOSTDEV_SCSI_PROTOCOL_TYPE_ISC= SI) { - if (!(source =3D qemuBuildSCSIiSCSIHostdevDrvStr(dev, qemuCaps))) + if (!(source =3D qemuBuildSCSIiSCSIHostdevDrvStr(dev))) return NULL; virBufferAdd(&buf, source, -1); } else { @@ -5170,7 +5165,7 @@ qemuBuildHostdevSCSIAttachPrepare(virDomainHostdevDef= *hostdev, } else { if (scsisrc->protocol =3D=3D VIR_DOMAIN_HOSTDEV_SCSI_PROTOCOL_TYPE= _ISCSI) src =3D scsisrc->u.iscsi.src; - ret->driveCmd =3D qemuBuildSCSIHostdevDrvStr(hostdev, qemuCaps); + ret->driveCmd =3D qemuBuildSCSIHostdevDrvStr(hostdev); ret->driveAlias =3D qemuAliasFromHostdev(hostdev); *backendAlias =3D ret->driveAlias; } diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 903e86f8dc..73e69d1558 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -1093,43 +1093,6 @@ qemuDomainVideoPrivateDispose(void *obj) } -/* qemuDomainSecretPlainSetup: - * @secinfo: Pointer to secret info - * @usageType: The virSecretUsageType - * @username: username to use for authentication (may be NULL) - * @seclookupdef: Pointer to seclookupdef data - * - * Taking a secinfo, fill in the plaintext information - * - * Returns 0 on success, -1 on failure with error message - */ -static int -qemuDomainSecretPlainSetup(qemuDomainSecretInfo *secinfo, - virSecretUsageType usageType, - const char *username, - virSecretLookupTypeDef *seclookupdef) -{ - VIR_IDENTITY_AUTORESTORE virIdentity *oldident =3D virIdentityElevateC= urrent(); - g_autoptr(virConnect) conn =3D virGetConnectSecret(); - int ret =3D -1; - - if (!oldident) - return -1; - - if (!conn) - return -1; - - secinfo->type =3D VIR_DOMAIN_SECRET_INFO_TYPE_PLAIN; - secinfo->s.plain.username =3D g_strdup(username); - - ret =3D virSecretGetSecretString(conn, seclookupdef, usageType, - &secinfo->s.plain.secret, - &secinfo->s.plain.secretlen); - - return ret; -} - - /* qemuDomainSecretAESSetup: * @priv: pointer to domain private object * @alias: alias of the secret @@ -1229,35 +1192,6 @@ qemuDomainSecretAESSetupFromSecret(qemuDomainObjPriv= ate *priv, } -/* qemuDomainSecretInfoNewPlain: - * @usageType: Secret usage type - * @username: username - * @lookupDef: lookup def describing secret - * - * Helper function to create a secinfo to be used for secinfo consumers. T= his - * sets up a 'plain' (unencrypted) secret for legacy consumers. - * - * Returns @secinfo on success, NULL on failure. Caller is responsible - * to eventually free @secinfo. - */ -static qemuDomainSecretInfo * -qemuDomainSecretInfoNewPlain(virSecretUsageType usageType, - const char *username, - virSecretLookupTypeDef *lookupDef) -{ - qemuDomainSecretInfo *secinfo =3D NULL; - - secinfo =3D g_new0(qemuDomainSecretInfo, 1); - - if (qemuDomainSecretPlainSetup(secinfo, usageType, username, lookupDef= ) < 0) { - g_clear_pointer(&secinfo, qemuDomainSecretInfoFree); - return NULL; - } - - return secinfo; -} - - /** * qemuDomainSecretInfoTLSNew: * @priv: pointer to domain private object @@ -1366,7 +1300,6 @@ qemuDomainSecretStorageSourcePrepare(qemuDomainObjPri= vate *priv, const char *aliasformat) { qemuDomainStorageSourcePrivate *srcPriv; - bool iscsiHasPS =3D virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_ISCSI_PAS= SWORD_SECRET); bool hasAuth =3D qemuDomainStorageSourceHasAuth(src); bool hasEnc =3D qemuDomainDiskHasEncryptionSecret(src); @@ -1384,19 +1317,11 @@ qemuDomainSecretStorageSourcePrepare(qemuDomainObjP= rivate *priv, if (src->protocol =3D=3D VIR_STORAGE_NET_PROTOCOL_RBD) usageType =3D VIR_SECRET_USAGE_TYPE_CEPH; - if (src->protocol =3D=3D VIR_STORAGE_NET_PROTOCOL_ISCSI && !iscsiH= asPS) { - srcPriv->secinfo =3D qemuDomainSecretInfoNewPlain(usageType, - src->auth->use= rname, - &src->auth->se= clookupdef); - } else { - srcPriv->secinfo =3D qemuDomainSecretAESSetupFromSecret(priv, = aliasprotocol, - "auth", - usageTyp= e, - src->aut= h->username, - &src->au= th->seclookupdef); - } - - if (!srcPriv->secinfo) + if (!(srcPriv->secinfo =3D qemuDomainSecretAESSetupFromSecret(priv= , aliasprotocol, + "auth", + usageT= ype, + src->a= uth->username, + &src->= auth->seclookupdef))) return -1; } @@ -4777,15 +4702,6 @@ qemuDomainValidateStorageSource(virStorageSource *sr= c, return -1; } - /* Use QEMU_CAPS_ISCSI_PASSWORD_SECRET as witness that iscsi 'initiato= r-name' - * option is available, it was introduced at the same time. */ - if (src->initiator.iqn && - !virQEMUCapsGet(qemuCaps, QEMU_CAPS_ISCSI_PASSWORD_SECRET)) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("iSCSI initiator IQN not supported with this QEMU= binary")); - return -1; - } - if (src->sliceStorage) { /* In pre-blockdev era we can't configure the slice so we can allo= w them * only for detected backing store entries as they are populated @@ -5322,7 +5238,6 @@ qemuDomainChrDefPostParse(virDomainChrDef *chr, */ static int qemuDomainDeviceDiskDefPostParseRestoreSecAlias(virDomainDiskDef *disk, - virQEMUCaps *qemuCaps, unsigned int parseFlags) { qemuDomainStorageSourcePrivate *priv =3D QEMU_DOMAIN_STORAGE_SOURCE_PR= IVATE(disk->src); @@ -5344,8 +5259,7 @@ qemuDomainDeviceDiskDefPostParseRestoreSecAlias(virDo= mainDiskDef *disk, * status XML */ if (virStorageSourceGetActualType(disk->src) =3D=3D VIR_STORAGE_TY= PE_NETWORK && (disk->src->protocol =3D=3D VIR_STORAGE_NET_PROTOCOL_RBD || - (disk->src->protocol =3D=3D VIR_STORAGE_NET_PROTOCOL_ISCSI && - virQEMUCapsGet(qemuCaps, QEMU_CAPS_ISCSI_PASSWORD_SECRET)))) + disk->src->protocol =3D=3D VIR_STORAGE_NET_PROTOCOL_ISCSI)) restoreAuthSecret =3D true; } @@ -5385,7 +5299,6 @@ qemuDomainDeviceDiskDefPostParseRestoreSecAlias(virDo= mainDiskDef *disk, static int qemuDomainDeviceDiskDefPostParse(virDomainDiskDef *disk, - virQEMUCaps *qemuCaps, unsigned int parseFlags) { /* set default disk types and drivers */ @@ -5402,8 +5315,7 @@ qemuDomainDeviceDiskDefPostParse(virDomainDiskDef *di= sk, disk->mirror->format =3D=3D VIR_STORAGE_FILE_NONE) disk->mirror->format =3D VIR_STORAGE_FILE_RAW; - if (qemuDomainDeviceDiskDefPostParseRestoreSecAlias(disk, qemuCaps, - parseFlags) < 0) + if (qemuDomainDeviceDiskDefPostParseRestoreSecAlias(disk, parseFlags) = < 0) return -1; /* regenerate TLS alias for old status XMLs */ @@ -5507,7 +5419,6 @@ qemuDomainVsockDefPostParse(virDomainVsockDef *vsock) */ static int qemuDomainDeviceHostdevDefPostParseRestoreSecAlias(virDomainHostdevDef *ho= stdev, - virQEMUCaps *qemuCaps, unsigned int parseFlags) { qemuDomainStorageSourcePrivate *priv; @@ -5521,7 +5432,6 @@ qemuDomainDeviceHostdevDefPostParseRestoreSecAlias(vi= rDomainHostdevDef *hostdev, if (hostdev->mode !=3D VIR_DOMAIN_HOSTDEV_MODE_SUBSYS || hostdev->source.subsys.type !=3D VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SC= SI || scsisrc->protocol !=3D VIR_DOMAIN_HOSTDEV_SCSI_PROTOCOL_TYPE_ISCSI= || - !virQEMUCapsGet(qemuCaps, QEMU_CAPS_ISCSI_PASSWORD_SECRET) || !qemuDomainStorageSourceHasAuth(iscsisrc->src)) return 0; @@ -5611,8 +5521,7 @@ qemuDomainHostdevDefPostParse(virDomainHostdevDef *ho= stdev, { virDomainHostdevSubsys *subsys =3D &hostdev->source.subsys; - if (qemuDomainDeviceHostdevDefPostParseRestoreSecAlias(hostdev, qemuCa= ps, - parseFlags) < 0) + if (qemuDomainDeviceHostdevDefPostParseRestoreSecAlias(hostdev, parseF= lags) < 0) return -1; if (qemuDomainDeviceHostdevDefPostParseRestoreBackendAlias(hostdev, qe= muCaps, @@ -5732,8 +5641,7 @@ qemuDomainDeviceDefPostParse(virDomainDeviceDef *dev, break; case VIR_DOMAIN_DEVICE_DISK: - ret =3D qemuDomainDeviceDiskDefPostParse(dev->data.disk, qemuCaps, - parseFlags); + ret =3D qemuDomainDeviceDiskDefPostParse(dev->data.disk, parseFlag= s); break; case VIR_DOMAIN_DEVICE_VIDEO: @@ -10863,24 +10771,15 @@ qemuDomainPrepareHostdev(virDomainHostdevDef *hos= tdev, } if (src->auth) { - bool iscsiHasPS =3D virQEMUCapsGet(priv->qemuCaps, QEMU_CA= PS_ISCSI_PASSWORD_SECRET); virSecretUsageType usageType =3D VIR_SECRET_USAGE_TYPE_ISC= SI; qemuDomainStorageSourcePrivate *srcPriv =3D qemuDomainStor= ageSourcePrivateFetch(src); - if (!iscsiHasPS) { - srcPriv->secinfo =3D qemuDomainSecretInfoNewPlain(usag= eType, - src->a= uth->username, - &src->= auth->seclookupdef); - } else { - srcPriv->secinfo =3D qemuDomainSecretAESSetupFromSecre= t(priv, - = backendalias, - = NULL, - = usageType, - = src->auth->username, - = &src->auth->seclookupdef); - } - - if (!srcPriv->secinfo) + if (!(srcPriv->secinfo =3D qemuDomainSecretAESSetupFromSec= ret(priv, + = backendalias, + = NULL, + = usageType, + = src->auth->username, + = &src->auth->seclookupdef))) return -1; } } diff --git a/tests/qemuxml2argvdata/disk-network-iscsi.args b/tests/qemuxml= 2argvdata/disk-network-iscsi.args index 4e6d920c88..e63f2f073f 100644 --- a/tests/qemuxml2argvdata/disk-network-iscsi.args +++ b/tests/qemuxml2argvdata/disk-network-iscsi.args @@ -27,14 +27,16 @@ QEMU_AUDIO_DRV=3Dnone \ -boot strict=3Don \ -device virtio-scsi-pci,id=3Dscsi0,bus=3Dpci.0,addr=3D0x2 \ -usb \ --drive file=3Discsi://example.org:6000/iqn.1992-01.com.example/0,format=3D= raw,if=3Dnone,id=3Ddrive-virtio-disk0 \ +-drive file.driver=3Discsi,file.portal=3Dexample.org:6000,file.target=3Diq= n.1992-01.com.example,file.lun=3D0,file.transport=3Dtcp,format=3Draw,if=3Dn= one,id=3Ddrive-virtio-disk0 \ -device virtio-blk-pci,bus=3Dpci.0,addr=3D0x3,drive=3Ddrive-virtio-disk0,i= d=3Dvirtio-disk0,bootindex=3D1 \ --drive file=3Discsi://example.org:6000/iqn.1992-01.com.example/1,format=3D= raw,if=3Dnone,id=3Ddrive-virtio-disk1 \ +-drive file.driver=3Discsi,file.portal=3Dexample.org:6000,file.target=3Diq= n.1992-01.com.example,file.lun=3D1,file.transport=3Dtcp,format=3Draw,if=3Dn= one,id=3Ddrive-virtio-disk1 \ -device virtio-blk-pci,bus=3Dpci.0,addr=3D0x4,drive=3Ddrive-virtio-disk1,i= d=3Dvirtio-disk1 \ --drive file=3Discsi://myname:AQCVn5hO6HzFAhAAq0NCv8jtJcIcE+HOBlMQ1A@exampl= e.org:6000/iqn.1992-01.com.example%3Astorage/1,format=3Draw,if=3Dnone,id=3D= drive-virtio-disk2 \ +-object secret,id=3Dvirtio-disk2-auth-secret0,data=3D9eao5F8qtkGt+seB1HYiv= WIxbtwUu6MQtg1zpj/oDtUsPr1q8wBYM91uEHCn6j/1,keyid=3DmasterKey0,iv=3DAAECAwQ= FBgcICQoLDA0ODw=3D=3D,format=3Dbase64 \ +-drive file.driver=3Discsi,file.portal=3Dexample.org:6000,file.target=3Diq= n.1992-01.com.example:storage,file.lun=3D1,file.transport=3Dtcp,file.user= =3Dmyname,file.password-secret=3Dvirtio-disk2-auth-secret0,format=3Draw,if= =3Dnone,id=3Ddrive-virtio-disk2 \ -device virtio-blk-pci,bus=3Dpci.0,addr=3D0x5,drive=3Ddrive-virtio-disk2,i= d=3Dvirtio-disk2 \ --drive file=3Discsi://myname:AQCVn5hO6HzFAhAAq0NCv8jtJcIcE+HOBlMQ1A@exampl= e.org:6000/iqn.1992-01.com.example%3Astorage/2,format=3Draw,if=3Dnone,id=3D= drive-virtio-disk3 \ +-object secret,id=3Dvirtio-disk3-auth-secret0,data=3D9eao5F8qtkGt+seB1HYiv= WIxbtwUu6MQtg1zpj/oDtUsPr1q8wBYM91uEHCn6j/1,keyid=3DmasterKey0,iv=3DAAECAwQ= FBgcICQoLDA0ODw=3D=3D,format=3Dbase64 \ +-drive file.driver=3Discsi,file.portal=3Dexample.org:6000,file.target=3Diq= n.1992-01.com.example:storage,file.lun=3D2,file.transport=3Dtcp,file.user= =3Dmyname,file.password-secret=3Dvirtio-disk3-auth-secret0,format=3Draw,if= =3Dnone,id=3Ddrive-virtio-disk3 \ -device virtio-blk-pci,bus=3Dpci.0,addr=3D0x6,drive=3Ddrive-virtio-disk3,i= d=3Dvirtio-disk3 \ --drive file=3Discsi://example.org:3260/iqn.1992-01.com.example/0,format=3D= raw,if=3Dnone,id=3Ddrive-scsi0-0-0-0 \ +-drive file.driver=3Discsi,file.portal=3Dexample.org:3260,file.target=3Diq= n.1992-01.com.example,file.lun=3D0,file.transport=3Dtcp,format=3Draw,if=3Dn= one,id=3Ddrive-scsi0-0-0-0 \ -device scsi-block,bus=3Dscsi0.0,channel=3D0,scsi-id=3D0,lun=3D0,drive=3Dd= rive-scsi0-0-0-0,id=3Dscsi0-0-0-0 \ -msg timestamp=3Don diff --git a/tests/qemuxml2argvdata/disk-network-source-auth.args b/tests/q= emuxml2argvdata/disk-network-source-auth.args index 9c58a9c8c0..0a040ac4ea 100644 --- a/tests/qemuxml2argvdata/disk-network-source-auth.args +++ b/tests/qemuxml2argvdata/disk-network-source-auth.args @@ -26,7 +26,8 @@ QEMU_AUDIO_DRV=3Dnone \ -no-acpi \ -boot strict=3Don \ -usb \ --drive file=3Discsi://myname:AQCVn5hO6HzFAhAAq0NCv8jtJcIcE+HOBlMQ1A@exampl= e.org:6000/iqn.1992-01.com.example%3Astorage/1,format=3Draw,if=3Dnone,id=3D= drive-virtio-disk0 \ +-object secret,id=3Dvirtio-disk0-auth-secret0,data=3D9eao5F8qtkGt+seB1HYiv= WIxbtwUu6MQtg1zpj/oDtUsPr1q8wBYM91uEHCn6j/1,keyid=3DmasterKey0,iv=3DAAECAwQ= FBgcICQoLDA0ODw=3D=3D,format=3Dbase64 \ +-drive file.driver=3Discsi,file.portal=3Dexample.org:6000,file.target=3Diq= n.1992-01.com.example:storage,file.lun=3D1,file.transport=3Dtcp,file.user= =3Dmyname,file.password-secret=3Dvirtio-disk0-auth-secret0,format=3Draw,if= =3Dnone,id=3Ddrive-virtio-disk0 \ -device virtio-blk-pci,bus=3Dpci.0,addr=3D0x2,drive=3Ddrive-virtio-disk0,i= d=3Dvirtio-disk0,bootindex=3D1 \ -object secret,id=3Dvirtio-disk1-auth-secret0,data=3D9eao5F8qtkGt+seB1HYiv= WIxbtwUu6MQtg1zpj/oDtUsPr1q8wBYM91uEHCn6j/1,keyid=3DmasterKey0,iv=3DAAECAwQ= FBgcICQoLDA0ODw=3D=3D,format=3Dbase64 \ -drive 'file=3Drbd:pool/image:id=3Dmyname:auth_supported=3Dcephx\;none:mon= _host=3Dmon1.example.org\:6321\;mon2.example.org\:6322\;mon3.example.org\:6= 322,file.password-secret=3Dvirtio-disk1-auth-secret0,format=3Draw,if=3Dnone= ,id=3Ddrive-virtio-disk1' \ diff --git a/tests/qemuxml2argvdata/disk-source-pool-mode.args b/tests/qemu= xml2argvdata/disk-source-pool-mode.args index d78637613e..f4f4a72a2a 100644 --- a/tests/qemuxml2argvdata/disk-source-pool-mode.args +++ b/tests/qemuxml2argvdata/disk-source-pool-mode.args @@ -28,11 +28,11 @@ QEMU_AUDIO_DRV=3Dnone \ -usb \ -drive file=3D/some/block/device/unit:0:0:1,format=3Draw,if=3Dnone,id=3Ddr= ive-ide0-0-1,readonly=3Don \ -device ide-cd,bus=3Dide.0,unit=3D1,drive=3Ddrive-ide0-0-1,id=3Dide0-0-1 \ --drive file=3Discsi://iscsi.example.com:3260/demo-target/2,format=3Draw,if= =3Dnone,id=3Ddrive-ide0-0-2,readonly=3Don \ +-drive file.driver=3Discsi,file.portal=3Discsi.example.com:3260,file.targe= t=3Ddemo-target,file.lun=3D2,file.transport=3Dtcp,format=3Draw,if=3Dnone,id= =3Ddrive-ide0-0-2,readonly=3Don \ -device ide-cd,bus=3Dide.0,unit=3D2,drive=3Ddrive-ide0-0-2,id=3Dide0-0-2 \ -drive file=3D/tmp/idedisk.img,format=3Draw,if=3Dnone,id=3Ddrive-ide0-0-3 \ -device ide-hd,bus=3Dide.0,unit=3D3,drive=3Ddrive-ide0-0-3,id=3Dide0-0-3,b= ootindex=3D1 \ --drive file=3Discsi://iscsi.example.com:3260/demo-target/3,format=3Draw,if= =3Dnone,id=3Ddrive-ide0-0-4,readonly=3Don \ +-drive file.driver=3Discsi,file.portal=3Discsi.example.com:3260,file.targe= t=3Ddemo-target,file.lun=3D3,file.transport=3Dtcp,format=3Draw,if=3Dnone,id= =3Ddrive-ide0-0-4,readonly=3Don \ -device ide-cd,bus=3Dide.0,unit=3D4,drive=3Ddrive-ide0-0-4,id=3Dide0-0-4 \ -device virtio-balloon-pci,id=3Dballoon0,bus=3Dpci.0,addr=3D0x2 \ -msg timestamp=3Don diff --git a/tests/qemuxml2argvdata/luks-disks-source-qcow2.args b/tests/qe= muxml2argvdata/luks-disks-source-qcow2.args index 881fa5c1ca..a0aa131ca5 100644 --- a/tests/qemuxml2argvdata/luks-disks-source-qcow2.args +++ b/tests/qemuxml2argvdata/luks-disks-source-qcow2.args @@ -32,11 +32,12 @@ QEMU_AUDIO_DRV=3Dnone \ -object secret,id=3Dvirtio-disk1-encryption-secret0,data=3D9eao5F8qtkGt+se= B1HYivWIxbtwUu6MQtg1zpj/oDtUsPr1q8wBYM91uEHCn6j/1,keyid=3DmasterKey0,iv=3DA= AECAwQFBgcICQoLDA0ODw=3D=3D,format=3Dbase64 \ -drive file=3D/storage/guest_disks/encryptdisk2,encrypt.format=3Dluks,encr= ypt.key-secret=3Dvirtio-disk1-encryption-secret0,format=3Dqcow2,if=3Dnone,i= d=3Ddrive-virtio-disk1 \ -device virtio-blk-pci,bus=3Dpci.0,addr=3D0x5,drive=3Ddrive-virtio-disk1,i= d=3Dvirtio-disk1 \ +-object secret,id=3Dvirtio-disk2-auth-secret0,data=3D9eao5F8qtkGt+seB1HYiv= WIxbtwUu6MQtg1zpj/oDtUsPr1q8wBYM91uEHCn6j/1,keyid=3DmasterKey0,iv=3DAAECAwQ= FBgcICQoLDA0ODw=3D=3D,format=3Dbase64 \ -object secret,id=3Dvirtio-disk2-encryption-secret0,data=3D9eao5F8qtkGt+se= B1HYivWIxbtwUu6MQtg1zpj/oDtUsPr1q8wBYM91uEHCn6j/1,keyid=3DmasterKey0,iv=3DA= AECAwQFBgcICQoLDA0ODw=3D=3D,format=3Dbase64 \ --drive file=3Discsi://myname:AQCVn5hO6HzFAhAAq0NCv8jtJcIcE+HOBlMQ1A@exampl= e.org:6000/iqn.1992-01.com.example%3Astorage/1,encrypt.format=3Dluks,encryp= t.key-secret=3Dvirtio-disk2-encryption-secret0,format=3Dqcow2,if=3Dnone,id= =3Ddrive-virtio-disk2 \ +-drive file.driver=3Discsi,file.portal=3Dexample.org:6000,file.target=3Diq= n.1992-01.com.example:storage,file.lun=3D1,file.transport=3Dtcp,file.user= =3Dmyname,file.password-secret=3Dvirtio-disk2-auth-secret0,encrypt.format= =3Dluks,encrypt.key-secret=3Dvirtio-disk2-encryption-secret0,format=3Dqcow2= ,if=3Dnone,id=3Ddrive-virtio-disk2 \ -device virtio-blk-pci,bus=3Dpci.0,addr=3D0x2,drive=3Ddrive-virtio-disk2,i= d=3Dvirtio-disk2 \ -object secret,id=3Dvirtio-disk3-encryption-secret0,data=3D9eao5F8qtkGt+se= B1HYivWIxbtwUu6MQtg1zpj/oDtUsPr1q8wBYM91uEHCn6j/1,keyid=3DmasterKey0,iv=3DA= AECAwQFBgcICQoLDA0ODw=3D=3D,format=3Dbase64 \ --drive file=3Discsi://iscsi.example.com:3260/demo-target/3,encrypt.format= =3Dluks,encrypt.key-secret=3Dvirtio-disk3-encryption-secret0,format=3Dqcow2= ,if=3Dnone,id=3Ddrive-virtio-disk3 \ +-drive file.driver=3Discsi,file.portal=3Discsi.example.com:3260,file.targe= t=3Ddemo-target,file.lun=3D3,file.transport=3Dtcp,encrypt.format=3Dluks,enc= rypt.key-secret=3Dvirtio-disk3-encryption-secret0,format=3Dqcow2,if=3Dnone,= id=3Ddrive-virtio-disk3 \ -device virtio-blk-pci,bus=3Dpci.0,addr=3D0x6,drive=3Ddrive-virtio-disk3,i= d=3Dvirtio-disk3 \ -object secret,id=3Dvirtio-disk4-encryption-secret0,data=3D9eao5F8qtkGt+se= B1HYivWIxbtwUu6MQtg1zpj/oDtUsPr1q8wBYM91uEHCn6j/1,keyid=3DmasterKey0,iv=3DA= AECAwQFBgcICQoLDA0ODw=3D=3D,format=3Dbase64 \ -drive 'file=3Drbd:pool/image:auth_supported=3Dnone:mon_host=3Dmon1.exampl= e.org\:6321\;mon2.example.org\:6322\;mon3.example.org\:6322,encrypt.format= =3Dluks,encrypt.key-secret=3Dvirtio-disk4-encryption-secret0,format=3Dqcow2= ,if=3Dnone,id=3Ddrive-virtio-disk4' \ diff --git a/tests/qemuxml2argvdata/luks-disks-source.args b/tests/qemuxml2= argvdata/luks-disks-source.args index 5854f3b153..4d056da220 100644 --- a/tests/qemuxml2argvdata/luks-disks-source.args +++ b/tests/qemuxml2argvdata/luks-disks-source.args @@ -32,11 +32,12 @@ QEMU_AUDIO_DRV=3Dnone \ -object secret,id=3Dvirtio-disk1-encryption-secret0,data=3D9eao5F8qtkGt+se= B1HYivWIxbtwUu6MQtg1zpj/oDtUsPr1q8wBYM91uEHCn6j/1,keyid=3DmasterKey0,iv=3DA= AECAwQFBgcICQoLDA0ODw=3D=3D,format=3Dbase64 \ -drive file=3D/storage/guest_disks/encryptdisk2,key-secret=3Dvirtio-disk1-= encryption-secret0,format=3Dluks,if=3Dnone,id=3Ddrive-virtio-disk1 \ -device virtio-blk-pci,bus=3Dpci.0,addr=3D0x5,drive=3Ddrive-virtio-disk1,i= d=3Dvirtio-disk1 \ +-object secret,id=3Dvirtio-disk2-auth-secret0,data=3D9eao5F8qtkGt+seB1HYiv= WIxbtwUu6MQtg1zpj/oDtUsPr1q8wBYM91uEHCn6j/1,keyid=3DmasterKey0,iv=3DAAECAwQ= FBgcICQoLDA0ODw=3D=3D,format=3Dbase64 \ -object secret,id=3Dvirtio-disk2-encryption-secret0,data=3D9eao5F8qtkGt+se= B1HYivWIxbtwUu6MQtg1zpj/oDtUsPr1q8wBYM91uEHCn6j/1,keyid=3DmasterKey0,iv=3DA= AECAwQFBgcICQoLDA0ODw=3D=3D,format=3Dbase64 \ --drive file=3Discsi://myname:AQCVn5hO6HzFAhAAq0NCv8jtJcIcE+HOBlMQ1A@exampl= e.org:6000/iqn.1992-01.com.example%3Astorage/1,key-secret=3Dvirtio-disk2-en= cryption-secret0,format=3Dluks,if=3Dnone,id=3Ddrive-virtio-disk2 \ +-drive file.driver=3Discsi,file.portal=3Dexample.org:6000,file.target=3Diq= n.1992-01.com.example:storage,file.lun=3D1,file.transport=3Dtcp,file.user= =3Dmyname,file.password-secret=3Dvirtio-disk2-auth-secret0,key-secret=3Dvir= tio-disk2-encryption-secret0,format=3Dluks,if=3Dnone,id=3Ddrive-virtio-disk= 2 \ -device virtio-blk-pci,bus=3Dpci.0,addr=3D0x2,drive=3Ddrive-virtio-disk2,i= d=3Dvirtio-disk2 \ -object secret,id=3Dvirtio-disk3-encryption-secret0,data=3D9eao5F8qtkGt+se= B1HYivWIxbtwUu6MQtg1zpj/oDtUsPr1q8wBYM91uEHCn6j/1,keyid=3DmasterKey0,iv=3DA= AECAwQFBgcICQoLDA0ODw=3D=3D,format=3Dbase64 \ --drive file=3Discsi://iscsi.example.com:3260/demo-target/3,key-secret=3Dvi= rtio-disk3-encryption-secret0,format=3Dluks,if=3Dnone,id=3Ddrive-virtio-dis= k3 \ +-drive file.driver=3Discsi,file.portal=3Discsi.example.com:3260,file.targe= t=3Ddemo-target,file.lun=3D3,file.transport=3Dtcp,key-secret=3Dvirtio-disk3= -encryption-secret0,format=3Dluks,if=3Dnone,id=3Ddrive-virtio-disk3 \ -device virtio-blk-pci,bus=3Dpci.0,addr=3D0x6,drive=3Ddrive-virtio-disk3,i= d=3Dvirtio-disk3 \ -object secret,id=3Dvirtio-disk4-encryption-secret0,data=3D9eao5F8qtkGt+se= B1HYivWIxbtwUu6MQtg1zpj/oDtUsPr1q8wBYM91uEHCn6j/1,keyid=3DmasterKey0,iv=3DA= AECAwQFBgcICQoLDA0ODw=3D=3D,format=3Dbase64 \ -drive 'file=3Drbd:pool/image:auth_supported=3Dnone:mon_host=3Dmon1.exampl= e.org\:6321\;mon2.example.org\:6322\;mon3.example.org\:6322,key-secret=3Dvi= rtio-disk4-encryption-secret0,format=3Dluks,if=3Dnone,id=3Ddrive-virtio-dis= k4' \ diff --git a/tests/qemuxml2argvdata/name-escape.args b/tests/qemuxml2argvda= ta/name-escape.args index 028b6efbbd..449244a082 100644 --- a/tests/qemuxml2argvdata/name-escape.args +++ b/tests/qemuxml2argvdata/name-escape.args @@ -39,7 +39,7 @@ QEMU_AUDIO_DRV=3Dspice \ -vnc unix:/tmp/lib/domain--1-foo=3D1,,bar=3D2/vnc.sock \ -spice unix,addr=3D/tmp/lib/domain--1-foo=3D1,,bar=3D2/spice.sock,gl=3Don,= rendernode=3D/dev/dri/foo,,bar,seamless-migration=3Don \ -device cirrus-vga,id=3Dvideo0,bus=3Dpci.0,addr=3D0x2 \ --drive file=3Discsi://example.foo.org:3260/iqn.1992-01.com.example%3Amy,,s= torage/1,if=3Dnone,format=3Draw,id=3Ddrive-hostdev0 \ +-drive file.driver=3Discsi,file.portal=3Dexample.foo.org:3260,file.target= =3Diqn.1992-01.com.example:my,,storage,file.lun=3D1,file.transport=3Dtcp,if= =3Dnone,format=3Draw,id=3Ddrive-hostdev0 \ -device scsi-generic,bus=3Dscsi0.0,channel=3D0,scsi-id=3D0,lun=3D4,drive= =3Ddrive-hostdev0,id=3Dhostdev0 \ -device virtio-balloon-pci,id=3Dballoon0,bus=3Dpci.0,addr=3D0x4 \ -msg timestamp=3Don diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 8c068b4a4f..f0cfca014c 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -1353,8 +1353,7 @@ mymain(void) DO_TEST("disk-network-iscsi", QEMU_CAPS_VIRTIO_SCSI, QEMU_CAPS_SCSI_BL= OCK); DO_TEST("disk-network-iscsi-modern", QEMU_CAPS_VIRTIO_SCSI, - QEMU_CAPS_SCSI_BLOCK, - QEMU_CAPS_ISCSI_PASSWORD_SECRET); + QEMU_CAPS_SCSI_BLOCK); DO_TEST_CAPS_VER("disk-network-iscsi", "2.12.0"); DO_TEST_CAPS_LATEST("disk-network-iscsi"); DO_TEST_PARSE_ERROR_NOCAPS("disk-network-iscsi-auth-secrettype-invalid= "); --=20 2.31.1