All of lore.kernel.org
 help / color / mirror / Atom feed
From: Max Reitz <mreitz@redhat.com>
To: "Benoît Canet" <benoit.canet@irqsave.net>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] Open by references and close on exit
Date: Thu, 13 Feb 2014 19:05:50 +0100	[thread overview]
Message-ID: <52FD097E.2070707@redhat.com> (raw)
In-Reply-To: <20140212171621.GA4225@irqsave.net>

Hi Benoît,

Hm, opening a reference should only result in the refcount of the 
respective BDS being incremented through bdrv_ref(). Since no new BDS is 
created, nothing should be added to bdrv_states. When the BDS “closed” 
through bdrv_unref(), it is only actually closed/deleted if the refcount 
reaches zero. Until then, it remains in bdrv_states so it can be 
referenced (since it has not been closed) and closed through 
bdrv_close_all().

I don't really see how bdrv_close_all() closes the BDS “a second time” – 
bdrv_unref() should only close the BDS if its refcount reaches zero. And 
if that's the case, it should be removed from bdrv_states anyway.


Kind regards,

Max

      reply	other threads:[~2014-02-13 18:03 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-12 17:16 [Qemu-devel] Open by references and close on exit Benoît Canet
2014-02-13 18:05 ` Max Reitz [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=52FD097E.2070707@redhat.com \
    --to=mreitz@redhat.com \
    --cc=benoit.canet@irqsave.net \
    --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.