#include <kvm/parse-options.h>
#include <kvm/kvm.h>
-static u64 instance_pid;
+static pid_t instance_pid;
static const char *instance_name;
static u64 inflate;
static u64 deflate;
static const struct option balloon_options[] = {
OPT_GROUP("Instance options:"),
OPT_STRING('n', "name", &instance_name, "name", "Instance name"),
- OPT_U64('p', "pid", &instance_pid, "Instance pid"),
+ OPT_INTEGER('p', "pid", &instance_pid, "Instance pid"),
OPT_GROUP("Balloon options:"),
OPT_U64('i', "inflate", &inflate, "Amount to inflate"),
OPT_U64('d', "deflate", &deflate, "Amount to deflate"),
#include <signal.h>
static bool all;
-static u64 instance_pid;
+static pid_t instance_pid;
static const char *instance_name;
static const char * const debug_usage[] = {
OPT_GROUP("General options:"),
OPT_BOOLEAN('a', "all", &all, "Debug all instances"),
OPT_STRING('n', "name", &instance_name, "name", "Instance name"),
- OPT_U64('p', "pid", &instance_pid, "Instance pid"),
+ OPT_INTEGER('p', "pid", &instance_pid, "Instance pid"),
OPT_END()
};
#include <signal.h>
static bool all;
-static u64 instance_pid;
+static pid_t instance_pid;
static const char *instance_name;
static const char * const pause_usage[] = {
OPT_GROUP("General options:"),
OPT_BOOLEAN('a', "all", &all, "Pause all instances"),
OPT_STRING('n', "name", &instance_name, "name", "Instance name"),
- OPT_U64('p', "pid", &instance_pid, "Instance pid"),
+ OPT_INTEGER('p', "pid", &instance_pid, "Instance pid"),
OPT_END()
};
#include <signal.h>
static bool all;
-static u64 instance_pid;
+static pid_t instance_pid;
static const char *instance_name;
static const char * const resume_usage[] = {
OPT_GROUP("General options:"),
OPT_BOOLEAN('a', "all", &all, "Resume all instances"),
OPT_STRING('n', "name", &instance_name, "name", "Instance name"),
- OPT_U64('p', "pid", &instance_pid, "Instance pid"),
+ OPT_INTEGER('p', "pid", &instance_pid, "Instance pid"),
OPT_END()
};
static bool mem;
static bool all;
-static u64 instance_pid;
+static pid_t instance_pid;
static const char *instance_name;
static const char * const stat_usage[] = {
OPT_GROUP("Instance options:"),
OPT_BOOLEAN('a', "all", &all, "All instances"),
OPT_STRING('n', "name", &instance_name, "name", "Instance name"),
- OPT_U64('p', "pid", &instance_pid, "Instance pid"),
+ OPT_INTEGER('p', "pid", &instance_pid, "Instance pid"),
OPT_END()
};
#include <signal.h>
static bool all;
-static u64 instance_pid;
+static pid_t instance_pid;
static const char *instance_name;
static const char * const stop_usage[] = {
OPT_GROUP("General options:"),
OPT_BOOLEAN('a', "all", &all, "Stop all instances"),
OPT_STRING('n', "name", &instance_name, "name", "Instance name"),
- OPT_U64('p', "pid", &instance_pid, "Instance pid"),
+ OPT_INTEGER('p', "pid", &instance_pid, "Instance pid"),
OPT_END()
};
void kvm__pause(void);
void kvm__continue(void);
void kvm__notify_paused(void);
-int kvm__get_pid_by_instance(const char *name);
+pid_t kvm__get_pid_by_instance(const char *name);
int kvm__enumerate_instances(int (*callback)(const char *name, int pid));
void kvm__remove_pidfile(const char *name);
unlink(full_name);
}
-int kvm__get_pid_by_instance(const char *name)
+pid_t kvm__get_pid_by_instance(const char *name)
{
- int fd, pid;
+ int fd;
+ pid_t pid;
char pid_str[10], pid_file[PATH_MAX];
sprintf(pid_file, "%s/%s/%s.pid", HOME_DIR, KVM_PID_FILE_PATH, name);