From: Markus Armbruster <armbru@redhat.com>
To: qemu-devel@nongnu.org
Cc: kwolf@redhat.com, stefano.stabellini@eu.citrix.com,
lcapitulino@redhat.com, hare@suse.de, amit.shah@redhat.com,
pbonzini@redhat.com, hch@lst.de
Subject: [Qemu-devel] [PATCH v3 00/27] Block layer cleanup & fixes
Date: Tue, 6 Sep 2011 18:58:33 +0200 [thread overview]
Message-ID: <1315328340-6192-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. Kevin picked the patches pushing
media_changed from v2, so that part's gone already.
* 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.
Part I: Move tray state to device models
PATCH 01-05 IDE tray open/closed
PATCH 06-07 SCSI tray open/closed
PATCH 08-09 Kill BlockDriverState tray_open
PATCH 10-11 IDE & SCSI track tray lock
PATCH 12-14 Kill BlockDriverState locked
PATCH 15-16 IDE & SCSI tray bug fixes
PATCH 17 IDE migrate tray state
Part II: Miscellaneous
PATCH 18-19 Replace BlockDriverState removable
PATCH 20 Cover tray open/closed in info block
PATCH 21-25 Reduce unclean use of block_int.h
PATCH 26-27 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 previous versions.
* Hannes ACKed the SCSI stuff in v2.
* Luiz reviewed the patches that affect QMP's query-block. I renamed
response member "ejected" to "tray-open" since then.
* Paolo commented PATCH 17 `ide/atapi: Preserve tray state on
migration'.
* Stefano reviewed v1 of PATCH 18 (affects "-drive if=xen").
Testing
* Linux installs from CD to empty disk, then boots fine from disk.
* 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
- 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)
v3:
* Rebased to block branch cfc606da
- Old PATCH 01-05,25,28-34,40 already there, drop
- a couple of simple conflicts in hw/scsi-disk.c
* Drop old PATCH v2 27 scsi-disk: Preserve tray state on migration,
because it doesn't make much sense without working SCSI migration.
* Drop old PATCH v2 22 ide/atapi: Avoid physical/virtual tray state
mismatch, because it has a bug, how to best fix it isn't obvious,
and it's not essential to this series. Drop related PATCH v2 20,24,
too. I plan to revisit them later.
* Clean up `ide: Use a table to declare which drive kinds accept each
command' a bit (Blue & Kevin)
* Hannes's advice:
- Rename some SCSISense variables
* Kevin's advice:
- Add comments to explain MMC-5 jargon loej
- Make bdrv_lock_medium() parameter locked bool.
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 (27):
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/atapi: Don't fail eject when tray is already open
scsi-disk: Fix START_STOP to fail when it can't eject
ide/atapi: Preserve tray state on migration
block: Clean up remaining users of "removable"
block: Drop BlockDriverState member removable
block: Show whether the virtual tray is open in info block
block: Move BlockConf & friends from block_int.h to block.h
hw: Trim superfluous #include "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 | 104 ++++++++++++++++++---------------
block.h | 63 ++++++++++++++++++--
block/nbd.c | 1 +
block/raw-posix.c | 8 +-
block/raw.c | 6 +-
block_int.h | 40 +------------
blockdev.c | 10 +--
hw/fdc.c | 4 +-
hw/ide/atapi.c | 58 +++++++++----------
hw/ide/cmd646.c | 1 -
hw/ide/core.c | 160 +++++++++++++++++++++++++++++++++++++++++---------
hw/ide/ich.c | 1 -
hw/ide/internal.h | 3 +-
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/via.c | 1 -
hw/lsi53c895a.c | 1 -
hw/scsi-bus.c | 10 +++
hw/scsi-disk.c | 69 +++++++++++++++++++---
hw/scsi-generic.c | 1 -
hw/scsi.h | 5 +-
hw/sd.c | 2 +-
hw/virtio-blk.c | 3 +-
hw/virtio.h | 2 +-
nbd.c | 1 +
nbd.h | 2 -
qmp-commands.hx | 2 +
trace-events | 1 +
31 files changed, 367 insertions(+), 197 deletions(-)
--
1.7.6
next reply other threads:[~2011-09-06 16:59 UTC|newest]
Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-06 16:58 Markus Armbruster [this message]
2011-09-06 16:58 ` [Qemu-devel] [PATCH v3 01/27] ide: Fix ATA command READ to set ATAPI signature for CD-ROM Markus Armbruster
2011-09-06 16:58 ` [Qemu-devel] [PATCH v3 02/27] ide: Use a table to declare which drive kinds accept each command Markus Armbruster
2011-09-07 15:40 ` Kevin Wolf
2011-09-08 7:05 ` Markus Armbruster
2011-09-06 16:58 ` [Qemu-devel] [PATCH v3 03/27] ide: Reject ATA commands specific to drive kinds Markus Armbruster
2011-09-06 16:58 ` [Qemu-devel] [PATCH v3 04/27] ide/atapi: Clean up misleading name in cmd_start_stop_unit() Markus Armbruster
2011-09-06 16:58 ` [Qemu-devel] [PATCH v3 05/27] ide/atapi: Track tray open/close state Markus Armbruster
2011-09-06 16:58 ` [Qemu-devel] [PATCH v3 06/27] scsi-disk: Factor out scsi_disk_emulate_start_stop() Markus Armbruster
2011-09-07 7:04 ` Paolo Bonzini
2011-09-06 16:58 ` [Qemu-devel] [PATCH v3 07/27] scsi-disk: Track tray open/close state Markus Armbruster
2011-09-07 7:05 ` Paolo Bonzini
2011-09-06 16:58 ` [Qemu-devel] [PATCH v3 08/27] block: Revert entanglement of bdrv_is_inserted() with tray status Markus Armbruster
2011-09-06 16:58 ` [Qemu-devel] [PATCH v3 09/27] block: Drop tray status tracking, no longer used Markus Armbruster
2011-09-06 16:58 ` [Qemu-devel] [PATCH v3 10/27] ide/atapi: Track tray locked state Markus Armbruster
2011-09-06 16:58 ` [Qemu-devel] [PATCH v3 11/27] scsi-disk: " Markus Armbruster
2011-09-07 7:05 ` Paolo Bonzini
2011-09-06 16:58 ` [Qemu-devel] [PATCH v3 12/27] block: Leave enforcing tray lock to device models Markus Armbruster
2011-09-06 16:58 ` [Qemu-devel] [PATCH v3 13/27] block: Drop medium lock tracking, ask device models instead Markus Armbruster
2011-09-07 7:06 ` Paolo Bonzini
2011-09-06 16:58 ` [Qemu-devel] [PATCH v3 14/27] block: Rename bdrv_set_locked() to bdrv_lock_medium() Markus Armbruster
2011-09-07 15:53 ` Kevin Wolf
2011-09-08 7:06 ` Markus Armbruster
2011-09-06 16:58 ` [Qemu-devel] [PATCH v3 15/27] ide/atapi: Don't fail eject when tray is already open Markus Armbruster
2011-09-06 16:58 ` [Qemu-devel] [PATCH v3 16/27] scsi-disk: Fix START_STOP to fail when it can't eject Markus Armbruster
2011-09-07 7:08 ` Paolo Bonzini
2011-09-06 16:58 ` [Qemu-devel] [PATCH v3 17/27] ide/atapi: Preserve tray state on migration Markus Armbruster
2011-09-07 7:14 ` Paolo Bonzini
2011-09-07 7:35 ` Kevin Wolf
2011-09-07 8:00 ` Paolo Bonzini
2011-09-06 16:58 ` [Qemu-devel] [PATCH v3 18/27] block: Clean up remaining users of "removable" Markus Armbruster
2011-09-06 16:58 ` [Qemu-devel] [PATCH v3 19/27] block: Drop BlockDriverState member removable Markus Armbruster
2011-09-06 16:58 ` [Qemu-devel] [PATCH v3 20/27] block: Show whether the virtual tray is open in info block Markus Armbruster
2011-09-06 16:58 ` [Qemu-devel] [PATCH v3 21/27] block: Move BlockConf & friends from block_int.h to block.h Markus Armbruster
2011-09-06 16:58 ` [Qemu-devel] [PATCH v3 22/27] hw: Trim superfluous #include "block_int.h" Markus Armbruster
2011-09-06 16:58 ` [Qemu-devel] [PATCH v3 23/27] block: New bdrv_set_buffer_alignment() Markus Armbruster
2011-09-06 16:58 ` [Qemu-devel] [PATCH v3 24/27] block: Reset buffer alignment on detach Markus Armbruster
2011-09-06 16:58 ` [Qemu-devel] [PATCH v3 25/27] nbd: Clean up use of block_int.h Markus Armbruster
2011-09-06 16:58 ` [Qemu-devel] [PATCH v3 26/27] block: New change_media_cb() parameter load Markus Armbruster
2011-09-06 16:59 ` [Qemu-devel] [PATCH v3 27/27] ide/atapi scsi-disk: Make monitor eject -f, then change work Markus Armbruster
2011-09-07 7:09 ` Paolo Bonzini
2011-09-08 11:40 ` [Qemu-devel] [PATCH v3 00/27] Block layer cleanup & fixes 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=1315328340-6192-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=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--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 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).