Displaying 1 result from an estimated 1 matches for "return_node".
Did you mean:
return_code
2018 Sep 13
1
[PATCH] lib: direct: Query qemu binary for availability of KVM (RHBZ#1605071).
...assume KVM is available.
+ *
+ * The JSON output looks like:
+ * {"return": {"enabled": true, "present": true}}
+ */
+static void
+parse_has_kvm (guestfs_h *g, const char *json, bool *ret)
+{
+ CLEANUP_JSON_T_DECREF json_t *tree = NULL;
+ json_error_t err;
+ json_t *return_node, *enabled_node;
+
+ *ret = true; /* Assume KVM is enabled. */
+
+ if (!json)
+ return;
+
+ tree = json_loads (json, 0, &err);
+ if (tree == NULL) {
+ if (strlen (err.text) > 0)
+ debug (g, "QMP parse error: %s (ignored)", err.text);
+ else
+...