]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: monitor: Remove unused qemuMonitor(Add|Remove)HostNetwork
authorPeter Krempa <pkrempa@redhat.com>
Tue, 22 May 2018 11:36:28 +0000 (13:36 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Wed, 23 May 2018 13:43:34 +0000 (15:43 +0200)
There are no callers for these. Remove them and the monitor
implementations.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/qemu/qemu_monitor.c
src/qemu/qemu_monitor.h
src/qemu/qemu_monitor_text.c
src/qemu/qemu_monitor_text.h

index 315bb460b9c1f5a030bd4cbc0b20bf80f498c751..b9fea5d0142d88da8e608c2ad7124c89b9b13056 100644 (file)
@@ -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,
index 6acc4edffae88ed475aff34355e943dae30c295a..c10cecd8888328da144b5948cd139426e6adc998 100644 (file)
@@ -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,
index 7c34ca5b07e23e0d0684d574290a174a10c5adcf..58d695ea22e82cabef801889248c3491a08bdef9 100644 (file)
@@ -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)
 {
index d57bdbc55f0c260b045ad639f4b21d6f464c7d96..a9cdce5f61e0b98ed61c188110019a594e498b60 100644 (file)
@@ -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);