1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2025-01-11 09:17:52 +03:00

Rename parameter in qemuMonitorDeviceDel

The parameter for the qemuMonitorDeviceDel() is a device alias,
not a device config string. Rename the parameter reflect this
and avoid confusion to readers.

* src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h,
  src/qemu/qemu_monitor_json.c, src/qemu/qemu_monitor_json.h,
  src/qemu/qemu_monitor_text.c, src/qemu/qemu_monitor_text.h:
  Rename devicestr to devalias in qemuMonitorDeviceDel()
This commit is contained in:
Daniel P. Berrange 2010-04-14 15:36:42 +01:00
parent efd4ee7871
commit fde060b8f5
6 changed files with 13 additions and 13 deletions

View File

@ -1453,15 +1453,15 @@ int qemuMonitorGetAllPCIAddresses(qemuMonitorPtr mon,
}
int qemuMonitorDelDevice(qemuMonitorPtr mon,
const char *devicestr)
const char *devalias)
{
DEBUG("mon=%p, fd=%d device(del)=%s", mon, mon->fd, devicestr);
DEBUG("mon=%p, fd=%d devalias=%s", mon, mon->fd, devalias);
int ret;
if (mon->json)
ret = qemuMonitorJSONDelDevice(mon, devicestr);
ret = qemuMonitorJSONDelDevice(mon, devalias);
else
ret = qemuMonitorTextDelDevice(mon, devicestr);
ret = qemuMonitorTextDelDevice(mon, devalias);
return ret;
}

View File

@ -338,7 +338,7 @@ int qemuMonitorAddDevice(qemuMonitorPtr mon,
const char *devicestr);
int qemuMonitorDelDevice(qemuMonitorPtr mon,
const char *devicestr);
const char *devalias);
int qemuMonitorAddDrive(qemuMonitorPtr mon,
const char *drivestr);

View File

@ -1938,14 +1938,14 @@ int qemuMonitorJSONGetAllPCIAddresses(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
int qemuMonitorJSONDelDevice(qemuMonitorPtr mon,
const char *devicestr)
const char *devalias)
{
int ret;
virJSONValuePtr cmd;
virJSONValuePtr reply = NULL;
cmd = qemuMonitorJSONMakeCommand("device_del",
"s:config", devicestr,
"s:config", devalias,
NULL);
if (!cmd)
return -1;

View File

@ -169,7 +169,7 @@ int qemuMonitorJSONAddDevice(qemuMonitorPtr mon,
const char *devicestr);
int qemuMonitorJSONDelDevice(qemuMonitorPtr mon,
const char *devicestr);
const char *devalias);
int qemuMonitorJSONAddDrive(qemuMonitorPtr mon,
const char *drivestr);

View File

@ -2133,14 +2133,14 @@ error:
int qemuMonitorTextDelDevice(qemuMonitorPtr mon,
const char *devicestr)
const char *devalias)
{
char *cmd = NULL;
char *reply = NULL;
char *safedev;
int ret = -1;
if (!(safedev = qemuMonitorEscapeArg(devicestr))) {
if (!(safedev = qemuMonitorEscapeArg(devalias))) {
virReportOOMError();
goto cleanup;
}
@ -2152,13 +2152,13 @@ int qemuMonitorTextDelDevice(qemuMonitorPtr mon,
if (qemuMonitorCommand(mon, cmd, &reply) < 0) {
qemuReportError(VIR_ERR_OPERATION_FAILED,
_("cannot detach %s device"), devicestr);
_("cannot detach %s device"), devalias);
goto cleanup;
}
if (STRNEQ(reply, "")) {
qemuReportError(VIR_ERR_OPERATION_FAILED,
_("detaching %s device failed: %s"), devicestr, reply);
_("detaching %s device failed: %s"), devalias, reply);
goto cleanup;
}

View File

@ -168,7 +168,7 @@ int qemuMonitorTextAddDevice(qemuMonitorPtr mon,
const char *devicestr);
int qemuMonitorTextDelDevice(qemuMonitorPtr mon,
const char *devicestr);
const char *devalias);
int qemuMonitorTextAddDrive(qemuMonitorPtr mon,
const char *drivestr);