|
|
586cba |
From 975af1b9f1811e113e1babd928ae70f8e4ebefb5 Mon Sep 17 00:00:00 2001
|
|
|
586cba |
From: Stefan Hajnoczi <stefanha@redhat.com>
|
|
|
586cba |
Date: Tue, 17 May 2022 09:28:19 +0100
|
|
|
586cba |
Subject: [PATCH 13/16] virtio-scsi: clean up virtio_scsi_handle_cmd_vq()
|
|
|
586cba |
|
|
|
586cba |
RH-Author: Stefan Hajnoczi <stefanha@redhat.com>
|
|
|
586cba |
RH-MergeRequest: 88: virtio-scsi: fix 100% CPU consumption with IOThreads
|
|
|
586cba |
RH-Commit: [5/6] 27b0225783fa9bbb8fe5ee692bd3f0a888d49d07 (stefanha/centos-stream-qemu-kvm)
|
|
|
586cba |
RH-Bugzilla: 2079347
|
|
|
586cba |
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
|
|
|
586cba |
RH-Acked-by: Kevin Wolf <kwolf@redhat.com>
|
|
|
586cba |
RH-Acked-by: Stefano Garzarella <sgarzare@redhat.com>
|
|
|
586cba |
|
|
|
586cba |
virtio_scsi_handle_cmd_vq() is only called from hw/scsi/virtio-scsi.c
|
|
|
586cba |
now and its return value is no longer used. Remove the function
|
|
|
586cba |
prototype from virtio-scsi.h and drop the return value.
|
|
|
586cba |
|
|
|
586cba |
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
|
|
|
586cba |
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
|
586cba |
Message-id: 20220427143541.119567-6-stefanha@redhat.com
|
|
|
586cba |
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
|
|
|
586cba |
(cherry picked from commit ad482b57ef841b2d4883c5079d20ba44ff5e4b3e)
|
|
|
586cba |
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
|
|
|
586cba |
---
|
|
|
586cba |
hw/scsi/virtio-scsi.c | 5 +----
|
|
|
586cba |
include/hw/virtio/virtio-scsi.h | 1 -
|
|
|
586cba |
2 files changed, 1 insertion(+), 5 deletions(-)
|
|
|
586cba |
|
|
|
586cba |
diff --git a/hw/scsi/virtio-scsi.c b/hw/scsi/virtio-scsi.c
|
|
|
586cba |
index a47033d91d..df5ff8bab7 100644
|
|
|
586cba |
--- a/hw/scsi/virtio-scsi.c
|
|
|
586cba |
+++ b/hw/scsi/virtio-scsi.c
|
|
|
586cba |
@@ -685,12 +685,11 @@ static void virtio_scsi_handle_cmd_req_submit(VirtIOSCSI *s, VirtIOSCSIReq *req)
|
|
|
586cba |
scsi_req_unref(sreq);
|
|
|
586cba |
}
|
|
|
586cba |
|
|
|
586cba |
-bool virtio_scsi_handle_cmd_vq(VirtIOSCSI *s, VirtQueue *vq)
|
|
|
586cba |
+static void virtio_scsi_handle_cmd_vq(VirtIOSCSI *s, VirtQueue *vq)
|
|
|
586cba |
{
|
|
|
586cba |
VirtIOSCSIReq *req, *next;
|
|
|
586cba |
int ret = 0;
|
|
|
586cba |
bool suppress_notifications = virtio_queue_get_notification(vq);
|
|
|
586cba |
- bool progress = false;
|
|
|
586cba |
|
|
|
586cba |
QTAILQ_HEAD(, VirtIOSCSIReq) reqs = QTAILQ_HEAD_INITIALIZER(reqs);
|
|
|
586cba |
|
|
|
586cba |
@@ -700,7 +699,6 @@ bool virtio_scsi_handle_cmd_vq(VirtIOSCSI *s, VirtQueue *vq)
|
|
|
586cba |
}
|
|
|
586cba |
|
|
|
586cba |
while ((req = virtio_scsi_pop_req(s, vq))) {
|
|
|
586cba |
- progress = true;
|
|
|
586cba |
ret = virtio_scsi_handle_cmd_req_prepare(s, req);
|
|
|
586cba |
if (!ret) {
|
|
|
586cba |
QTAILQ_INSERT_TAIL(&reqs, req, next);
|
|
|
586cba |
@@ -725,7 +723,6 @@ bool virtio_scsi_handle_cmd_vq(VirtIOSCSI *s, VirtQueue *vq)
|
|
|
586cba |
QTAILQ_FOREACH_SAFE(req, &reqs, next, next) {
|
|
|
586cba |
virtio_scsi_handle_cmd_req_submit(s, req);
|
|
|
586cba |
}
|
|
|
586cba |
- return progress;
|
|
|
586cba |
}
|
|
|
586cba |
|
|
|
586cba |
static void virtio_scsi_handle_cmd(VirtIODevice *vdev, VirtQueue *vq)
|
|
|
586cba |
diff --git a/include/hw/virtio/virtio-scsi.h b/include/hw/virtio/virtio-scsi.h
|
|
|
586cba |
index 44dc3b81ec..2497530064 100644
|
|
|
586cba |
--- a/include/hw/virtio/virtio-scsi.h
|
|
|
586cba |
+++ b/include/hw/virtio/virtio-scsi.h
|
|
|
586cba |
@@ -151,7 +151,6 @@ void virtio_scsi_common_realize(DeviceState *dev,
|
|
|
586cba |
Error **errp);
|
|
|
586cba |
|
|
|
586cba |
void virtio_scsi_common_unrealize(DeviceState *dev);
|
|
|
586cba |
-bool virtio_scsi_handle_cmd_vq(VirtIOSCSI *s, VirtQueue *vq);
|
|
|
586cba |
void virtio_scsi_init_req(VirtIOSCSI *s, VirtQueue *vq, VirtIOSCSIReq *req);
|
|
|
586cba |
void virtio_scsi_free_req(VirtIOSCSIReq *req);
|
|
|
586cba |
void virtio_scsi_push_event(VirtIOSCSI *s, SCSIDevice *dev,
|
|
|
586cba |
--
|
|
|
586cba |
2.31.1
|
|
|
586cba |
|