mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-09-08 00:34:49 +00:00
Include support for Vfio stats during Migration
As of now, libvirt supports few essential stats as part of virDomainGetJobStats for Live Migration such as memory transferred, dirty rate, number of iteration etc. Currently it does not have support for the vfio stats returned via QEMU. This patch adds support for that. Signed-off-by: Kshitij Jha <kshitij.jha@nutanix.com> Signed-off-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
7a9e9dfb18
commit
6d3955acf1
@ -4612,6 +4612,15 @@ typedef enum {
|
||||
*/
|
||||
# define VIR_DOMAIN_JOB_DISK_TEMP_TOTAL "disk_temp_total"
|
||||
|
||||
/**
|
||||
* VIR_DOMAIN_JOB_VFIO_DATA_TRANSFERRED:
|
||||
* virDomainGetJobStats field: number of bytes transferred by VFIO devices
|
||||
* in that iteration, as VIR_TYPED_PARAM_ULLONG.
|
||||
*
|
||||
* Since: 10.6.0
|
||||
*/
|
||||
# define VIR_DOMAIN_JOB_VFIO_DATA_TRANSFERRED "vfio_data_transferred"
|
||||
|
||||
/**
|
||||
* virConnectDomainEventGenericCallback:
|
||||
* @conn: the connection pointer
|
||||
|
@ -414,6 +414,12 @@ qemuDomainMigrationJobDataToParams(virDomainJobData *jobData,
|
||||
stats->cpu_throttle_percentage) < 0)
|
||||
goto error;
|
||||
|
||||
if (stats->vfio_data_transferred &&
|
||||
virTypedParamsAddULLong(&par, &npar, &maxpar,
|
||||
VIR_DOMAIN_JOB_VFIO_DATA_TRANSFERRED,
|
||||
stats->vfio_data_transferred) < 0)
|
||||
goto error;
|
||||
|
||||
done:
|
||||
*type = virDomainJobStatusToType(jobData->status);
|
||||
*params = par;
|
||||
|
@ -814,6 +814,7 @@ struct _qemuMonitorMigrationStats {
|
||||
unsigned long long xbzrle_overflow;
|
||||
|
||||
int cpu_throttle_percentage;
|
||||
unsigned long long vfio_data_transferred;
|
||||
};
|
||||
|
||||
int qemuMonitorGetMigrationStats(qemuMonitor *mon,
|
||||
|
@ -2910,6 +2910,7 @@ qemuMonitorJSONGetMigrationStatsReply(virJSONValue *reply,
|
||||
virJSONValue *ram;
|
||||
virJSONValue *disk;
|
||||
virJSONValue *comp;
|
||||
virJSONValue *vfio;
|
||||
const char *statusstr;
|
||||
int rc;
|
||||
double mbps;
|
||||
@ -3092,6 +3093,17 @@ qemuMonitorJSONGetMigrationStatsReply(virJSONValue *reply,
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
vfio = virJSONValueObjectGetObject(ret, "vfio");
|
||||
if (vfio) {
|
||||
rc = virJSONValueObjectGetNumberUlong(vfio, "transferred",
|
||||
&stats->vfio_data_transferred);
|
||||
if (rc < 0) {
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||
_("vfio migration was active, but 'transferred' data was missing"));
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user