From patchwork Fri Apr 15 21:37: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: 65976 Delivered-To: patch@linaro.org Received: by 10.140.93.198 with SMTP id d64csp157876qge; Fri, 15 Apr 2016 14:39:59 -0700 (PDT) X-Received: by 10.140.19.6 with SMTP id 6mr6109321qgg.75.1460756399095; Fri, 15 Apr 2016 14:39:59 -0700 (PDT) Return-Path: Received: from mx4-phx2.redhat.com (mx4-phx2.redhat.com. [209.132.183.25]) by mx.google.com with ESMTPS id p129si38001681qha.127.2016.04.15.14.39.58 (version=TLS1 cipher=AES128-SHA bits=128/128); Fri, 15 Apr 2016 14:39:59 -0700 (PDT) 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 u3FLbLlg022711; Fri, 15 Apr 2016 17:37:21 -0400 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id u3FLbKTQ021994 for ; Fri, 15 Apr 2016 17:37:20 -0400 Received: from colepc.redhat.com (ovpn-113-40.phx2.redhat.com [10.3.113.40]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u3FLbJwE005787; Fri, 15 Apr 2016 17:37:20 -0400 From: Cole Robinson To: libvirt-list@redhat.com Date: Fri, 15 Apr 2016 17:37:17 -0400 Message-Id: X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH] qemu: reject min_guarantee 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 min_guarantee isn't implemented for qemu, and an explicit check was added in june 2014 to reject the VM at qemu startup time. It's a weird place to do XML validation, so move it to the post parse area where we have similar checks. Also drop a validation check against min_guarantee in the command line building; it will never see min_guarantee there. --- src/qemu/qemu_command.c | 1 - src/qemu/qemu_domain.c | 7 +++++++ src/qemu/qemu_process.c | 7 ------- 3 files changed, 7 insertions(+), 8 deletions(-) -- 2.7.3 -- 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 26c19ff..2fb967a 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -9143,7 +9143,6 @@ qemuBuildCommandLineValidate(virQEMUDriverPtr driver, if (virMemoryLimitIsSet(def->mem.hard_limit) || virMemoryLimitIsSet(def->mem.soft_limit) || - def->mem.min_guarantee || virMemoryLimitIsSet(def->mem.swap_hard_limit)) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("Memory tuning is not available in session mode")); diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 73187ce..f5fafc8 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -1690,6 +1690,13 @@ qemuDomainDefPostParse(virDomainDefPtr def, return ret; } + if (def->mem.min_guarantee) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("Parameter 'min_guarantee' " + "not supported by QEMU.")); + return -1; + } + if (def->os.loader && def->os.loader->type == VIR_DOMAIN_LOADER_TYPE_PFLASH && def->os.loader->readonly == VIR_TRISTATE_SWITCH_ON && diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 81d86c2..387aff5 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -4550,13 +4550,6 @@ qemuProcessStartValidate(virQEMUDriverPtr driver, virDomainDefCheckDuplicateDiskInfo(vm->def) < 0) return -1; - if (vm->def->mem.min_guarantee) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("Parameter 'min_guarantee' " - "not supported by QEMU.")); - return -1; - } - VIR_DEBUG("Checking for any possible (non-fatal) issues"); /*