aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorkaf24@labyrinth.cl.cam.ac.uk <kaf24@labyrinth.cl.cam.ac.uk>2003-02-24 17:56:39 +0000
committerkaf24@labyrinth.cl.cam.ac.uk <kaf24@labyrinth.cl.cam.ac.uk>2003-02-24 17:56:39 +0000
commit2b1c361bee7ecb1dc6d68b8ddadbaaf85f03587f (patch)
tree515cb0e4c0f07cd3720525dc69cc6a6e850655ff /tools
parent704f9b012699742823381c48873de8e18f660366 (diff)
downloadxen-2b1c361bee7ecb1dc6d68b8ddadbaaf85f03587f.tar.gz
xen-2b1c361bee7ecb1dc6d68b8ddadbaaf85f03587f.tar.bz2
xen-2b1c361bee7ecb1dc6d68b8ddadbaaf85f03587f.zip
bitkeeper revision 1.96 (3e5a5cd7-6YCRyx9vceH0j_ljuOe-Q)
hypervisor-ifs: new file Many files: Allow forced killing of domains with 'kill_domain -f'. task_structs now reference counted. .del-network.h~823d28e86ebe9d9b: Delete: xenolinux-2.4.21-pre4-sparse/include/asm-xeno/hypervisor-ifs/network.h .del-hypervisor-if.h~d1f6a7dd4307ddfe: Delete: xenolinux-2.4.21-pre4-sparse/include/asm-xeno/hypervisor-ifs/hypervisor-if.h .del-block.h~81aa08f4e2012da6: Delete: xenolinux-2.4.21-pre4-sparse/include/asm-xeno/hypervisor-ifs/block.h
Diffstat (limited to 'tools')
-rw-r--r--tools/domain_builder/dom0_ops.h1
-rw-r--r--tools/domain_builder/dom_kill.c14
2 files changed, 11 insertions, 4 deletions
diff --git a/tools/domain_builder/dom0_ops.h b/tools/domain_builder/dom0_ops.h
index d98ce1b1eb..6c60a93ff6 100644
--- a/tools/domain_builder/dom0_ops.h
+++ b/tools/domain_builder/dom0_ops.h
@@ -27,6 +27,7 @@ typedef struct dom0_newdomain_st
typedef struct dom0_killdomain_st
{
unsigned int domain;
+ int force;
} dom0_killdomain_t;
typedef struct dom0_getmemlist_st
diff --git a/tools/domain_builder/dom_kill.c b/tools/domain_builder/dom_kill.c
index 2b8b0a5097..ddc0f8a4fd 100644
--- a/tools/domain_builder/dom_kill.c
+++ b/tools/domain_builder/dom_kill.c
@@ -15,7 +15,7 @@
#define PERR_STRING "Xen Domain Killer"
-static int do_kill_domain(int dom_id)
+static int do_kill_domain(int dom_id, int force)
{
char cmd_path[MAX_PATH];
dom0_op_t dop;
@@ -23,6 +23,7 @@ static int do_kill_domain(int dom_id)
dop.cmd = DOM0_KILLDOMAIN;
dop.u.killdomain.domain = dom_id;
+ dop.u.killdomain.force = force;
/* open the /proc command interface */
sprintf(cmd_path, "%s%s%s%s", "/proc/", PROC_XENO_ROOT, "/", PROC_CMD);
@@ -42,13 +43,18 @@ int main(int argc, char **argv)
{
int ret;
- if(argc < 2){
- printf("Usage: kill_domain <domain_id>\n");
+ if ( (argc < 2) || (argc > 3) )
+ {
+ usage:
+ printf("Usage: kill_domain [-f] <domain_id>\n");
+ printf(" -f: Forces immediate destruction of specified domain\n");
ret = -1;
goto out;
}
- ret = do_kill_domain(atoi(argv[1]));
+ if ( (argc == 3) && strcmp("-f", argv[1]) ) goto usage;
+
+ ret = do_kill_domain(atoi(argv[argc-1]), argc == 3);
out:
return ret;