From nobody Thu Nov 14 07:14:38 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.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 216.205.24.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=1632310634; cv=none; d=zohomail.com; s=zohoarc; b=ksxe37yvS2wmzAk+Mwlp9nseogszyfYNCsH4AbvNaRmygesnBEj5KBfhLM/ckfKL5Ct070m1YUkzIuv8tGyUzkClkL5VAfMKe6BD8UqNwOV5L+PkE9D8CKBcJy8jCRVcnXCFwMC4D+b5FXLKL1LjzMA7yVJirhXt/ibz/T9FyFI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1632310634; 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=SM0l960XZMF7wIIVrSrUhsk7nnRl9nWAXRYM0cSGSYI=; b=KjZSHpJoBjJY9xbc8j9gLSgSZASlOFQr9AeeedU4F7tFWm7NpoDkP1zhPg55J9Hm/Q/ds2aaok0AsLvF2KaV6Zpv9MrAVPF8VM6DqO5NRQsStvAJL0+ayazzq6GBTwOoDpHbyEX4KiXwMsx8S0r5ias9VRPsDE5J9eqoyTbqJ2c= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.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 [216.205.24.124]) by mx.zohomail.com with SMTPS id 1632310634927900.3692174473244; Wed, 22 Sep 2021 04:37:14 -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-433-R9pKTzQyMOuBdos_p_Sj2g-1; Wed, 22 Sep 2021 07:36:22 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id D23BCA40C3; Wed, 22 Sep 2021 11:36:13 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id AFBA35D9F4; Wed, 22 Sep 2021 11:36:13 +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 5EBC11832DD2; Wed, 22 Sep 2021 11:36:13 +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 18MBZnf3006719 for ; Wed, 22 Sep 2021 07:35:49 -0400 Received: by smtp.corp.redhat.com (Postfix) id E926C60854; Wed, 22 Sep 2021 11:35:49 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.16]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4F13C60871 for ; Wed, 22 Sep 2021 11:35:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1632310633; 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=SM0l960XZMF7wIIVrSrUhsk7nnRl9nWAXRYM0cSGSYI=; b=FifjpLC+N2WLqKYCbfWv7+WSWfruanr9GlUQjS/YvLZn9Q/cVcVHNuRqiGKUEAmFFt1KSt AEabS5KSLfU7rXfubM1LLcK+l5ZVse1e7lHqOesa+eTYD9GvnlZyogZUWeILsEHF+YgssA MD9Ijxeg1GXS5crLjM/ZK2ICo5S8mPs= X-MC-Unique: R9pKTzQyMOuBdos_p_Sj2g-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 10/12] qemu: Simplify qemuDomainSecretInfo Date: Wed, 22 Sep 2021 13:35:29 +0200 Message-Id: <631a6749a517b0b821f0cc49c7293e232437051b.1632310421.git.pkrempa@redhat.com> 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.14 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: 1632310636224100001 Content-Type: text/plain; charset="utf-8" Now that we've removed support for plaintext secrets qemuDomainSecretInfo can be simplified by removing the 'type' field and merging in all the fields from 'qemuDomainSecretAES'. Signed-off-by: Peter Krempa --- src/qemu/qemu_backup.c | 2 +- src/qemu/qemu_block.c | 40 ++++++++++++---------------- src/qemu/qemu_command.c | 41 +++++++++++------------------ src/qemu/qemu_domain.c | 45 +++++++++----------------------- src/qemu/qemu_domain.h | 20 +++----------- src/qemu/qemu_hotplug.c | 4 +-- src/qemu/qemu_migration_params.c | 2 +- tests/qemublocktest.c | 13 ++++----- 8 files changed, 56 insertions(+), 111 deletions(-) diff --git a/src/qemu/qemu_backup.c b/src/qemu/qemu_backup.c index 4f1e3b7bad..d7583e7399 100644 --- a/src/qemu/qemu_backup.c +++ b/src/qemu/qemu_backup.c @@ -723,7 +723,7 @@ qemuBackupBeginPrepareTLS(virDomainObj *vm, if (qemuBuildSecretInfoProps(secinfo, tlsSecretProps) < 0) return -1; - tlsKeySecretAlias =3D secinfo->s.aes.alias; + tlsKeySecretAlias =3D secinfo->alias; } if (qemuBuildTLSx509BackendProps(cfg->backupTLSx509certdir, true, diff --git a/src/qemu/qemu_block.c b/src/qemu/qemu_block.c index 0bc92f6a23..393d3f44d7 100644 --- a/src/qemu/qemu_block.c +++ b/src/qemu/qemu_block.c @@ -746,12 +746,12 @@ qemuBlockStorageSourceGetCURLProps(virStorageSource *= src, if (!onlytarget) { if (src->auth) { username =3D src->auth->username; - passwordalias =3D srcPriv->secinfo->s.aes.alias; + passwordalias =3D srcPriv->secinfo->alias; } if (srcPriv && srcPriv->httpcookie) - cookiealias =3D srcPriv->httpcookie->s.aes.alias; + cookiealias =3D srcPriv->httpcookie->alias; } else { /* format target string along with cookies */ cookiestr =3D qemuBlockStorageSourceGetCookieString(src); @@ -819,7 +819,7 @@ qemuBlockStorageSourceGetISCSIProps(virStorageSource *s= rc, if (!onlytarget && src->auth) { username =3D src->auth->username; - objalias =3D srcPriv->secinfo->s.aes.alias; + objalias =3D srcPriv->secinfo->alias; } ignore_value(virJSONValueObjectCreate(&ret, @@ -885,8 +885,8 @@ qemuBlockStorageSourceGetRBDProps(virStorageSource *src, return NULL; if (!onlytarget && src->auth) { - username =3D srcPriv->secinfo->s.aes.username; - keysecret =3D srcPriv->secinfo->s.aes.alias; + username =3D srcPriv->secinfo->username; + keysecret =3D srcPriv->secinfo->alias; /* the auth modes are modelled after our old command line generato= r */ authmodes =3D virJSONValueNewArray(); @@ -1267,7 +1267,7 @@ qemuBlockStorageSourceGetFormatLUKSProps(virStorageSo= urce *src, { qemuDomainStorageSourcePrivate *srcPriv =3D QEMU_DOMAIN_STORAGE_SOURCE= _PRIVATE(src); - if (!srcPriv || !srcPriv->encinfo || !srcPriv->encinfo->s.aes.alias) { + if (!srcPriv || !srcPriv->encinfo || !srcPriv->encinfo->alias) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("missing secret info for 'luks' driver")); return -1; @@ -1275,7 +1275,7 @@ qemuBlockStorageSourceGetFormatLUKSProps(virStorageSo= urce *src, if (virJSONValueObjectAdd(props, "s:driver", "luks", - "s:key-secret", srcPriv->encinfo->s.aes.alia= s, + "s:key-secret", srcPriv->encinfo->alias, NULL) < 0) return -1; @@ -1313,14 +1313,9 @@ qemuBlockStorageSourceGetCryptoProps(virStorageSourc= e *src, *encprops =3D NULL; - /* qemu requires encrypted secrets regardless of encryption method use= d when - * passed using the blockdev infrastructure, thus only - * VIR_DOMAIN_SECRET_INFO_TYPE_AES works here. The correct type needs = to be - * instantiated elsewhere. */ if (!src->encryption || !srcpriv || - !srcpriv->encinfo || - srcpriv->encinfo->type !=3D VIR_DOMAIN_SECRET_INFO_TYPE_AES) + !srcpriv->encinfo) return 0; switch ((virStorageEncryptionFormatType) src->encryption->format) { @@ -1342,7 +1337,7 @@ qemuBlockStorageSourceGetCryptoProps(virStorageSource= *src, return virJSONValueObjectCreate(encprops, "s:format", encformat, - "s:key-secret", srcpriv->encinfo->s.ae= s.alias, + "s:key-secret", srcpriv->encinfo->alia= s, NULL); } @@ -1906,17 +1901,17 @@ qemuBlockStorageSourceDetachPrepare(virStorageSourc= e *src, data->tlsAlias =3D g_strdup(src->tlsAlias); if (srcpriv) { - if (srcpriv->secinfo && srcpriv->secinfo->type =3D=3D VIR_DOMAIN_S= ECRET_INFO_TYPE_AES) - data->authsecretAlias =3D g_strdup(srcpriv->secinfo->s.aes.ali= as); + if (srcpriv->secinfo) + data->authsecretAlias =3D g_strdup(srcpriv->secinfo->alias); - if (srcpriv->encinfo && srcpriv->encinfo->type =3D=3D VIR_DOMAIN_S= ECRET_INFO_TYPE_AES) - data->encryptsecretAlias =3D g_strdup(srcpriv->encinfo->s.aes.= alias); + if (srcpriv->encinfo) + data->encryptsecretAlias =3D g_strdup(srcpriv->encinfo->alias); if (srcpriv->httpcookie) - data->httpcookiesecretAlias =3D g_strdup(srcpriv->httpcookie->= s.aes.alias); + data->httpcookiesecretAlias =3D g_strdup(srcpriv->httpcookie->= alias); if (srcpriv->tlsKeySecret) - data->tlsKeySecretAlias =3D g_strdup(srcpriv->tlsKeySecret->s.= aes.alias); + data->tlsKeySecretAlias =3D g_strdup(srcpriv->tlsKeySecret->al= ias); } return g_steal_pointer(&data); @@ -2319,9 +2314,8 @@ qemuBlockStorageSourceCreateGetEncryptionLUKS(virStor= ageSource *src, const char *keysecret =3D NULL; if (srcpriv && - srcpriv->encinfo && - srcpriv->encinfo->type =3D=3D VIR_DOMAIN_SECRET_INFO_TYPE_AES) - keysecret =3D srcpriv->encinfo->s.aes.alias; + srcpriv->encinfo) + keysecret =3D srcpriv->encinfo->alias; if (virJSONValueObjectCreate(&props, "s:key-secret", keysecret, diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 0b87719f75..5b738b230e 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -707,9 +707,9 @@ qemuBuildSecretInfoProps(qemuDomainSecretInfo *secinfo, return -1; return qemuMonitorCreateObjectProps(propsret, "secret", - secinfo->s.aes.alias, "s:data", - secinfo->s.aes.ciphertext, "s:keyi= d", - keyid, "s:iv", secinfo->s.aes.iv, + secinfo->alias, "s:data", + secinfo->ciphertext, "s:keyid", + keyid, "s:iv", secinfo->iv, "s:format", "base64", NULL); } @@ -763,20 +763,11 @@ static int qemuBuildRBDSecinfoURI(virBuffer *buf, qemuDomainSecretInfo *secinfo) { - if (!secinfo) { + if (!secinfo) virBufferAddLit(buf, ":auth_supported=3Dnone"); - return 0; - } - - switch ((qemuDomainSecretInfoType) secinfo->type) { - case VIR_DOMAIN_SECRET_INFO_TYPE_AES: + else virBufferEscape(buf, '\\', ":", ":id=3D%s:auth_supported=3Dcephx\\= ;none", - secinfo->s.aes.username); - break; - - case VIR_DOMAIN_SECRET_INFO_TYPE_LAST: - return -1; - } + secinfo->username); return 0; } @@ -1264,8 +1255,8 @@ qemuBuildDriveSourceStr(virDomainDiskDef *disk, virQEMUBuildBufferEscapeComma(buf, source); - if (secinfo && secinfo->type =3D=3D VIR_DOMAIN_SECRET_INFO_TYPE_AE= S) - virBufferAsprintf(buf, ",file.password-secret=3D%s", secinfo->= s.aes.alias); + if (secinfo) + virBufferAsprintf(buf, ",file.password-secret=3D%s", secinfo->= alias); if (disk->src->debug) virBufferAsprintf(buf, ",file.debug=3D%d", disk->src->debugLev= el); @@ -1282,12 +1273,12 @@ qemuBuildDriveSourceStr(virDomainDiskDef *disk, if (encinfo) { if (disk->src->format =3D=3D VIR_STORAGE_FILE_RAW) { - virBufferAsprintf(buf, "key-secret=3D%s,", encinfo->s.aes.alia= s); + virBufferAsprintf(buf, "key-secret=3D%s,", encinfo->alias); rawluks =3D true; } else if (disk->src->format =3D=3D VIR_STORAGE_FILE_QCOW2 && disk->src->encryption->format =3D=3D VIR_STORAGE_ENCRYP= TION_FORMAT_LUKS) { virBufferAddLit(buf, "encrypt.format=3Dluks,"); - virBufferAsprintf(buf, "encrypt.key-secret=3D%s,", encinfo->s.= aes.alias); + virBufferAsprintf(buf, "encrypt.key-secret=3D%s,", encinfo->al= ias); } } @@ -4886,7 +4877,7 @@ qemuBuildChrChardevStr(virLogManager *logManager, qemuCaps) < 0) return NULL; - tlsCertEncSecAlias =3D chrSourcePriv->secinfo->s.aes.alias; + tlsCertEncSecAlias =3D chrSourcePriv->secinfo->alias; } if (!(objalias =3D qemuAliasTLSObjFromSrcAlias(charAlias))) @@ -5046,9 +5037,8 @@ qemuBuildHostdevSCSIDetachPrepare(virDomainHostdevDef= *hostdev, ret->storageNodeName =3D src->nodestorage; ret->storageAttached =3D true; - if (srcpriv && srcpriv->secinfo && - srcpriv->secinfo->type =3D=3D VIR_DOMAIN_SECRET_INFO_TYPE_AES) - ret->authsecretAlias =3D g_strdup(srcpriv->secinfo->s.aes.alia= s); + if (srcpriv && srcpriv->secinfo) + ret->authsecretAlias =3D g_strdup(srcpriv->secinfo->alias); } else { ret->driveAlias =3D qemuAliasFromHostdev(hostdev); @@ -8012,7 +8002,7 @@ qemuBuildGraphicsVNCCommandLine(virQEMUDriverConfig *= cfg, gfxPriv->secinfo, qemuCaps) < 0) return -1; - secretAlias =3D gfxPriv->secinfo->s.aes.alias; + secretAlias =3D gfxPriv->secinfo->alias; } if (qemuBuildTLSx509CommandLine(cmd, @@ -10898,7 +10888,6 @@ qemuBuildStorageSourceAttachPrepareCommon(virStorag= eSource *src, if (srcpriv) { if (srcpriv->secinfo && - srcpriv->secinfo->type =3D=3D VIR_DOMAIN_SECRET_INFO_TYPE_AES = && qemuBuildSecretInfoProps(srcpriv->secinfo, &data->authsecretPr= ops) < 0) return -1; @@ -10914,7 +10903,7 @@ qemuBuildStorageSourceAttachPrepareCommon(virStorag= eSource *src, if (qemuBuildSecretInfoProps(srcpriv->tlsKeySecret, &data->tls= KeySecretProps) < 0) return -1; - tlsKeySecretAlias =3D srcpriv->tlsKeySecret->s.aes.alias; + tlsKeySecretAlias =3D srcpriv->tlsKeySecret->alias; } } diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index e9c1f3eacb..befe6bd476 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -657,19 +657,6 @@ qemuDomainMasterKeyCreate(virDomainObj *vm) } -static void -qemuDomainSecretAESClear(struct _qemuDomainSecretAES *secret, - bool keepAlias) -{ - if (!keepAlias) - VIR_FREE(secret->alias); - - VIR_FREE(secret->username); - VIR_FREE(secret->iv); - VIR_FREE(secret->ciphertext); -} - - static void qemuDomainSecretInfoClear(qemuDomainSecretInfo *secinfo, bool keepAlias) @@ -677,14 +664,12 @@ qemuDomainSecretInfoClear(qemuDomainSecretInfo *secin= fo, if (!secinfo) return; - switch ((qemuDomainSecretInfoType) secinfo->type) { - case VIR_DOMAIN_SECRET_INFO_TYPE_AES: - qemuDomainSecretAESClear(&secinfo->s.aes, keepAlias); - break; + if (!keepAlias) + VIR_FREE(secinfo->alias); - case VIR_DOMAIN_SECRET_INFO_TYPE_LAST: - break; - } + VIR_FREE(secinfo->username); + VIR_FREE(secinfo->iv); + VIR_FREE(secinfo->ciphertext); } @@ -1106,9 +1091,8 @@ qemuDomainSecretAESSetup(qemuDomainObjPrivate *priv, secinfo =3D g_new0(qemuDomainSecretInfo, 1); - secinfo->type =3D VIR_DOMAIN_SECRET_INFO_TYPE_AES; - secinfo->s.aes.alias =3D g_strdup(alias); - secinfo->s.aes.username =3D g_strdup(username); + secinfo->alias =3D g_strdup(alias); + secinfo->username =3D g_strdup(username); raw_iv =3D g_new0(uint8_t, ivlen); @@ -1117,7 +1101,7 @@ qemuDomainSecretAESSetup(qemuDomainObjPrivate *priv, return NULL; /* Encode the IV and save that since qemu will need it */ - secinfo->s.aes.iv =3D g_base64_encode(raw_iv, ivlen); + secinfo->iv =3D g_base64_encode(raw_iv, ivlen); if (virCryptoEncryptData(VIR_CRYPTO_CIPHER_AES256CBC, priv->masterKey, QEMU_DOMAIN_MASTER_KEY_LEN, @@ -1126,8 +1110,7 @@ qemuDomainSecretAESSetup(qemuDomainObjPrivate *priv, return NULL; /* Now encode the ciphertext and store to be passed to qemu */ - secinfo->s.aes.ciphertext =3D g_base64_encode(ciphertext, - ciphertextlen); + secinfo->ciphertext =3D g_base64_encode(ciphertext, ciphertextlen); return g_steal_pointer(&secinfo); } @@ -1809,11 +1792,9 @@ qemuStorageSourcePrivateDataAssignSecinfo(qemuDomain= SecretInfo **secinfo, if (!*secinfo) { *secinfo =3D g_new0(qemuDomainSecretInfo, 1); - (*secinfo)->type =3D VIR_DOMAIN_SECRET_INFO_TYPE_AES; } - if ((*secinfo)->type =3D=3D VIR_DOMAIN_SECRET_INFO_TYPE_AES) - (*secinfo)->s.aes.alias =3D g_steal_pointer(&*alias); + (*secinfo)->alias =3D g_steal_pointer(&*alias); return 0; } @@ -1881,13 +1862,11 @@ qemuStorageSourcePrivateDataFormatSecinfo(virBuffer= *buf, qemuDomainSecretInfo *secinfo, const char *type) { - if (!secinfo || - secinfo->type !=3D VIR_DOMAIN_SECRET_INFO_TYPE_AES || - !secinfo->s.aes.alias) + if (!secinfo || !secinfo->alias) return; virBufferAsprintf(buf, "\n", - type, secinfo->s.aes.alias); + type, secinfo->alias); } diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h index cb5c665766..f8004efbb1 100644 --- a/src/qemu/qemu_domain.h +++ b/src/qemu/qemu_domain.h @@ -90,31 +90,17 @@ struct _qemuDomainUnpluggingDevice { #define QEMU_DEVICE_MAPPER_CONTROL_PATH "/dev/mapper/control" -/* Type of domain secret */ -typedef enum { - VIR_DOMAIN_SECRET_INFO_TYPE_AES, /* utilize GNUTLS_CIPHER_AES_256_CBC= */ - - VIR_DOMAIN_SECRET_INFO_TYPE_LAST -} qemuDomainSecretInfoType; - #define QEMU_DOMAIN_AES_IV_LEN 16 /* 16 bytes for 128 bit random */ /* initialization vector */ -typedef struct _qemuDomainSecretAES qemuDomainSecretAES; -struct _qemuDomainSecretAES { + +typedef struct _qemuDomainSecretInfo qemuDomainSecretInfo; +struct _qemuDomainSecretInfo { char *username; char *alias; /* generated alias for secret */ char *iv; /* base64 encoded initialization vector */ char *ciphertext; /* encoded/encrypted secret */ }; -typedef struct _qemuDomainSecretInfo qemuDomainSecretInfo; -struct _qemuDomainSecretInfo { - qemuDomainSecretInfoType type; - union { - qemuDomainSecretAES aes; - } s; -}; - typedef struct _qemuDomainObjPrivate qemuDomainObjPrivate; struct _qemuDomainObjPrivate { virQEMUDriver *driver; diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index 9c16ab4567..9b0dcf2629 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -1846,7 +1846,7 @@ qemuDomainGetTLSObjects(virQEMUCaps *qemuCaps, if (qemuBuildSecretInfoProps(secinfo, secProps) < 0) return -1; - secAlias =3D secinfo->s.aes.alias; + secAlias =3D secinfo->alias; } if (qemuBuildTLSx509BackendProps(tlsCertdir, tlsListen, tlsVerify, @@ -1890,7 +1890,7 @@ qemuDomainAddChardevTLSObjects(virQEMUDriver *driver, secinfo =3D chrSourcePriv->secinfo; if (secinfo) - *secAlias =3D secinfo->s.aes.alias; + *secAlias =3D secinfo->alias; if (!(*tlsAlias =3D qemuAliasTLSObjFromSrcAlias(charAlias))) goto cleanup; diff --git a/src/qemu/qemu_migration_params.c b/src/qemu/qemu_migration_par= ams.c index 018e62cf6e..88dba3b999 100644 --- a/src/qemu/qemu_migration_params.c +++ b/src/qemu/qemu_migration_params.c @@ -955,7 +955,7 @@ qemuMigrationParamsEnableTLS(virQEMUDriver *driver, qemuDomainSecretInfoTLSNew(priv, QEMU_MIGRATION_TLS_ALIAS_BA= SE, cfg->migrateTLSx509secretUUID))) return -1; - secAlias =3D priv->migSecinfo->s.aes.alias; + secAlias =3D priv->migSecinfo->alias; } if (!(*tlsAlias =3D qemuAliasTLSObjFromSrcAlias(QEMU_MIGRATION_TLS_ALI= AS_BASE))) diff --git a/tests/qemublocktest.c b/tests/qemublocktest.c index 4af8862c5b..3e61e923a9 100644 --- a/tests/qemublocktest.c +++ b/tests/qemublocktest.c @@ -235,19 +235,16 @@ testQemuDiskXMLToJSONFakeSecrets(virStorageSource *sr= c) if (src->auth) { srcpriv->secinfo =3D g_new0(qemuDomainSecretInfo, 1); - srcpriv->secinfo->type =3D VIR_DOMAIN_SECRET_INFO_TYPE_AES; - srcpriv->secinfo->s.aes.username =3D g_strdup(src->auth->username); - - srcpriv->secinfo->s.aes.alias =3D g_strdup_printf("%s-secalias", - NULLSTR(src->nodes= torage)); + srcpriv->secinfo->username =3D g_strdup(src->auth->username); + srcpriv->secinfo->alias =3D g_strdup_printf("%s-secalias", + NULLSTR(src->nodestorage= )); } if (src->encryption) { srcpriv->encinfo =3D g_new0(qemuDomainSecretInfo, 1); - srcpriv->encinfo->type =3D VIR_DOMAIN_SECRET_INFO_TYPE_AES; - srcpriv->encinfo->s.aes.alias =3D g_strdup_printf("%s-encalias", - NULLSTR(src->nodef= ormat)); + srcpriv->encinfo->alias =3D g_strdup_printf("%s-encalias", + NULLSTR(src->nodeformat)= ); } return 0; --=20 2.31.1