vmstate = get_vmstate(sock);
if ((int)pid < 0 || vmstate < 0)
- goto cleanup;
+ return -1;
if (vmstate == KVM_VMSTATE_PAUSED)
printf("%5d %-20s %s\n", pid, name, KVM_INSTANCE_PAUSED);
printf("%5d %-20s %s\n", pid, name, KVM_INSTANCE_RUNNING);
return 0;
-
-cleanup:
- kvm__remove_socket(name);
- return -1;
}
static int kvm_list_running_instances(void)
return s;
local.sun_family = AF_UNIX;
strcpy(local.sun_path, full_name);
- unlink(local.sun_path);
len = strlen(local.sun_path) + sizeof(local.sun_family);
r = bind(s, (struct sockaddr *)&local, len);
if (r < 0)
r = connect(s, &local, len);
if (r < 0 && errno == ECONNREFUSED) {
- /* Clean ghost socket file */
- unlink(sock_file);
+ /* Tell the user clean ghost socket file */
+ pr_err("\"%s\" could be a ghost socket file, please remove it",
+ sock_file);
return -1;
} else if (r < 0) {
die("Failed connecting to instance");