From nobody Wed May 14 16:58:44 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1526992590959820.5371536958254; Tue, 22 May 2018 05:36:30 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id F1B853147B00; Tue, 22 May 2018 12:36:28 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 601A15E7D2; Tue, 22 May 2018 12:36:28 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 679054CAA7; Tue, 22 May 2018 12:36:27 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w4MCa2hj013692 for ; Tue, 22 May 2018 08:36:02 -0400 Received: by smtp.corp.redhat.com (Postfix) id AE846215CDAA; Tue, 22 May 2018 12:36:02 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.136]) by smtp.corp.redhat.com (Postfix) with ESMTP id 360EF215CDA7; Tue, 22 May 2018 12:36:02 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Tue, 22 May 2018 14:35:43 +0200 Message-Id: In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-loop: libvir-list@redhat.com Cc: Peter Krempa Subject: [libvirt] [PATCH 3/8] qemu: monitor: Remove unused qemuMonitor(Add|Remove)HostNetwork X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.49]); Tue, 22 May 2018 12:36:29 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" There are no callers for these. Remove them and the monitor implementations. Signed-off-by: Peter Krempa Reviewed-by: J=EF=BF=BDn Tomko --- 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, i= nt fd) } -int -qemuMonitorAddHostNetwork(qemuMonitorPtr mon, - const char *netstr, - int *tapfd, char **tapfdName, int tapfdSize, - int *vhostfd, char **vhostfdName, int vhostfdSiz= e) -{ - int ret =3D -1; - size_t i =3D 0, j =3D 0; - - VIR_DEBUG("netstr=3D%s tapfd=3D%p tapfdName=3D%p tapfdSize=3D%d " - "vhostfd=3D%p vhostfdName=3D%p vhostfdSize=3D%d", - netstr, tapfd, tapfdName, tapfdSize, - vhostfd, vhostfdName, vhostfdSize); - - QEMU_CHECK_MONITOR(mon); - - for (i =3D 0; i < tapfdSize; i++) { - if (qemuMonitorSendFileHandle(mon, tapfdName[i], tapfd[i]) < 0) - goto cleanup; - } - for (j =3D 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 =3D 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=3D%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 vhostf= dSize); - -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 mo= n, } -int qemuMonitorTextAddHostNetwork(qemuMonitorPtr mon, - const char *netstr) -{ - char *cmd; - char *reply =3D NULL; - int ret =3D -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 =3D 0; - - cleanup: - VIR_FREE(cmd); - VIR_FREE(reply); - return ret; -} - - -int qemuMonitorTextRemoveHostNetwork(qemuMonitorPtr mon, - int vlan, - const char *netname) -{ - char *cmd; - char *reply =3D NULL; - int ret =3D -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 =3D 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); --=20 2.16.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list