void do_info_snapshots(Monitor *mon)

{

    DriveInfo *dinfo;

    BlockDriverState *bs, *bs1;

    QEMUSnapshotInfo *sn_tab, *sn;

    int nb_sns, i;

    char buf[256];



    bs = get_bs_snapshots();

    if (!bs) {

        monitor_printf(mon, "No available block device supports snapshots\n");

        return;

    }

    monitor_printf(mon, "Snapshot devices:");

    TAILQ_FOREACH(dinfo, &drives, next) {

        bs1 = dinfo->bdrv;

        if (bdrv_has_snapshot(bs1)) {

            if (bs == bs1)

                monitor_printf(mon, " %s", bdrv_get_device_name(bs1));

        }

    }

    monitor_printf(mon, "\n");



    nb_sns = bdrv_snapshot_list(bs, &sn_tab);

    if (nb_sns < 0) {

        monitor_printf(mon, "bdrv_snapshot_list: error %d\n", nb_sns);

        return;

    }

    monitor_printf(mon, "Snapshot list (from %s):\n",

                   bdrv_get_device_name(bs));

    monitor_printf(mon, "%s\n", bdrv_snapshot_dump(buf, sizeof(buf), NULL));

    for(i = 0; i < nb_sns; i++) {

        sn = &sn_tab[i];

        monitor_printf(mon, "%s\n", bdrv_snapshot_dump(buf, sizeof(buf), sn));

    }

    qemu_free(sn_tab);

}

void do_info_snapshots(Monitor *mon)

{

    DriveInfo *dinfo;

    BlockDriverState *bs, *bs1;

    QEMUSnapshotInfo *sn_tab, *sn;

    int nb_sns, i;

    char buf[256];



    bs = get_bs_snapshots();

    if (!bs) {

        monitor_printf(mon, "No available block device supports snapshots\n");

        return;

    }

    monitor_printf(mon, "Snapshot devices:");

    TAILQ_FOREACH(dinfo, &drives, next) {

        bs1 = dinfo->bdrv;

        if (bdrv_has_snapshot(bs1)) {

            if (bs == bs1)

                monitor_printf(mon, " %s", bdrv_get_device_name(bs1));

        }

    }

    monitor_printf(mon, "\n");



    nb_sns = bdrv_snapshot_list(bs, &sn_tab);

    if (nb_sns < 0) {

        monitor_printf(mon, "bdrv_snapshot_list: error %d\n", nb_sns);

        return;

    }

    monitor_printf(mon, "Snapshot list (from %s):\n",

                   bdrv_get_device_name(bs));

    monitor_printf(mon, "%s\n", bdrv_snapshot_dump(buf, sizeof(buf), NULL));

    for(i = 0; i < nb_sns; i++) {

        sn = &sn_tab[i];

        monitor_printf(mon, "%s\n", bdrv_snapshot_dump(buf, sizeof(buf), sn));

    }

    qemu_free(sn_tab);

}

void FUNC_0(Monitor *VAR_0)

{

    DriveInfo *dinfo;

    BlockDriverState *bs, *bs1;

    QEMUSnapshotInfo *sn_tab, *sn;

    int VAR_1, VAR_2;

    char VAR_3[256];



    bs = get_bs_snapshots();

    if (!bs) {

        monitor_printf(VAR_0, "No available block device supports snapshots\n");

        return;

    }

    monitor_printf(VAR_0, "Snapshot devices:");

    TAILQ_FOREACH(dinfo, &drives, next) {

        bs1 = dinfo->bdrv;

        if (bdrv_has_snapshot(bs1)) {

            if (bs == bs1)

                monitor_printf(VAR_0, " %s", bdrv_get_device_name(bs1));

        }

    }

    monitor_printf(VAR_0, "\n");



    VAR_1 = bdrv_snapshot_list(bs, &sn_tab);

    if (VAR_1 < 0) {

        monitor_printf(VAR_0, "bdrv_snapshot_list: error %d\n", VAR_1);

        return;

    }

    monitor_printf(VAR_0, "Snapshot list (from %s):\n",

                   bdrv_get_device_name(bs));

    monitor_printf(VAR_0, "%s\n", bdrv_snapshot_dump(VAR_3, sizeof(VAR_3), NULL));

    for(VAR_2 = 0; VAR_2 < VAR_1; VAR_2++) {

        sn = &sn_tab[VAR_2];

        monitor_printf(VAR_0, "%s\n", bdrv_snapshot_dump(VAR_3, sizeof(VAR_3), sn));

    }

    qemu_free(sn_tab);

}

void FUNC_0(Monitor *VAR_0)
{ DriveInfo *dinfo; BlockDriverState *bs, *bs1; QEMUSnapshotInfo *sn_tab, *sn; int VAR_1, VAR_2; char VAR_3[256]; bs = get_bs_snapshots(); if (!bs) { monitor_printf(VAR_0, "No available block device supports snapshots\n"); return; } monitor_printf(VAR_0, "Snapshot devices:"); TAILQ_FOREACH(dinfo, &drives, next) { bs1 = dinfo->bdrv; if (bdrv_has_snapshot(bs1)) { if (bs == bs1)
monitor_printf(VAR_0, " %s", bdrv_get_device_name(bs1)); } } monitor_printf(VAR_0, "\n"); VAR_1 = bdrv_snapshot_list(bs, &sn_tab); if (VAR_1 < 0) { monitor_printf(VAR_0, "bdrv_snapshot_list: error %d\n", VAR_1); return; } monitor_printf(VAR_0, "Snapshot list (from %s):\n",
bdrv_get_device_name(bs)); monitor_printf(VAR_0, "%s\n", bdrv_snapshot_dump(VAR_3, sizeof(VAR_3), NULL)); for(VAR_2 = 0; VAR_2 < VAR_1; VAR_2++) { sn = &sn_tab[VAR_2]; monitor_printf(VAR_0, "%s\n", bdrv_snapshot_dump(VAR_3, sizeof(VAR_3), sn)); } qemu_free(sn_tab); }