Skip to content

Commit

Permalink
Log VIR_DOMAIN_EVENT_ID_BLOCK_JOB_2 libvirt event errors in VDSM
Browse files Browse the repository at this point in the history
Fixes oVirt#395

This change logs error messages related to the VIR_DOMAIN_EVENT_ID_BLOCK_JOB_2 in VDSM.

Signed-off-by: Brooklyn Dewolf <[email protected]>
  • Loading branch information
BrooklynDewolf committed Jun 4, 2024
1 parent d206f0b commit 0964645
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/vdsm/clientIF.py
Original file line number Diff line number Diff line change
Expand Up @@ -692,7 +692,7 @@ def dispatchLibvirtEvents(self, conn, dom, *args):
v.volume_monitor.on_block_threshold(
dev, path, threshold, excess)
elif eventid == libvirt.VIR_DOMAIN_EVENT_ID_BLOCK_JOB_2:
drive, job_type, job_status, _ = args
drive, job_type, job_status, error, _ = args
v.on_block_job_event(drive, job_type, job_status)
elif eventid == libvirt.VIR_DOMAIN_EVENT_ID_AGENT_LIFECYCLE:
vmid = dom.UUIDString()
Expand Down
4 changes: 3 additions & 1 deletion lib/vdsm/virt/vm.py
Original file line number Diff line number Diff line change
Expand Up @@ -5934,7 +5934,7 @@ def updateVmJobs(self):
def query_jobs(self):
return self._drive_merger.query_jobs()

def on_block_job_event(self, drive, job_type, job_status):
def on_block_job_event(self, drive, job_type, job_status, error=None):
"""
Implement virConnectDomainEventBlockJobCallback.
Expand Down Expand Up @@ -5970,6 +5970,8 @@ def on_block_job_event(self, drive, job_type, job_status):
self.log.error(
"Block job %s type %s for drive %s: unexpected status %s",
job_id, type_name, drive, job_status)
if error is not None:
self.log.error("Error: %s", error)

def merge(self, driveSpec, baseVolUUID, topVolUUID, bandwidth, jobUUID):
return self._drive_merger.merge(
Expand Down

0 comments on commit 0964645

Please sign in to comment.