[virt-tools-list] [RFC PATCH v2 0/7] Guest time sync on snapshot resume

Michael Weiser michael.weiser at gmx.de
Fri Dec 6 17:00:44 UTC 2019


Hello Cole,

find attached my second attempt at implementing guest time sync as per
your suggestions. Please let me know if this is moving into the right
direction.

These patches do:
* add method _set_time() calling the libvirt setTime API
* wire it up in resume from paused and saved state as well as revert to
  a snapshot containing a running domain state
* only run the API if the connection is of type qemu or test
* only run the API if a guest agent channel is defined for a qemu
  connection
* wait for the guest agent channel state to become connected, i.e. the
  guest agent coming online inside the guest
* add global and per-vm option to disable time sync
* try to fix up some peculiar behaviour of checkable vm window menu
  items

If you drop me some quick pointers how to go about dispatching the set
time operation to a separate or already existing background thread so it
doesn't block the UI, I'll be happy to give that a whirl as well. As it
stands now, the attempts at syncing time cause a five second delay if
the agent does not come online. It would be nice to avoid that.

I would actually like the time sync enable/disable setting to live in
the domain XML so it could travel with the VM instead of the user
potentially having to configure multiple instances of virt-manager
identically. The metadata element would be the way to go here AFAICT.

I do not like the boilerplate in disabling the toggled signals on
settings update to avoid the write-through of the global default to the
per-vm setting but I couldn't come up with anything better.

What do you think of those last two?

Changes to v1:
- fix quoting and other minor stylistic changes
- rename _get_agent() and _agent_ready() to reflect they're private
- add the dconf settings and UI items

Michael Weiser (7):
  virtManager: object: domain: Set time on resume
  virtManager: object: domain: Restrict time sync to qemu
  virtManager: object: domain: Check for guest agent
  virtManager: object: domain: Set time on unpause and revert
  virtManager: config: Make guest time sync configurable
  virtManager: config: Correctly reflect global defaults change
  virtManager: config: Prevent global default override

 .../org.virt-manager.virt-manager.gschema.xml |  12 ++
 ui/preferences.ui                             |  15 ++
 ui/vmwindow.ui                                |  19 ++-
 virtManager/baseclass.py                      |  16 ++-
 virtManager/config.py                         |   9 ++
 virtManager/details/console.py                |  37 +++--
 virtManager/object/domain.py                  | 129 ++++++++++++++++--
 virtManager/preferences.py                    |   8 ++
 virtManager/vmwindow.py                       |  29 ++--
 9 files changed, 236 insertions(+), 38 deletions(-)

-- 
2.24.0





More information about the virt-tools-list mailing list