]> git.proxmox.com Git - qemu-server.git/commitdiff
Fix: rtcflags: ignore startdate 'now'
authorAlwin Antreich <a.antreich@proxmox.com>
Thu, 4 Jul 2019 09:00:58 +0000 (11:00 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Thu, 4 Jul 2019 09:29:26 +0000 (11:29 +0200)
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@proxmox.com>
PVE/QemuServer.pm

index b4b15801dc51ba30d6201c0f1d8ec1dcb4e2914d..5ef92a3f69613a92c3f483a85b8ebf48e2747bdb 100644 (file)
@@ -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';