static const char *bitmapDetectPrefix = "qemublocktestdata/bitmap/";
-static void
-testQemuDetectBitmapsWorker(GHashTable *nodedata,
+static int
+testQemuDetectBitmapsWorker(void *payload,
const char *nodename,
- virBuffer *buf)
+ void *opaque)
{
- qemuBlockNamedNodeData *data;
+ qemuBlockNamedNodeData *data = payload;
+ virBuffer *buf = opaque;
size_t i;
- if (!(data = virHashLookup(nodedata, nodename)))
- return;
-
virBufferAsprintf(buf, "%s:\n", nodename);
if (data->qcow2v2)
virBufferAddLit(buf, " qcow2 v2\n");
virBufferAsprintf(buf, " '%s'%s", (const char *) n->key, vms);
}
+
+ virBufferAddLit(buf, "\n");
}
virBufferAdjustIndent(buf, -1);
+ return 0;
}
g_autofree char *actual = NULL;
g_autofree char *expectpath = NULL;
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
- size_t i;
expectpath = g_strdup_printf("%s/%s%s.out", abs_srcdir,
bitmapDetectPrefix, name);
return -1;
}
- /* we detect for the first 30 nodenames for simplicity */
- for (i = 0; i < 30; i++) {
- g_autofree char *nodename = g_strdup_printf("libvirt-%zu-format", i);
-
- testQemuDetectBitmapsWorker(nodedata, nodename, &buf);
- }
-
+ virHashForEachSorted(nodedata, testQemuDetectBitmapsWorker, &buf);
actual = virBufferContentAndReset(&buf);
return virTestCompareToFile(actual, expectpath);
b: record:1 busy:0 persist:1 inconsist:0 gran:65536 dirty:0
c: record:1 busy:0 persist:1 inconsist:0 gran:65536 dirty:0
current: record:1 busy:0 persist:1 inconsist:0 gran:65536 dirty:0
+libvirt-1-storage:
libvirt-2-format:
c: record:1 busy:0 persist:1 inconsist:0 gran:65536 dirty:0
b: record:1 busy:0 persist:1 inconsist:0 gran:65536 dirty:0
a: record:1 busy:0 persist:1 inconsist:0 gran:65536 dirty:0
d: record:1 busy:0 persist:1 inconsist:0 gran:65536 dirty:0
+libvirt-2-storage:
libvirt-3-format:
a: record:1 busy:0 persist:1 inconsist:0 gran:65536 dirty:0
b: record:1 busy:0 persist:1 inconsist:0 gran:65536 dirty:0
c: record:1 busy:0 persist:1 inconsist:0 gran:65536 dirty:0
+libvirt-3-storage:
libvirt-4-format:
a: record:1 busy:0 persist:1 inconsist:0 gran:65536 dirty:0
+libvirt-4-storage:
libvirt-5-format:
a: record:1 busy:0 persist:1 inconsist:0 gran:65536 dirty:0
+libvirt-5-storage:
top-inactive: record:0 busy:0 persist:1 inconsist:0 gran:65536 dirty:0
top-transient: record:1 busy:0 persist:0 inconsist:0 gran:65536 dirty:0
top-transient-inactive: record:0 busy:0 persist:0 inconsist:0 gran:65536 dirty:0
+libvirt-1-storage:
libvirt-2-format:
d: record:1 busy:0 persist:1 inconsist:0 gran:65536 dirty:0
+libvirt-2-storage:
libvirt-3-format:
b: record:1 busy:0 persist:0 inconsist:0 gran:65536 dirty:0
c: record:0 busy:0 persist:1 inconsist:0 gran:65536 dirty:0
d: record:1 busy:0 persist:1 inconsist:0 gran:65536 dirty:0
+libvirt-3-storage:
libvirt-4-format:
+libvirt-4-storage:
libvirt-5-format:
a: record:1 busy:0 persist:1 inconsist:0 gran:65536 dirty:0
+libvirt-5-storage: