vhost: Remove unused vhost_dev_{load|save}_inflight
PATCH 1/1 vhost: Remove unused vhost_dev_{load|save}_inflight
From: "Dr. David Alan Gilbert" <[email protected]>
vhost_dev_load_inflight and vhost_dev_save_inflight have been unused since they were added in 2019 by:
5ad204bf2a ("vhost-user: Support transferring inflight buffer between qemu and backend")
Remove them, and their helper vhost_dev_resize_inflight.
--- hw/virtio/vhost.c | 56 --------------------------------------- include/hw/virtio/vhost.h | 2 -- 2 files changed, 58 deletions(-)
hw/virtio/vhost.c +0 -56
@@ -1930,62 +1930,6 @@ void vhost_dev_free_inflight(struct vhost_inflight *inflight) } } -static int vhost_dev_resize_inflight (struct vhost_inflight *inflight, -uint64_t new_size) -{ -Error *err =NULL ; -int fd =-1 ; -void *addr =qemu_memfd_alloc ("vhost-inflight" , new_size, -F_SEAL_GROW |F_SEAL_SHRINK |F_SEAL_SEAL , - &fd, &err); - -if (err) { -error_report_err (err); -return -ENOMEM ; - } - -vhost_dev_free_inflight (inflight); - inflight->offset =0 ; - inflight->addr = addr; - inflight->fd = fd; - inflight->size = new_size; - -return 0 ; -} - -void vhost_dev_save_inflight (struct vhost_inflight *inflight,QEMUFile *f) -{ -if (inflight->addr) { -qemu_put_be64 (f, inflight->size); -qemu_put_be16 (f, inflight->queue_size); -qemu_put_buffer (f, inflight->addr, inflight->size); - }else { -qemu_put_be64 (f,0 ); - } -} - -int vhost_dev_load_inflight (struct vhost_inflight *inflight,QEMUFile *f) -{ -uint64_t size; - - size =qemu_get_be64 (f); -if (!size) { -return 0 ; - } - -if (inflight->size != size) { -int ret =vhost_dev_resize_inflight (inflight, size); -if (ret <0 ) { -return ret; - } - } - inflight->queue_size =qemu_get_be16 (f); - -qemu_get_buffer (f, inflight->addr, size); - -return 0 ; -} -int vhost_dev_prepare_inflight (struct vhost_dev *hdev,VirtIODevice *vdev) {int r;
include/hw/virtio/vhost.h +0 -2
@@ -338,8 +338,6 @@ void vhost_virtqueue_stop(struct vhost_dev *dev, struct VirtIODevice *vdev,void vhost_dev_reset_inflight (struct vhost_inflight *inflight);void vhost_dev_free_inflight (struct vhost_inflight *inflight); -void vhost_dev_save_inflight (struct vhost_inflight *inflight,QEMUFile *f); -int vhost_dev_load_inflight (struct vhost_inflight *inflight,QEMUFile *f);int vhost_dev_prepare_inflight (struct vhost_dev *hdev,VirtIODevice *vdev);int vhost_dev_set_inflight (struct vhost_dev *dev,struct vhost_inflight *inflight);
Signature · 1 line
2.46.0
Quoted 10 lines · On Wed, 18 Sep 2024 13:10:34 +0100 [email protected] wrote:
From: "Dr. David Alan Gilbert" <[email protected]>
vhost_dev_load_inflightandvhost_dev_save_inflighthave been unused since they were added in 2019 by:
5ad204bf2a("vhost-user: Support transferring inflight buffer between qemu and backend")Remove them, and their helper
vhost_dev_resize_inflight.Signed-off-by Dr. David Alan Gilbert <[email protected]>
Quoted 85 lines
--- hw/virtio/vhost.c | 56 --------------------------------------- include/hw/virtio/vhost.h | 2 -- 2 files changed, 58 deletions(-)hw/virtio/vhost.c +0
-56@@ -1930,62 +1930,6 @@ void vhost_dev_free_inflight(struct vhost_inflight *inflight) } } -static int vhost_dev_resize_inflight (struct vhost_inflight *inflight, -uint64_t new_size) -{ -Error *err =NULL ; -int fd =-1 ; -void *addr =qemu_memfd_alloc ("vhost-inflight" , new_size, -F_SEAL_GROW |F_SEAL_SHRINK |F_SEAL_SEAL , - &fd, &err); - -if (err) { -error_report_err (err); -return -ENOMEM ; - } - -vhost_dev_free_inflight (inflight); - inflight->offset =0 ; - inflight->addr = addr; - inflight->fd = fd; - inflight->size = new_size; - -return 0 ; -} - -void vhost_dev_save_inflight (struct vhost_inflight *inflight,QEMUFile *f) -{ -if (inflight->addr) { -qemu_put_be64 (f, inflight->size); -qemu_put_be16 (f, inflight->queue_size); -qemu_put_buffer (f, inflight->addr, inflight->size); - }else { -qemu_put_be64 (f,0 ); - } -} - -int vhost_dev_load_inflight (struct vhost_inflight *inflight,QEMUFile *f) -{ -uint64_t size; - - size =qemu_get_be64 (f); -if (!size) { -return 0 ; - } - -if (inflight->size != size) { -int ret =vhost_dev_resize_inflight (inflight, size); -if (ret <0 ) { -return ret; - } - } - inflight->queue_size =qemu_get_be16 (f); - -qemu_get_buffer (f, inflight->addr, size); - -return 0 ; -} -int vhost_dev_prepare_inflight (struct vhost_dev *hdev,VirtIODevice *vdev) {int r;include/hw/virtio/vhost.h +0
-2@@ -338,8 +338,6 @@ void vhost_virtqueue_stop(struct vhost_dev *dev, struct VirtIODevice *vdev,void vhost_dev_reset_inflight (struct vhost_inflight *inflight);void vhost_dev_free_inflight (struct vhost_inflight *inflight); -void vhost_dev_save_inflight (struct vhost_inflight *inflight,QEMUFile *f); -int vhost_dev_load_inflight (struct vhost_inflight *inflight,QEMUFile *f);int vhost_dev_prepare_inflight (struct vhost_dev *hdev,VirtIODevice *vdev);int vhost_dev_set_inflight (struct vhost_dev *dev,struct vhost_inflight *inflight);
Quoted 7 lines · On Wed, Sep 18, 2024 at 01:10:34PM GMT, [email protected] wrote:
From: "Dr. David Alan Gilbert" <[email protected]>
vhost_dev_load_inflightandvhost_dev_save_inflighthave been unused since they were added in 2019 by:
5ad204bf2a("vhost-user: Support transferring inflight buffer between qemu and backend")
Quoted 7 lines
Remove them, and their helper
vhost_dev_resize_inflight.Signed-off-by Dr. David Alan Gilbert <[email protected]>---
hw/virtio/vhost.c| 56 ---------------------------------------include/hw/virtio/vhost.h| 2 --2 files changed, 58 deletions(-)
Quoted 85 lines
hw/virtio/vhost.c +0
-56@@ -1930,62 +1930,6 @@ void vhost_dev_free_inflight(struct vhost_inflight *inflight) } } -static int vhost_dev_resize_inflight (struct vhost_inflight *inflight, -uint64_t new_size) -{ -Error *err =NULL ; -int fd =-1 ; -void *addr =qemu_memfd_alloc ("vhost-inflight" , new_size, -F_SEAL_GROW |F_SEAL_SHRINK |F_SEAL_SEAL , - &fd, &err); - -if (err) { -error_report_err (err); -return -ENOMEM ; - } - -vhost_dev_free_inflight (inflight); - inflight->offset =0 ; - inflight->addr = addr; - inflight->fd = fd; - inflight->size = new_size; - -return 0 ; -} - -void vhost_dev_save_inflight (struct vhost_inflight *inflight,QEMUFile *f) -{ -if (inflight->addr) { -qemu_put_be64 (f, inflight->size); -qemu_put_be16 (f, inflight->queue_size); -qemu_put_buffer (f, inflight->addr, inflight->size); - }else { -qemu_put_be64 (f,0 ); - } -} - -int vhost_dev_load_inflight (struct vhost_inflight *inflight,QEMUFile *f) -{ -uint64_t size; - - size =qemu_get_be64 (f); -if (!size) { -return 0 ; - } - -if (inflight->size != size) { -int ret =vhost_dev_resize_inflight (inflight, size); -if (ret <0 ) { -return ret; - } - } - inflight->queue_size =qemu_get_be16 (f); - -qemu_get_buffer (f, inflight->addr, size); - -return 0 ; -} -int vhost_dev_prepare_inflight (struct vhost_dev *hdev,VirtIODevice *vdev) {int r;include/hw/virtio/vhost.h +0
-2@@ -338,8 +338,6 @@ void vhost_virtqueue_stop(struct vhost_dev *dev, struct VirtIODevice *vdev,void vhost_dev_reset_inflight (struct vhost_inflight *inflight);void vhost_dev_free_inflight (struct vhost_inflight *inflight); -void vhost_dev_save_inflight (struct vhost_inflight *inflight,QEMUFile *f); -int vhost_dev_load_inflight (struct vhost_inflight *inflight,QEMUFile *f);int vhost_dev_prepare_inflight (struct vhost_dev *hdev,VirtIODevice *vdev);int vhost_dev_set_inflight (struct vhost_dev *dev,struct vhost_inflight *inflight);Signature · 1 line
2.46.0
Quoted 87 lines · On 18/09/2024 14.10, [email protected] wrote:
From: "Dr. David Alan Gilbert" <[email protected]>
vhost_dev_load_inflightandvhost_dev_save_inflighthave been unused since they were added in 2019 by:
5ad204bf2a("vhost-user: Support transferring inflight buffer between qemu and backend")Remove them, and their helper
vhost_dev_resize_inflight.Signed-off-by Dr. David Alan Gilbert <[email protected]>--- hw/virtio/vhost.c | 56 --------------------------------------- include/hw/virtio/vhost.h | 2 -- 2 files changed, 58 deletions(-)hw/virtio/vhost.c +0
-56@@ -1930,62 +1930,6 @@ void vhost_dev_free_inflight(struct vhost_inflight *inflight) } } -static int vhost_dev_resize_inflight (struct vhost_inflight *inflight, -uint64_t new_size) -{ -Error *err =NULL ; -int fd =-1 ; -void *addr =qemu_memfd_alloc ("vhost-inflight" , new_size, -F_SEAL_GROW |F_SEAL_SHRINK |F_SEAL_SEAL , - &fd, &err); - -if (err) { -error_report_err (err); -return -ENOMEM ; - } - -vhost_dev_free_inflight (inflight); - inflight->offset =0 ; - inflight->addr = addr; - inflight->fd = fd; - inflight->size = new_size; - -return 0 ; -} - -void vhost_dev_save_inflight (struct vhost_inflight *inflight,QEMUFile *f) -{ -if (inflight->addr) { -qemu_put_be64 (f, inflight->size); -qemu_put_be16 (f, inflight->queue_size); -qemu_put_buffer (f, inflight->addr, inflight->size); - }else { -qemu_put_be64 (f,0 ); - } -} - -int vhost_dev_load_inflight (struct vhost_inflight *inflight,QEMUFile *f) -{ -uint64_t size; - - size =qemu_get_be64 (f); -if (!size) { -return 0 ; - } - -if (inflight->size != size) { -int ret =vhost_dev_resize_inflight (inflight, size); -if (ret <0 ) { -return ret; - } - } - inflight->queue_size =qemu_get_be16 (f); - -qemu_get_buffer (f, inflight->addr, size); - -return 0 ; -} -int vhost_dev_prepare_inflight (struct vhost_dev *hdev,VirtIODevice *vdev) {int r;include/hw/virtio/vhost.h +0
-0
include/hw/virtio/vhost.h void vhost_virtqueue_stop(struct vhost_dev *dev, struct VirtIODevice *vdev, · line 343
Quoted 8 lines
include/hw/virtio/vhost.h +0
-2@@ -338,8 +338,6 @@ void vhost_virtqueue_stop(struct vhost_dev *dev, struct VirtIODevice *vdev,void vhost_dev_reset_inflight (struct vhost_inflight *inflight);void vhost_dev_free_inflight (struct vhost_inflight *inflight); -void vhost_dev_save_inflight (struct vhost_inflight *inflight,QEMUFile *f); -int vhost_dev_load_inflight (struct vhost_inflight *inflight,QEMUFile *f);int vhost_dev_prepare_inflight (struct vhost_dev *hdev,VirtIODevice *vdev);int vhost_dev_set_inflight (struct vhost_dev *dev,struct vhost_inflight *inflight);