From: Markus Armbruster <armbru@redhat.com>
To: qemu-devel@nongnu.org
Cc: kwolf@redhat.com, quintela@redhat.com,
stefano.stabellini@eu.citrix.com, lcapitulino@redhat.com,
hare@suse.de, amit.shah@redhat.com, hch@lst.de
Subject: [Qemu-devel] [PATCH v2 00/45] Block layer cleanup & fixes
Date: Wed, 3 Aug 2011 15:07:39 +0200 [thread overview]
Message-ID: <1312376904-16115-1-git-send-email-armbru@redhat.com> (raw)
This patch series looks bigger than it is. All the patches are small
and hopefully easy to review.
Objectives:
* Push BlockDriverState members locked, tray_open, media_changed into
device models, where they belong.
* BlockDriverState member removable is a confusing mess, replace it.
* Improve eject -f.
Also clean up minor messes as they get in the way.
It is based on Kevin's block branch f08df41b.
Part I: Preliminaries
PATCH 01-03: Work on block layer interface for device models
Part II: Move tray state to device models
PATCH 04-10 IDE tray open/closed
PATCH 11-12 SCSI tray open/closed
PATCH 13-14 block layer kill tray_open
PATCH 15-16 IDE & SCSI tray lock
PATCH 17-19 block layer kill locked
PATCH 20-24 IDE & SCSI tray bug fixes
PATCH 25-27 IDE & SCSI migrate tray state
PATCH 28-30 block layer & fdc media_changed
Part III: Replace removable
PATCH 31-34 clean up inappopriate uses of removable
PATCH 35-36 replace remaining users
Part IV: Miscellaneous
PATCH 37 cover tray open/closed in info block
PATCH 38-43 Reduce unclean use of block_int.h
PATCH 44-45 Improve eject -f
Naturally, I want all parts applied. But I did my best to make
applying only a prefix workable, too.
Review invited from:
* Kevin, Christoph and Amit reviewed v1.
* Hannes commented on the SCSI stuff in v1.
* Luiz, the following patches affect QMP's query-block: PATCH 35
`block: Clean up remaining users of "removable"' and PATCH 38
`block: Show whether the guest ejected the medium in info block'.
* Juan, please review PATCH 26 `ide/atapi: Preserve tray state on
migration', PATCH 27 `scsi-disk: Preserve tray state on migration',
and PATCH 32 `savevm: Include writable devices with removable
media'.
* Andrzej commented to v1 of PATCH 34 `spitz tosa: Simplify "drive is
suitable for microdrive" test'. It is unchanged.
* Stefano, you reviewed v1 of PATCH 35 (affects "-drive if=xen").
Please have a look at new PATCH 33 `xen: Clean up
pci_piix3_xen_ide_unplug()'s test for "not a CD"'.
Testing
* Both master and the block branch are broken for me by Avi's memory
API work (Avi reproduced, and claims to have a fix), so for testing
I had to rebase the block branch on an older master cde1a700 plus my
dependencies: some Xen work e3745602..679f4f8b, and some nand work
64de0e46..63efb1d9.
* Linux boots, both from HD and CD.
* For both IDE and SCSI:
- info block reports tray state correctly
- Guest locking the tray stops eject (without -f) and change
- eject -f; change works even while tray is locked by guest
- Physical tray state tracks the virtual one (file=/dev/sr0)
- Reading /dev/sr0 with tray open behaves as before: IDE closes the
tray and reads (matches bare metal), SCSI reports no medium
- Tray state is migrated correctly (tested with savevm/loadvm)
* Guest still notices CD media change (IDE only, SCSI doesn't work
before or after my patches because GESN isn't implemented)
* Migrating ide-cd to older version works when tray is closed and
unlocked, else fails (tested with savevm/loadvm)
* Migrating scsi-cd to older version fails
* Linux detects fdc media change (from monitor)
* savevm and loadvm snapshot read/write floppy
* spitz and tosa initialize their microdrive as before (PATCH 34;
tested with -S -M {spitz,tosa}, didn't actually try to boot)
Not tested:
* BlockDriver "host_floppy"
Lack the hardware. Like pretty much everybody not running a
computer museum.
Is keeping BlockDriver "host_floppy" around still worth our while?
If the answer is no, I'm happy to respin with PATCH 28-30 replaced
by a single patch to remove it, and simplify block.c and hw/fdc.c.
v2:
* Rebased to block branch; non-trivial conflicts:
- Old PATCH 01-02,06-09 already there, drop
- `block: Attach non-qdev devices as well':
- cover new pci_piix3_xen_ide_unplug()
- hw/nand has been qdefivied, drop hunk
- onenand_init() changed, rewrite hunk
- pci_piix3_xen_ide_unplug() needs new PATCH 33.
* Drop old PATCH 18 `scsi-disk: Reject CD-specific SCSI commands to
disks' because Hannes wants to do it differently, and it's not
essential to this series.
* Christoph's advice:
- Rework `ide: Update command code definitions as per ACS-2'
- Add comment to `ide: Fix ATA command READ to set ATAPI signature
for CD-ROM'
- Squash `ide/atapi: Track tray open/close state' and `ide/atapi:
Switch from BlockDriverState's tray_open to own'
- Squash `ide/atapi: Track tray locked state' and `ide/atapi: Switch
from BlockDriverState's locked to own tray_locked'
- Squash `scsi-disk: Track tray locked state' and `scsi-disk: Switch
from BlockDriverState's locked to own tray_locked'
- Drop `block: Move BlockDriverAIOCB & friends from block_int.h to
block.h'
* Luiz's advice:
- Change query-block to always include "ejected" for removable
devices. Requires moving `block: Show whether the guest ejected
the medium in info block', which causes a bunch of conflicts.
* A few cosmetic improvements
Markus Armbruster (45):
block: Attach non-qdev devices as well
block: Generalize change_cb() to BlockDevOps
block: Split change_cb() into change_media_cb(), resize_cb()
ide: Update command code definitions as per ACS-2 Table B.2
ide: Clean up case label indentation in ide_exec_cmd()
ide: Fix ATA command READ to set ATAPI signature for CD-ROM
ide: Use a table to declare which drive kinds accept each command
ide: Reject ATA commands specific to drive kinds
ide/atapi: Clean up misleading name in cmd_start_stop_unit()
ide/atapi: Track tray open/close state
scsi-disk: Factor out scsi_disk_emulate_start_stop()
scsi-disk: Track tray open/close state
block: Revert entanglement of bdrv_is_inserted() with tray status
block: Drop tray status tracking, no longer used
ide/atapi: Track tray locked state
scsi-disk: Track tray locked state
block: Leave enforcing tray lock to device models
block: Drop medium lock tracking, ask device models instead
block: Rename bdrv_set_locked() to bdrv_lock_medium()
ide: Provide IDEDeviceInfo method exit()
ide/atapi: Don't fail eject when tray is already open
ide/atapi: Avoid physical/virtual tray state mismatch
scsi-disk: Fix START_STOP to fail when it can't eject
scsi-disk: Avoid physical/virtual tray state mismatch
ide: Give vmstate structs internal linkage where possible
ide/atapi: Preserve tray state on migration
scsi-disk: Preserve tray state on migration
block/raw: Fix to forward method bdrv_media_changed()
block: Leave tracking media change to device models
fdc: Make media change detection more robust
block: Clean up bdrv_flush_all()
savevm: Include writable devices with removable media
xen: Clean up pci_piix3_xen_ide_unplug()'s test for "not a CD"
spitz tosa: Simplify "drive is suitable for microdrive" test
block: Clean up remaining users of "removable"
block: Drop BlockDriverState member removable
block: Show whether the guest ejected the medium in info block
block: Move BlockConf & friends from block_int.h to block.h
hw: Trim superfluous #include "block_int.h"
block: Declare qemu_blockalign() in block.h, not block_int.h
block: New bdrv_set_buffer_alignment()
block: Reset buffer alignment on detach
nbd: Clean up use of block_int.h
block: New change_media_cb() parameter load
ide/atapi scsi-disk: Make monitor eject -f, then change work
block.c | 195 +++++++++++++++++++++++++++-----------------------
block.h | 90 ++++++++++++++++++++---
block/nbd.c | 1 +
block/raw-posix.c | 8 +-
block/raw.c | 13 +++-
block_int.h | 54 ++-------------
blockdev.c | 15 ++---
hw/fdc.c | 48 ++++++-------
hw/ide/atapi.c | 58 +++++++--------
hw/ide/cmd646.c | 1 -
hw/ide/core.c | 196 ++++++++++++++++++++++++++++++++++++++------------
hw/ide/ich.c | 1 -
hw/ide/internal.h | 175 ++++++++++++++++++++++++---------------------
hw/ide/isa.c | 1 -
hw/ide/macio.c | 1 -
hw/ide/microdrive.c | 1 -
hw/ide/mmio.c | 1 -
hw/ide/pci.c | 1 -
hw/ide/piix.c | 7 +-
hw/ide/qdev.c | 30 ++++++++
hw/ide/via.c | 1 -
hw/lsi53c895a.c | 1 -
hw/onenand.c | 4 +-
hw/pflash_cfi01.c | 1 +
hw/pflash_cfi02.c | 1 +
hw/qdev-properties.c | 6 +-
hw/scsi-bus.c | 10 +++
hw/scsi-disk.c | 111 ++++++++++++++++++++++++++---
hw/scsi-generic.c | 1 -
hw/scsi.h | 5 +-
hw/sd.c | 14 ++--
hw/spitz.c | 10 +--
hw/tosa.c | 10 +--
hw/usb-msd.c | 2 +-
hw/virtio-blk.c | 15 ++--
hw/virtio.h | 2 +-
hw/xen_disk.c | 1 +
nbd.c | 1 +
nbd.h | 2 -
qmp-commands.hx | 2 +
savevm.c | 4 +-
trace-events | 2 +-
42 files changed, 690 insertions(+), 413 deletions(-)
--
1.7.6
next reply other threads:[~2011-08-03 13:08 UTC|newest]
Thread overview: 105+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-03 13:07 Markus Armbruster [this message]
2011-08-03 13:07 ` [Qemu-devel] [PATCH v2 01/45] block: Attach non-qdev devices as well Markus Armbruster
2011-08-03 13:07 ` [Qemu-devel] [PATCH v2 02/45] block: Generalize change_cb() to BlockDevOps Markus Armbruster
2011-08-03 13:07 ` [Qemu-devel] [PATCH v2 03/45] block: Split change_cb() into change_media_cb(), resize_cb() Markus Armbruster
2011-08-03 13:07 ` [Qemu-devel] [PATCH v2 04/45] ide: Update command code definitions as per ACS-2 Table B.2 Markus Armbruster
2011-08-03 13:07 ` [Qemu-devel] [PATCH v2 05/45] ide: Clean up case label indentation in ide_exec_cmd() Markus Armbruster
2011-08-03 13:07 ` [Qemu-devel] [PATCH v2 06/45] ide: Fix ATA command READ to set ATAPI signature for CD-ROM Markus Armbruster
2011-08-03 13:07 ` [Qemu-devel] [PATCH v2 07/45] ide: Use a table to declare which drive kinds accept each command Markus Armbruster
2011-08-03 16:53 ` Blue Swirl
2011-08-03 17:15 ` Markus Armbruster
2011-09-02 10:08 ` Kevin Wolf
2011-09-02 14:43 ` Markus Armbruster
2011-08-03 13:07 ` [Qemu-devel] [PATCH v2 08/45] ide: Reject ATA commands specific to drive kinds Markus Armbruster
2011-08-03 13:07 ` [Qemu-devel] [PATCH v2 09/45] ide/atapi: Clean up misleading name in cmd_start_stop_unit() Markus Armbruster
2011-09-02 10:20 ` Kevin Wolf
2011-09-02 14:47 ` Markus Armbruster
2011-08-03 13:07 ` [Qemu-devel] [PATCH v2 10/45] ide/atapi: Track tray open/close state Markus Armbruster
2011-09-02 10:23 ` Kevin Wolf
2011-09-02 14:51 ` Markus Armbruster
2011-08-03 13:07 ` [Qemu-devel] [PATCH v2 11/45] scsi-disk: Factor out scsi_disk_emulate_start_stop() Markus Armbruster
2011-08-04 6:12 ` Hannes Reinecke
2011-09-02 10:26 ` Kevin Wolf
2011-09-02 14:55 ` Markus Armbruster
2011-08-03 13:07 ` [Qemu-devel] [PATCH v2 12/45] scsi-disk: Track tray open/close state Markus Armbruster
2011-08-04 6:13 ` Hannes Reinecke
2011-08-03 13:07 ` [Qemu-devel] [PATCH v2 13/45] block: Revert entanglement of bdrv_is_inserted() with tray status Markus Armbruster
2011-08-03 13:07 ` [Qemu-devel] [PATCH v2 14/45] block: Drop tray status tracking, no longer used Markus Armbruster
2011-08-03 13:07 ` [Qemu-devel] [PATCH v2 15/45] ide/atapi: Track tray locked state Markus Armbruster
2011-09-02 11:02 ` Kevin Wolf
2011-09-02 14:56 ` Markus Armbruster
2011-08-03 13:07 ` [Qemu-devel] [PATCH v2 16/45] scsi-disk: " Markus Armbruster
2011-08-04 6:14 ` Hannes Reinecke
2011-08-04 6:39 ` Markus Armbruster
2011-08-04 6:46 ` Hannes Reinecke
2011-08-04 7:25 ` Markus Armbruster
2011-08-04 7:30 ` Hannes Reinecke
2011-08-03 13:07 ` [Qemu-devel] [PATCH v2 17/45] block: Leave enforcing tray lock to device models Markus Armbruster
2011-08-03 13:07 ` [Qemu-devel] [PATCH v2 18/45] block: Drop medium lock tracking, ask device models instead Markus Armbruster
2011-08-03 13:07 ` [Qemu-devel] [PATCH v2 19/45] block: Rename bdrv_set_locked() to bdrv_lock_medium() Markus Armbruster
2011-09-02 11:30 ` Kevin Wolf
2011-09-02 14:58 ` Markus Armbruster
2011-08-03 13:07 ` [Qemu-devel] [PATCH v2 20/45] ide: Provide IDEDeviceInfo method exit() Markus Armbruster
2011-08-04 17:48 ` Luiz Capitulino
2011-08-05 7:13 ` Markus Armbruster
2011-08-03 13:08 ` [Qemu-devel] [PATCH v2 21/45] ide/atapi: Don't fail eject when tray is already open Markus Armbruster
2011-08-03 13:08 ` [Qemu-devel] [PATCH v2 22/45] ide/atapi: Avoid physical/virtual tray state mismatch Markus Armbruster
2011-09-02 12:07 ` Kevin Wolf
2011-09-02 15:19 ` Markus Armbruster
2011-08-03 13:08 ` [Qemu-devel] [PATCH v2 23/45] scsi-disk: Fix START_STOP to fail when it can't eject Markus Armbruster
2011-08-04 6:20 ` Hannes Reinecke
2011-08-04 6:48 ` Markus Armbruster
2011-08-03 13:08 ` [Qemu-devel] [PATCH v2 24/45] scsi-disk: Avoid physical/virtual tray state mismatch Markus Armbruster
2011-08-04 6:21 ` Hannes Reinecke
2011-08-03 13:08 ` [Qemu-devel] [PATCH v2 25/45] ide: Give vmstate structs internal linkage where possible Markus Armbruster
2011-08-03 13:08 ` [Qemu-devel] [PATCH v2 26/45] ide/atapi: Preserve tray state on migration Markus Armbruster
2011-09-02 12:20 ` Kevin Wolf
2011-09-02 12:35 ` Paolo Bonzini
2011-09-02 15:22 ` Markus Armbruster
2011-09-02 15:25 ` Paolo Bonzini
2011-09-02 15:20 ` Markus Armbruster
2011-09-02 15:59 ` Kevin Wolf
2011-08-03 13:08 ` [Qemu-devel] [PATCH v2 27/45] scsi-disk: " Markus Armbruster
2011-08-04 6:23 ` Hannes Reinecke
2011-08-04 6:45 ` Paolo Bonzini
2011-08-04 9:57 ` Kevin Wolf
2011-09-02 12:25 ` Kevin Wolf
2011-09-02 15:35 ` Markus Armbruster
2011-09-02 16:18 ` Kevin Wolf
2011-09-02 16:45 ` Markus Armbruster
2011-08-03 13:08 ` [Qemu-devel] [PATCH v2 28/45] block/raw: Fix to forward method bdrv_media_changed() Markus Armbruster
2011-08-03 13:08 ` [Qemu-devel] [PATCH v2 29/45] block: Leave tracking media change to device models Markus Armbruster
2011-08-03 13:08 ` [Qemu-devel] [PATCH v2 30/45] fdc: Make media change detection more robust Markus Armbruster
2011-08-03 13:08 ` [Qemu-devel] [PATCH v2 31/45] block: Clean up bdrv_flush_all() Markus Armbruster
2011-08-03 13:08 ` [Qemu-devel] [PATCH v2 32/45] savevm: Include writable devices with removable media Markus Armbruster
2011-08-03 13:08 ` [Qemu-devel] [PATCH v2 33/45] xen: Clean up pci_piix3_xen_ide_unplug()'s test for "not a CD" Markus Armbruster
2011-08-03 13:08 ` [Qemu-devel] [PATCH v2 34/45] spitz tosa: Simplify "drive is suitable for microdrive" test Markus Armbruster
2011-08-03 13:08 ` [Qemu-devel] [PATCH v2 35/45] block: Clean up remaining users of "removable" Markus Armbruster
2011-08-04 17:58 ` Luiz Capitulino
2011-08-03 13:08 ` [Qemu-devel] [PATCH v2 36/45] block: Drop BlockDriverState member removable Markus Armbruster
2011-08-03 13:08 ` [Qemu-devel] [PATCH v2 37/45] block: Show whether the guest ejected the medium in info block Markus Armbruster
2011-08-04 18:05 ` Luiz Capitulino
2011-09-02 13:04 ` Kevin Wolf
2011-09-02 15:29 ` Markus Armbruster
2011-09-02 16:22 ` Kevin Wolf
2011-08-03 13:08 ` [Qemu-devel] [PATCH v2 38/45] block: Move BlockConf & friends from block_int.h to block.h Markus Armbruster
2011-08-03 13:08 ` [Qemu-devel] [PATCH v2 39/45] hw: Trim superfluous #include "block_int.h" Markus Armbruster
2011-08-03 13:08 ` [Qemu-devel] [PATCH v2 40/45] block: Declare qemu_blockalign() in block.h, not block_int.h Markus Armbruster
2011-08-04 18:10 ` Luiz Capitulino
2011-08-04 18:22 ` Markus Armbruster
2011-08-04 18:28 ` Luiz Capitulino
2011-08-03 13:08 ` [Qemu-devel] [PATCH v2 41/45] block: New bdrv_set_buffer_alignment() Markus Armbruster
2011-09-02 13:13 ` Kevin Wolf
2011-09-02 15:30 ` Markus Armbruster
2011-09-02 16:25 ` Kevin Wolf
2011-09-02 16:53 ` Markus Armbruster
2011-08-03 13:08 ` [Qemu-devel] [PATCH v2 42/45] block: Reset buffer alignment on detach Markus Armbruster
2011-09-02 13:20 ` Kevin Wolf
2011-09-02 15:32 ` Markus Armbruster
2011-08-03 13:08 ` [Qemu-devel] [PATCH v2 43/45] nbd: Clean up use of block_int.h Markus Armbruster
2011-08-03 13:08 ` [Qemu-devel] [PATCH v2 44/45] block: New change_media_cb() parameter load Markus Armbruster
2011-09-02 13:26 ` Kevin Wolf
2011-09-02 15:33 ` Markus Armbruster
2011-08-03 13:08 ` [Qemu-devel] [PATCH v2 45/45] ide/atapi scsi-disk: Make monitor eject -f, then change work Markus Armbruster
2011-08-04 15:54 ` [Qemu-devel] [PATCH v2 00/45] Block layer cleanup & fixes Avi Kivity
2011-09-02 13:37 ` Kevin Wolf
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=1312376904-16115-1-git-send-email-armbru@redhat.com \
--to=armbru@redhat.com \
--cc=amit.shah@redhat.com \
--cc=hare@suse.de \
--cc=hch@lst.de \
--cc=kwolf@redhat.com \
--cc=lcapitulino@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=quintela@redhat.com \
--cc=stefano.stabellini@eu.citrix.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.