static int eject_device(Monitor *mon, BlockDriverState *bs, int force)

{

    if (bdrv_is_inserted(bs)) {

        if (!force) {

            if (!bdrv_is_removable(bs)) {

                qerror_report(QERR_DEVICE_NOT_REMOVABLE,

                               bdrv_get_device_name(bs));

                return -1;

            }

            if (bdrv_is_locked(bs)) {

                qerror_report(QERR_DEVICE_LOCKED, bdrv_get_device_name(bs));

                return -1;

            }

        }

        bdrv_close(bs);

    }

    return 0;

}

static int eject_device(Monitor *mon, BlockDriverState *bs, int force)

{

    if (bdrv_is_inserted(bs)) {

        if (!force) {

            if (!bdrv_is_removable(bs)) {

                qerror_report(QERR_DEVICE_NOT_REMOVABLE,

                               bdrv_get_device_name(bs));

                return -1;

            }

            if (bdrv_is_locked(bs)) {

                qerror_report(QERR_DEVICE_LOCKED, bdrv_get_device_name(bs));

                return -1;

            }

        }

        bdrv_close(bs);

    }

    return 0;

}

    if (bdrv_is_inserted(bs)) {         if (!force) {             if (!bdrv_is_removable(bs)) {                 qerror_report(QERR_DEVICE_NOT_REMOVABLE,                                bdrv_get_device_name(bs));                 return -1;             if (bdrv_is_locked(bs)) {                 qerror_report(QERR_DEVICE_LOCKED, bdrv_get_device_name(bs));                 return -1;         bdrv_close(bs);
static int FUNC_0(Monitor *VAR_0, BlockDriverState *VAR_1, int VAR_2)

{

    if (bdrv_is_inserted(VAR_1)) {

        if (!VAR_2) {

            if (!bdrv_is_removable(VAR_1)) {

                qerror_report(QERR_DEVICE_NOT_REMOVABLE,

                               bdrv_get_device_name(VAR_1));

                return -1;

            }

            if (bdrv_is_locked(VAR_1)) {

                qerror_report(QERR_DEVICE_LOCKED, bdrv_get_device_name(VAR_1));

                return -1;

            }

        }

        bdrv_close(VAR_1);

    }

    return 0;

}

static int FUNC_0(Monitor *VAR_0, BlockDriverState *VAR_1, int VAR_2)
{ if (bdrv_is_inserted(VAR_1)) { if (!VAR_2) { if (!bdrv_is_removable(VAR_1)) { qerror_report(QERR_DEVICE_NOT_REMOVABLE,
bdrv_get_device_name(VAR_1)); return -1; } if (bdrv_is_locked(VAR_1)) { qerror_report(QERR_DEVICE_LOCKED, bdrv_get_device_name(VAR_1)); return -1; } } bdrv_close(VAR_1); } return 0; }