qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Cindy Lu <lulu@redhat.com>
To: lulu@redhat.com, mst@redhat.com, jasowang@redhat.com,
	qemu-devel@nongnu.org
Cc: qemu-stable@nongnu.org
Subject: [PATCH v4 2/2] virtio-pci: Add check the return of kvm_virtio_pci_vector_use_one
Date: Tue,  2 Jul 2024 09:59:37 +0800	[thread overview]
Message-ID: <20240702020033.139261-3-lulu@redhat.com> (raw)
In-Reply-To: <20240702020033.139261-1-lulu@redhat.com>

Add the return value check for kvm_virtio_pci_vector_use_one().
Since the return value of function virtio_pci_set_vector() is void,
we can do nothing here. So just add the error message here.

Signed-off-by: Cindy Lu <lulu@redhat.com>
---
 hw/virtio/virtio-pci.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c
index 6b62165ef6..dc31a37ec0 100644
--- a/hw/virtio/virtio-pci.c
+++ b/hw/virtio/virtio-pci.c
@@ -1455,7 +1455,9 @@ static void virtio_pci_set_vector(VirtIODevice *vdev,
     }
     /* If the new vector changed need to set it up. */
     if (kvm_irqfd && new_vector != VIRTIO_NO_VECTOR) {
-        kvm_virtio_pci_vector_use_one(proxy, queue_no);
+        if (kvm_virtio_pci_vector_use_one(proxy, queue_no)) {
+            virtio_error(vdev, "fail to set the vector %d", new_vector);
+        }
     }
 }
 
-- 
2.45.0



  parent reply	other threads:[~2024-07-02  2:01 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-02  1:59 [PATCH v4 0/2] virtio-pci: Fix the use of an uninitialized irqfd Cindy Lu
2024-07-02  1:59 ` [PATCH v4 1/2] " Cindy Lu
2024-07-02  7:09   ` Jason Wang
2024-07-16  6:25     ` Cindy Lu
2024-07-02  1:59 ` Cindy Lu [this message]
2024-07-02  7:10   ` [PATCH v4 2/2] virtio-pci: Add check the return of kvm_virtio_pci_vector_use_one Jason Wang

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=20240702020033.139261-3-lulu@redhat.com \
    --to=lulu@redhat.com \
    --cc=jasowang@redhat.com \
    --cc=mst@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-stable@nongnu.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).