From patchwork Tue Mar 1 04:00:46 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Fehlig X-Patchwork-Id: 8461681 Return-Path: X-Original-To: patchwork-xen-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id A188EC0553 for ; Tue, 1 Mar 2016 04:03:58 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id CC2DD20172 for ; Tue, 1 Mar 2016 04:03:56 +0000 (UTC) Received: from lists.xen.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D6E6B20160 for ; Tue, 1 Mar 2016 04:03:54 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xen.org) by lists.xen.org with esmtp (Exim 4.84) (envelope-from ) id 1aabUp-0005zt-Nw; Tue, 01 Mar 2016 04:01:15 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.84) (envelope-from ) id 1aabUn-0005xF-JM for xen-devel@lists.xen.org; Tue, 01 Mar 2016 04:01:13 +0000 Received: from [85.158.137.68] by server-6.bemta-3.messagelabs.com id F3/7A-23864-80415D65; Tue, 01 Mar 2016 04:01:12 +0000 X-Env-Sender: jfehlig@suse.com X-Msg-Ref: server-8.tower-31.messagelabs.com!1456804869!26029285!1 X-Originating-IP: [137.65.250.81] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 7.35.1; banners=-,-,- X-VirusChecked: Checked Received: (qmail 22579 invoked from network); 1 Mar 2016 04:01:11 -0000 Received: from smtp2.provo.novell.com (HELO smtp2.provo.novell.com) (137.65.250.81) by server-8.tower-31.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 1 Mar 2016 04:01:11 -0000 Received: from talkeetna.gns.novell.com (prv-ext-foundry1int.gns.novell.com [137.65.251.240]) by smtp2.provo.novell.com with ESMTP (NOT encrypted); Mon, 29 Feb 2016 21:00:59 -0700 From: Jim Fehlig To: libvir-list@redhat.com Date: Mon, 29 Feb 2016 21:00:46 -0700 Message-Id: <1456804848-13127-3-git-send-email-jfehlig@suse.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1456804848-13127-1-git-send-email-jfehlig@suse.com> References: <1456804848-13127-1-git-send-email-jfehlig@suse.com> Cc: Jim Fehlig , xen-devel@lists.xen.org Subject: [Xen-devel] [PATCH V2 2/4] xenconfig: change 'hap' setting to align with Xen behavior X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP hap is enabled by default in xm and xl config and usually only specified when it is desirable to disable hap (hap = 0). Change the xm,xl <-> xml converter to behave similarly. I.e. only produce 'hap = 0' when and vice versa. Signed-off-by: Jim Fehlig Reviewed-by: Joao Martins --- src/xenconfig/xen_common.c | 14 ++--- .../test-disk-positional-parms-full.cfg | 1 - .../test-disk-positional-parms-partial.cfg | 1 - ...est-fullvirt-direct-kernel-boot-bogus-extra.cfg | 1 - .../test-fullvirt-direct-kernel-boot-extra.cfg | 1 - .../test-fullvirt-direct-kernel-boot.cfg | 1 - tests/xlconfigdata/test-fullvirt-multiusb.cfg | 1 - tests/xlconfigdata/test-fullvirt-nohap.cfg | 26 ++++++++++ tests/xlconfigdata/test-fullvirt-nohap.xml | 59 ++++++++++++++++++++++ tests/xlconfigdata/test-new-disk.cfg | 1 - tests/xlconfigdata/test-rbd-multihost-noauth.cfg | 1 - tests/xlconfigdata/test-spice-features.cfg | 1 - tests/xlconfigdata/test-spice.cfg | 1 - tests/xlconfigdata/test-vif-rate.cfg | 1 - tests/xlconfigtest.c | 1 + tests/xmconfigdata/test-escape-paths.cfg | 1 - .../xmconfigdata/test-fullvirt-default-feature.cfg | 1 - tests/xmconfigdata/test-fullvirt-force-hpet.cfg | 1 - tests/xmconfigdata/test-fullvirt-force-nohpet.cfg | 1 - tests/xmconfigdata/test-fullvirt-localtime.cfg | 1 - tests/xmconfigdata/test-fullvirt-net-netfront.cfg | 1 - tests/xmconfigdata/test-fullvirt-new-cdrom.cfg | 1 - tests/xmconfigdata/test-fullvirt-nohap.cfg | 28 ++++++++++ tests/xmconfigdata/test-fullvirt-nohap.xml | 51 +++++++++++++++++++ tests/xmconfigdata/test-fullvirt-parallel-tcp.cfg | 1 - .../test-fullvirt-serial-dev-2-ports.cfg | 1 - .../test-fullvirt-serial-dev-2nd-port.cfg | 1 - tests/xmconfigdata/test-fullvirt-serial-file.cfg | 1 - tests/xmconfigdata/test-fullvirt-serial-null.cfg | 1 - tests/xmconfigdata/test-fullvirt-serial-pipe.cfg | 1 - tests/xmconfigdata/test-fullvirt-serial-pty.cfg | 1 - tests/xmconfigdata/test-fullvirt-serial-stdio.cfg | 1 - .../test-fullvirt-serial-tcp-telnet.cfg | 1 - tests/xmconfigdata/test-fullvirt-serial-tcp.cfg | 1 - tests/xmconfigdata/test-fullvirt-serial-udp.cfg | 1 - tests/xmconfigdata/test-fullvirt-serial-unix.cfg | 1 - tests/xmconfigdata/test-fullvirt-sound.cfg | 1 - tests/xmconfigdata/test-fullvirt-usbmouse.cfg | 1 - tests/xmconfigdata/test-fullvirt-usbtablet.cfg | 1 - tests/xmconfigdata/test-fullvirt-utc.cfg | 1 - tests/xmconfigdata/test-no-source-cdrom.cfg | 1 - tests/xmconfigdata/test-pci-devs.cfg | 1 - tests/xmconfigtest.c | 1 + 43 files changed, 173 insertions(+), 43 deletions(-) diff --git a/src/xenconfig/xen_common.c b/src/xenconfig/xen_common.c index 828c8e9..4dcd484 100644 --- a/src/xenconfig/xen_common.c +++ b/src/xenconfig/xen_common.c @@ -528,11 +528,11 @@ xenParseCPUFeatures(virConfPtr conf, virDomainDefPtr def) else if (val) def->features[VIR_DOMAIN_FEATURE_APIC] = VIR_TRISTATE_SWITCH_ON; - if (xenConfigGetBool(conf, "hap", &val, 0) < 0) + if (xenConfigGetBool(conf, "hap", &val, 1) < 0) return -1; - else if (val) - def->features[VIR_DOMAIN_FEATURE_HAP] = VIR_TRISTATE_SWITCH_ON; + else if (!val) + def->features[VIR_DOMAIN_FEATURE_HAP] = VIR_TRISTATE_SWITCH_OFF; if (xenConfigGetBool(conf, "viridian", &val, 0) < 0) return -1; @@ -1572,10 +1572,10 @@ xenFormatCPUFeatures(virConfPtr conf, virDomainDefPtr def) VIR_TRISTATE_SWITCH_ON) ? 1 : 0) < 0) return -1; - if (xenConfigSetInt(conf, "hap", - (def->features[VIR_DOMAIN_FEATURE_HAP] == - VIR_TRISTATE_SWITCH_ON) ? 1 : 0) < 0) - return -1; + if (def->features[VIR_DOMAIN_FEATURE_HAP] == VIR_TRISTATE_SWITCH_OFF) { + if (xenConfigSetInt(conf, "hap", 0) < 0) + return -1; + } if (xenConfigSetInt(conf, "viridian", (def->features[VIR_DOMAIN_FEATURE_VIRIDIAN] == diff --git a/tests/xlconfigdata/test-disk-positional-parms-full.cfg b/tests/xlconfigdata/test-disk-positional-parms-full.cfg index 026e451..c5bbb03 100644 --- a/tests/xlconfigdata/test-disk-positional-parms-full.cfg +++ b/tests/xlconfigdata/test-disk-positional-parms-full.cfg @@ -6,7 +6,6 @@ vcpus = 1 pae = 1 acpi = 1 apic = 1 -hap = 0 viridian = 0 rtc_timeoffset = 0 localtime = 0 diff --git a/tests/xlconfigdata/test-disk-positional-parms-partial.cfg b/tests/xlconfigdata/test-disk-positional-parms-partial.cfg index 0591037..09eeb94 100644 --- a/tests/xlconfigdata/test-disk-positional-parms-partial.cfg +++ b/tests/xlconfigdata/test-disk-positional-parms-partial.cfg @@ -6,7 +6,6 @@ vcpus = 1 pae = 1 acpi = 1 apic = 1 -hap = 0 viridian = 0 rtc_timeoffset = 0 localtime = 0 diff --git a/tests/xlconfigdata/test-fullvirt-direct-kernel-boot-bogus-extra.cfg b/tests/xlconfigdata/test-fullvirt-direct-kernel-boot-bogus-extra.cfg index 83ab975..8012737 100644 --- a/tests/xlconfigdata/test-fullvirt-direct-kernel-boot-bogus-extra.cfg +++ b/tests/xlconfigdata/test-fullvirt-direct-kernel-boot-bogus-extra.cfg @@ -6,7 +6,6 @@ vcpus = 1 pae = 1 acpi = 1 apic = 1 -hap = 0 viridian = 0 rtc_timeoffset = 0 localtime = 0 diff --git a/tests/xlconfigdata/test-fullvirt-direct-kernel-boot-extra.cfg b/tests/xlconfigdata/test-fullvirt-direct-kernel-boot-extra.cfg index f452af6..4ed5a90 100644 --- a/tests/xlconfigdata/test-fullvirt-direct-kernel-boot-extra.cfg +++ b/tests/xlconfigdata/test-fullvirt-direct-kernel-boot-extra.cfg @@ -6,7 +6,6 @@ vcpus = 1 pae = 1 acpi = 1 apic = 1 -hap = 0 viridian = 0 rtc_timeoffset = 0 localtime = 0 diff --git a/tests/xlconfigdata/test-fullvirt-direct-kernel-boot.cfg b/tests/xlconfigdata/test-fullvirt-direct-kernel-boot.cfg index 9ebbc89..110f0a0 100644 --- a/tests/xlconfigdata/test-fullvirt-direct-kernel-boot.cfg +++ b/tests/xlconfigdata/test-fullvirt-direct-kernel-boot.cfg @@ -6,7 +6,6 @@ vcpus = 1 pae = 1 acpi = 1 apic = 1 -hap = 0 viridian = 0 rtc_timeoffset = 0 localtime = 0 diff --git a/tests/xlconfigdata/test-fullvirt-multiusb.cfg b/tests/xlconfigdata/test-fullvirt-multiusb.cfg index 097de88..003eb2b 100755 --- a/tests/xlconfigdata/test-fullvirt-multiusb.cfg +++ b/tests/xlconfigdata/test-fullvirt-multiusb.cfg @@ -6,7 +6,6 @@ vcpus = 1 pae = 1 acpi = 1 apic = 1 -hap = 0 viridian = 0 rtc_timeoffset = 0 localtime = 0 diff --git a/tests/xlconfigdata/test-fullvirt-nohap.cfg b/tests/xlconfigdata/test-fullvirt-nohap.cfg new file mode 100644 index 0000000..44bfa3c --- /dev/null +++ b/tests/xlconfigdata/test-fullvirt-nohap.cfg @@ -0,0 +1,26 @@ +name = "XenGuest2" +uuid = "c7a5fdb2-cdaf-9455-926a-d65c16db1809" +maxmem = 579 +memory = 394 +vcpus = 1 +pae = 1 +acpi = 1 +apic = 1 +hap = 0 +viridian = 0 +rtc_timeoffset = 0 +localtime = 0 +on_poweroff = "destroy" +on_reboot = "restart" +on_crash = "restart" +device_model = "/usr/lib/xen/bin/qemu-dm" +sdl = 0 +vnc = 1 +vncunused = 1 +vnclisten = "127.0.0.1" +vif = [ "mac=00:16:3e:66:92:9c,bridge=xenbr1,script=vif-bridge,model=e1000,rate=10240KB/s" ] +parallel = "none" +serial = "none" +builder = "hvm" +boot = "d" +disk = [ "format=raw,vdev=hda,access=rw,backendtype=phy,target=/dev/HostVG/XenGuest2", "format=qcow2,vdev=hdb,access=rw,backendtype=qdisk,target=/var/lib/libvirt/images/XenGuest2-home", "format=raw,vdev=hdc,access=ro,backendtype=qdisk,devtype=cdrom,target=/root/boot.iso" ] diff --git a/tests/xlconfigdata/test-fullvirt-nohap.xml b/tests/xlconfigdata/test-fullvirt-nohap.xml new file mode 100644 index 0000000..d9dad20 --- /dev/null +++ b/tests/xlconfigdata/test-fullvirt-nohap.xml @@ -0,0 +1,59 @@ + + XenGuest2 + c7a5fdb2-cdaf-9455-926a-d65c16db1809 + 592896 + 403456 + 1 + + hvm + /usr/lib/xen/boot/hvmloader + + + + + + + + + + destroy + restart + restart + + /usr/lib/xen/bin/qemu-dm + + + + +
+ + + + + +
+ + + + + + +
+ + + + + + + + +