On 1/25/21 7:23 AM, gongwei wrote:
Hey, patch looks almost good. Couple of comments.
Pass the parameter clock rt to qemu to ensure that the
virtual machine is not synchronized with the host time
We require that commits are Signed-off so that we know that contributors
comply with Developer Certificate of Origin
https://libvirt.org/hacking.html#developer-certificate-of-origin
---
src/conf/domain_conf.c | 1 +
src/qemu/qemu_command.c | 3 +++
src/qemu/qemu_validate.c | 1 +
3 files changed, 5 insertions(+)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index dab4f10..c19124d 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -1106,6 +1106,7 @@ VIR_ENUM_IMPL(virDomainTimerTrack,
"boot",
"guest",
"wall",
+ "realtime",
);
VIR_ENUM_IMPL(virDomainTimerTickpolicy,
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 1ec302d..5e09aa0 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -5947,6 +5947,9 @@ qemuBuildClockArgStr(virDomainClockDefPtr def)
case VIR_DOMAIN_TIMER_TRACK_WALL:
virBufferAddLit(&buf, ",clock=host");
break;
+ case VIR_DOMAIN_TIMER_TRACK_REALTIME:
This is undeclared. You need to add this to virDomainTimerTrackType enum
too.
+ virBufferAddLit(&buf, ",clock=rt");
+ break;
}
switch (def->timers[i]->tickpolicy) {
diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c
index a060bd9..d4fe40f 100644
--- a/src/qemu/qemu_validate.c
+++ b/src/qemu/qemu_validate.c
@@ -444,6 +444,7 @@ qemuValidateDomainDefClockTimers(const virDomainDef *def,
case -1: /* unspecified - use hypervisor default */
case VIR_DOMAIN_TIMER_TRACK_GUEST:
case VIR_DOMAIN_TIMER_TRACK_WALL:
+ case VIR_DOMAIN_TIMER_TRACK_REALTIME:
break;
case VIR_DOMAIN_TIMER_TRACK_BOOT:
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
What is furthermore missing in this patch is documentation
(docs/formatdomain.rst), schema adjustment
(docs/schemas/domaincommon.rng) and a test case (qemuxml2argv and
qemuxml2xml).
Looking forward to v2.
Michal