From: Paolo Bonzini <pbonzini@redhat.com>
To: Fam Zheng <famz@redhat.com>, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] virtio-scsi: Report error if num_queues is 0 or too large
Date: Tue, 26 Aug 2014 13:20:19 +0200 [thread overview]
Message-ID: <53FC6D73.8010401@redhat.com> (raw)
In-Reply-To: <1409034630-22226-1-git-send-email-famz@redhat.com>
Il 26/08/2014 08:30, Fam Zheng ha scritto:
> No cmd vq surprises guest (Linux panics in virtscsi_probe), too many
> queues abort qemu (in the following virtio_add_queue).
>
> Signed-off-by: Fam Zheng <famz@redhat.com>
> ---
> hw/scsi/virtio-scsi.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/hw/scsi/virtio-scsi.c b/hw/scsi/virtio-scsi.c
> index 2dd9255..86aba88 100644
> --- a/hw/scsi/virtio-scsi.c
> +++ b/hw/scsi/virtio-scsi.c
> @@ -699,6 +699,12 @@ void virtio_scsi_common_realize(DeviceState *dev, Error **errp,
> virtio_init(vdev, "virtio-scsi", VIRTIO_ID_SCSI,
> sizeof(VirtIOSCSIConfig));
>
> + if (s->conf.num_queues <= 0 || s->conf.num_queues > VIRTIO_PCI_QUEUE_MAX) {
> + error_setg(errp, "Invalid number of queues (= %" PRId32 "), "
> + "must be a positive integer less than %d.",
> + s->conf.num_queues, VIRTIO_PCI_QUEUE_MAX);
> + return;
> + }
> s->cmd_vqs = g_malloc0(s->conf.num_queues * sizeof(VirtQueue *));
> s->sense_size = VIRTIO_SCSI_SENSE_SIZE;
> s->cdb_size = VIRTIO_SCSI_CDB_SIZE;
>
Thanks, applying to scsi-next.
Paolo
prev parent reply other threads:[~2014-08-26 11:20 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-26 6:30 [Qemu-devel] [PATCH] virtio-scsi: Report error if num_queues is 0 or too large Fam Zheng
2014-08-26 11:20 ` Paolo Bonzini [this message]
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=53FC6D73.8010401@redhat.com \
--to=pbonzini@redhat.com \
--cc=famz@redhat.com \
--cc=qemu-devel@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).