From: "Philippe Mathieu-Daudé" <philmd@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Hanna Reitz" <hreitz@redhat.com>,
"Igor Mammedov" <imammedo@redhat.com>,
"Laurent Vivier" <laurent@vivier.eu>,
"Alexandre Iooss" <erdnaxe@crans.org>,
"Alex Bennée" <alex.bennee@linaro.org>,
"Michael Roth" <michael.roth@amd.com>,
"Zhang Chen" <chen.zhang@intel.com>,
"Shannon Zhao" <shannon.zhaosl@gmail.com>,
"Richard Henderson" <richard.henderson@linaro.org>,
"Alex Williamson" <alex.williamson@redhat.com>,
"Eduardo Habkost" <ehabkost@redhat.com>,
"Markus Armbruster" <armbru@redhat.com>,
"Eric Blake" <eblake@redhat.com>, "Stefan Weil" <sw@weilnetz.de>,
"John Snow" <jsnow@redhat.com>,
"Mahmoud Mandour" <ma.mandourr@gmail.com>,
"Li Zhijian" <lizhijian@cn.fujitsu.com>,
"Marcel Apfelbaum" <marcel.apfelbaum@gmail.com>,
qemu-block@nongnu.org, "Helge Deller" <deller@gmx.de>,
"Michael S. Tsirkin" <mst@redhat.com>,
"David Gibson" <david@gibson.dropbear.id.au>,
"Peter Xu" <peterx@redhat.com>,
"Gonglei (Arei)" <arei.gonglei@huawei.com>,
"Gerd Hoffmann" <kraxel@redhat.com>, "Fam Zheng" <fam@euphon.net>,
"Jason Wang" <jasowang@redhat.com>,
"Vladimir Sementsov-Ogievskiy" <vsementsov@virtuozzo.com>,
"Christian Schoenebeck" <qemu_oss@crudebyte.com>,
"Kevin Wolf" <kwolf@redhat.com>,
"Yuval Shaia" <yuval.shaia.ml@gmail.com>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Peter Maydell" <peter.maydell@linaro.org>,
qemu-arm@nongnu.org, "Thomas Huth" <thuth@redhat.com>,
"Laurent Vivier" <lvivier@redhat.com>,
"Greg Kurz" <groug@kaod.org>,
"Philippe Mathieu-Daudé" <philmd@redhat.com>,
qemu-ppc@nongnu.org, "David Hildenbrand" <david@redhat.com>
Subject: [PATCH 01/28] hw/hyperv/vmbus: Remove unused vmbus_load/save_req()
Date: Fri, 3 Sep 2021 13:06:35 +0200 [thread overview]
Message-ID: <20210903110702.588291-2-philmd@redhat.com> (raw)
In-Reply-To: <20210903110702.588291-1-philmd@redhat.com>
vmbus_save_req() and vmbus_load_req() are not used.
Remove them to avoid maintaining dead code.
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
include/hw/hyperv/vmbus.h | 3 --
hw/hyperv/vmbus.c | 59 ---------------------------------------
2 files changed, 62 deletions(-)
diff --git a/include/hw/hyperv/vmbus.h b/include/hw/hyperv/vmbus.h
index f98bea3888d..8ea660dd8e6 100644
--- a/include/hw/hyperv/vmbus.h
+++ b/include/hw/hyperv/vmbus.h
@@ -223,7 +223,4 @@ int vmbus_map_sgl(VMBusChanReq *req, DMADirection dir, struct iovec *iov,
void vmbus_unmap_sgl(VMBusChanReq *req, DMADirection dir, struct iovec *iov,
unsigned iov_cnt, size_t accessed);
-void vmbus_save_req(QEMUFile *f, VMBusChanReq *req);
-void *vmbus_load_req(QEMUFile *f, VMBusDevice *dev, uint32_t size);
-
#endif
diff --git a/hw/hyperv/vmbus.c b/hw/hyperv/vmbus.c
index c9887d5a7bc..18d3c3b9240 100644
--- a/hw/hyperv/vmbus.c
+++ b/hw/hyperv/vmbus.c
@@ -1311,65 +1311,6 @@ static const VMStateDescription vmstate_vmbus_chan_req = {
}
};
-void vmbus_save_req(QEMUFile *f, VMBusChanReq *req)
-{
- VMBusChanReqSave req_save;
-
- req_save.chan_idx = req->chan->subchan_idx;
- req_save.pkt_type = req->pkt_type;
- req_save.msglen = req->msglen;
- req_save.msg = req->msg;
- req_save.transaction_id = req->transaction_id;
- req_save.need_comp = req->need_comp;
- req_save.num = req->sgl.nsg;
- req_save.sgl = g_memdup(req->sgl.sg,
- req_save.num * sizeof(ScatterGatherEntry));
-
- vmstate_save_state(f, &vmstate_vmbus_chan_req, &req_save, NULL);
-
- g_free(req_save.sgl);
-}
-
-void *vmbus_load_req(QEMUFile *f, VMBusDevice *dev, uint32_t size)
-{
- VMBusChanReqSave req_save;
- VMBusChanReq *req = NULL;
- VMBusChannel *chan = NULL;
- uint32_t i;
-
- vmstate_load_state(f, &vmstate_vmbus_chan_req, &req_save, 0);
-
- if (req_save.chan_idx >= dev->num_channels) {
- error_report("%s: %u(chan_idx) > %u(num_channels)", __func__,
- req_save.chan_idx, dev->num_channels);
- goto out;
- }
- chan = &dev->channels[req_save.chan_idx];
-
- if (vmbus_channel_reserve(chan, 0, req_save.msglen)) {
- goto out;
- }
-
- req = vmbus_alloc_req(chan, size, req_save.pkt_type, req_save.msglen,
- req_save.transaction_id, req_save.need_comp);
- if (req_save.msglen) {
- memcpy(req->msg, req_save.msg, req_save.msglen);
- }
-
- for (i = 0; i < req_save.num; i++) {
- qemu_sglist_add(&req->sgl, req_save.sgl[i].base, req_save.sgl[i].len);
- }
-
-out:
- if (req_save.msglen) {
- g_free(req_save.msg);
- }
- if (req_save.num) {
- g_free(req_save.sgl);
- }
- return req;
-}
-
static void channel_event_cb(EventNotifier *e)
{
VMBusChannel *chan = container_of(e, VMBusChannel, notifier);
--
2.31.1
WARNING: multiple messages have this Message-ID (diff)
From: "Philippe Mathieu-Daudé" <philmd@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Fam Zheng" <fam@euphon.net>,
"Peter Maydell" <peter.maydell@linaro.org>,
"Li Zhijian" <lizhijian@cn.fujitsu.com>,
"Michael S. Tsirkin" <mst@redhat.com>,
"Jason Wang" <jasowang@redhat.com>,
"Christian Schoenebeck" <qemu_oss@crudebyte.com>,
"Yuval Shaia" <yuval.shaia.ml@gmail.com>,
"Peter Xu" <peterx@redhat.com>,
"Gerd Hoffmann" <kraxel@redhat.com>,
"Alexandre Iooss" <erdnaxe@crans.org>,
"Eric Blake" <eblake@redhat.com>,
qemu-block@nongnu.org, "Zhang Chen" <chen.zhang@intel.com>,
"Alex Bennée" <alex.bennee@linaro.org>,
"Helge Deller" <deller@gmx.de>,
"David Hildenbrand" <david@redhat.com>,
"Markus Armbruster" <armbru@redhat.com>,
"Gonglei (Arei)" <arei.gonglei@huawei.com>,
"Stefan Weil" <sw@weilnetz.de>,
"Philippe Mathieu-Daudé" <philmd@redhat.com>,
"Laurent Vivier" <lvivier@redhat.com>,
"Thomas Huth" <thuth@redhat.com>,
"Eduardo Habkost" <ehabkost@redhat.com>,
"Michael Roth" <michael.roth@amd.com>,
"Richard Henderson" <richard.henderson@linaro.org>,
"Greg Kurz" <groug@kaod.org>,
"Alex Williamson" <alex.williamson@redhat.com>,
qemu-arm@nongnu.org, "Paolo Bonzini" <pbonzini@redhat.com>,
"John Snow" <jsnow@redhat.com>,
"David Gibson" <david@gibson.dropbear.id.au>,
"Kevin Wolf" <kwolf@redhat.com>,
"Vladimir Sementsov-Ogievskiy" <vsementsov@virtuozzo.com>,
"Laurent Vivier" <laurent@vivier.eu>,
"Shannon Zhao" <shannon.zhaosl@gmail.com>,
"Hanna Reitz" <hreitz@redhat.com>,
qemu-ppc@nongnu.org, "Igor Mammedov" <imammedo@redhat.com>,
"Mahmoud Mandour" <ma.mandourr@gmail.com>
Subject: [PATCH 01/28] hw/hyperv/vmbus: Remove unused vmbus_load/save_req()
Date: Fri, 3 Sep 2021 13:06:35 +0200 [thread overview]
Message-ID: <20210903110702.588291-2-philmd@redhat.com> (raw)
In-Reply-To: <20210903110702.588291-1-philmd@redhat.com>
vmbus_save_req() and vmbus_load_req() are not used.
Remove them to avoid maintaining dead code.
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
include/hw/hyperv/vmbus.h | 3 --
hw/hyperv/vmbus.c | 59 ---------------------------------------
2 files changed, 62 deletions(-)
diff --git a/include/hw/hyperv/vmbus.h b/include/hw/hyperv/vmbus.h
index f98bea3888d..8ea660dd8e6 100644
--- a/include/hw/hyperv/vmbus.h
+++ b/include/hw/hyperv/vmbus.h
@@ -223,7 +223,4 @@ int vmbus_map_sgl(VMBusChanReq *req, DMADirection dir, struct iovec *iov,
void vmbus_unmap_sgl(VMBusChanReq *req, DMADirection dir, struct iovec *iov,
unsigned iov_cnt, size_t accessed);
-void vmbus_save_req(QEMUFile *f, VMBusChanReq *req);
-void *vmbus_load_req(QEMUFile *f, VMBusDevice *dev, uint32_t size);
-
#endif
diff --git a/hw/hyperv/vmbus.c b/hw/hyperv/vmbus.c
index c9887d5a7bc..18d3c3b9240 100644
--- a/hw/hyperv/vmbus.c
+++ b/hw/hyperv/vmbus.c
@@ -1311,65 +1311,6 @@ static const VMStateDescription vmstate_vmbus_chan_req = {
}
};
-void vmbus_save_req(QEMUFile *f, VMBusChanReq *req)
-{
- VMBusChanReqSave req_save;
-
- req_save.chan_idx = req->chan->subchan_idx;
- req_save.pkt_type = req->pkt_type;
- req_save.msglen = req->msglen;
- req_save.msg = req->msg;
- req_save.transaction_id = req->transaction_id;
- req_save.need_comp = req->need_comp;
- req_save.num = req->sgl.nsg;
- req_save.sgl = g_memdup(req->sgl.sg,
- req_save.num * sizeof(ScatterGatherEntry));
-
- vmstate_save_state(f, &vmstate_vmbus_chan_req, &req_save, NULL);
-
- g_free(req_save.sgl);
-}
-
-void *vmbus_load_req(QEMUFile *f, VMBusDevice *dev, uint32_t size)
-{
- VMBusChanReqSave req_save;
- VMBusChanReq *req = NULL;
- VMBusChannel *chan = NULL;
- uint32_t i;
-
- vmstate_load_state(f, &vmstate_vmbus_chan_req, &req_save, 0);
-
- if (req_save.chan_idx >= dev->num_channels) {
- error_report("%s: %u(chan_idx) > %u(num_channels)", __func__,
- req_save.chan_idx, dev->num_channels);
- goto out;
- }
- chan = &dev->channels[req_save.chan_idx];
-
- if (vmbus_channel_reserve(chan, 0, req_save.msglen)) {
- goto out;
- }
-
- req = vmbus_alloc_req(chan, size, req_save.pkt_type, req_save.msglen,
- req_save.transaction_id, req_save.need_comp);
- if (req_save.msglen) {
- memcpy(req->msg, req_save.msg, req_save.msglen);
- }
-
- for (i = 0; i < req_save.num; i++) {
- qemu_sglist_add(&req->sgl, req_save.sgl[i].base, req_save.sgl[i].len);
- }
-
-out:
- if (req_save.msglen) {
- g_free(req_save.msg);
- }
- if (req_save.num) {
- g_free(req_save.sgl);
- }
- return req;
-}
-
static void channel_event_cb(EventNotifier *e)
{
VMBusChannel *chan = container_of(e, VMBusChannel, notifier);
--
2.31.1
next prev parent reply other threads:[~2021-09-03 11:07 UTC|newest]
Thread overview: 78+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-03 11:06 [PATCH 00/28] glib: Replace g_memdup() by g_memdup2_qemu() Philippe Mathieu-Daudé
2021-09-03 11:06 ` Philippe Mathieu-Daudé
2021-09-03 11:06 ` Philippe Mathieu-Daudé [this message]
2021-09-03 11:06 ` [PATCH 01/28] hw/hyperv/vmbus: Remove unused vmbus_load/save_req() Philippe Mathieu-Daudé
2021-09-03 11:06 ` [PATCH 02/28] glib-compat: Introduce g_memdup2() wrapper Philippe Mathieu-Daudé
2021-09-03 11:06 ` Philippe Mathieu-Daudé
2021-09-03 11:16 ` Daniel P. Berrangé
2021-09-03 11:16 ` Daniel P. Berrangé
2021-09-03 11:51 ` Vladimir Sementsov-Ogievskiy
2021-09-03 11:56 ` Daniel P. Berrangé
2021-09-03 11:56 ` Daniel P. Berrangé
2021-09-03 12:03 ` Vladimir Sementsov-Ogievskiy
2021-09-03 17:09 ` Philippe Mathieu-Daudé
2021-09-03 17:09 ` Philippe Mathieu-Daudé
2021-09-03 11:06 ` [PATCH 03/28] qapi: Replace g_memdup() by g_memdup2_qemu() Philippe Mathieu-Daudé
2021-09-03 11:06 ` Philippe Mathieu-Daudé
2021-09-03 11:18 ` Daniel P. Berrangé
2021-09-03 11:18 ` Daniel P. Berrangé
2021-09-03 17:10 ` Philippe Mathieu-Daudé
2021-09-03 17:10 ` Philippe Mathieu-Daudé
2021-09-03 11:06 ` [PATCH 04/28] accel/tcg: " Philippe Mathieu-Daudé
2021-09-03 11:06 ` Philippe Mathieu-Daudé
2021-09-03 11:06 ` [PATCH 05/28] block/qcow2-bitmap: " Philippe Mathieu-Daudé
2021-09-03 11:06 ` Philippe Mathieu-Daudé
2021-09-03 11:06 ` [PATCH 06/28] softmmu: " Philippe Mathieu-Daudé
2021-09-03 11:06 ` Philippe Mathieu-Daudé
2021-09-03 11:06 ` [PATCH 07/28] hw/9pfs: " Philippe Mathieu-Daudé
2021-09-03 11:06 ` Philippe Mathieu-Daudé
2021-09-03 11:06 ` [PATCH 08/28] hw/acpi: Avoid truncating acpi_data_len() to 32-bit Philippe Mathieu-Daudé
2021-09-03 11:06 ` Philippe Mathieu-Daudé
2021-09-08 7:15 ` Igor Mammedov
2021-09-08 7:15 ` Igor Mammedov
2021-09-03 11:06 ` [PATCH 09/28] hw/acpi: Replace g_memdup() by g_memdup2_qemu() Philippe Mathieu-Daudé
2021-09-03 11:06 ` Philippe Mathieu-Daudé
2021-09-08 7:16 ` Igor Mammedov
2021-09-08 7:16 ` Igor Mammedov
2021-09-03 11:06 ` [PATCH 10/28] hw/core/machine: " Philippe Mathieu-Daudé
2021-09-03 11:06 ` Philippe Mathieu-Daudé
2021-09-03 11:06 ` [PATCH 11/28] hw/hppa/machine: " Philippe Mathieu-Daudé
2021-09-03 11:06 ` Philippe Mathieu-Daudé
2021-09-03 11:06 ` [PATCH 12/28] hw/i386/multiboot: " Philippe Mathieu-Daudé
2021-09-03 11:06 ` Philippe Mathieu-Daudé
2021-09-03 11:06 ` [PATCH 13/28] hw/net/eepro100: " Philippe Mathieu-Daudé
2021-09-03 11:06 ` Philippe Mathieu-Daudé
2021-09-03 11:06 ` [PATCH 14/28] hw/nvram/fw_cfg: " Philippe Mathieu-Daudé
2021-09-03 11:06 ` Philippe Mathieu-Daudé
2021-09-03 11:06 ` [PATCH 15/28] hw/scsi/mptsas: " Philippe Mathieu-Daudé
2021-09-03 11:06 ` Philippe Mathieu-Daudé
2021-09-03 11:06 ` [PATCH 16/28] hw/ppc/spapr_pci: " Philippe Mathieu-Daudé
2021-09-03 11:06 ` Philippe Mathieu-Daudé
2021-09-03 11:45 ` David Gibson
2021-09-03 11:45 ` David Gibson
2021-09-03 11:06 ` [PATCH 17/28] hw/rdma: " Philippe Mathieu-Daudé
2021-09-03 11:06 ` Philippe Mathieu-Daudé
2021-09-03 11:06 ` [PATCH 18/28] hw/vfio/pci: " Philippe Mathieu-Daudé
2021-09-03 11:06 ` Philippe Mathieu-Daudé
2021-09-03 11:06 ` [RFC PATCH 19/28] hw/virtio: " Philippe Mathieu-Daudé
2021-09-03 11:06 ` Philippe Mathieu-Daudé
2021-09-03 11:06 ` [PATCH 20/28] net/colo: " Philippe Mathieu-Daudé
2021-09-03 11:06 ` Philippe Mathieu-Daudé
2021-09-03 11:06 ` [RFC PATCH 21/28] ui/clipboard: " Philippe Mathieu-Daudé
2021-09-03 11:06 ` Philippe Mathieu-Daudé
2021-09-03 11:06 ` [RFC PATCH 22/28] linux-user: " Philippe Mathieu-Daudé
2021-09-03 11:06 ` Philippe Mathieu-Daudé
2021-09-03 11:06 ` [PATCH 23/28] tests/unit: " Philippe Mathieu-Daudé
2021-09-03 11:06 ` Philippe Mathieu-Daudé
2021-09-03 11:06 ` [PATCH 24/28] tests/qtest: " Philippe Mathieu-Daudé
2021-09-03 11:06 ` Philippe Mathieu-Daudé
2021-09-03 11:06 ` [PATCH 25/28] target/arm: " Philippe Mathieu-Daudé
2021-09-03 11:06 ` Philippe Mathieu-Daudé
2021-09-03 11:07 ` [PATCH 26/28] target/ppc: " Philippe Mathieu-Daudé
2021-09-03 11:07 ` Philippe Mathieu-Daudé
2021-09-03 11:45 ` David Gibson
2021-09-03 11:45 ` David Gibson
2021-09-03 11:07 ` [PATCH 27/28] contrib: " Philippe Mathieu-Daudé
2021-09-03 11:07 ` Philippe Mathieu-Daudé
2021-09-03 11:07 ` [PATCH 28/28] checkpatch: Do not allow deprecated g_memdup() Philippe Mathieu-Daudé
2021-09-03 11:07 ` Philippe Mathieu-Daudé
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210903110702.588291-2-philmd@redhat.com \
--to=philmd@redhat.com \
--cc=alex.bennee@linaro.org \
--cc=alex.williamson@redhat.com \
--cc=arei.gonglei@huawei.com \
--cc=armbru@redhat.com \
--cc=chen.zhang@intel.com \
--cc=david@gibson.dropbear.id.au \
--cc=david@redhat.com \
--cc=deller@gmx.de \
--cc=eblake@redhat.com \
--cc=ehabkost@redhat.com \
--cc=erdnaxe@crans.org \
--cc=fam@euphon.net \
--cc=groug@kaod.org \
--cc=hreitz@redhat.com \
--cc=imammedo@redhat.com \
--cc=jasowang@redhat.com \
--cc=jsnow@redhat.com \
--cc=kraxel@redhat.com \
--cc=kwolf@redhat.com \
--cc=laurent@vivier.eu \
--cc=lizhijian@cn.fujitsu.com \
--cc=lvivier@redhat.com \
--cc=ma.mandourr@gmail.com \
--cc=marcel.apfelbaum@gmail.com \
--cc=michael.roth@amd.com \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=peterx@redhat.com \
--cc=qemu-arm@nongnu.org \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
--cc=qemu_oss@crudebyte.com \
--cc=richard.henderson@linaro.org \
--cc=shannon.zhaosl@gmail.com \
--cc=sw@weilnetz.de \
--cc=thuth@redhat.com \
--cc=vsementsov@virtuozzo.com \
--cc=yuval.shaia.ml@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.