-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Logs more VM state info in updater #523
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -430,10 +430,11 @@ def shutdown_and_start_vms(): | |
sdlog.info("Killing system fedora-based VMs for updates") | ||
for vm in sys_vms_in_order: | ||
try: | ||
subprocess.check_call(["qvm-kill", vm]) | ||
subprocess.check_output(["qvm-kill", vm], stderr=subprocess.PIPE) | ||
except subprocess.CalledProcessError as e: | ||
sdlog.error("Error while killing {}".format(vm)) | ||
sdlog.error(str(e)) | ||
sdlog.error(str(e.stderr)) | ||
|
||
sdlog.info("Starting system fedora-based VMs after updates") | ||
for vm in reversed(sys_vms_in_order): | ||
|
@@ -446,19 +447,27 @@ def shutdown_and_start_vms(): | |
|
||
def _safely_shutdown_vm(vm): | ||
try: | ||
subprocess.check_call(["qvm-shutdown", "--wait", vm]) | ||
subprocess.check_output(["qvm-shutdown", "--wait", vm], stderr=subprocess.PIPE) | ||
except subprocess.CalledProcessError as e: | ||
sdlog.error("Failed to shut down {}".format(vm)) | ||
sdlog.error(str(e)) | ||
sdlog.error(str(e.stderr)) | ||
return UpdateStatus.UPDATES_FAILED | ||
|
||
|
||
def _safely_start_vm(vm): | ||
try: | ||
subprocess.check_call(["qvm-start", "--skip-if-running", vm]) | ||
running_vms = subprocess.check_output( | ||
["qvm-ls", "--running", "--raw-list"], stderr=subprocess.PIPE | ||
) | ||
sdlog.info("VMs running before start of {}: {}".format(vm, running_vms)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This will produce logs like:
I would recommend converting the list of VMs to a comma-separated list for readability. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done. New format looks like:
|
||
subprocess.check_output( | ||
["qvm-start", "--skip-if-running", vm], stderr=subprocess.PIPE | ||
) | ||
except subprocess.CalledProcessError as e: | ||
sdlog.error("Error while starting {}".format(vm)) | ||
sdlog.error(str(e)) | ||
sdlog.error(str(e.stderr)) | ||
|
||
|
||
def should_launch_updater(interval): | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would adding a log line about information about running VMs here make sense as well? This would help debug situations where a VM can't shutdown due to a VM depending on it being still powered on. In the current workstation case, no VM will be a netVM, but it can be a receiver of qubes-rpc calls, which will cause it to power on again
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, would rather have the logs than not. Will add momentarily!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Neglected to add more logging info as suggested. Merging now so devs get the more verbose logs pronto, will continue to look for opportunities to expand logging in follow-ups.