From nobody Thu May 15 20:57:57 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 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 150600866571923.027348292684906; Thu, 21 Sep 2017 08:44:25 -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 B5E6C3680B; Thu, 21 Sep 2017 15:44:23 +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 6496A5EE06; Thu, 21 Sep 2017 15:44:23 +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 63D521855945; Thu, 21 Sep 2017 15:44:22 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v8LEla9D014670 for ; Thu, 21 Sep 2017 10:47:36 -0400 Received: by smtp.corp.redhat.com (Postfix) id BD5CC6031A; Thu, 21 Sep 2017 14:47:36 +0000 (UTC) Received: from moe.brq.redhat.com (unknown [10.43.2.192]) by smtp.corp.redhat.com (Postfix) with ESMTP id 43E6660481 for ; Thu, 21 Sep 2017 14:47:35 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com B5E6C3680B Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=libvir-list-bounces@redhat.com From: Michal Privoznik To: libvir-list@redhat.com Date: Thu, 21 Sep 2017 16:47:05 +0200 Message-Id: <689041dd4bc11e730ec6979b0ea0497e14b9519a.1506005021.git.mprivozn@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v1 1/7] qemu_command: Drop useless alias checks 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.30]); Thu, 21 Sep 2017 15:44:24 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" At the point when we are building the command line all aliases are assigned. There's no point in checking. Signed-off-by: Michal Privoznik --- src/qemu/qemu_command.c | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index abeb24846..47ece35f6 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -3526,12 +3526,6 @@ qemuBuildMemoryDimmBackendStr(virDomainMemoryDefPtr = mem, const char *backendType; char *ret =3D NULL; =20 - if (!mem->info.alias) { - virReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("memory device alias is not assigned")); - return NULL; - } - if (virAsprintf(&alias, "mem%s", mem->info.alias) < 0) goto cleanup; =20 @@ -3555,12 +3549,6 @@ qemuBuildMemoryDeviceStr(virDomainMemoryDefPtr mem) virBuffer buf =3D VIR_BUFFER_INITIALIZER; const char *device; =20 - if (!mem->info.alias) { - virReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("missing alias for memory device")); - return NULL; - } - switch ((virDomainMemoryModel) mem->model) { case VIR_DOMAIN_MEMORY_MODEL_NVDIMM: case VIR_DOMAIN_MEMORY_MODEL_DIMM: @@ -3925,8 +3913,7 @@ qemuBuildHostNetStr(virDomainNetDefPtr net, =20 if (vlan >=3D 0) { virBufferAsprintf(&buf, "vlan=3D%d,", vlan); - if (net->info.alias) - virBufferAsprintf(&buf, "name=3Dhost%s,", net->info.alias); + virBufferAsprintf(&buf, "name=3Dhost%s,", net->info.alias); } else { virBufferAsprintf(&buf, "id=3Dhost%s,", net->info.alias); } @@ -5860,12 +5847,6 @@ qemuBuildRNGCommandLine(virLogManagerPtr logManager, virDomainRNGDefPtr rng =3D def->rngs[i]; char *tmp; =20 - if (!rng->info.alias) { - virReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("RNG device is missing alias")); - return -1; - } - /* possibly add character device for backend */ if (qemuBuildRNGBackendChrdevStr(logManager, cmd, cfg, def, rng, qemuCaps, &tmp, --=20 2.13.5 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list