mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-03 03:25:20 +00:00
qemuMonitorGetBlockIoThrottle: Drop 'diskalias' argument
Every caller will pass 'qdevid' as it's populated in the data mandatorily with qemu-4.2 and onwards due to mandatory -blockdev use. Thus we can drop compatibility with the old way of matching the disk via alias. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
52c874d913
commit
f0296aa9a3
@ -15240,8 +15240,6 @@ qemuDomainGetBlockIoTune(virDomainPtr dom,
|
|||||||
virDomainDef *def = NULL;
|
virDomainDef *def = NULL;
|
||||||
virDomainDef *persistentDef = NULL;
|
virDomainDef *persistentDef = NULL;
|
||||||
virDomainBlockIoTuneInfo reply = {0};
|
virDomainBlockIoTuneInfo reply = {0};
|
||||||
g_autofree char *drivealias = NULL;
|
|
||||||
const char *qdevid = NULL;
|
|
||||||
int ret = -1;
|
int ret = -1;
|
||||||
int maxparams;
|
int maxparams;
|
||||||
|
|
||||||
@ -15288,14 +15286,8 @@ qemuDomainGetBlockIoTune(virDomainPtr dom,
|
|||||||
if (!qemuDomainDiskBlockIoTuneIsSupported(disk))
|
if (!qemuDomainDiskBlockIoTuneIsSupported(disk))
|
||||||
goto endjob;
|
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);
|
qemuDomainObjEnterMonitor(vm);
|
||||||
rc = qemuMonitorGetBlockIoThrottle(priv->mon, drivealias, qdevid, &reply);
|
rc = qemuMonitorGetBlockIoThrottle(priv->mon, QEMU_DOMAIN_DISK_PRIVATE(disk)->qomName, &reply);
|
||||||
qemuDomainObjExitMonitor(vm);
|
qemuDomainObjExitMonitor(vm);
|
||||||
|
|
||||||
if (rc < 0)
|
if (rc < 0)
|
||||||
|
@ -2988,16 +2988,14 @@ qemuMonitorSetBlockIoThrottle(qemuMonitor *mon,
|
|||||||
|
|
||||||
int
|
int
|
||||||
qemuMonitorGetBlockIoThrottle(qemuMonitor *mon,
|
qemuMonitorGetBlockIoThrottle(qemuMonitor *mon,
|
||||||
const char *drivealias,
|
|
||||||
const char *qdevid,
|
const char *qdevid,
|
||||||
virDomainBlockIoTuneInfo *reply)
|
virDomainBlockIoTuneInfo *reply)
|
||||||
{
|
{
|
||||||
VIR_DEBUG("drivealias=%s, qdevid=%s, reply=%p",
|
VIR_DEBUG("qdevid=%s, reply=%p", NULLSTR(qdevid), reply);
|
||||||
NULLSTR(drivealias), NULLSTR(qdevid), reply);
|
|
||||||
|
|
||||||
QEMU_CHECK_MONITOR(mon);
|
QEMU_CHECK_MONITOR(mon);
|
||||||
|
|
||||||
return qemuMonitorJSONGetBlockIoThrottle(mon, drivealias, qdevid, reply);
|
return qemuMonitorJSONGetBlockIoThrottle(mon, qdevid, reply);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1057,7 +1057,6 @@ int qemuMonitorSetBlockIoThrottle(qemuMonitor *mon,
|
|||||||
virDomainBlockIoTuneInfo *info);
|
virDomainBlockIoTuneInfo *info);
|
||||||
|
|
||||||
int qemuMonitorGetBlockIoThrottle(qemuMonitor *mon,
|
int qemuMonitorGetBlockIoThrottle(qemuMonitor *mon,
|
||||||
const char *drivealias,
|
|
||||||
const char *qdevid,
|
const char *qdevid,
|
||||||
virDomainBlockIoTuneInfo *reply);
|
virDomainBlockIoTuneInfo *reply);
|
||||||
|
|
||||||
|
@ -4517,7 +4517,6 @@ int qemuMonitorJSONOpenGraphics(qemuMonitor *mon,
|
|||||||
}
|
}
|
||||||
static int
|
static int
|
||||||
qemuMonitorJSONBlockIoThrottleInfo(virJSONValue *io_throttle,
|
qemuMonitorJSONBlockIoThrottleInfo(virJSONValue *io_throttle,
|
||||||
const char *drivealias,
|
|
||||||
const char *qdevid,
|
const char *qdevid,
|
||||||
virDomainBlockIoTuneInfo *reply)
|
virDomainBlockIoTuneInfo *reply)
|
||||||
{
|
{
|
||||||
@ -4547,8 +4546,8 @@ qemuMonitorJSONBlockIoThrottleInfo(virJSONValue *io_throttle,
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((drivealias && current_drive && STRNEQ(current_drive, drivealias)) ||
|
if (STRNEQ_NULLABLE(current_qdev, qdevid) &&
|
||||||
(qdevid && current_qdev && STRNEQ(current_qdev, qdevid)))
|
STRNEQ_NULLABLE(current_drive, qdevid))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
found = true;
|
found = true;
|
||||||
@ -4587,7 +4586,7 @@ qemuMonitorJSONBlockIoThrottleInfo(virJSONValue *io_throttle,
|
|||||||
if (!found) {
|
if (!found) {
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
_("cannot find throttling info for device '%1$s'"),
|
_("cannot find throttling info for device '%1$s'"),
|
||||||
drivealias ? drivealias : qdevid);
|
qdevid);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4640,7 +4639,6 @@ int qemuMonitorJSONSetBlockIoThrottle(qemuMonitor *mon,
|
|||||||
}
|
}
|
||||||
|
|
||||||
int qemuMonitorJSONGetBlockIoThrottle(qemuMonitor *mon,
|
int qemuMonitorJSONGetBlockIoThrottle(qemuMonitor *mon,
|
||||||
const char *drivealias,
|
|
||||||
const char *qdevid,
|
const char *qdevid,
|
||||||
virDomainBlockIoTuneInfo *reply)
|
virDomainBlockIoTuneInfo *reply)
|
||||||
{
|
{
|
||||||
@ -4649,7 +4647,7 @@ int qemuMonitorJSONGetBlockIoThrottle(qemuMonitor *mon,
|
|||||||
if (!(devices = qemuMonitorJSONQueryBlock(mon)))
|
if (!(devices = qemuMonitorJSONQueryBlock(mon)))
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
return qemuMonitorJSONBlockIoThrottleInfo(devices, drivealias, qdevid, reply);
|
return qemuMonitorJSONBlockIoThrottleInfo(devices, qdevid, reply);
|
||||||
}
|
}
|
||||||
|
|
||||||
int qemuMonitorJSONSystemWakeup(qemuMonitor *mon)
|
int qemuMonitorJSONSystemWakeup(qemuMonitor *mon)
|
||||||
|
@ -407,7 +407,6 @@ qemuMonitorJSONSetBlockIoThrottle(qemuMonitor *mon,
|
|||||||
|
|
||||||
int
|
int
|
||||||
qemuMonitorJSONGetBlockIoThrottle(qemuMonitor *mon,
|
qemuMonitorJSONGetBlockIoThrottle(qemuMonitor *mon,
|
||||||
const char *drivealias,
|
|
||||||
const char *qdevid,
|
const char *qdevid,
|
||||||
virDomainBlockIoTuneInfo *reply);
|
virDomainBlockIoTuneInfo *reply);
|
||||||
|
|
||||||
|
@ -1897,7 +1897,7 @@ testQemuMonitorJSONqemuMonitorJSONSetBlockIoThrottle(const void *opaque)
|
|||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
if (qemuMonitorJSONGetBlockIoThrottle(qemuMonitorTestGetMonitor(test),
|
if (qemuMonitorJSONGetBlockIoThrottle(qemuMonitorTestGetMonitor(test),
|
||||||
"drive-virtio-disk0", NULL, &info) < 0)
|
"drive-virtio-disk0", &info) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
if (testValidateGetBlockIoThrottle(&info, &expectedInfo) < 0)
|
if (testValidateGetBlockIoThrottle(&info, &expectedInfo) < 0)
|
||||||
|
Loading…
Reference in New Issue
Block a user