aboutsummaryrefslogtreecommitdiff
path: root/hw/ide/core.c
diff options
context:
space:
mode:
Diffstat (limited to 'hw/ide/core.c')
-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;