add the zeroinit block driver filter
[pve-qemu-kvm.git] / debian / patches / old / move-bdrv-snapshot-find.patch
blob0cb7d488ad539c04876c49f420a1f77fcab9f661
1 Index: new/block.c
2 ===================================================================
3 --- new.orig/block.c 2013-02-12 12:05:14.000000000 +0100
4 +++ new/block.c 2013-02-12 12:06:52.000000000 +0100
5 @@ -3162,6 +3162,28 @@
6 return -ENOTSUP;
9 +int bdrv_snapshot_find(BlockDriverState *bs, QEMUSnapshotInfo *sn_info,
10 + const char *name)
12 + QEMUSnapshotInfo *sn_tab, *sn;
13 + int nb_sns, i, ret;
15 + ret = -ENOENT;
16 + nb_sns = bdrv_snapshot_list(bs, &sn_tab);
17 + if (nb_sns < 0)
18 + return ret;
19 + for(i = 0; i < nb_sns; i++) {
20 + sn = &sn_tab[i];
21 + if (!strcmp(sn->id_str, name) || !strcmp(sn->name, name)) {
22 + *sn_info = *sn;
23 + ret = 0;
24 + break;
25 + }
26 + }
27 + g_free(sn_tab);
28 + return ret;
31 int bdrv_snapshot_load_tmp(BlockDriverState *bs,
32 const char *snapshot_name)
34 Index: new/include/block/block.h
35 ===================================================================
36 --- new.orig/include/block/block.h 2013-02-12 12:05:14.000000000 +0100
37 +++ new/include/block/block.h 2013-02-12 12:06:52.000000000 +0100
38 @@ -331,6 +331,8 @@
39 int bdrv_snapshot_delete(BlockDriverState *bs, const char *snapshot_id);
40 int bdrv_snapshot_list(BlockDriverState *bs,
41 QEMUSnapshotInfo **psn_info);
42 +int bdrv_snapshot_find(BlockDriverState *bs, QEMUSnapshotInfo *sn_info,
43 + const char *name);
44 int bdrv_snapshot_load_tmp(BlockDriverState *bs,
45 const char *snapshot_name);
46 char *bdrv_snapshot_dump(char *buf, int buf_size, QEMUSnapshotInfo *sn);
47 Index: new/savevm.c
48 ===================================================================
49 --- new.orig/savevm.c 2013-02-12 12:05:14.000000000 +0100
50 +++ new/savevm.c 2013-02-12 12:06:52.000000000 +0100
51 @@ -2055,28 +2055,6 @@
52 return ret;
55 -static int bdrv_snapshot_find(BlockDriverState *bs, QEMUSnapshotInfo *sn_info,
56 - const char *name)
58 - QEMUSnapshotInfo *sn_tab, *sn;
59 - int nb_sns, i, ret;
61 - ret = -ENOENT;
62 - nb_sns = bdrv_snapshot_list(bs, &sn_tab);
63 - if (nb_sns < 0)
64 - return ret;
65 - for(i = 0; i < nb_sns; i++) {
66 - sn = &sn_tab[i];
67 - if (!strcmp(sn->id_str, name) || !strcmp(sn->name, name)) {
68 - *sn_info = *sn;
69 - ret = 0;
70 - break;
71 - }
72 - }
73 - g_free(sn_tab);
74 - return ret;
78 * Deletes snapshots of a given name in all opened images.