xenconfig: change 'hap' setting to align with Xen behavior

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 <hap state='off'/> and vice versa.

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
This commit is contained in:
Jim Fehlig 2016-02-22 18:50:19 -07:00
parent 9d243e0895
commit 4c9ffc5388
43 changed files with 173 additions and 43 deletions

View File

@ -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] ==

View File

@ -6,7 +6,6 @@ vcpus = 1
pae = 1
acpi = 1
apic = 1
hap = 0
viridian = 0
rtc_timeoffset = 0
localtime = 0

View File

@ -6,7 +6,6 @@ vcpus = 1
pae = 1
acpi = 1
apic = 1
hap = 0
viridian = 0
rtc_timeoffset = 0
localtime = 0

View File

@ -6,7 +6,6 @@ vcpus = 1
pae = 1
acpi = 1
apic = 1
hap = 0
viridian = 0
rtc_timeoffset = 0
localtime = 0

View File

@ -6,7 +6,6 @@ vcpus = 1
pae = 1
acpi = 1
apic = 1
hap = 0
viridian = 0
rtc_timeoffset = 0
localtime = 0

View File

@ -6,7 +6,6 @@ vcpus = 1
pae = 1
acpi = 1
apic = 1
hap = 0
viridian = 0
rtc_timeoffset = 0
localtime = 0

View File

@ -6,7 +6,6 @@ vcpus = 1
pae = 1
acpi = 1
apic = 1
hap = 0
viridian = 0
rtc_timeoffset = 0
localtime = 0

View File

@ -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" ]

View File

@ -0,0 +1,59 @@
<domain type='xen'>
<name>XenGuest2</name>
<uuid>c7a5fdb2-cdaf-9455-926a-d65c16db1809</uuid>
<memory unit='KiB'>592896</memory>
<currentMemory unit='KiB'>403456</currentMemory>
<vcpu placement='static'>1</vcpu>
<os>
<type arch='x86_64' machine='xenfv'>hvm</type>
<loader type='rom'>/usr/lib/xen/boot/hvmloader</loader>
<boot dev='cdrom'/>
</os>
<features>
<acpi/>
<apic/>
<pae/>
<hap state='off'/>
</features>
<clock offset='variable' adjustment='0' basis='utc'/>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>restart</on_crash>
<devices>
<emulator>/usr/lib/xen/bin/qemu-dm</emulator>
<disk type='block' device='disk'>
<driver name='phy' type='raw'/>
<source dev='/dev/HostVG/XenGuest2'/>
<target dev='hda' bus='ide'/>
<address type='drive' controller='0' bus='0' target='0' unit='0'/>
</disk>
<disk type='file' device='disk'>
<driver name='qemu' type='qcow2'/>
<source file='/var/lib/libvirt/images/XenGuest2-home'/>
<target dev='hdb' bus='ide'/>
<address type='drive' controller='0' bus='0' target='0' unit='1'/>
</disk>
<disk type='file' device='cdrom'>
<driver name='qemu' type='raw'/>
<source file='/root/boot.iso'/>
<target dev='hdc' bus='ide'/>
<readonly/>
<address type='drive' controller='0' bus='1' target='0' unit='0'/>
</disk>
<controller type='ide' index='0'/>
<interface type='bridge'>
<mac address='00:16:3e:66:92:9c'/>
<source bridge='xenbr1'/>
<bandwidth>
<outbound average='10240'/>
</bandwidth>
<script path='vif-bridge'/>
<model type='e1000'/>
</interface>
<input type='mouse' bus='ps2'/>
<input type='keyboard' bus='ps2'/>
<graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1'>
<listen type='address' address='127.0.0.1'/>
</graphics>
</devices>
</domain>

View File

@ -6,7 +6,6 @@ vcpus = 1
pae = 1
acpi = 1
apic = 1
hap = 0
viridian = 0
rtc_timeoffset = 0
localtime = 0

View File

@ -6,7 +6,6 @@ vcpus = 1
pae = 1
acpi = 1
apic = 1
hap = 0
viridian = 0
rtc_timeoffset = 0
localtime = 0

View File

