void hmp_drive_mirror(Monitor *mon, const QDict *qdict)

{

    const char *device = qdict_get_str(qdict, "device");

    const char *filename = qdict_get_str(qdict, "target");

    const char *format = qdict_get_try_str(qdict, "format");

    int reuse = qdict_get_try_bool(qdict, "reuse", 0);

    int full = qdict_get_try_bool(qdict, "full", 0);

    enum NewImageMode mode;

    Error *errp = NULL;



    if (!filename) {

        error_set(&errp, QERR_MISSING_PARAMETER, "target");

        hmp_handle_error(mon, &errp);

        return;

    }



    if (reuse) {

        mode = NEW_IMAGE_MODE_EXISTING;

    } else {

        mode = NEW_IMAGE_MODE_ABSOLUTE_PATHS;

    }



    qmp_drive_mirror(device, filename, !!format, format,

                     full ? MIRROR_SYNC_MODE_FULL : MIRROR_SYNC_MODE_TOP,

                     true, mode, false, 0, &errp);

    hmp_handle_error(mon, &errp);

}

void hmp_drive_mirror(Monitor *mon, const QDict *qdict)

{

    const char *device = qdict_get_str(qdict, "device");

    const char *filename = qdict_get_str(qdict, "target");

    const char *format = qdict_get_try_str(qdict, "format");

    int reuse = qdict_get_try_bool(qdict, "reuse", 0);

    int full = qdict_get_try_bool(qdict, "full", 0);

    enum NewImageMode mode;

    Error *errp = NULL;



    if (!filename) {

        error_set(&errp, QERR_MISSING_PARAMETER, "target");

        hmp_handle_error(mon, &errp);

        return;

    }



    if (reuse) {

        mode = NEW_IMAGE_MODE_EXISTING;

    } else {

        mode = NEW_IMAGE_MODE_ABSOLUTE_PATHS;

    }



    qmp_drive_mirror(device, filename, !!format, format,

                     full ? MIRROR_SYNC_MODE_FULL : MIRROR_SYNC_MODE_TOP,

                     true, mode, false, 0, &errp);

    hmp_handle_error(mon, &errp);

}

                     true, mode, false, 0, &errp);
void FUNC_0(Monitor *VAR_0, const QDict *VAR_1)

{

    const char *VAR_2 = qdict_get_str(VAR_1, "VAR_2");

    const char *VAR_3 = qdict_get_str(VAR_1, "target");

    const char *VAR_4 = qdict_get_try_str(VAR_1, "VAR_4");

    int VAR_5 = qdict_get_try_bool(VAR_1, "VAR_5", 0);

    int VAR_6 = qdict_get_try_bool(VAR_1, "VAR_6", 0);

    enum NewImageMode VAR_7;

    Error *errp = NULL;



    if (!VAR_3) {

        error_set(&errp, QERR_MISSING_PARAMETER, "target");

        hmp_handle_error(VAR_0, &errp);

        return;

    }



    if (VAR_5) {

        VAR_7 = NEW_IMAGE_MODE_EXISTING;

    } else {

        VAR_7 = NEW_IMAGE_MODE_ABSOLUTE_PATHS;

    }



    qmp_drive_mirror(VAR_2, VAR_3, !!VAR_4, VAR_4,

                     VAR_6 ? MIRROR_SYNC_MODE_FULL : MIRROR_SYNC_MODE_TOP,

                     true, VAR_7, false, 0, &errp);

    hmp_handle_error(VAR_0, &errp);

}

void FUNC_0(Monitor *VAR_0, const QDict *VAR_1)
{ const char *VAR_2 = qdict_get_str(VAR_1, "VAR_2"); const char *VAR_3 = qdict_get_str(VAR_1, "target"); const char *VAR_4 = qdict_get_try_str(VAR_1, "VAR_4"); int VAR_5 = qdict_get_try_bool(VAR_1, "VAR_5", 0); int VAR_6 = qdict_get_try_bool(VAR_1, "VAR_6", 0); enum NewImageMode VAR_7; Error *errp = NULL; if (!VAR_3) { error_set(&errp, QERR_MISSING_PARAMETER, "target"); hmp_handle_error(VAR_0, &errp); return; } if (VAR_5) { VAR_7 = NEW_IMAGE_MODE_EXISTING; } else { VAR_7 = NEW_IMAGE_MODE_ABSOLUTE_PATHS; } qmp_drive_mirror(VAR_2, VAR_3, !!VAR_4, VAR_4,
VAR_6 ? MIRROR_SYNC_MODE_FULL : MIRROR_SYNC_MODE_TOP,
true, VAR_7, false, 0, &errp); hmp_handle_error(VAR_0, &errp); }