]> git.proxmox.com Git - mirror_qemu.git/commit - vl.c
block: Geometry and translation hints are now useless, purge them
authorMarkus Armbruster <armbru@redhat.com>
Tue, 10 Jul 2012 09:12:50 +0000 (11:12 +0200)
committerKevin Wolf <kwolf@redhat.com>
Tue, 17 Jul 2012 14:48:31 +0000 (16:48 +0200)
commit2b584959ed300ddff4acba0d7554becad5f274fd
treeab5b71c96edf1e96951fddb0497c02e0cddc9dee
parent856dcba23ad2aeea4d98d5d3c97cd46aac0cd073
block: Geometry and translation hints are now useless, purge them

There are two producers of these hints: drive_init() on behalf of
-drive, and hd_geometry_guess().

The only consumer of the hint is hd_geometry_guess().

The callers of hd_geometry_guess() call it only when drive_init()
didn't set the hints.  Therefore, drive_init()'s hints are never used.

Thus, hd_geometry_guess() only ever sees hints it produced itself in a
prior call.  Only the first call computes something, subsequent calls
just repeat the first call's results.  However, hd_geometry_guess() is
never called more than once: the device models don't, and the block
device is destroyed on unplug.  Thus, dropping the repeat feature
doesn't break anything now.

If a block device wasn't destroyed on unplug and could be reused with
a new device, then repeating old results would be wrong.  Thus,
dropping the repeat feature prevents future breakage.

This renders the hints unused.  Purge them from the block layer.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block.c
block.h
block_int.h
blockdev.c
hw/block-common.h
hw/hd-geometry.c
hw/pc.c
hw/qdev-properties.c
vl.c