@ -6,7 +6,6 @@ vcpus = 1
pae = 1
acpi = 1
apic = 1
hap = 0
viridian = 0
rtc_timeoffset = 0
localtime = 0

View File

@ -6,7 +6,6 @@ vcpus = 1
pae = 1
acpi = 1
apic = 1
hap = 0
viridian = 0
rtc_timeoffset = 0
localtime = 0

View File

@ -6,7 +6,6 @@ vcpus = 1
pae = 1
acpi = 1
apic = 1
hap = 0
viridian = 0
rtc_timeoffset = 0
localtime = 0

View File

@ -213,6 +213,7 @@ mymain(void)
DO_TEST("spice");
DO_TEST("spice-features");
DO_TEST("vif-rate");
DO_TEST("fullvirt-nohap");
DO_TEST("paravirt-cmdline");
DO_TEST_FORMAT("paravirt-cmdline-extra-root");

View File

@ -6,7 +6,6 @@ vcpus = 1
pae = 1
acpi = 1
apic = 1
hap = 0
viridian = 0
rtc_timeoffset = 0
localtime = 0

View File

@ -7,7 +7,6 @@ builder = "hvm"
kernel = "/usr/lib/xen/boot/hvmloader"
boot = "d"
hpet = 1
hap = 0
viridian = 0
rtc_timeoffset = 0
localtime = 0

View File

@ -6,7 +6,6 @@ vcpus = 1
pae = 1
acpi = 1
apic = 1
hap = 0
viridian = 0
hpet = 1
rtc_timeoffset = 0

View File

@ -6,7 +6,6 @@ vcpus = 1
pae = 1
acpi = 1
apic = 1
hap = 0
viridian = 0
hpet = 0
rtc_timeoffset = 0

View File

@ -6,7 +6,6 @@ vcpus = 1
pae = 1
acpi = 1
apic = 1
hap = 0
viridian = 0
rtc_timeoffset = 0
localtime = 1

View File

@ -6,7 +6,6 @@ vcpus = 1
pae = 1
acpi = 1
apic = 1
hap = 0
viridian = 0
rtc_timeoffset = 0
localtime = 0

View File

@ -6,7 +6,6 @@ vcpus = 1
pae = 1
acpi = 1
apic = 1
hap = 0
viridian = 0
rtc_timeoffset = 0
localtime = 0

View File

@ -0,0 +1,28 @@
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"
vncpasswd = "123poi"
vif = [ "mac=00:16:3e:66:92:9c,bridge=xenbr1,script=vif-bridge,model=e1000" ]
parallel = "none"
serial = "none"
builder = "hvm"
kernel = "/usr/lib/xen/boot/hvmloader"
boot = "d"
disk = [ "phy:/dev/HostVG/XenGuest2,hda,w", "file:/root/boot.iso,hdc:cdrom,r" ]

View File

@ -0,0 +1,51 @@
<domain type='xen'>
<name>XenGuest2</name>
<uuid>c7a5fdb2-cdaf-9455-926a-d65c16db1809</uuid>
<memory unit='KiB'>592896</memory>
<currentMemory unit='KiB'>403456</currentMemory>
<vcpu placement='static'>1</vcpu>
<os>
<type arch='i686' machine='xenfv'>hvm</type>
<loader type='rom'>/usr/lib/xen/boot/hvmloader</loader>
<boot dev='cdrom'/>
</os>
<features>
<acpi/>
<apic/>
<pae/>
<hap state='off'/>
</features>
<clock offset='variable' adjustment='0' basis='utc'/>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>restart</on_crash>
<devices>
<emulator>/usr/lib/xen/bin/qemu-dm</emulator>
<disk type='block' device='disk'>
<driver name='phy'/>
<source dev='/dev/HostVG/XenGuest2'/>
<target dev='hda' bus='ide'/>
<address type='drive' controller='0' bus='0' target='0' unit='0'/>
</disk>
<disk type='file' device='cdrom'>
<driver name='file'/>
<source file='/root/boot.iso'/>
<target dev='hdc' bus='ide'/>
<readonly/>
<address type='drive' controller='0' bus='1' target='0' unit='0'/>
</disk>
<controller type='ide' index='0'/>
<interface type='bridge'>
<mac address='00:16:3e:66:92:9c'/>
<source bridge='xenbr1'/>
<script path='vif-bridge'/>
<model type='e1000'/>
</interface>
<input type='mouse' bus='ps2'/>
<input type='keyboard' bus='ps2'/>
<graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1' passwd='123poi'>
<listen type='address' address='127.0.0.1'/>
</graphics>
<memballoon model='xen'/>
</devices>
</domain>

