From patchwork Fri Jan 8 03:49:58 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cole Robinson X-Patchwork-Id: 59319 Delivered-To: patch@linaro.org Received: by 10.112.130.2 with SMTP id oa2csp311140lbb; Thu, 7 Jan 2016 19:53:27 -0800 (PST) X-Received: by 10.140.251.131 with SMTP id w125mr148154127qhc.1.1452225203996; Thu, 07 Jan 2016 19:53:23 -0800 (PST) Return-Path: Received: from mx4-phx2.redhat.com (mx4-phx2.redhat.com. [209.132.183.25]) by mx.google.com with ESMTPS id g67si82595917qgg.60.2016.01.07.19.53.23 (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 07 Jan 2016 19:53:23 -0800 (PST) Received-SPF: pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.25 as permitted sender) client-ip=209.132.183.25; Authentication-Results: mx.google.com; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.25 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by mx4-phx2.redhat.com (8.13.8/8.13.8) with ESMTP id u083osT9014964; Thu, 7 Jan 2016 22:50:54 -0500 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id u083oFKw005722 for ; Thu, 7 Jan 2016 22:50:15 -0500 Received: from colepc.redhat.com (ovpn-113-33.phx2.redhat.com [10.3.113.33]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u083oBtZ030219; Thu, 7 Jan 2016 22:50:14 -0500 From: Cole Robinson To: libvirt-list@redhat.com Date: Thu, 7 Jan 2016 22:49:58 -0500 Message-Id: In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 04/12] domain: Add virDomainDefAddImplicitDevices 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 Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com It's just a combination of AddImplicitControllers, and AddConsoleCompat. Every caller that wants ImplicitControllers also wants the ConsoleCompat AFAICT, so lump them together. We also need it for future patches. --- src/conf/domain_conf.c | 19 ++++++++++++++----- src/conf/domain_conf.h | 2 +- src/libvirt_private.syms | 2 +- src/qemu/qemu_command.c | 2 +- src/qemu/qemu_driver.c | 6 +++--- src/vmx/vmx.c | 2 +- src/vz/vz_sdk.c | 2 +- 7 files changed, 22 insertions(+), 13 deletions(-) -- 2.5.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 5b9dab9..61dc650 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -3842,9 +3842,6 @@ virDomainDefPostParseInternal(virDomainDefPtr def, if (virDomainDefPostParseMemory(def, parseFlags) < 0) return -1; - if (virDomainDefAddConsoleCompat(def) < 0) - return -1; - if (virDomainDefRejectDuplicateControllers(def) < 0) return -1; @@ -3854,7 +3851,7 @@ virDomainDefPostParseInternal(virDomainDefPtr def, if (virDomainDefPostParseTimer(def) < 0) return -1; - if (virDomainDefAddImplicitControllers(def) < 0) + if (virDomainDefAddImplicitDevices(def) < 0) return -1; /* clean up possibly duplicated metadata entries */ @@ -18216,7 +18213,7 @@ virDomainDefMaybeAddSmartcardController(virDomainDefPtr def) * in the XML. This is for compat with existing apps which will * not know/care about info in the XML */ -int +static int virDomainDefAddImplicitControllers(virDomainDefPtr def) { if (virDomainDefAddDiskControllersForType(def, @@ -18251,6 +18248,18 @@ virDomainDefAddImplicitControllers(virDomainDefPtr def) return 0; } +int +virDomainDefAddImplicitDevices(virDomainDefPtr def) +{ + if (virDomainDefAddConsoleCompat(def) < 0) + return -1; + + if (virDomainDefAddImplicitControllers(def) < 0) + return -1; + + return 0; +} + virDomainIOThreadIDDefPtr virDomainIOThreadIDFind(virDomainDefPtr def, unsigned int iothread_id) diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index ae6d546..4a91f24 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -2718,7 +2718,7 @@ virDomainObjPtr virDomainObjParseFile(const char *filename, bool virDomainDefCheckABIStability(virDomainDefPtr src, virDomainDefPtr dst); -int virDomainDefAddImplicitControllers(virDomainDefPtr def); +int virDomainDefAddImplicitDevices(virDomainDefPtr def); virDomainIOThreadIDDefPtr virDomainIOThreadIDFind(virDomainDefPtr def, unsigned int iothread_id); diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index 1e51dcf..0f2f66c 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -197,7 +197,7 @@ virDomainControllerRemove; virDomainControllerTypeToString; virDomainCpuPlacementModeTypeFromString; virDomainCpuPlacementModeTypeToString; -virDomainDefAddImplicitControllers; +virDomainDefAddImplicitDevices; virDomainDefCheckABIStability; virDomainDefCheckDuplicateDiskInfo; virDomainDefCheckUnsupportedMemoryHotplug; diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 66ca111..2ea87cc 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -13862,7 +13862,7 @@ qemuParseCommandLine(virCapsPtr qemuCaps, VIR_FREE(nics); - if (virDomainDefAddImplicitControllers(def) < 0) + if (virDomainDefAddImplicitDevices(def) < 0) goto error; if (virDomainDefPostParse(def, qemuCaps, VIR_DOMAIN_DEF_PARSE_ABI_UPDATE, diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 1161aa0..51c6950 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -8074,7 +8074,7 @@ qemuDomainAttachDeviceConfig(virQEMUCapsPtr qemuCaps, /* vmdef has the pointer. Generic codes for vmdef will do all jobs */ dev->data.disk = NULL; if (disk->bus != VIR_DOMAIN_DISK_BUS_VIRTIO) - if (virDomainDefAddImplicitControllers(vmdef) < 0) + if (virDomainDefAddImplicitDevices(vmdef) < 0) return -1; if (qemuDomainAssignAddresses(vmdef, qemuCaps, NULL) < 0) return -1; @@ -8099,7 +8099,7 @@ qemuDomainAttachDeviceConfig(virQEMUCapsPtr qemuCaps, if (virDomainHostdevInsert(vmdef, hostdev)) return -1; dev->data.hostdev = NULL; - if (virDomainDefAddImplicitControllers(vmdef) < 0) + if (virDomainDefAddImplicitDevices(vmdef) < 0) return -1; if (qemuDomainAssignAddresses(vmdef, qemuCaps, NULL) < 0) return -1; @@ -8141,7 +8141,7 @@ qemuDomainAttachDeviceConfig(virQEMUCapsPtr qemuCaps, if (qemuDomainChrInsert(vmdef, dev->data.chr) < 0) return -1; dev->data.chr = NULL; - if (virDomainDefAddImplicitControllers(vmdef) < 0) + if (virDomainDefAddImplicitDevices(vmdef) < 0) return -1; if (qemuDomainAssignAddresses(vmdef, qemuCaps, NULL) < 0) return -1; diff --git a/src/vmx/vmx.c b/src/vmx/vmx.c index 568b2c7..e641571 100644 --- a/src/vmx/vmx.c +++ b/src/vmx/vmx.c @@ -1689,7 +1689,7 @@ virVMXParseConfig(virVMXContext *ctx, } /* def:controllers */ - if (virDomainDefAddImplicitControllers(def) < 0) { + if (virDomainDefAddImplicitDevices(def) < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("Could not add controllers")); goto cleanup; } diff --git a/src/vz/vz_sdk.c b/src/vz/vz_sdk.c index b78c413..f691713 100644 --- a/src/vz/vz_sdk.c +++ b/src/vz/vz_sdk.c @@ -1350,7 +1350,7 @@ prlsdkLoadDomain(vzConnPtr privconn, if (prlsdkGetDomainState(sdkdom, &domainState) < 0) goto error; - if (virDomainDefAddImplicitControllers(def) < 0) + if (virDomainDefAddImplicitDevices(def) < 0) goto error; if (def->ngraphics > 0) {