static void ide_cd_change_cb(void *opaque, bool load)

{

    IDEState *s = opaque;

    uint64_t nb_sectors;



    s->tray_open = !load;

    bdrv_get_geometry(s->bs, &nb_sectors);

    s->nb_sectors = nb_sectors;



    /*

     * First indicate to the guest that a CD has been removed.  That's

     * done on the next command the guest sends us.

     *

     * Then we set UNIT_ATTENTION, by which the guest will

     * detect a new CD in the drive.  See ide_atapi_cmd() for details.

     */

    s->cdrom_changed = 1;

    s->events.new_media = true;

    s->events.eject_request = false;

    ide_set_irq(s->bus);

}

static void ide_cd_change_cb(void *opaque, bool load)

{

    IDEState *s = opaque;

    uint64_t nb_sectors;



    s->tray_open = !load;

    bdrv_get_geometry(s->bs, &nb_sectors);

    s->nb_sectors = nb_sectors;



    













    s->cdrom_changed = 1;

    s->events.new_media = true;

    s->events.eject_request = false;

    ide_set_irq(s->bus);

}

static void FUNC_0(void *VAR_0, bool VAR_1)

{

    IDEState *s = VAR_0;

    uint64_t nb_sectors;



    s->tray_open = !VAR_1;

    bdrv_get_geometry(s->bs, &nb_sectors);

    s->nb_sectors = nb_sectors;



    













    s->cdrom_changed = 1;

    s->events.new_media = true;

    s->events.eject_request = false;

    ide_set_irq(s->bus);

}

static void FUNC_0(void *VAR_0, bool VAR_1)
{ IDEState *s = VAR_0; uint64_t nb_sectors; s->tray_open = !VAR_1; bdrv_get_geometry(s->bs, &nb_sectors); s->nb_sectors = nb_sectors; s->cdrom_changed = 1; s->events.new_media = true; s->events.eject_request = false; ide_set_irq(s->bus); }