the RTC adjustments are lost at each reboot. :since:`Since 0.7.7`
:since:`Since 0.9.11` the ``basis`` attribute can be either 'utc'
(default) or 'localtime'.
+ ``absolute``
+ The guest clock will be always set to the value of the ``start``
+ attribute at startup of the domain. The ``start`` attribute takes an
+ epoch timestamp.
+ :since:`Since 8.4.0`.
A ``clock`` may have zero or more ``timer`` sub-elements. :since:`Since
0.8.0`
"localtime",
"variable",
"timezone",
+ "absolute",
);
VIR_ENUM_IMPL(virDomainClockBasis,
return -1;
}
break;
+
+ case VIR_DOMAIN_CLOCK_OFFSET_ABSOLUTE:
+ if (virXPathULongLong("number(./clock/@start)", ctxt,
+ &def->clock.data.starttime) < 0) {
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("missing 'start' attribute for clock with offset='absolute'"));
+ return -1;
+ }
+ break;
}
if ((n = virXPathNodeSet("./clock/timer", ctxt, &nodes)) < 0)
case VIR_DOMAIN_CLOCK_OFFSET_TIMEZONE:
virBufferEscapeString(&clockAttr, " timezone='%s'", def->data.timezone);
break;
+ case VIR_DOMAIN_CLOCK_OFFSET_ABSOLUTE:
+ virBufferAsprintf(&clockAttr, " start='%llu'", def->data.starttime);
+ break;
}
for (n = 0; n < def->ntimers; n++) {
VIR_DOMAIN_CLOCK_OFFSET_LOCALTIME = 1,
VIR_DOMAIN_CLOCK_OFFSET_VARIABLE = 2,
VIR_DOMAIN_CLOCK_OFFSET_TIMEZONE = 3,
+ VIR_DOMAIN_CLOCK_OFFSET_ABSOLUTE = 4,
VIR_DOMAIN_CLOCK_OFFSET_LAST
} virDomainClockOffsetType;
/* Timezone name, when
* offset == VIR_DOMAIN_CLOCK_OFFSET_LOCALTIME */
char *timezone;
+
+ /* absolute clock start time for VIR_DOMAIN_CLOCK_OFFSET_ABSOLUTE */
+ unsigned long long starttime;
} data;
size_t ntimers;
</attribute>
</optional>
</group>
+ <group>
+ <attribute name="offset">
+ <value>absolute</value>
+ </attribute>
+ <attribute name="start">
+ <ref name="unsignedInt"/>
+ </attribute>
+ </group>
</choice>
<zeroOrMore>
<ref name="timer"/>
virDomainClockOffsetTypeToString(clock.offset));
return -1;
+ case VIR_DOMAIN_CLOCK_OFFSET_ABSOLUTE:
case VIR_DOMAIN_CLOCK_OFFSET_LAST:
default:
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
--- /dev/null
+<domain type='qemu'>
+ <name>QEMUGuest1</name>
+ <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+ <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>
+ <clock offset='absolute' start='1234'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>destroy</on_crash>
+ <devices>
+ <emulator>/usr/bin/qemu-system-x86_64</emulator>
+ <disk type='block' device='disk'>
+ <driver name='qemu' type='raw'/>
+ <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'/>
+ <input type='mouse' bus='ps2'/>
+ <input type='keyboard' bus='ps2'/>
+ <memballoon model='none'/>
+ </devices>
+</domain>
--- /dev/null
+<domain type='qemu'>
+ <name>QEMUGuest1</name>
+ <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+ <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='custom' match='exact' check='none'>
+ <model fallback='forbid'>qemu64</model>
+ </cpu>
+ <clock offset='absolute' start='1234'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>destroy</on_crash>
+ <devices>
+ <emulator>/usr/bin/qemu-system-x86_64</emulator>
+ <disk type='block' device='disk'>
+ <driver name='qemu' type='raw'/>
+ <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' model='piix3-uhci'>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
+ </controller>
+ <controller type='ide' index='0'>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
+ </controller>
+ <controller type='pci' index='0' model='pci-root'/>
+ <input type='mouse' bus='ps2'/>
+ <input type='keyboard' bus='ps2'/>
+ <audio id='1' type='none'/>
+ <memballoon model='none'/>
+ </devices>
+</domain>
DO_TEST_NOCAPS("clock-timer-hyperv-rtc");
DO_TEST_CAPS_ARCH_LATEST("clock-timer-armvtimer", "aarch64");
DO_TEST_NOCAPS("clock-realtime");
+ DO_TEST_CAPS_LATEST("clock-absolute");
DO_TEST_NOCAPS("cpu-eoi-disabled");
DO_TEST_NOCAPS("cpu-eoi-enabled");