New qemus report if given block node is active. We'll be using this data
to decide if we need to reactivate them prior to blockjobs. Extract the
data as 'inactive' as it's simpler to track and we care only about
inactive nodes.
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
/* qcow2 data file 'raw' feature is enabled */
bool qcow2dataFileRaw;
+
+ /* node is deactivated in qemu (reported as 'active' but may be missing,
+ * thus the flag is asserted only when we know it's inactive) */
+ bool inactive;
};
GHashTable *
virJSONValue *bitmaps;
virJSONValue *snapshots;
virJSONValue *format_specific;
+ bool active;
const char *nodename;
g_autoptr(qemuBlockNamedNodeData) ent = NULL;
if ((bitmaps = virJSONValueObjectGetArray(val, "dirty-bitmaps")))
qemuMonitorJSONBlockGetNamedNodeDataBitmaps(bitmaps, ent);
+ /* stored as negative as the value may be missing from some qemus */
+ if (virJSONValueObjectGetBoolean(val, "active", &active) == 0)
+ ent->inactive = !active;
+
if ((snapshots = virJSONValueObjectGetArray(img, "snapshots"))) {
size_t nsnapshots = virJSONValueArraySize(snapshots);
size_t i;