mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-09 01:18:00 +03:00
qemu: Check for job being set when getting iothread stats
The qemuDomainGetStatsIOThread() accesses the monitor by calling qemuDomainGetIOThreadsMon(). And it's also marked as "need monitor" in qemuDomainGetStatsWorkers[]. However, it's not checking if acquiring job was successful. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
This commit is contained in:
parent
1faf74050f
commit
3d46d684d1
@ -21194,7 +21194,7 @@ static int
|
||||
qemuDomainGetStatsIOThread(virQEMUDriverPtr driver,
|
||||
virDomainObjPtr dom,
|
||||
virTypedParamListPtr params,
|
||||
unsigned int privflags G_GNUC_UNUSED)
|
||||
unsigned int privflags)
|
||||
{
|
||||
qemuDomainObjPrivatePtr priv = dom->privateData;
|
||||
size_t i;
|
||||
@ -21202,7 +21202,7 @@ qemuDomainGetStatsIOThread(virQEMUDriverPtr driver,
|
||||
int niothreads;
|
||||
int ret = -1;
|
||||
|
||||
if (!virDomainObjIsActive(dom))
|
||||
if (!HAVE_JOB(privflags) || !virDomainObjIsActive(dom))
|
||||
return 0;
|
||||
|
||||
if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_OBJECT_IOTHREAD))
|
||||
|
Loading…
Reference in New Issue
Block a user