From patchwork Fri Jan 22 19:30:17 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cole Robinson X-Patchwork-Id: 60195 Delivered-To: patch@linaro.org Received: by 10.112.130.2 with SMTP id oa2csp51364lbb; Fri, 22 Jan 2016 11:33:24 -0800 (PST) X-Received: by 10.140.93.77 with SMTP id c71mr6077080qge.46.1453491195507; Fri, 22 Jan 2016 11:33:15 -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 f11si8598482qgf.11.2016.01.22.11.33.14 (version=TLS1 cipher=AES128-SHA bits=128/128); Fri, 22 Jan 2016 11:33:15 -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 u0MJUnMJ001554; Fri, 22 Jan 2016 14:30:49 -0500 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id u0MJUc7k019869 for ; Fri, 22 Jan 2016 14:30:38 -0500 Received: from colepc.redhat.com (ovpn-113-198.phx2.redhat.com [10.3.113.198]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u0MJUaPP002518; Fri, 22 Jan 2016 14:30:38 -0500 From: Cole Robinson To: libvirt-list@redhat.com Date: Fri, 22 Jan 2016 14:30:17 -0500 Message-Id: <382a9b141829f6ed3f854bc575227590762d3e88.1453489951.git.crobinso@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 02/17] qemu: Validate type != xen at parse time 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 There's a validation check at VM startup time that rejects type=xen or os type=xen|linux. The latter bit is already validated in generic domain_conf.c code, so it can be dropped. The former bit is can be done at XML parse time, so move it there. --- src/qemu/qemu_command.c | 8 -------- src/qemu/qemu_domain.c | 7 +++++++ 2 files changed, 7 insertions(+), 8 deletions(-) -- 2.5.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 5d3ab3a..75fb352 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -9557,14 +9557,6 @@ qemuBuildCommandLine(virConnectPtr conn, } virCommandAddArgList(cmd, "-uuid", uuid, NULL); - if (def->virtType == VIR_DOMAIN_VIRT_XEN || - def->os.type == VIR_DOMAIN_OSTYPE_XEN || - def->os.type == VIR_DOMAIN_OSTYPE_LINUX) { - virReportError(VIR_ERR_INTERNAL_ERROR, - _("qemu emulator '%s' does not support xen"), - def->emulator); - goto error; - } if ((def->os.smbios_mode != VIR_DOMAIN_SMBIOS_NONE) && (def->os.smbios_mode != VIR_DOMAIN_SMBIOS_EMULATE)) { diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 9b456e8..a1dd604 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -1251,6 +1251,13 @@ qemuDomainDefPostParse(virDomainDefPtr def, goto cleanup; } + if (def->virtType == VIR_DOMAIN_VIRT_XEN) { + virReportError(VIR_ERR_INTERNAL_ERROR, + _("qemu emulator '%s' does not support xen"), + def->emulator); + goto cleanup; + } + /* check for emulator and create a default one if needed */ if (!def->emulator && !(def->emulator = virDomainDefGetDefaultEmulator(def, caps)))