From: "Michael S. Tsirkin" <mst@redhat.com>
To: Jes.Sorensen@redhat.com
Cc: qemu-devel@nongnu.org
Subject: [Qemu-devel] Re: [PATCH] vhost_dev_unassign_memory() don't assert if removing first entry in list.
Date: Sat, 24 Jul 2010 22:03:00 +0300 [thread overview]
Message-ID: <20100724190300.GB3728@redhat.com> (raw)
In-Reply-To: <1279898202-7223-1-git-send-email-Jes.Sorensen@redhat.com>
On Fri, Jul 23, 2010 at 05:16:42PM +0200, Jes.Sorensen@redhat.com wrote:
> From: Jes Sorensen <Jes.Sorensen@redhat.com>
>
> If removing an entry from the list which is fully included in the
> region and this is the first entry in the list. In this case 'to' can
> go to -1, which is perfectly valid. Don't assert() on this case.
>
> Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
> ---
> hw/vhost.c | 1 -
> 1 files changed, 0 insertions(+), 1 deletions(-)
>
> diff --git a/hw/vhost.c b/hw/vhost.c
> index d37a66e..f30cf91 100644
> --- a/hw/vhost.c
> +++ b/hw/vhost.c
> @@ -119,7 +119,6 @@ static void vhost_dev_unassign_memory(struct vhost_dev *dev,
> if (start_addr <= reg->guest_phys_addr && memlast >= reglast) {
> --dev->mem->nregions;
> --to;
> - assert(to >= 0);
> ++overlap_middle;
> continue;
> }
Good catch.
I think I must have meant dev->mem->nregions >= 0. Does this work
if you put in that assertion, or did I miss something else?
> --
> 1.7.1.1
next prev parent reply other threads:[~2010-07-24 19:08 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-07-23 15:16 [Qemu-devel] [PATCH] vhost_dev_unassign_memory() don't assert if removing first entry in list Jes.Sorensen
2010-07-24 19:03 ` Michael S. Tsirkin [this message]
2010-07-26 6:49 ` [Qemu-devel] " Jes Sorensen
2010-07-26 9:30 ` Michael S. Tsirkin
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=20100724190300.GB3728@redhat.com \
--to=mst@redhat.com \
--cc=Jes.Sorensen@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.