This patch waits before polling qemu with QMP so that it has time to be ready
for requests. It also increases wait time in case the host machine is slow.
Write permission is not needed to get information about each virtual drive so
this patch changes permissions to 'only read'. This can prevent race conditions.
This patch calls poweroff in virtual mode when no VM is running and no jobs are
being executed. This is useful when the guest OS shutdowns so that the host OS
does not continue to run.
This patch includes changes to:
- Poweroff VM before running operations that require access to virtual disks.
- Poweroff VM before host system poweroff.
When virtual mode is activated, send the last stored partitions setup because
it is not possible to access a running virtual drive to get its information.
recv method is useful for receiving information that was not previously
requested (such as "events"). This patch also implements automatic handshake
on OgQMP by sending an "qmp_capabilities" request.
We observed that with the new ogClient the ogLive did not show the
realtime log menu*.
This commit changes the ogClient to launch the browser and show the
realtime log menu when some commands are executed.
* The realtime log menu is a menu that shows current status and info
about the command that the ogLive is executing.
We have observed that the ogLive browser did not show the changes when
an image restoration o script execution was called. The problem was that
the HTML menu was not updated/regenerated in these cases.
This commit adds the call to the HTML regeneration function to image
restore and script execution commands. This way, when the browser is
restarted it loads the updated HTML menu.
We have observed that the browser did not show changes. This happens
because the ogClient opens the browser at the beginning and forget
about it. To show correctly the changes ogClient had to restart the
browser every time the menu html changes.
This commit changes the behaviour to restart the browser when the menu
html has changed.
Testing the ogClient I found that if a value of the json match a key the
ogClient has an exception. For example:
body = "... shell/run {"run": "fdisk -l"} ..."
CURRENT
Enters in
if "disk" in body:...
if "run" in body:...
EXPECTED
Enters in
if "run" in body:...
This commit changes the behaviour to search for the keys in the
dictionary returned by json.loads() instead of searching in the raw
string. This way the ogClient looks for the keys without searching in
the values.