From nobody Sun May 19 03:38:19 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 165393621559761.804408633554885; Mon, 30 May 2022 11:43:35 -0700 (PDT) Received: from localhost ([::1]:49918 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nvkMY-0007rC-7r for importer@patchew.org; Mon, 30 May 2022 14:43:34 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49896) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nvkKZ-0006JN-LL for qemu-devel@nongnu.org; Mon, 30 May 2022 14:41:31 -0400 Received: from vps-vb.mhejs.net ([37.28.154.113]:45676) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nvkKY-0008Ao-4Q for qemu-devel@nongnu.org; Mon, 30 May 2022 14:41:31 -0400 Received: from MUA by vps-vb.mhejs.net with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1nvkKQ-0006e7-4U; Mon, 30 May 2022 20:41:22 +0200 From: "Maciej S. Szmigiero" To: qemu-devel@nongnu.org Cc: Thomas Huth Subject: [PULL 1/2] MAINTAINERS: Add myself as the maintainer for Hyper-V VMBus Date: Mon, 30 May 2022 20:41:10 +0200 Message-Id: X-Mailer: git-send-email 2.35.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=37.28.154.113; envelope-from=mail@maciej.szmigiero.name; helo=vps-vb.mhejs.net X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZM-MESSAGEID: 1653936216723100001 Content-Type: text/plain; charset="utf-8" From: "Maciej S. Szmigiero" This way there is some contact point for incoming patches, and somebody to review and pick up them. Signed-off-by: Maciej S. Szmigiero --- MAINTAINERS | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index dff0200f70..00dc4a8ecb 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1777,6 +1777,12 @@ F: include/hw/block/fdc.h F: tests/qtest/fdc-test.c T: git https://gitlab.com/jsnow/qemu.git ide =20 +Hyper-V VMBus +M: Maciej S. Szmigiero +S: Odd Fixes +F: hw/hyperv/vmbus.c +F: include/hw/hyperv/vmbus*.h + OMAP M: Peter Maydell L: qemu-arm@nongnu.org From nobody Sun May 19 03:38:19 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1653936415642456.62137308052263; Mon, 30 May 2022 11:46:55 -0700 (PDT) Received: from localhost ([::1]:54532 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nvkPl-0002Y4-DX for importer@patchew.org; Mon, 30 May 2022 14:46:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49900) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nvkKa-0006KX-BP for qemu-devel@nongnu.org; Mon, 30 May 2022 14:41:32 -0400 Received: from vps-vb.mhejs.net ([37.28.154.113]:55724) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nvkKY-0008D8-Ck for qemu-devel@nongnu.org; Mon, 30 May 2022 14:41:32 -0400 Received: from MUA by vps-vb.mhejs.net with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1nvkKV-0006eG-I6; Mon, 30 May 2022 20:41:27 +0200 From: "Maciej S. Szmigiero" To: qemu-devel@nongnu.org Cc: Thomas Huth , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 2/2] hw/hyperv/vmbus: Remove unused vmbus_load/save_req() Date: Mon, 30 May 2022 20:41:11 +0200 Message-Id: <6ede46b910ac66fd10bc169fb0a6f681429a9c5c.1653934780.git.mail@maciej.szmigiero.name> X-Mailer: git-send-email 2.35.1 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=37.28.154.113; envelope-from=mail@maciej.szmigiero.name; helo=vps-vb.mhejs.net X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZM-MESSAGEID: 1653936417902100001 From: Philippe Mathieu-Daud=C3=A9 vmbus_save_req() and vmbus_load_req() are not used. Remove them to avoid maintaining dead code. This essentially reverts commit 4dd8a7064b8a6527f99a62be11 ("vmbus: add infrastructure to save/load vmbus requests"). Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20211106134155.582312-2-philmd@redhat.com> [MSS: Remove also corresponding variables, which are now unused] Signed-off-by: Maciej S. Szmigiero --- hw/hyperv/vmbus.c | 99 --------------------------------------- include/hw/hyperv/vmbus.h | 3 -- 2 files changed, 102 deletions(-) diff --git a/hw/hyperv/vmbus.c b/hw/hyperv/vmbus.c index 8aad29f1bb..30bc04e1c4 100644 --- a/hw/hyperv/vmbus.c +++ b/hw/hyperv/vmbus.c @@ -1273,105 +1273,6 @@ void vmbus_free_req(void *req) g_free(req); } =20 -static const VMStateDescription vmstate_sgent =3D { - .name =3D "vmbus/sgentry", - .version_id =3D 0, - .minimum_version_id =3D 0, - .fields =3D (VMStateField[]) { - VMSTATE_UINT64(base, ScatterGatherEntry), - VMSTATE_UINT64(len, ScatterGatherEntry), - VMSTATE_END_OF_LIST() - } -}; - -typedef struct VMBusChanReqSave { - uint16_t chan_idx; - uint16_t pkt_type; - uint32_t msglen; - void *msg; - uint64_t transaction_id; - bool need_comp; - uint32_t num; - ScatterGatherEntry *sgl; -} VMBusChanReqSave; - -static const VMStateDescription vmstate_vmbus_chan_req =3D { - .name =3D "vmbus/vmbus_chan_req", - .version_id =3D 0, - .minimum_version_id =3D 0, - .fields =3D (VMStateField[]) { - VMSTATE_UINT16(chan_idx, VMBusChanReqSave), - VMSTATE_UINT16(pkt_type, VMBusChanReqSave), - VMSTATE_UINT32(msglen, VMBusChanReqSave), - VMSTATE_VBUFFER_ALLOC_UINT32(msg, VMBusChanReqSave, 0, NULL, msgle= n), - VMSTATE_UINT64(transaction_id, VMBusChanReqSave), - VMSTATE_BOOL(need_comp, VMBusChanReqSave), - VMSTATE_UINT32(num, VMBusChanReqSave), - VMSTATE_STRUCT_VARRAY_POINTER_UINT32(sgl, VMBusChanReqSave, num, - vmstate_sgent, ScatterGatherE= ntry), - VMSTATE_END_OF_LIST() - } -}; - -void vmbus_save_req(QEMUFile *f, VMBusChanReq *req) -{ - VMBusChanReqSave req_save; - - req_save.chan_idx =3D req->chan->subchan_idx; - req_save.pkt_type =3D req->pkt_type; - req_save.msglen =3D req->msglen; - req_save.msg =3D req->msg; - req_save.transaction_id =3D req->transaction_id; - req_save.need_comp =3D req->need_comp; - req_save.num =3D req->sgl.nsg; - req_save.sgl =3D 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 =3D NULL; - VMBusChannel *chan =3D NULL; - uint32_t i; - - vmstate_load_state(f, &vmstate_vmbus_chan_req, &req_save, 0); - - if (req_save.chan_idx >=3D dev->num_channels) { - error_report("%s: %u(chan_idx) > %u(num_channels)", __func__, - req_save.chan_idx, dev->num_channels); - goto out; - } - chan =3D &dev->channels[req_save.chan_idx]; - - if (vmbus_channel_reserve(chan, 0, req_save.msglen)) { - goto out; - } - - req =3D 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 =3D 0; i < req_save.num; i++) { - qemu_sglist_add(&req->sgl, req_save.sgl[i].base, req_save.sgl[i].l= en); - } - -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 =3D container_of(e, VMBusChannel, notifier); diff --git a/include/hw/hyperv/vmbus.h b/include/hw/hyperv/vmbus.h index f98bea3888..8ea660dd8e 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 *io= v, unsigned iov_cnt, size_t accessed); =20 -void vmbus_save_req(QEMUFile *f, VMBusChanReq *req); -void *vmbus_load_req(QEMUFile *f, VMBusDevice *dev, uint32_t size); - #endif