[libvirt] [PATCH 2/4] Rename parameter in qemuMonitorDeviceDel

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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()
---
 src/qemu/qemu_monitor.c      |    8 ++++----
 src/qemu/qemu_monitor.h      |    2 +-
 src/qemu/qemu_monitor_json.c |    4 ++--
 src/qemu/qemu_monitor_json.h |    2 +-
 src/qemu/qemu_monitor_text.c |    8 ++++----
 src/qemu/qemu_monitor_text.h |    2 +-
 6 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c
index 01e3a46..c3cb3f8 100644
--- a/src/qemu/qemu_monitor.c
+++ b/src/qemu/qemu_monitor.c
@@ -1438,15 +1438,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;
 }
 
diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h
index 21b8989..1d77f99 100644
--- a/src/qemu/qemu_monitor.h
+++ b/src/qemu/qemu_monitor.h
@@ -335,7 +335,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);
diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c
index ec04d79..6c73685 100644
--- a/src/qemu/qemu_monitor_json.c
+++ b/src/qemu/qemu_monitor_json.c
@@ -1823,14 +1823,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;
diff --git a/src/qemu/qemu_monitor_json.h b/src/qemu/qemu_monitor_json.h
index e7baf84..c6ab1e8 100644
--- a/src/qemu/qemu_monitor_json.h
+++ b/src/qemu/qemu_monitor_json.h
@@ -166,7 +166,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);
diff --git a/src/qemu/qemu_monitor_text.c b/src/qemu/qemu_monitor_text.c
index 9942768..48c9a54 100644
--- a/src/qemu/qemu_monitor_text.c
+++ b/src/qemu/qemu_monitor_text.c
@@ -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;
     }
 
diff --git a/src/qemu/qemu_monitor_text.h b/src/qemu/qemu_monitor_text.h
index fb7d08b..3200660 100644
--- a/src/qemu/qemu_monitor_text.h
+++ b/src/qemu/qemu_monitor_text.h
@@ -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);
-- 
1.6.6.1

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]