From patchwork Fri Jan 8 03:49:55 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cole Robinson X-Patchwork-Id: 59313 Delivered-To: patch@linaro.org Received: by 10.112.130.2 with SMTP id oa2csp311000lbb; Thu, 7 Jan 2016 19:53:03 -0800 (PST) X-Received: by 10.140.218.72 with SMTP id o69mr14139462qhb.22.1452225183611; Thu, 07 Jan 2016 19:53:03 -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 i9si26025494qkh.31.2016.01.07.19.53.02 (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 07 Jan 2016 19:53:03 -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 u083oEx1014928; Thu, 7 Jan 2016 22:50:15 -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 u083oDGg005697 for ; Thu, 7 Jan 2016 22:50:13 -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 u083oBtW030219; Thu, 7 Jan 2016 22:50:12 -0500 From: Cole Robinson To: libvirt-list@redhat.com Date: Thu, 7 Jan 2016 22:49:55 -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 01/12] domain: separate out function for post parse console compat 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 This should be a no-op --- src/conf/domain_conf.c | 38 ++++++++++++++++++++++++-------------- 1 file changed, 24 insertions(+), 14 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 9d47846..ab22322 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -3664,24 +3664,11 @@ virDomainDefPostParseMemory(virDomainDefPtr def, return 0; } - static int -virDomainDefPostParseInternal(virDomainDefPtr def, - virCapsPtr caps ATTRIBUTE_UNUSED, - unsigned int parseFlags) +virDomainDefAddConsoleCompat(virDomainDefPtr def) { size_t i; - /* verify init path for container based domains */ - if (def->os.type == VIR_DOMAIN_OSTYPE_EXE && !def->os.init) { - virReportError(VIR_ERR_XML_ERROR, "%s", - _("init binary must be specified")); - return -1; - } - - if (virDomainDefPostParseMemory(def, parseFlags) < 0) - return -1; - /* * Some really crazy backcompat stuff for consoles * @@ -3774,6 +3761,29 @@ virDomainDefPostParseInternal(virDomainDefPtr def, def->consoles[0]->targetType = VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_SERIAL; } + return 0; +} + +static int +virDomainDefPostParseInternal(virDomainDefPtr def, + virCapsPtr caps ATTRIBUTE_UNUSED, + unsigned int parseFlags) +{ + size_t i; + + /* verify init path for container based domains */ + if (def->os.type == VIR_DOMAIN_OSTYPE_EXE && !def->os.init) { + virReportError(VIR_ERR_XML_ERROR, "%s", + _("init binary must be specified")); + return -1; + } + + if (virDomainDefPostParseMemory(def, parseFlags) < 0) + return -1; + + if (virDomainDefAddConsoleCompat(def) < 0) + return -1; + if (virDomainDefRejectDuplicateControllers(def) < 0) return -1;