diff options
author | Christoph Hellwig <hch@lst.de> | 2011-01-24 13:32:41 +0100 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2011-01-31 10:03:00 +0100 |
commit | db97ee6a976bacbb0d18818e951cfc41b39269a7 (patch) | |
tree | 14c8b30a7b745f84da878aab6f35220dd701b79f /hw/ide | |
parent | 6d4a2b3a47959f02e7f307f50396e70e8464f95e (diff) | |
download | qemu-db97ee6a976bacbb0d18818e951cfc41b39269a7.zip qemu-db97ee6a976bacbb0d18818e951cfc41b39269a7.tar.gz qemu-db97ee6a976bacbb0d18818e951cfc41b39269a7.tar.bz2 |
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.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/hw/ide/core.c b/hw/ide/core.c index e698c13..dd63664 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; |