qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Igor Mammedov <imammedo@redhat.com>
Cc: pbonzini@redhat.com, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH for-2.4 v3 3/3] vhost: fail backend intialization if memslots number is more than its supported limit
Date: Thu, 30 Jul 2015 18:29:49 +0300	[thread overview]
Message-ID: <20150730182849-mutt-send-email-mst@redhat.com> (raw)
In-Reply-To: <1438251119-285996-4-git-send-email-imammedo@redhat.com>

On Thu, Jul 30, 2015 at 12:11:59PM +0200, Igor Mammedov wrote:
> Signed-off-by: Igor Mammedov <imammedo@redhat.com>
> ---
>  hw/virtio/vhost.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c
> index bcbad48..48fbac1 100644
> --- a/hw/virtio/vhost.c
> +++ b/hw/virtio/vhost.c
> @@ -985,6 +985,12 @@ int vhost_dev_init(struct vhost_dev *hdev, void *opaque,
>      hdev->started = false;
>      hdev->memory_changed = false;
>      memory_listener_register(&hdev->memory_listener, &address_space_memory);
> +    if (!vhost_has_free_slot()) {

I think this one needs a different test: we are not adding
a new slot so just checking <= there should be
enough.


> +        fprintf(stderr, "vhost backend memory slots limit is less"
> +                " than current number of present memory slots\n");
> +        vhost_dev_cleanup(hdev);
> +        return -1;
> +    }
>      return 0;
>  fail_vq:
>      while (--i >= 0) {
> -- 
> 1.8.3.1

      reply	other threads:[~2015-07-30 15:30 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-30 10:11 [Qemu-devel] [PATCH for-2.4 v3 0/3] vhost: check if vhost has capacity for hotplugged memory Igor Mammedov
2015-07-30 10:11 ` [Qemu-devel] [PATCH for-2.4 v3 1/3] vhost: add vhost_has_free_slot() interface Igor Mammedov
2015-07-30 15:28   ` Michael S. Tsirkin
2015-07-30 15:45     ` Igor Mammedov
2015-07-30 15:51       ` Michael S. Tsirkin
2015-07-30 10:11 ` [Qemu-devel] [PATCH for-2.4 v3 2/3] pc-dimm: add vhost slots limit check before commiting to hotplug Igor Mammedov
2015-07-30 10:11 ` [Qemu-devel] [PATCH for-2.4 v3 3/3] vhost: fail backend intialization if memslots number is more than its supported limit Igor Mammedov
2015-07-30 15:29   ` Michael S. Tsirkin [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=20150730182849-mutt-send-email-mst@redhat.com \
    --to=mst@redhat.com \
    --cc=imammedo@redhat.com \
    --cc=pbonzini@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).