virDomainDef *def = NULL;
virDomainDef *persistentDef = NULL;
virDomainBlockIoTuneInfo reply = {0};
- g_autofree char *drivealias = NULL;
- const char *qdevid = NULL;
int ret = -1;
int maxparams;
if (!qemuDomainDiskBlockIoTuneIsSupported(disk))
goto endjob;
- if (QEMU_DOMAIN_DISK_PRIVATE(disk)->qomName) {
- qdevid = QEMU_DOMAIN_DISK_PRIVATE(disk)->qomName;
- } else {
- if (!(drivealias = qemuAliasDiskDriveFromDisk(disk)))
- goto endjob;
- }
qemuDomainObjEnterMonitor(vm);
- rc = qemuMonitorGetBlockIoThrottle(priv->mon, drivealias, qdevid, &reply);
+ rc = qemuMonitorGetBlockIoThrottle(priv->mon, QEMU_DOMAIN_DISK_PRIVATE(disk)->qomName, &reply);
qemuDomainObjExitMonitor(vm);
if (rc < 0)
int
qemuMonitorGetBlockIoThrottle(qemuMonitor *mon,
- const char *drivealias,
const char *qdevid,
virDomainBlockIoTuneInfo *reply)
{
- VIR_DEBUG("drivealias=%s, qdevid=%s, reply=%p",
- NULLSTR(drivealias), NULLSTR(qdevid), reply);
+ VIR_DEBUG("qdevid=%s, reply=%p", NULLSTR(qdevid), reply);
QEMU_CHECK_MONITOR(mon);
- return qemuMonitorJSONGetBlockIoThrottle(mon, drivealias, qdevid, reply);
+ return qemuMonitorJSONGetBlockIoThrottle(mon, qdevid, reply);
}
virDomainBlockIoTuneInfo *info);
int qemuMonitorGetBlockIoThrottle(qemuMonitor *mon,
- const char *drivealias,
const char *qdevid,
virDomainBlockIoTuneInfo *reply);
}
static int
qemuMonitorJSONBlockIoThrottleInfo(virJSONValue *io_throttle,
- const char *drivealias,
const char *qdevid,
virDomainBlockIoTuneInfo *reply)
{
return -1;
}
- if ((drivealias && current_drive && STRNEQ(current_drive, drivealias)) ||
- (qdevid && current_qdev && STRNEQ(current_qdev, qdevid)))
+ if (STRNEQ_NULLABLE(current_qdev, qdevid) &&
+ STRNEQ_NULLABLE(current_drive, qdevid))
continue;
found = true;
if (!found) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("cannot find throttling info for device '%1$s'"),
- drivealias ? drivealias : qdevid);
+ qdevid);
return -1;
}
}
int qemuMonitorJSONGetBlockIoThrottle(qemuMonitor *mon,
- const char *drivealias,
const char *qdevid,
virDomainBlockIoTuneInfo *reply)
{
if (!(devices = qemuMonitorJSONQueryBlock(mon)))
return -1;
- return qemuMonitorJSONBlockIoThrottleInfo(devices, drivealias, qdevid, reply);
+ return qemuMonitorJSONBlockIoThrottleInfo(devices, qdevid, reply);
}
int qemuMonitorJSONSystemWakeup(qemuMonitor *mon)
int
qemuMonitorJSONGetBlockIoThrottle(qemuMonitor *mon,
- const char *drivealias,
const char *qdevid,
virDomainBlockIoTuneInfo *reply);
return -1;
if (qemuMonitorJSONGetBlockIoThrottle(qemuMonitorTestGetMonitor(test),
- "drive-virtio-disk0", NULL, &info) < 0)
+ "drive-virtio-disk0", &info) < 0)
goto cleanup;
if (testValidateGetBlockIoThrottle(&info, &expectedInfo) < 0)