Fix: rtcflags: ignore startdate 'now'

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>
This commit is contained in:
Alwin Antreich 2019-07-04 11:00:58 +02:00 committed by Thomas Lamprecht
parent fbab413dc2
commit 85f0511db3

View 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';