From nobody Sun May 5 22:23:17 2024 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 1524048963733162.0589415177801; Wed, 18 Apr 2018 03:56:03 -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 6CA38326226F; Wed, 18 Apr 2018 10:56:02 +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 281AA7F37D; Wed, 18 Apr 2018 10:56:02 +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 C0A494CA97; Wed, 18 Apr 2018 10:56:01 +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 w3IAtr8j006241 for ; Wed, 18 Apr 2018 06:55:54 -0400 Received: by smtp.corp.redhat.com (Postfix) id BDFDD1C723; Wed, 18 Apr 2018 10:55:53 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.136]) by smtp.corp.redhat.com (Postfix) with ESMTP id 446641C720; Wed, 18 Apr 2018 10:55:53 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Wed, 18 Apr 2018 12:55:38 +0200 Message-Id: <9b221fecc6349e3846dc6eb0b04b5c023d76a1b2.1524048872.git.pkrempa@redhat.com> 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 1/6] conf: Make argument of virDomainDiskGetDriver const 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.45]); Wed, 18 Apr 2018 10:56:02 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Peter Krempa Reviewed-by: J=EF=BF=BDn Tomko --- src/conf/domain_conf.c | 2 +- src/conf/domain_conf.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 4dad8e3b20..0dc1c3a276 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -1852,7 +1852,7 @@ virDomainDiskEmptySource(virDomainDiskDefPtr def) const char * -virDomainDiskGetDriver(virDomainDiskDefPtr def) +virDomainDiskGetDriver(const virDomainDiskDef *def) { return def->src->driverName; } diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index bbaa24137d..3a3ec6f6c3 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -2763,7 +2763,7 @@ const char *virDomainDiskGetSource(virDomainDiskDef c= onst *def); int virDomainDiskSetSource(virDomainDiskDefPtr def, const char *src) ATTRIBUTE_RETURN_CHECK; void virDomainDiskEmptySource(virDomainDiskDefPtr def); -const char *virDomainDiskGetDriver(virDomainDiskDefPtr def); +const char *virDomainDiskGetDriver(const virDomainDiskDef *def); int virDomainDiskSetDriver(virDomainDiskDefPtr def, const char *name) ATTRIBUTE_RETURN_CHECK; int virDomainDiskGetFormat(virDomainDiskDefPtr def); --=20 2.16.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun May 5 22:23:17 2024 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 1524048960234408.45882662946985; Wed, 18 Apr 2018 03:56:00 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id 61A21C04AC4D; Wed, 18 Apr 2018 10:55:58 +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 28DED17AE0; Wed, 18 Apr 2018 10:55:58 +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 C8D96180215F; Wed, 18 Apr 2018 10:55:57 +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 w3IAts9x006251 for ; Wed, 18 Apr 2018 06:55:54 -0400 Received: by smtp.corp.redhat.com (Postfix) id 7EBD51C722; Wed, 18 Apr 2018 10:55:54 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.136]) by smtp.corp.redhat.com (Postfix) with ESMTP id 04D881C72E; Wed, 18 Apr 2018 10:55:53 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Wed, 18 Apr 2018 12:55:39 +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 2/6] qemu: Move disk driver name validation into disk validation callback 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.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Wed, 18 Apr 2018 10:55:58 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" There were two places where we'd check this independently. Move it to the disk definition validation callback. This also fixes possible use of NULL in a printf for network storage. Signed-off-by: Peter Krempa Reviewed-by: J=EF=BF=BDn Tomko --- src/qemu/qemu_command.c | 12 ------------ src/qemu/qemu_domain.c | 9 +++++++++ src/qemu/qemu_hotplug.c | 7 ------- 3 files changed, 9 insertions(+), 19 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index a1a9e91e49..0f45a25038 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -9708,18 +9708,6 @@ qemuBuildCommandLineValidate(virQEMUDriverPtr driver, return -1; } - for (i =3D 0; i < def->ndisks; i++) { - virDomainDiskDefPtr disk =3D def->disks[i]; - - if (disk->src->driverName !=3D NULL && - STRNEQ(disk->src->driverName, "qemu")) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("unsupported driver name '%s' for disk '%s'"), - disk->src->driverName, disk->src->path); - return -1; - } - } - return 0; } diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 4c4a9a428d..a3431696af 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -4165,6 +4165,7 @@ static int qemuDomainDeviceDefValidateDisk(const virDomainDiskDef *disk, virQEMUCapsPtr qemuCaps) { + const char *driverName; virStorageSourcePtr n; if (disk->src->shared && !disk->src->readonly) { @@ -4183,6 +4184,14 @@ qemuDomainDeviceDefValidateDisk(const virDomainDiskD= ef *disk, } } + if ((driverName =3D virDomainDiskGetDriver(disk)) && + STRNEQ(driverName, "qemu")) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("unsupported driver name '%s' for disk '%s'"), + driverName, disk->dst); + return -1; + } + for (n =3D disk->src; virStorageSourceIsBacking(n); n =3D n->backingSt= ore) { if (qemuDomainValidateStorageSource(n, qemuCaps) < 0) return -1; diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index 8d3191f971..df9e8aa716 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -699,13 +699,6 @@ qemuDomainAttachDeviceDiskLive(virQEMUDriverPtr driver, virDomainDiskDefPtr orig_disk =3D NULL; int ret =3D -1; - if (STRNEQ_NULLABLE(virDomainDiskGetDriver(disk), "qemu")) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("unsupported driver name '%s' for disk '%s'"), - virDomainDiskGetDriver(disk), disk->dst); - goto cleanup; - } - if (virDomainDiskTranslateSourcePool(disk) < 0) goto cleanup; --=20 2.16.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun May 5 22:23:17 2024 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 1524048959640922.7637972356479; Wed, 18 Apr 2018 03:55:59 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id EB7CD3262264; Wed, 18 Apr 2018 10:55:57 +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 BCB8C66D66; Wed, 18 Apr 2018 10:55:57 +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 4A2FF180596E; Wed, 18 Apr 2018 10:55:57 +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 w3IAttps006259 for ; Wed, 18 Apr 2018 06:55:55 -0400 Received: by smtp.corp.redhat.com (Postfix) id 409497C4D; Wed, 18 Apr 2018 10:55:55 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.136]) by smtp.corp.redhat.com (Postfix) with ESMTP id B9E0C1C723; Wed, 18 Apr 2018 10:55:54 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Wed, 18 Apr 2018 12:55:40 +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 3/6] conf, qemu: Replace access to disk driver name with accessors 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.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.45]); Wed, 18 Apr 2018 10:55:58 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Replace direct usage of disk->src->driverName with the existing accessors. The parser code where we assign the driver form XML is intentionally not fixed to save an allocation. Signed-off-by: Peter Krempa Reviewed-by: J=EF=BF=BDn Tomko --- src/conf/domain_conf.c | 4 ++-- src/qemu/qemu_parse_command.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 0dc1c3a276..987f65df23 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -9395,7 +9395,7 @@ virDomainDiskDefParseXML(virDomainXMLOptionPtr xmlopt, physical_block_size); goto error; } - } else if (!def->src->driverName && + } else if (!virDomainDiskGetDriver(def) && virXMLNodeNameEqual(cur, "driver")) { if (virDomainVirtioOptionsParseXML(cur, &def->virtio) < 0) goto error; @@ -23100,7 +23100,7 @@ virDomainDiskDefFormat(virBufferPtr buf, virBufferAddLit(buf, ">\n"); virBufferAdjustIndent(buf, 2); - virBufferEscapeString(&driverBuf, " name=3D'%s'", def->src->driverName= ); + virBufferEscapeString(&driverBuf, " name=3D'%s'", virDomainDiskGetDriv= er(def)); if (def->src->format > 0) virBufferAsprintf(&driverBuf, " type=3D'%s'", virStorageFileFormatTypeToString(def->src->forma= t)); diff --git a/src/qemu/qemu_parse_command.c b/src/qemu/qemu_parse_command.c index 5f27d296b3..0ce963222f 100644 --- a/src/qemu/qemu_parse_command.c +++ b/src/qemu/qemu_parse_command.c @@ -783,7 +783,7 @@ qemuParseCommandLineDisk(virDomainXMLOptionPtr xmlopt, def->device =3D VIR_DOMAIN_DISK_DEVICE_FLOPPY; } } else if (STREQ(keywords[i], "format")) { - if (VIR_STRDUP(def->src->driverName, "qemu") < 0) + if (virDomainDiskSetDriver(def, "qemu") < 0) goto error; def->src->format =3D virStorageFileFormatTypeFromString(values= [i]); } else if (STREQ(keywords[i], "cache")) { --=20 2.16.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun May 5 22:23:17 2024 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 From nobody Sun May 5 22:23:17 2024 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 1524048969351816.7988653549467; Wed, 18 Apr 2018 03:56:09 -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 F013BC057FA0; Wed, 18 Apr 2018 10:56:07 +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 B3AE55C25A; Wed, 18 Apr 2018 10:56: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 686714CA97; Wed, 18 Apr 2018 10:56:07 +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 w3IAtuAB006280 for ; Wed, 18 Apr 2018 06:55:56 -0400 Received: by smtp.corp.redhat.com (Postfix) id B730C1C722; 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 3C44F1C720; Wed, 18 Apr 2018 10:55:56 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Wed, 18 Apr 2018 12:55:42 +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 5/6] conf: Disk 'shared' state is not guest ABI 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.32]); Wed, 18 Apr 2018 10:56:08 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Drop the checking of 'shared' from the ABI stability check. This property controls whether the hypervisor allows multiple accesses to the same file, but this fact does not influence guest ABI. Signed-off-by: Peter Krempa Reviewed-by: J=EF=BF=BDn Tomko --- src/conf/domain_conf.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 1ae742a110..fdf8930f73 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -20819,8 +20819,7 @@ virDomainDiskDefCheckABIStability(virDomainDiskDefP= tr src, } - if (src->src->readonly !=3D dst->src->readonly || - src->src->shared !=3D dst->src->shared) { + if (src->src->readonly !=3D dst->src->readonly) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("Target disk access mode does not match source")); return false; --=20 2.16.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun May 5 22:23:17 2024 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 1524048965401566.2323322645925; Wed, 18 Apr 2018 03:56:05 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id CB19B3133E60; Wed, 18 Apr 2018 10:56:03 +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 93B167ED6F; 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 3DC9A180BAD3; 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 w3IAtvVP006293 for ; Wed, 18 Apr 2018 06:55:57 -0400 Received: by smtp.corp.redhat.com (Postfix) id 7777A1C722; Wed, 18 Apr 2018 10:55:57 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.136]) by smtp.corp.redhat.com (Postfix) with ESMTP id F1D0C1C72E; Wed, 18 Apr 2018 10:55:56 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Wed, 18 Apr 2018 12:55:43 +0200 Message-Id: <6ff4738a78b5d75d9e070cb1aadcb1036170c992.1524048873.git.pkrempa@redhat.com> 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 6/6] qemu: driver: Fix error message in qemuDomainBlockCommit 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.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.46]); Wed, 18 Apr 2018 10:56:04 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" When qemu does not support changing of the backing store string, we'd reaport that block pull is not supported instead of block commit. Signed-off-by: Peter Krempa Reviewed-by: J=EF=BF=BDn Tomko --- src/qemu/qemu_driver.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 4e06c9c745..5673d9fd8d 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -17705,7 +17705,7 @@ qemuDomainBlockCommit(virDomainPtr dom, topSource !=3D disk->src) { if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_CHANGE_BACKING_FILE)= ) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("this qemu doesn't support relative blockpull= ")); + _("this qemu doesn't support relative block com= mit")); goto endjob; } --=20 2.16.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list