All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kevin Wolf <kwolf@redhat.com>
To: Markus Armbruster <armbru@redhat.com>
Cc: Stefan Hajnoczi <stefanha@gmail.com>,
	qemu-devel@nongnu.org, Luiz Capitulino <lcapitulino@redhat.com>
Subject: Re: [Qemu-devel] [PATCH 05/18] ide: Turn debug messages into assertions
Date: Mon, 06 Jun 2011 14:56:12 +0200	[thread overview]
Message-ID: <4DECCE6C.9010103@redhat.com> (raw)
In-Reply-To: <m3ei379nq8.fsf@blackfin.pond.sub.org>

Am 06.06.2011 13:57, schrieb Markus Armbruster:
>>>> Not sure what's the best way of fixing this. Maybe just ignoring
>>>> -snapshot for read-only block devices?
>>>
>>> Why not, the combination is pointless.
>>
>> It could start making a difference in some obscure combinations. Imagine
>> a read-only image with a backing file, -snapshot and the 'commit'
>> monitor command.
>>
>> Sounds pretty insane, but I wouldn't bet that people aren't using it...
> 
> People try all kinds of insane things.  The question is whether we can
> change it anyway.

We have a backing file chain like base <- cow [<- tmp], and the drive is
read-only.

Currently, 'commit' means that tmp is committed to cow (i.e. nothing
happens because it's read-only). After changing it, we would commit the
content of cow to base and possibly corrupt other images that are based
on base.

We can hope that nobody would be hit by it in practice, but it's not a
change I'd feel very comfortable about.

>>>>                                        Or we could try and forward the
>>>> eject request to the backing file if the format driver doesn't handle it.
>>>
>>> For what it's worth, the "raw" driver forwards manually.
>>
>> Yeah, but copying that into each driver probably isn't the right thing
>> to do.
> 
> I didn't mean to hold up the "raw" driver as a shining example of how to
> do stuff.
> 
>>        For a generic implementation we could probably first try the
>> driver itself, if it returns -ENOTSUP we try the protocol, and if that
>> returns -ENOTSUP, too, we ask the backing file driver.
> 
> I don't want to start another "format vs. protocol" semantic war, just
> point out that the general case is a tree of block drivers, and a
> general rule for passing eject up the tree better covers that.
> 
> The current block.c provides for binary trees (bs->file and
> bs->backing_hd).  When we discussed blockdev_add, we came up with much
> wilder trees.

I didn't mean to imply that you suggested raw was a shining example.
However, if we're going for the wild trees (or even graphs), there's no
simple option of doing it in generic code any more. Backing files and
protocols (for lack of a better term) are special in the tree because
they are a concept that the block layer knows. For everything else the
least we need is a hint from the block driver.

In any case passing up the tree means that you need to decide which
child is the one to try first, or if there are children to which it
shouldn't be passed at all.

Kevin

  reply	other threads:[~2011-06-06 12:53 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-19 12:33 [Qemu-devel] [PULL 00/18] Block patches Kevin Wolf
2011-05-19 12:33 ` [Qemu-devel] [PATCH 01/18] ide: cleanup warnings Kevin Wolf
2011-05-19 12:33 ` [Qemu-devel] [PATCH 02/18] posix-aio-compat: Fix idle_threads counter Kevin Wolf
2011-05-19 12:33 ` [Qemu-devel] [PATCH 03/18] qemu-img.c: Remove superfluous parenthesis Kevin Wolf
2011-05-19 12:33 ` [Qemu-devel] [PATCH 04/18] hw/xen_disk: Remove unused local variable Kevin Wolf
2011-05-19 12:33 ` [Qemu-devel] [PATCH 05/18] ide: Turn debug messages into assertions Kevin Wolf
2011-05-26 21:12   ` Luiz Capitulino
2011-05-27  6:39     ` Kevin Wolf
2011-05-27 13:12       ` Luiz Capitulino
2011-06-01 13:44     ` Luiz Capitulino
2011-06-01 14:02       ` Kevin Wolf
2011-06-01 14:07         ` Luiz Capitulino
2011-06-01 15:32         ` Markus Armbruster
2011-06-06  9:08           ` Kevin Wolf
2011-06-06 11:57             ` Markus Armbruster
2011-06-06 12:56               ` Kevin Wolf [this message]
2011-06-06 13:52                 ` Markus Armbruster
2011-06-06 15:54       ` Kevin Wolf
2011-05-19 12:33 ` [Qemu-devel] [PATCH 06/18] Add documentation for qemu_progress_{init, print}() Kevin Wolf
2011-05-19 12:33 ` [Qemu-devel] [PATCH 07/18] ahci: Fix crashes on duplicate BH registration Kevin Wolf
2011-05-19 12:33 ` [Qemu-devel] [PATCH 08/18] qemu-tool: Stub out qemu-timer functions Kevin Wolf
2011-05-19 12:33 ` [Qemu-devel] [PATCH 09/18] qed: Periodically flush and clear need check bit Kevin Wolf
2011-05-19 12:33 ` [Qemu-devel] [PATCH 10/18] qemu_img: is_not_zero() optimization Kevin Wolf
2011-05-19 12:33 ` [Qemu-devel] [PATCH 11/18] qed: support for growing images Kevin Wolf
2011-05-19 12:33 ` [Qemu-devel] [PATCH 12/18] ide: Split qdev "ide-drive" into "ide-hd" and "ide-cd" Kevin Wolf
2011-05-19 12:33 ` [Qemu-devel] [PATCH 13/18] scsi: Split qdev "scsi-disk" into "scsi-hd" and "scsi-cd" Kevin Wolf
2011-05-19 12:33 ` [Qemu-devel] [PATCH 14/18] defaults: ide-cd, ide-hd and scsi-cd devices suppress default CD-ROM Kevin Wolf
2011-05-19 12:33 ` [Qemu-devel] [PATCH 15/18] block QMP: Deprecate query-block's "type", drop info block's "type=" Kevin Wolf
2011-05-19 12:33 ` [Qemu-devel] [PATCH 16/18] blockdev: Store -drive option media in DriveInfo Kevin Wolf
2011-05-19 12:33 ` [Qemu-devel] [PATCH 17/18] block: Remove type hint, it's guest matter, doesn't belong here Kevin Wolf
2011-05-19 12:33 ` [Qemu-devel] [PATCH 18/18] ahci: Fix non-NCQ accesses for LBA > 16bits Kevin Wolf
2011-05-19 15:09 ` [Qemu-devel] [PULL 00/18] Block patches Anthony Liguori

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=4DECCE6C.9010103@redhat.com \
    --to=kwolf@redhat.com \
    --cc=armbru@redhat.com \
    --cc=lcapitulino@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@gmail.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 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.