mirror of https://gitee.com/openkylin/libvirt.git
Revert "qemu: add support for tsc.on_reboot element"
This reverts commit 06c960e477
.
Turns out, this feature is not needed and QEMU will fix TSC
without any intervention from outside.
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>P
This commit is contained in:
parent
bcb3bf2f7c
commit
087473a3ef
|
@ -669,7 +669,6 @@ VIR_ENUM_IMPL(virQEMUCaps,
|
||||||
/* 425 */
|
/* 425 */
|
||||||
"blockdev.nbd.tls-hostname", /* QEMU_CAPS_BLOCKDEV_NBD_TLS_HOSTNAME */
|
"blockdev.nbd.tls-hostname", /* QEMU_CAPS_BLOCKDEV_NBD_TLS_HOSTNAME */
|
||||||
"memory-backend-file.prealloc-threads", /* QEMU_CAPS_MEMORY_BACKEND_PREALLOC_THREADS */
|
"memory-backend-file.prealloc-threads", /* QEMU_CAPS_MEMORY_BACKEND_PREALLOC_THREADS */
|
||||||
"x86-cpu.tsc-clear-on-reset", /* QEMU_CAPS_X86_CPU_TSC_CLEAR_ON_RESET */
|
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
@ -1778,7 +1777,6 @@ static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsMemoryBackendMemfd[]
|
||||||
static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsMaxCPU[] = {
|
static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsMaxCPU[] = {
|
||||||
{ "unavailable-features", QEMU_CAPS_CPU_UNAVAILABLE_FEATURES },
|
{ "unavailable-features", QEMU_CAPS_CPU_UNAVAILABLE_FEATURES },
|
||||||
{ "kvm-no-adjvtime", QEMU_CAPS_CPU_KVM_NO_ADJVTIME },
|
{ "kvm-no-adjvtime", QEMU_CAPS_CPU_KVM_NO_ADJVTIME },
|
||||||
{ "tsc-clear-on-reset", QEMU_CAPS_X86_CPU_TSC_CLEAR_ON_RESET },
|
|
||||||
{ "migratable", QEMU_CAPS_CPU_MIGRATABLE },
|
{ "migratable", QEMU_CAPS_CPU_MIGRATABLE },
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -644,7 +644,6 @@ typedef enum { /* virQEMUCapsFlags grouping marker for syntax-check */
|
||||||
/* 425 */
|
/* 425 */
|
||||||
QEMU_CAPS_BLOCKDEV_NBD_TLS_HOSTNAME, /* tls hostname can be overriden for NBD clients */
|
QEMU_CAPS_BLOCKDEV_NBD_TLS_HOSTNAME, /* tls hostname can be overriden for NBD clients */
|
||||||
QEMU_CAPS_MEMORY_BACKEND_PREALLOC_THREADS, /* -object memory-backend-*.prealloc-threads */
|
QEMU_CAPS_MEMORY_BACKEND_PREALLOC_THREADS, /* -object memory-backend-*.prealloc-threads */
|
||||||
QEMU_CAPS_X86_CPU_TSC_CLEAR_ON_RESET, /* x86-cpu.tsc-clear-on-reset */
|
|
||||||
|
|
||||||
QEMU_CAPS_LAST /* this must always be the last item */
|
QEMU_CAPS_LAST /* this must always be the last item */
|
||||||
} virQEMUCapsFlags;
|
} virQEMUCapsFlags;
|
||||||
|
|
|
@ -6616,17 +6616,6 @@ qemuBuildCpuCommandLine(virCommand *cmd,
|
||||||
case VIR_DOMAIN_TIMER_NAME_TSC:
|
case VIR_DOMAIN_TIMER_NAME_TSC:
|
||||||
if (timer->frequency > 0)
|
if (timer->frequency > 0)
|
||||||
virBufferAsprintf(&buf, ",tsc-frequency=%llu", timer->frequency);
|
virBufferAsprintf(&buf, ",tsc-frequency=%llu", timer->frequency);
|
||||||
switch (timer->reboot) {
|
|
||||||
case VIR_DOMAIN_TIMER_REBOOT_MODE_CLEAR:
|
|
||||||
virBufferAddLit(&buf, ",tsc-clear-on-reset=on");
|
|
||||||
break;
|
|
||||||
case VIR_DOMAIN_TIMER_REBOOT_MODE_KEEP:
|
|
||||||
virBufferAddLit(&buf, ",tsc-clear-on-reset=off");
|
|
||||||
break;
|
|
||||||
case VIR_DOMAIN_TIMER_REBOOT_MODE_DEFAULT:
|
|
||||||
case VIR_DOMAIN_TIMER_REBOOT_MODE_LAST:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case VIR_DOMAIN_TIMER_NAME_ARMVTIMER:
|
case VIR_DOMAIN_TIMER_NAME_ARMVTIMER:
|
||||||
switch (timer->tickpolicy) {
|
switch (timer->tickpolicy) {
|
||||||
|
|
|
@ -396,11 +396,10 @@ static int
|
||||||
qemuValidateDomainDefClockTimers(const virDomainDef *def,
|
qemuValidateDomainDefClockTimers(const virDomainDef *def,
|
||||||
virQEMUCaps *qemuCaps)
|
virQEMUCaps *qemuCaps)
|
||||||
{
|
{
|
||||||
virDomainTimerDef *timer;
|
|
||||||
size_t i;
|
size_t i;
|
||||||
|
|
||||||
for (i = 0; i < def->clock.ntimers; i++) {
|
for (i = 0; i < def->clock.ntimers; i++) {
|
||||||
timer = def->clock.timers[i];
|
virDomainTimerDef *timer = def->clock.timers[i];
|
||||||
|
|
||||||
switch ((virDomainTimerNameType)timer->name) {
|
switch ((virDomainTimerNameType)timer->name) {
|
||||||
case VIR_DOMAIN_TIMER_NAME_PLATFORM:
|
case VIR_DOMAIN_TIMER_NAME_PLATFORM:
|
||||||
|
@ -410,22 +409,18 @@ qemuValidateDomainDefClockTimers(const virDomainDef *def,
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
case VIR_DOMAIN_TIMER_NAME_TSC:
|
case VIR_DOMAIN_TIMER_NAME_TSC:
|
||||||
if (!ARCH_IS_X86(def->os.arch) && timer->present == VIR_TRISTATE_BOOL_YES)
|
|
||||||
goto no_support;
|
|
||||||
|
|
||||||
if (timer->reboot != VIR_DOMAIN_TIMER_REBOOT_MODE_DEFAULT &&
|
|
||||||
!virQEMUCapsGet(qemuCaps, QEMU_CAPS_X86_CPU_TSC_CLEAR_ON_RESET)) {
|
|
||||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
|
||||||
_("Configuring the '%s' timer to reset on reboot is not supported with this QEMU binary"),
|
|
||||||
virDomainTimerNameTypeToString(timer->name));
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case VIR_DOMAIN_TIMER_NAME_KVMCLOCK:
|
case VIR_DOMAIN_TIMER_NAME_KVMCLOCK:
|
||||||
case VIR_DOMAIN_TIMER_NAME_HYPERVCLOCK:
|
case VIR_DOMAIN_TIMER_NAME_HYPERVCLOCK:
|
||||||
if (!ARCH_IS_X86(def->os.arch) && timer->present == VIR_TRISTATE_BOOL_YES)
|
if (!ARCH_IS_X86(def->os.arch) && timer->present == VIR_TRISTATE_BOOL_YES) {
|
||||||
goto no_support;
|
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||||
|
_("Configuring the '%s' timer is not supported "
|
||||||
|
"for virtType=%s arch=%s machine=%s guests"),
|
||||||
|
virDomainTimerNameTypeToString(timer->name),
|
||||||
|
virDomainVirtTypeToString(def->virtType),
|
||||||
|
virArchToString(def->os.arch),
|
||||||
|
def->os.machine);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case VIR_DOMAIN_TIMER_NAME_LAST:
|
case VIR_DOMAIN_TIMER_NAME_LAST:
|
||||||
|
@ -504,7 +499,14 @@ qemuValidateDomainDefClockTimers(const virDomainDef *def,
|
||||||
case VIR_DOMAIN_TIMER_NAME_ARMVTIMER:
|
case VIR_DOMAIN_TIMER_NAME_ARMVTIMER:
|
||||||
if (def->virtType != VIR_DOMAIN_VIRT_KVM ||
|
if (def->virtType != VIR_DOMAIN_VIRT_KVM ||
|
||||||
!qemuDomainIsARMVirt(def)) {
|
!qemuDomainIsARMVirt(def)) {
|
||||||
goto no_support;
|
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||||
|
_("Configuring the '%s' timer is not supported "
|
||||||
|
"for virtType=%s arch=%s machine=%s guests"),
|
||||||
|
virDomainTimerNameTypeToString(timer->name),
|
||||||
|
virDomainVirtTypeToString(def->virtType),
|
||||||
|
virArchToString(def->os.arch),
|
||||||
|
def->os.machine);
|
||||||
|
return -1;
|
||||||
}
|
}
|
||||||
if (timer->present == VIR_TRISTATE_BOOL_NO) {
|
if (timer->present == VIR_TRISTATE_BOOL_NO) {
|
||||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||||
|
@ -538,15 +540,6 @@ qemuValidateDomainDefClockTimers(const virDomainDef *def,
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
no_support:
|
|
||||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
|
||||||
_("Configuring the '%s' timer is not supported for virtType=%s arch=%s machine=%s guests"),
|
|
||||||
virDomainTimerNameTypeToString(timer->name),
|
|
||||||
virDomainVirtTypeToString(def->virtType),
|
|
||||||
virArchToString(def->os.arch),
|
|
||||||
def->os.machine);
|
|
||||||
return -1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -28849,10 +28849,6 @@
|
||||||
{
|
{
|
||||||
"name": "sse4_1",
|
"name": "sse4_1",
|
||||||
"type": "bool"
|
"type": "bool"
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "tsc-clear-on-reset",
|
|
||||||
"type": "bool"
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"id": "libvirt-41"
|
"id": "libvirt-41"
|
||||||
|
|
|
@ -245,7 +245,6 @@
|
||||||
<flag name='dirtyrate-param.mode'/>
|
<flag name='dirtyrate-param.mode'/>
|
||||||
<flag name='blockdev.nbd.tls-hostname'/>
|
<flag name='blockdev.nbd.tls-hostname'/>
|
||||||
<flag name='memory-backend-file.prealloc-threads'/>
|
<flag name='memory-backend-file.prealloc-threads'/>
|
||||||
<flag name='x86-cpu.tsc-clear-on-reset'/>
|
|
||||||
<version>6002050</version>
|
<version>6002050</version>
|
||||||
<kvmVersion>0</kvmVersion>
|
<kvmVersion>0</kvmVersion>
|
||||||
<microcodeVersion>43100243</microcodeVersion>
|
<microcodeVersion>43100243</microcodeVersion>
|
||||||
|
|
|
@ -1,32 +0,0 @@
|
||||||
LC_ALL=C \
|
|
||||||
PATH=/bin \
|
|
||||||
HOME=/tmp/lib/domain--1-QEMUGuest1 \
|
|
||||||
USER=test \
|
|
||||||
LOGNAME=test \
|
|
||||||
XDG_DATA_HOME=/tmp/lib/domain--1-QEMUGuest1/.local/share \
|
|
||||||
XDG_CACHE_HOME=/tmp/lib/domain--1-QEMUGuest1/.cache \
|
|
||||||
XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \
|
|
||||||
QEMU_AUDIO_DRV=none \
|
|
||||||
/usr/bin/qemu-system-x86_64 \
|
|
||||||
-name guest=QEMUGuest1,debug-threads=on \
|
|
||||||
-S \
|
|
||||||
-object secret,id=masterKey0,format=raw,file=/tmp/lib/domain--1-QEMUGuest1/master-key.aes \
|
|
||||||
-machine pc,usb=off,dump-guest-core=off \
|
|
||||||
-accel kvm \
|
|
||||||
-cpu Haswell,vme=on,ds=on,acpi=on,ss=on,ht=on,tm=on,pbe=on,dtes64=on,monitor=on,ds-cpl=on,vmx=on,smx=on,est=on,tm2=on,xtpr=on,pdcm=on,f16c=on,rdrand=on,pdpe1gb=on,abm=on,lahf-lm=on,invtsc=on,tsc-clear-on-reset=on \
|
|
||||||
-m 214 \
|
|
||||||
-realtime mlock=off \
|
|
||||||
-smp 1,sockets=1,cores=1,threads=1 \
|
|
||||||
-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
|
|
||||||
-display none \
|
|
||||||
-no-user-config \
|
|
||||||
-nodefaults \
|
|
||||||
-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,server=on,wait=off \
|
|
||||||
-mon chardev=charmonitor,id=monitor,mode=control \
|
|
||||||
-rtc base=utc \
|
|
||||||
-no-shutdown \
|
|
||||||
-no-acpi \
|
|
||||||
-boot strict=on \
|
|
||||||
-usb \
|
|
||||||
-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \
|
|
||||||
-msg timestamp=on
|
|
|
@ -1,34 +0,0 @@
|
||||||
LC_ALL=C \
|
|
||||||
PATH=/bin \
|
|
||||||
HOME=/tmp/lib/domain--1-QEMUGuest1 \
|
|
||||||
USER=test \
|
|
||||||
LOGNAME=test \
|
|
||||||
XDG_DATA_HOME=/tmp/lib/domain--1-QEMUGuest1/.local/share \
|
|
||||||
XDG_CACHE_HOME=/tmp/lib/domain--1-QEMUGuest1/.cache \
|
|
||||||
XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \
|
|
||||||
/usr/bin/qemu-system-x86_64 \
|
|
||||||
-name guest=QEMUGuest1,debug-threads=on \
|
|
||||||
-S \
|
|
||||||
-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/tmp/lib/domain--1-QEMUGuest1/master-key.aes"}' \
|
|
||||||
-machine pc-i440fx-7.0,usb=off,dump-guest-core=off,memory-backend=pc.ram \
|
|
||||||
-accel kvm \
|
|
||||||
-cpu EPYC-Rome,x2apic=on,tsc-deadline=on,hypervisor=on,tsc-adjust=on,stibp=on,arch-capabilities=on,ssbd=on,xsaves=on,cmp-legacy=on,amd-ssbd=on,virt-ssbd=on,svme-addr-chk=on,rdctl-no=on,skip-l1dfl-vmentry=on,mds-no=on,pschange-mc-no=on,invtsc=on,tsc-clear-on-reset=on \
|
|
||||||
-m 214 \
|
|
||||||
-object '{"qom-type":"memory-backend-ram","id":"pc.ram","size":224395264}' \
|
|
||||||
-overcommit mem-lock=off \
|
|
||||||
-smp 1,sockets=1,cores=1,threads=1 \
|
|
||||||
-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
|
|
||||||
-display none \
|
|
||||||
-no-user-config \
|
|
||||||
-nodefaults \
|
|
||||||
-chardev socket,id=charmonitor,fd=1729,server=on,wait=off \
|
|
||||||
-mon chardev=charmonitor,id=monitor,mode=control \
|
|
||||||
-rtc base=utc \
|
|
||||||
-no-shutdown \
|
|
||||||
-no-acpi \
|
|
||||||
-boot strict=on \
|
|
||||||
-device '{"driver":"piix3-usb-uhci","id":"usb","bus":"pci.0","addr":"0x1.0x2"}' \
|
|
||||||
-audiodev '{"id":"audio1","driver":"none"}' \
|
|
||||||
-device '{"driver":"virtio-balloon-pci","id":"balloon0","bus":"pci.0","addr":"0x2"}' \
|
|
||||||
-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \
|
|
||||||
-msg timestamp=on
|
|
|
@ -1,35 +0,0 @@
|
||||||
<domain type='kvm'>
|
|
||||||
<name>QEMUGuest1</name>
|
|
||||||
<uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
|
|
||||||
<title>A description of the test machine.</title>
|
|
||||||
<description>
|
|
||||||
A test of qemu's minimal configuration.
|
|
||||||
This test also tests the description and title elements.
|
|
||||||
</description>
|
|
||||||
<memory unit='KiB'>219100</memory>
|
|
||||||
<currentMemory unit='KiB'>219100</currentMemory>
|
|
||||||
<vcpu placement='static'>1</vcpu>
|
|
||||||
<os>
|
|
||||||
<type arch='x86_64' machine='pc'>hvm</type>
|
|
||||||
<boot dev='hd'/>
|
|
||||||
</os>
|
|
||||||
<cpu mode='host-model'>
|
|
||||||
<model fallback='allow'/>
|
|
||||||
<feature policy='require' name='invtsc'/>
|
|
||||||
</cpu>
|
|
||||||
<clock offset='utc'>
|
|
||||||
<timer name='tsc' on_reboot='clear'/>
|
|
||||||
</clock>
|
|
||||||
<on_poweroff>destroy</on_poweroff>
|
|
||||||
<on_reboot>restart</on_reboot>
|
|
||||||
<on_crash>destroy</on_crash>
|
|
||||||
<devices>
|
|
||||||
<emulator>/usr/bin/qemu-system-x86_64</emulator>
|
|
||||||
<controller type='usb' index='0'/>
|
|
||||||
<controller type='ide' index='0'/>
|
|
||||||
<controller type='pci' index='0' model='pci-root'/>
|
|
||||||
<input type='mouse' bus='ps2'/>
|
|
||||||
<input type='keyboard' bus='ps2'/>
|
|
||||||
<memballoon model='virtio'/>
|
|
||||||
</devices>
|
|
||||||
</domain>
|
|
|
@ -2094,8 +2094,6 @@ mymain(void)
|
||||||
DO_TEST("cpu-Haswell-noTSX", QEMU_CAPS_KVM);
|
DO_TEST("cpu-Haswell-noTSX", QEMU_CAPS_KVM);
|
||||||
DO_TEST_NOCAPS("cpu-host-model-cmt");
|
DO_TEST_NOCAPS("cpu-host-model-cmt");
|
||||||
DO_TEST_CAPS_VER("cpu-host-model-cmt", "4.0.0");
|
DO_TEST_CAPS_VER("cpu-host-model-cmt", "4.0.0");
|
||||||
DO_TEST("cpu-tsc-clear-on-reset", QEMU_CAPS_X86_CPU_TSC_CLEAR_ON_RESET);
|
|
||||||
DO_TEST_CAPS_VER("cpu-tsc-clear-on-reset", "7.0.0");
|
|
||||||
DO_TEST("cpu-tsc-frequency", QEMU_CAPS_KVM);
|
DO_TEST("cpu-tsc-frequency", QEMU_CAPS_KVM);
|
||||||
DO_TEST_CAPS_VER("cpu-tsc-frequency", "4.0.0");
|
DO_TEST_CAPS_VER("cpu-tsc-frequency", "4.0.0");
|
||||||
DO_TEST_CAPS_VER("cpu-translation", "4.0.0");
|
DO_TEST_CAPS_VER("cpu-translation", "4.0.0");
|
||||||
|
|
Loading…
Reference in New Issue