Skip to content

Commit

Permalink
Do not attempt to start libvirt on shutdown (#14403)
Browse files Browse the repository at this point in the history
(cherry picked from commit 94cbfe4)

Co-authored-by: M. Rehan <[email protected]>
  • Loading branch information
bugclerk and Qubad786 authored Sep 3, 2024
1 parent 867a6f3 commit 0fb469d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/middlewared/middlewared/plugins/vm/vms.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,12 @@ def bootloader_ovmf_choices(self):
@private
def extend_context(self, rows, extra):
status = {}
shutting_down = self.middleware.call_sync('system.state') == 'SHUTTING_DOWN'
kvm_supported = self._is_kvm_supported()
if rows and kvm_supported:
if shutting_down is False and rows and kvm_supported:
self._safely_check_setup_connection(5)

libvirt_running = self._is_connection_alive()
libvirt_running = shutting_down is False and self._is_connection_alive()
for row in rows:
status[row['id']] = self.status_impl(row) if libvirt_running else get_default_status()

Expand Down

0 comments on commit 0fb469d

Please sign in to comment.