mirror of https://gitee.com/openkylin/libvirt.git
qemu: don't use deprecated -no-kvm-pit-reinjection
Since qemu-kvm 1.1 [1] (since 1.3. in upstream QEMU [2]) '-no-kvm-pit-reinjection' has been deprecated. Use -global kvm-pit.lost_tick_policy=discard instead. https://bugzilla.redhat.com/show_bug.cgi?id=978719 [1] http://git.kernel.org/cgit/virt/kvm/qemu-kvm.git/commit/?id=4e4fa39 [2] http://git.qemu.org/?p=qemu.git;a=commitdiff;h=c21fb4f
This commit is contained in:
parent
5669045580
commit
1569fa14d8
|
@ -242,6 +242,7 @@ VIR_ENUM_IMPL(virQEMUCaps, QEMU_CAPS_LAST,
|
|||
"usb-storage.removable",
|
||||
"virtio-mmio",
|
||||
"ich9-intel-hda",
|
||||
"kvm-pit-lost-tick-policy",
|
||||
);
|
||||
|
||||
struct _virQEMUCaps {
|
||||
|
@ -1458,6 +1459,10 @@ static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsUsbStorage[] = {
|
|||
{ "removable", QEMU_CAPS_USB_STORAGE_REMOVABLE },
|
||||
};
|
||||
|
||||
static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsKVMPit[] = {
|
||||
{ "lost_tick_policy", QEMU_CAPS_KVM_PIT_TICK_POLICY },
|
||||
};
|
||||
|
||||
struct virQEMUCapsObjectTypeProps {
|
||||
const char *type;
|
||||
struct virQEMUCapsStringFlags *props;
|
||||
|
@ -1501,6 +1506,8 @@ static struct virQEMUCapsObjectTypeProps virQEMUCapsObjectProps[] = {
|
|||
ARRAY_CARDINALITY(virQEMUCapsObjectPropsQ35PciHost) },
|
||||
{ "usb-storage", virQEMUCapsObjectPropsUsbStorage,
|
||||
ARRAY_CARDINALITY(virQEMUCapsObjectPropsUsbStorage) },
|
||||
{ "kvm-pit", virQEMUCapsObjectPropsKVMPit,
|
||||
ARRAY_CARDINALITY(virQEMUCapsObjectPropsKVMPit) },
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -197,6 +197,7 @@ enum virQEMUCapsFlags {
|
|||
QEMU_CAPS_USB_STORAGE_REMOVABLE = 156, /* usb-storage.removable */
|
||||
QEMU_CAPS_DEVICE_VIRTIO_MMIO = 157, /* -device virtio-mmio */
|
||||
QEMU_CAPS_DEVICE_ICH9_INTEL_HDA = 158, /* -device ich9-intel-hda */
|
||||
QEMU_CAPS_KVM_PIT_TICK_POLICY = 159, /* kvm-pit.lost_tick_policy */
|
||||
|
||||
QEMU_CAPS_LAST, /* this must always be the last item */
|
||||
};
|
||||
|
|
|
@ -7993,11 +7993,15 @@ qemuBuildCommandLine(virConnectPtr conn,
|
|||
case VIR_DOMAIN_TIMER_TICKPOLICY_DELAY:
|
||||
/* delay is the default if we don't have kernel
|
||||
(-no-kvm-pit), otherwise, the default is catchup. */
|
||||
if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_NO_KVM_PIT))
|
||||
if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_KVM_PIT_TICK_POLICY))
|
||||
virCommandAddArgList(cmd, "-global",
|
||||
"kvm-pit.lost_tick_policy=discard", NULL);
|
||||
else if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_NO_KVM_PIT))
|
||||
virCommandAddArg(cmd, "-no-kvm-pit-reinjection");
|
||||
break;
|
||||
case VIR_DOMAIN_TIMER_TICKPOLICY_CATCHUP:
|
||||
if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_NO_KVM_PIT)) {
|
||||
if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_NO_KVM_PIT) ||
|
||||
virQEMUCapsGet(qemuCaps, QEMU_CAPS_KVM_PIT_TICK_POLICY)) {
|
||||
/* do nothing - this is default for kvm-pit */
|
||||
} else if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_TDF)) {
|
||||
/* -tdf switches to 'catchup' with userspace pit. */
|
||||
|
|
|
@ -111,4 +111,5 @@
|
|||
<flag name='vnc-share-policy'/>
|
||||
<flag name='usb-storage'/>
|
||||
<flag name='usb-storage.removable'/>
|
||||
<flag name='kvm-pit-lost-tick-policy'/>
|
||||
</qemuCaps>
|
||||
|
|
|
@ -1391,6 +1391,20 @@
|
|||
"id": "libvirt-25"
|
||||
}
|
||||
|
||||
{
|
||||
"return": [
|
||||
{
|
||||
"name": "lost_tick_policy",
|
||||
"type": "LostTickPolicy"
|
||||
},
|
||||
{
|
||||
"name": "iobase",
|
||||
"type": "hex32"
|
||||
}
|
||||
],
|
||||
"id": "libvirt-26"
|
||||
}
|
||||
|
||||
{
|
||||
"return": [
|
||||
{
|
||||
|
|
|
@ -125,4 +125,5 @@
|
|||
<flag name='dmi-to-pci-bridge'/>
|
||||
<flag name='usb-storage'/>
|
||||
<flag name='usb-storage.removable'/>
|
||||
<flag name='kvm-pit-lost-tick-policy'/>
|
||||
</qemuCaps>
|
||||
|
|
|
@ -1550,6 +1550,20 @@
|
|||
"id": "libvirt-25"
|
||||
}
|
||||
|
||||
{
|
||||
"return": [
|
||||
{
|
||||
"name": "lost_tick_policy",
|
||||
"type": "LostTickPolicy"
|
||||
},
|
||||
{
|
||||
"name": "iobase",
|
||||
"type": "hex32"
|
||||
}
|
||||
],
|
||||
"id": "libvirt-26"
|
||||
}
|
||||
|
||||
{
|
||||
"return": [
|
||||
{
|
||||
|
|
|
@ -126,4 +126,5 @@
|
|||
<flag name='usb-storage'/>
|
||||
<flag name='usb-storage.removable'/>
|
||||
<flag name='ich9-intel-hda'/>
|
||||
<flag name='kvm-pit-lost-tick-policy'/>
|
||||
</qemuCaps>
|
||||
|
|
|
@ -1597,6 +1597,20 @@
|
|||
"id": "libvirt-25"
|
||||
}
|
||||
|
||||
{
|
||||
"return": [
|
||||
{
|
||||
"name": "lost_tick_policy",
|
||||
"type": "LostTickPolicy"
|
||||
},
|
||||
{
|
||||
"name": "iobase",
|
||||
"type": "hex32"
|
||||
}
|
||||
],
|
||||
"id": "libvirt-26"
|
||||
}
|
||||
|
||||
{
|
||||
"return": [
|
||||
{
|
||||
|
|
|
@ -130,4 +130,5 @@
|
|||
<flag name='usb-storage'/>
|
||||
<flag name='usb-storage.removable'/>
|
||||
<flag name='ich9-intel-hda'/>
|
||||
<flag name='kvm-pit-lost-tick-policy'/>
|
||||
</qemuCaps>
|
||||
|
|
|
@ -1671,6 +1671,20 @@
|
|||
"id": "libvirt-25"
|
||||
}
|
||||
|
||||
{
|
||||
"return": [
|
||||
{
|
||||
"name": "lost_tick_policy",
|
||||
"type": "LostTickPolicy"
|
||||
},
|
||||
{
|
||||
"name": "iobase",
|
||||
"type": "hex32"
|
||||
}
|
||||
],
|
||||
"id": "libvirt-26"
|
||||
}
|
||||
|
||||
{
|
||||
"return": [
|
||||
{
|
||||
|
|
|
@ -134,4 +134,5 @@
|
|||
<flag name='usb-storage.removable'/>
|
||||
<flag name='virtio-mmio'/>
|
||||
<flag name='ich9-intel-hda'/>
|
||||
<flag name='kvm-pit-lost-tick-policy'/>
|
||||
</qemuCaps>
|
||||
|
|
|
@ -1733,6 +1733,20 @@
|
|||
"id": "libvirt-25"
|
||||
}
|
||||
|
||||
{
|
||||
"return": [
|
||||
{
|
||||
"name": "lost_tick_policy",
|
||||
"type": "LostTickPolicy"
|
||||
},
|
||||
{
|
||||
"name": "iobase",
|
||||
"type": "hex32"
|
||||
}
|
||||
],
|
||||
"id": "libvirt-26"
|
||||
}
|
||||
|
||||
{
|
||||
"return": [
|
||||
{
|
||||
|
|
|
@ -133,4 +133,5 @@
|
|||
<flag name='usb-storage.removable'/>
|
||||
<flag name='virtio-mmio'/>
|
||||
<flag name='ich9-intel-hda'/>
|
||||
<flag name='kvm-pit-lost-tick-policy'/>
|
||||
</qemuCaps>
|
||||
|
|
|
@ -1697,6 +1697,20 @@
|
|||
"id": "libvirt-25"
|
||||
}
|
||||
|
||||
{
|
||||
"return": [
|
||||
{
|
||||
"name": "lost_tick_policy",
|
||||
"type": "LostTickPolicy"
|
||||
},
|
||||
{
|
||||
"name": "iobase",
|
||||
"type": "hex32"
|
||||
}
|
||||
],
|
||||
"id": "libvirt-26"
|
||||
}
|
||||
|
||||
{
|
||||
"return": [
|
||||
{
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test QEMU_AUDIO_DRV=none \
|
||||
/usr/bin/qemu -S -M pc -m 214 -smp 2 -nographic \
|
||||
-monitor unix:/tmp/test-monitor,server,nowait \
|
||||
-no-kvm-pit-reinjection -no-acpi -boot c -usb -hda /dev/HostVG/QEMUGuest1 \
|
||||
-net none -serial none -parallel none
|
|
@ -0,0 +1,29 @@
|
|||
<domain type='qemu'>
|
||||
<name>QEMUGuest1</name>
|
||||
<uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
|
||||
<memory unit='KiB'>219136</memory>
|
||||
<currentMemory unit='KiB'>219136</currentMemory>
|
||||
<vcpu placement='static'>2</vcpu>
|
||||
<os>
|
||||
<type arch='i686' machine='pc'>hvm</type>
|
||||
<boot dev='hd'/>
|
||||
</os>
|
||||
<clock offset='utc'>
|
||||
<timer name='pit' tickpolicy='delay'/>
|
||||
</clock>
|
||||
<on_poweroff>destroy</on_poweroff>
|
||||
<on_reboot>restart</on_reboot>
|
||||
<on_crash>destroy</on_crash>
|
||||
<devices>
|
||||
<emulator>/usr/bin/qemu</emulator>
|
||||
<disk type='block' device='disk'>
|
||||
<source dev='/dev/HostVG/QEMUGuest1'/>
|
||||
<target dev='hda' bus='ide'/>
|
||||
<address type='drive' controller='0' bus='0' target='0' unit='0'/>
|
||||
</disk>
|
||||
<controller type='usb' index='0'/>
|
||||
<controller type='ide' index='0'/>
|
||||
<controller type='pci' index='0' model='pci-root'/>
|
||||
<memballoon model='virtio'/>
|
||||
</devices>
|
||||
</domain>
|
|
@ -0,0 +1,5 @@
|
|||
LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test QEMU_AUDIO_DRV=none \
|
||||
/usr/bin/qemu -S -M pc -m 214 -smp 2 -nographic \
|
||||
-monitor unix:/tmp/test-monitor,server,nowait \
|
||||
-global kvm-pit.lost_tick_policy=discard -no-acpi -boot c -usb \
|
||||
-hda /dev/HostVG/QEMUGuest1 -net none -serial none -parallel none
|
|
@ -0,0 +1,29 @@
|
|||
<domain type='qemu'>
|
||||
<name>QEMUGuest1</name>
|
||||
<uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
|
||||
<memory unit='KiB'>219136</memory>
|
||||
<currentMemory unit='KiB'>219136</currentMemory>
|
||||
<vcpu placement='static'>2</vcpu>
|
||||
<os>
|
||||
<type arch='i686' machine='pc'>hvm</type>
|
||||
<boot dev='hd'/>
|
||||
</os>
|
||||
<clock offset='utc'>
|
||||
<timer name='pit' tickpolicy='delay'/>
|
||||
</clock>
|
||||
<on_poweroff>destroy</on_poweroff>
|
||||
<on_reboot>restart</on_reboot>
|
||||
<on_crash>destroy</on_crash>
|
||||
<devices>
|
||||
<emulator>/usr/bin/qemu</emulator>
|
||||
<disk type='block' device='disk'>
|
||||
<source dev='/dev/HostVG/QEMUGuest1'/>
|
||||
<target dev='hda' bus='ide'/>
|
||||
<address type='drive' controller='0' bus='0' target='0' unit='0'/>
|
||||
</disk>
|
||||
<controller type='usb' index='0'/>
|
||||
<controller type='ide' index='0'/>
|
||||
<controller type='pci' index='0' model='pci-root'/>
|
||||
<memballoon model='virtio'/>
|
||||
</devices>
|
||||
</domain>
|
|
@ -1103,6 +1103,11 @@ mymain(void)
|
|||
QEMU_CAPS_DRIVE, QEMU_CAPS_DEVICE_VIRTIO_MMIO,
|
||||
QEMU_CAPS_DEVICE_VIRTIO_RNG, QEMU_CAPS_OBJECT_RNG_RANDOM);
|
||||
|
||||
DO_TEST("kvm-pit-device", QEMU_CAPS_KVM_PIT_TICK_POLICY);
|
||||
DO_TEST("kvm-pit-delay", QEMU_CAPS_NO_KVM_PIT);
|
||||
DO_TEST("kvm-pit-device", QEMU_CAPS_NO_KVM_PIT,
|
||||
QEMU_CAPS_KVM_PIT_TICK_POLICY);
|
||||
|
||||
virObjectUnref(driver.config);
|
||||
virObjectUnref(driver.caps);
|
||||
virObjectUnref(driver.xmlopt);
|
||||
|
|
Loading…
Reference in New Issue