qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@gmail.com>
To: Ryan Harper <ryanh@us.ibm.com>
Cc: Markus Armbruster <armbru@redhat.com>, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] Do not delete BlockDriverState when deleting the drive
Date: Thu, 3 Mar 2011 10:19:57 +0000	[thread overview]
Message-ID: <AANLkTine4M_1A3ppeBi7YUE1bdB4B2dLbNUkhoShD5UL@mail.gmail.com> (raw)
In-Reply-To: <20110302150342.GZ13257@us.ibm.com>

On Wed, Mar 2, 2011 at 3:03 PM, Ryan Harper <ryanh@us.ibm.com> wrote:
> +void bdrv_remove(BlockDriverState *bs)
> +{
> +    if (bs->device_name[0] != '\0') {
> +        QTAILQ_REMOVE(&bdrv_states, bs, list);
> +    }
> +}

It's not safe to invoke QTAILQ_REMOVE() twice.  Since both
do_drive_del() and bdrv_delete() call bdrv_remove(), could it be
invoked twice?  A quick fix is to set bs->device_name[0] = '\0' to
prevent the second removal.

Stefan

      reply	other threads:[~2011-03-03 10:20 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-02 15:03 [Qemu-devel] [PATCH] Do not delete BlockDriverState when deleting the drive Ryan Harper
2011-03-03 10:19 ` Stefan Hajnoczi [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=AANLkTine4M_1A3ppeBi7YUE1bdB4B2dLbNUkhoShD5UL@mail.gmail.com \
    --to=stefanha@gmail.com \
    --cc=armbru@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=ryanh@us.ibm.com \
    /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).