continue;
}
if (errno != 0) {
- fprintf(stderr, "error parsing vmid for %d: %s\n", pid, strerror(errno));
vmid = 0;
}
- goto ret;
+ break;
}
if (errno) {
fprintf(stderr, "error parsing vmid for %d: %s\n", pid, strerror(errno));
- } else {
+ } else if (!vmid) {
fprintf(stderr, "error parsing vmid for %d: no matching qemu.slice cgroup entry\n", pid);
}
-ret:
free(buf);
fclose(fp);
return vmid;
bool active = false;
if (has_status) {
const char *status_str = json_object_get_string(status);
- active = status_str &&
- (!strcmp(status_str, "running") || !strcmp(status_str, "paused"));
+ active = status_str && (
+ !strcmp(status_str, "running")
+ || !strcmp(status_str, "paused")
+ || !strcmp(status_str, "suspended")
+ || !strcmp(status_str, "prelaunch")
+ );
}
switch (client->state) {