提交 58be5738 编写于 作者: P Peter Krempa

qemu: monitor: Remove unused qemuMonitor(Add|Remove)HostNetwork

There are no callers for these. Remove them and the monitor
implementations.
Signed-off-by: NPeter Krempa <pkrempa@redhat.com>
Reviewed-by: NJán Tomko <jtomko@redhat.com>
上级 b9571bc6
......@@ -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,
......
......@@ -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,
......
......@@ -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)
{
......
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册