From nobody Wed May 14 14:01:08 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1524048966571953.6211126048102; Wed, 18 Apr 2018 03:56:06 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 334AE80B56; Wed, 18 Apr 2018 10:56:04 +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 F12415F722; Wed, 18 Apr 2018 10:56:03 +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 A07C54CA9E; Wed, 18 Apr 2018 10:56:03 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w3IAtu4D006269 for ; Wed, 18 Apr 2018 06:55:56 -0400 Received: by smtp.corp.redhat.com (Postfix) id 012711C722; Wed, 18 Apr 2018 10:55:56 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.136]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7AFCF1C720; Wed, 18 Apr 2018 10:55:55 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Wed, 18 Apr 2018 12:55:41 +0200 Message-Id: In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-loop: libvir-list@redhat.com Cc: Peter Krempa Subject: [libvirt] [PATCH 4/6] conf: Punt 'driverName' back to disk definition structure 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: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Wed, 18 Apr 2018 10:56:04 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Currently it is not used in backing chains and does not seem that we will need to use it so return it back to the disk definition. Thankfully most accesses are done via the accessors. Signed-off-by: Peter Krempa Reviewed-by: J=EF=BF=BDn Tomko --- src/conf/domain_conf.c | 11 ++++++----- src/conf/domain_conf.h | 2 ++ src/util/virstoragefile.c | 6 ------ src/util/virstoragefile.h | 1 - 4 files changed, 8 insertions(+), 12 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 987f65df23..1ae742a110 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -1790,6 +1790,7 @@ virDomainDiskDefFree(virDomainDiskDefPtr def) VIR_FREE(def->dst); virStorageSourceFree(def->mirror); VIR_FREE(def->wwn); + VIR_FREE(def->driverName); VIR_FREE(def->vendor); VIR_FREE(def->product); VIR_FREE(def->domain_name); @@ -1854,7 +1855,7 @@ virDomainDiskEmptySource(virDomainDiskDefPtr def) const char * virDomainDiskGetDriver(const virDomainDiskDef *def) { - return def->src->driverName; + return def->driverName; } @@ -1862,11 +1863,11 @@ int virDomainDiskSetDriver(virDomainDiskDefPtr def, const char *name) { int ret; - char *tmp =3D def->src->driverName; + char *tmp =3D def->driverName; - ret =3D VIR_STRDUP(def->src->driverName, name); + ret =3D VIR_STRDUP(def->driverName, name); if (ret < 0) - def->src->driverName =3D tmp; + def->driverName =3D tmp; else VIR_FREE(tmp); return ret; @@ -9132,7 +9133,7 @@ virDomainDiskDefDriverParseXML(virDomainDiskDefPtr de= f, char *tmp =3D NULL; int ret =3D -1; - def->src->driverName =3D virXMLPropString(cur, "name"); + def->driverName =3D virXMLPropString(cur, "name"); if ((tmp =3D virXMLPropString(cur, "cache")) && (def->cachemode =3D virDomainDiskCacheTypeFromString(tmp)) < 0) { diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 3a3ec6f6c3..7e20b8837b 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -644,6 +644,8 @@ struct _virDomainDiskDef { virDomainBlockIoTuneInfo blkdeviotune; + char *driverName; + char *serial; char *wwn; char *vendor; diff --git a/src/util/virstoragefile.c b/src/util/virstoragefile.c index 67b9ec71ac..531540ac91 100644 --- a/src/util/virstoragefile.c +++ b/src/util/virstoragefile.c @@ -2048,7 +2048,6 @@ virStorageSourceCopy(const virStorageSource *src, if (VIR_STRDUP(ret->path, src->path) < 0 || VIR_STRDUP(ret->volume, src->volume) < 0 || - VIR_STRDUP(ret->driverName, src->driverName) < 0 || VIR_STRDUP(ret->relPath, src->relPath) < 0 || VIR_STRDUP(ret->backingStoreRaw, src->backingStoreRaw) < 0 || VIR_STRDUP(ret->snapshot, src->snapshot) < 0 || @@ -2135,10 +2134,6 @@ virStorageSourceInitChainElement(virStorageSourcePtr= newelem, virStorageSourceSeclabelsCopy(newelem, old) < 0) goto cleanup; - if (!newelem->driverName && - VIR_STRDUP(newelem->driverName, old->driverName) < 0) - goto cleanup; - newelem->shared =3D old->shared; newelem->readonly =3D old->readonly; @@ -2266,7 +2261,6 @@ virStorageSourceClear(virStorageSourcePtr def) VIR_FREE(def->snapshot); VIR_FREE(def->configFile); virStorageSourcePoolDefFree(def->srcpool); - VIR_FREE(def->driverName); virBitmapFree(def->features); VIR_FREE(def->compat); virStorageEncryptionFree(def->encryption); diff --git a/src/util/virstoragefile.h b/src/util/virstoragefile.h index 596746ccb7..d129e81978 100644 --- a/src/util/virstoragefile.h +++ b/src/util/virstoragefile.h @@ -246,7 +246,6 @@ struct _virStorageSource { virObjectPtr privateData; - char *driverName; int format; /* virStorageFileFormat in domain backing chains, but * pool-specific enum for storage volumes */ virBitmapPtr features; --=20 2.16.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list