[libvirt PATCH v2] libvirt-guests: Sync time for autostarted guests

Tim Wiederhake posted 1 patch 3 years, 5 months ago
Test syntax-check failed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/20201028135935.29750-1-twiederh@redhat.com
tools/libvirt-guests.sh.in | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
[libvirt PATCH v2] libvirt-guests: Sync time for autostarted guests
Posted by Tim Wiederhake 3 years, 5 months ago
From: Orion Poplawski <orion@nwra.com>

Setting SYNC_TIME=1 does not work on autostarted guests.

See https://bugzilla.redhat.com/show_bug.cgi?id=1555398.

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
---
 tools/libvirt-guests.sh.in | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tools/libvirt-guests.sh.in b/tools/libvirt-guests.sh.in
index d69df908d2..87f96af14d 100644
--- a/tools/libvirt-guests.sh.in
+++ b/tools/libvirt-guests.sh.in
@@ -206,9 +206,9 @@ start() {
                     retval run_virsh "$uri" start $bypass "$name" \
                         >/dev/null && \
                     gettext "done"; echo
-                    if "$sync_time"; then
-                        run_virsh "$uri" domtime --sync "$name" >/dev/null
-                    fi
+                fi
+                if "$sync_time"; then
+                    run_virsh "$uri" domtime --sync "$name" >/dev/null
                 fi
             fi
         done
-- 
2.26.2

Re: [libvirt PATCH v2] libvirt-guests: Sync time for autostarted guests
Posted by Daniel P. Berrangé 3 years, 5 months ago
On Wed, Oct 28, 2020 at 02:59:35PM +0100, Tim Wiederhake wrote:
> From: Orion Poplawski <orion@nwra.com>
> 
> Setting SYNC_TIME=1 does not work on autostarted guests.
> 
> See https://bugzilla.redhat.com/show_bug.cgi?id=1555398.
> 
> Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
> ---
>  tools/libvirt-guests.sh.in | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>

> 
> diff --git a/tools/libvirt-guests.sh.in b/tools/libvirt-guests.sh.in
> index d69df908d2..87f96af14d 100644
> --- a/tools/libvirt-guests.sh.in
> +++ b/tools/libvirt-guests.sh.in
> @@ -206,9 +206,9 @@ start() {
>                      retval run_virsh "$uri" start $bypass "$name" \
>                          >/dev/null && \
>                      gettext "done"; echo
> -                    if "$sync_time"; then
> -                        run_virsh "$uri" domtime --sync "$name" >/dev/null
> -                    fi
> +                fi
> +                if "$sync_time"; then
> +                    run_virsh "$uri" domtime --sync "$name" >/dev/null
>                  fi
>              fi
>          done
> -- 
> 2.26.2
> 

Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|