[libvirt] [PATCH 3/8] qemu: monitor: Remove unused qemuMonitor(Add|Remove)HostNetwork

Peter Krempa pkrempa at redhat.com
Tue May 22 12:35:43 UTC 2018


There are no callers for these. Remove them and the monitor
implementations.

Signed-off-by: Peter Krempa <pkrempa at redhat.com>
---
 src/qemu/qemu_monitor.c      | 66 --------------------------------------------
 src/qemu/qemu_monitor.h      | 12 --------
 src/qemu/qemu_monitor_text.c | 54 ------------------------------------
 src/qemu/qemu_monitor_text.h |  7 -----
 4 files changed, 139 deletions(-)

diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c
index f21bf7000d..3e87bf5a4a 100644
--- a/src/qemu/qemu_monitor.c
+++ b/src/qemu/qemu_monitor.c
@@ -2944,72 +2944,6 @@ qemuMonitorRemoveFd(qemuMonitorPtr mon, int fdset, int fd)
 }


-int
-qemuMonitorAddHostNetwork(qemuMonitorPtr mon,
-                          const char *netstr,
-                          int *tapfd, char **tapfdName, int tapfdSize,
-                          int *vhostfd, char **vhostfdName, int vhostfdSize)
-{
-    int ret = -1;
-    size_t i = 0, j = 0;
-
-    VIR_DEBUG("netstr=%s tapfd=%p tapfdName=%p tapfdSize=%d "
-              "vhostfd=%p vhostfdName=%p vhostfdSize=%d",
-              netstr, tapfd, tapfdName, tapfdSize,
-              vhostfd, vhostfdName, vhostfdSize);
-
-    QEMU_CHECK_MONITOR(mon);
-
-    for (i = 0; i < tapfdSize; i++) {
-        if (qemuMonitorSendFileHandle(mon, tapfdName[i], tapfd[i]) < 0)
-            goto cleanup;
-    }
-    for (j = 0; j < vhostfdSize; j++) {
-        if (qemuMonitorSendFileHandle(mon, vhostfdName[j], vhostfd[j]) < 0)
-            goto cleanup;
-    }
-
-    if (mon->json)
-        virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
-                       _("JSON monitor should be using AddNetdev"));
-    else
-        ret = qemuMonitorTextAddHostNetwork(mon, netstr);
-
- cleanup:
-    if (ret < 0) {
-        while (i--) {
-            if (qemuMonitorCloseFileHandle(mon, tapfdName[i]) < 0)
-                VIR_WARN("failed to close device handle '%s'", tapfdName[i]);
-        }
-        while (j--) {
-            if (qemuMonitorCloseFileHandle(mon, vhostfdName[j]) < 0)
-                VIR_WARN("failed to close device handle '%s'", vhostfdName[j]);
-        }
-    }
-
-    return ret;
-}
-
-
-int
-qemuMonitorRemoveHostNetwork(qemuMonitorPtr mon,
-                             int vlan,
-                             const char *netname)
-{
-    VIR_DEBUG("netname=%s", netname);
-
-    QEMU_CHECK_MONITOR(mon);
-
-    if (mon->json) {
-        virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
-                       _("JSON monitor should be using RemoveNetdev"));
-        return -1;
-    }
-
-    return qemuMonitorTextRemoveHostNetwork(mon, vlan, netname);
-}
-
-
 int
 qemuMonitorAddNetdev(qemuMonitorPtr mon,
                      const char *netdevstr,
diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h
index 6cba37c281..b3aeb83cf0 100644
--- a/src/qemu/qemu_monitor.h
+++ b/src/qemu/qemu_monitor.h
@@ -771,18 +771,6 @@ int qemuMonitorCloseFileHandle(qemuMonitorPtr mon,
                                const char *fdname);
 int qemuMonitorRemoveFd(qemuMonitorPtr mon, int fdset, int fd);

-/* XXX do we really want to hardcode 'netstr' as the
- * sendable item here
- */
-int qemuMonitorAddHostNetwork(qemuMonitorPtr mon,
-                              const char *netstr,
-                              int *tapfd, char **tapfdName, int tapfdSize,
-                              int *vhostfd, char **vhostfdName, int vhostfdSize);
-
-int qemuMonitorRemoveHostNetwork(qemuMonitorPtr mon,
-                                 int vlan,
-                                 const char *netname);
-
 int qemuMonitorAddNetdev(qemuMonitorPtr mon,
                          const char *netdevstr,
                          int *tapfd, char **tapfdName, int tapfdSize,
diff --git a/src/qemu/qemu_monitor_text.c b/src/qemu/qemu_monitor_text.c
index 7c34ca5b07..58d695ea22 100644
--- a/src/qemu/qemu_monitor_text.c
+++ b/src/qemu/qemu_monitor_text.c
@@ -1650,60 +1650,6 @@ int qemuMonitorTextCloseFileHandle(qemuMonitorPtr mon,
 }


-int qemuMonitorTextAddHostNetwork(qemuMonitorPtr mon,
-                                  const char *netstr)
-{
-    char *cmd;
-    char *reply = NULL;
-    int ret = -1;
-
-    if (virAsprintf(&cmd, "host_net_add %s", netstr) < 0)
-        return -1;
-
-    if (qemuMonitorHMPCommand(mon, cmd, &reply) < 0)
-        goto cleanup;
-
-    if (STRNEQ(reply, "")) {
-        virReportError(VIR_ERR_INTERNAL_ERROR,
-                       _("unable to add host net: %s"),
-                       reply);
-        goto cleanup;
-    }
-
-    ret = 0;
-
- cleanup:
-    VIR_FREE(cmd);
-    VIR_FREE(reply);
-    return ret;
-}
-
-
-int qemuMonitorTextRemoveHostNetwork(qemuMonitorPtr mon,
-                                     int vlan,
-                                     const char *netname)
-{
-    char *cmd;
-    char *reply = NULL;
-    int ret = -1;
-
-    if (virAsprintf(&cmd, "host_net_remove %d %s", vlan, netname) < 0)
-        return -1;
-
-    if (qemuMonitorHMPCommand(mon, cmd, &reply) < 0)
-        goto cleanup;
-
-    /* XXX error messages here ? */
-
-    ret = 0;
-
- cleanup:
-    VIR_FREE(cmd);
-    VIR_FREE(reply);
-    return ret;
-}
-
-
 int qemuMonitorTextAddNetdev(qemuMonitorPtr mon,
                              const char *netdevstr)
 {
diff --git a/src/qemu/qemu_monitor_text.h b/src/qemu/qemu_monitor_text.h
index d57bdbc55f..a9cdce5f61 100644
--- a/src/qemu/qemu_monitor_text.h
+++ b/src/qemu/qemu_monitor_text.h
@@ -126,13 +126,6 @@ int qemuMonitorTextSendFileHandle(qemuMonitorPtr mon,
 int qemuMonitorTextCloseFileHandle(qemuMonitorPtr mon,
                                    const char *fdname);

-int qemuMonitorTextAddHostNetwork(qemuMonitorPtr mon,
-                                  const char *netstr);
-
-int qemuMonitorTextRemoveHostNetwork(qemuMonitorPtr mon,
-                                     int vlan,
-                                     const char *netname);
-
 int qemuMonitorTextAddNetdev(qemuMonitorPtr mon,
                              const char *netdevstr);

-- 
2.16.2




More information about the libvir-list mailing list