Skip to content

Commit

Permalink
virt: Accept None returned by guest agent for vCPU count
Browse files Browse the repository at this point in the history
If guest agent returns None for vCPU count, TypeError is raised. This
patch adds correct handling of this situation.

Bug-Url: https://bugzilla.redhat.com/2120381
Signed-off-by: Shmuel Melamud <smelamud@redhat.com>
  • Loading branch information
smelamud authored and mz-pdm committed Nov 3, 2022
1 parent 691fb31 commit 459c753
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/vdsm/virt/qemuguestagent.py
Original file line number Diff line number Diff line change
Expand Up @@ -794,6 +794,9 @@ def _qga_call_get_vcpus(self, vm):
'Not querying QEMU-GA for guest CPU info because domain'
'is not running for vm-id=%s', vm.id)
return {}
if vcpus is None:
self.log.info('Guest CPU count was not returned for vm=%s', vm.id)
return {}
if 'online' in vcpus:
count = len(taskset.cpulist_parse(vcpus['online']))
else:
Expand Down

0 comments on commit 459c753

Please sign in to comment.