summaryrefslogtreecommitdiff
path: root/hw/ide
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2011-01-24 13:32:41 +0100
committerKevin Wolf <kwolf@redhat.com>2011-01-31 10:03:00 +0100
commitdb97ee6a976bacbb0d18818e951cfc41b39269a7 (patch)
tree14c8b30a7b745f84da878aab6f35220dd701b79f /hw/ide
parent6d4a2b3a47959f02e7f307f50396e70e8464f95e (diff)
downloadqemu-db97ee6a976bacbb0d18818e951cfc41b39269a7.tar.gz
block: tell drivers about an image resize
Extend the change_cb callback with a reason argument, and use it to tell drivers about size changes. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'hw/ide')
-rw-r--r--hw/ide/core.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/hw/ide/core.c b/hw/ide/core.c
index e698c13ac5..dd63664c0d 100644
--- a/hw/ide/core.c
+++ b/hw/ide/core.c
@@ -1584,11 +1584,15 @@ static void ide_cfata_metadata_write(IDEState *s)
}
/* called when the inserted state of the media has changed */
-static void cdrom_change_cb(void *opaque)
+static void cdrom_change_cb(void *opaque, int reason)
{
IDEState *s = opaque;
uint64_t nb_sectors;
+ if (!(reason & CHANGE_MEDIA)) {
+ return;
+ }
+
bdrv_get_geometry(s->bs, &nb_sectors);
s->nb_sectors = nb_sectors;