void qmp_eject(const char *device, bool has_force, bool force, Error **errp)

{

    Error *local_err = NULL;

    int rc;



    if (!has_force) {

        force = false;

    }



    rc = do_open_tray(device, force, &local_err);

    if (local_err) {

        error_propagate(errp, local_err);

        return;

    }



    if (rc == EINPROGRESS) {

        error_setg(errp, "Device '%s' is locked and force was not specified, "

                   "wait for tray to open and try again", device);

        return;

    }



    qmp_x_blockdev_remove_medium(device, errp);

}

void qmp_eject(const char *device, bool has_force, bool force, Error **errp)

{

    Error *local_err = NULL;

    int rc;



    if (!has_force) {

        force = false;

    }



    rc = do_open_tray(device, force, &local_err);

    if (local_err) {

        error_propagate(errp, local_err);

        return;

    }



    if (rc == EINPROGRESS) {

        error_setg(errp, "Device '%s' is locked and force was not specified, "

                   "wait for tray to open and try again", device);

        return;

    }



    qmp_x_blockdev_remove_medium(device, errp);

}

void FUNC_0(const char *VAR_0, bool VAR_1, bool VAR_2, Error **VAR_3)

{

    Error *local_err = NULL;

    int VAR_4;



    if (!VAR_1) {

        VAR_2 = false;

    }



    VAR_4 = do_open_tray(VAR_0, VAR_2, &local_err);

    if (local_err) {

        error_propagate(VAR_3, local_err);

        return;

    }



    if (VAR_4 == EINPROGRESS) {

        error_setg(VAR_3, "Device '%s' is locked and VAR_2 was not specified, "

                   "wait for tray to open and try again", VAR_0);

        return;

    }



    qmp_x_blockdev_remove_medium(VAR_0, VAR_3);

}

void FUNC_0(const char *VAR_0, bool VAR_1, bool VAR_2, Error **VAR_3)
{ Error *local_err = NULL; int VAR_4; if (!VAR_1) { VAR_2 = false; } VAR_4 = do_open_tray(VAR_0, VAR_2, &local_err); if (local_err) { error_propagate(VAR_3, local_err); return; } if (VAR_4 == EINPROGRESS) { error_setg(VAR_3, "Device '%s' is locked and VAR_2 was not specified, "
"wait for tray to open and try again", VAR_0); return; } qmp_x_blockdev_remove_medium(VAR_0, VAR_3); }