View File

@ -6,7 +6,6 @@ vcpus = 1
pae = 1
acpi = 1
apic = 1
hap = 0
viridian = 0
rtc_timeoffset = 0
localtime = 0

View File

@ -6,7 +6,6 @@ vcpus = 1
pae = 1
acpi = 1
apic = 1
hap = 0
viridian = 0
rtc_timeoffset = 0
localtime = 0

View File

@ -6,7 +6,6 @@ vcpus = 1
pae = 1
acpi = 1
apic = 1
hap = 0
viridian = 0
rtc_timeoffset = 0
localtime = 0

View File

@ -6,7 +6,6 @@ vcpus = 1
pae = 1
acpi = 1
apic = 1
hap = 0
viridian = 0
rtc_timeoffset = 0
localtime = 0

View File

@ -6,7 +6,6 @@ vcpus = 1
pae = 1
acpi = 1
apic = 1
hap = 0
viridian = 0
rtc_timeoffset = 0
localtime = 0

View File

@ -6,7 +6,6 @@ vcpus = 1
pae = 1
acpi = 1
apic = 1
hap = 0
viridian = 0
rtc_timeoffset = 0
localtime = 0

View File

@ -6,7 +6,6 @@ vcpus = 1
pae = 1
acpi = 1
apic = 1
hap = 0
viridian = 0
rtc_timeoffset = 0
localtime = 0

View File

@ -6,7 +6,6 @@ vcpus = 1
pae = 1
acpi = 1
apic = 1
hap = 0
viridian = 0
rtc_timeoffset = 0
localtime = 0

View File

@ -6,7 +6,6 @@ vcpus = 1
pae = 1
acpi = 1
apic = 1
hap = 0
viridian = 0
rtc_timeoffset = 0
localtime = 0

View File

@ -6,7 +6,6 @@ vcpus = 1
pae = 1
acpi = 1
apic = 1
hap = 0
viridian = 0
rtc_timeoffset = 0
localtime = 0

View File

@ -6,7 +6,6 @@ vcpus = 1
pae = 1
acpi = 1
apic = 1
hap = 0
viridian = 0
rtc_timeoffset = 0
localtime = 0

View File

@ -6,7 +6,6 @@ vcpus = 1
pae = 1
acpi = 1
apic = 1
hap = 0
viridian = 0
rtc_timeoffset = 0
localtime = 0

View File

@ -6,7 +6,6 @@ vcpus = 1
pae = 1
acpi = 1
apic = 1
hap = 0
viridian = 0
rtc_timeoffset = 0
localtime = 0

View File

@ -6,7 +6,6 @@ vcpus = 1
pae = 1
acpi = 1
apic = 1
hap = 0
viridian = 0
rtc_timeoffset = 0
localtime = 0

View File

@ -6,7 +6,6 @@ vcpus = 1
pae = 1
acpi = 1
apic = 1
hap = 0
viridian = 0
rtc_timeoffset = 0
localtime = 0

View File

@ -6,7 +6,6 @@ vcpus = 1
pae = 1
acpi = 1
apic = 1
hap = 0
viridian = 0
rtc_timeoffset = 0
localtime = 0

View File

@ -6,7 +6,6 @@ vcpus = 1
pae = 1
acpi = 1
apic = 1
hap = 0
viridian = 0
rtc_timeoffset = 0
localtime = 0

View File

@ -6,7 +6,6 @@ vcpus = 1
pae = 1
acpi = 1
apic = 1
hap = 0
viridian = 0
rtc_timeoffset = 0
localtime = 0

View File

@ -235,6 +235,7 @@ mymain(void)
DO_TEST("fullvirt-force-hpet");
DO_TEST("fullvirt-force-nohpet");
DO_TEST("fullvirt-nohap");
DO_TEST("fullvirt-parallel-tcp");