On 07/14/2017 06:55 AM, Kothapally Madhu Pavan wrote:
QEMU fails to launch a sPAPR guest with clock sources other that
RTC.
Internally qemu only uses RTC timer for hwclock. This patch reports
the right error message instead of qemu erroring out when any other
timer other than RTC is used.
Signed-off-by: Kothapally Madhu Pavan <kmp(a)linux.vnet.ibm.com>
---
src/qemu/qemu_domain.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index 8e7404d..b74800d 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -3025,6 +3025,7 @@ qemuDomainDefValidate(const virDomainDef *def,
virQEMUCapsPtr qemuCaps = NULL;
unsigned int topologycpus;
int ret = -1;
+ size_t i;
if (!(qemuCaps = virQEMUCapsCacheLookup(caps,
driver->qemuCapsCache,
@@ -3037,6 +3038,18 @@ qemuDomainDefValidate(const virDomainDef *def,
goto cleanup;
}
+ /* Only RTC timer is supported as hwclock for sPAPR machines */
+ for (i = 0; i < def->clock.ntimers; i++) {
+ virDomainTimerDefPtr timer = def->clock.timers[i];
+ if (ARCH_IS_PPC64(def->os.arch) && timer->name !=
VIR_DOMAIN_TIMER_NAME_RTC) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("unsupported clock timer '%s' for %s
architecture"),
+
virDomainTimerNameTypeToString(def->clock.timers[i]->name),
+ virArchToString(def->os.arch));
+ goto cleanup;
+ }
+ }
+
/* On x86, UEFI requires ACPI */
if (def->os.loader &&
def->os.loader->type == VIR_DOMAIN_LOADER_TYPE_PFLASH &&
Rather than enforce this for only PPC64, you can reject hpet if the
QEMU_CAPS_NO_HPET flag isn't available, and pit if QEMU_CAPS_NO_KVM_PIT aren't
available (this is effectively non-x86, see virQEMUCapsInitQMPBasicArch, but I
think it's better this way)
- Cole