summaryrefslogtreecommitdiff
path: root/hw/sd.c
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/sd.c
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/sd.c')
-rw-r--r--hw/sd.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/hw/sd.c b/hw/sd.c
index 601545b2d9..789ca84785 100644
--- a/hw/sd.c
+++ b/hw/sd.c
@@ -422,9 +422,14 @@ static void sd_reset(SDState *sd, BlockDriverState *bdrv)
sd->pwd_len = 0;
}
-static void sd_cardchange(void *opaque)
+static void sd_cardchange(void *opaque, int reason)
{
SDState *sd = opaque;
+
+ if (!(reason & CHANGE_MEDIA)) {
+ return;
+ }
+
qemu_set_irq(sd->inserted_cb, bdrv_is_inserted(sd->bdrv));
if (bdrv_is_inserted(sd->bdrv)) {
sd_reset(sd, sd->bdrv);