[pve-devel] [PATCH qemu-server] Fix: rtcflags: ignore startdate 'now'

Alwin Antreich a.antreich at proxmox.com
Thu Jul 4 11:00:58 CEST 2019


If 'now' is passed to the startdate option, the kvm start fails with
below failure.
 kvm: invalid datetime format
 valid formats: '2006-06-17T16:01:21' or '2006-06-17'

With this patch, 'now' is ignored and not passed to the rtcflags (-rtc).

Signed-off-by: Alwin Antreich <a.antreich at proxmox.com>
---
 PVE/QemuServer.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index b4b1580..5ef92a3 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -3854,7 +3854,7 @@ sub config_to_command {
 	push @$machineFlags, "type=${machine_type}";
     }
 
-    if ($conf->{startdate}) {
+    if (($conf->{startdate}) && ($conf->{startdate} ne 'now')) {
 	push @$rtcFlags, "base=$conf->{startdate}";
     } elsif ($useLocaltime) {
 	push @$rtcFlags, 'base=localtime';
-- 
2.20.1





More information about the pve-devel mailing list