mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 10:40:03 +01:00
Many files: new file Clean up dom0 proc interfaces. Implemented ioremap and /dev/mem. .del-dom0_block.c~63815c1974691c1c: Delete: xenolinux-2.4.21-sparse/arch/xeno/drivers/dom0/dom0_block.c .del-sched_ops.c~20807e5c2ed6b51: Delete: xenolinux-2.4.21-sparse/arch/xeno/drivers/dom0/sched_ops.c .del-xi_list~49abab167156959: Delete: tools/internal/xi_list .del-xl_physdisk_proc.c~49451bc26a40fcb2: Delete: xenolinux-2.4.21-sparse/arch/xeno/drivers/block/xl_physdisk_proc.c .del-mmu.h~6bc56547519b6f96: Delete: xenolinux-2.4.21-sparse/include/asm-xeno/mmu.h .del-dom0.h~6fb656bb4a0c52e1: Delete: xenolinux-2.4.21-sparse/include/asm-xeno/dom0.h .del-dom0_ops.h~fb19960d77217740: Delete: tools/internal/dom0_ops.h .del-dom0_ops.h~5c52b016e619bd2d: Delete: xenolinux-2.4.21-sparse/arch/xeno/drivers/dom0/dom0_ops.h .del-dom0_memory.c~c72c6e5f7fd65d38: Delete: xenolinux-2.4.21-sparse/arch/xeno/drivers/dom0/dom0_memory.c .del-direct_map.c~d2fedc686b334f2a: Delete: xenolinux-2.4.21-sparse/arch/xeno/mm/direct_map.c direct_map.c: Rename: xenolinux-2.4.21-sparse/arch/xeno/mm/get_unmapped_area.c -> xenolinux-2.4.21-sparse/arch/xeno/mm/direct_map.c
48 lines
1.1 KiB
C
48 lines
1.1 KiB
C
/*
|
|
* XenoDomainBuilder, copyright (c) Boris Dragovic, bd240@cl.cam.ac.uk
|
|
* This code is released under terms and conditions of GNU GPL :).
|
|
* Usage: <executable> <mem_kb> <os image> <num_vifs>
|
|
*/
|
|
|
|
#include <hypervisor-ifs/dom0_ops.h>
|
|
#include "dom0_defs.h"
|
|
#include "mem_defs.h"
|
|
|
|
static char *argv0 = "internal_domain_create";
|
|
|
|
static int create_new_domain(long req_mem, char *name)
|
|
{
|
|
int err;
|
|
dom0_op_t op;
|
|
|
|
op.cmd = DOM0_CREATEDOMAIN;
|
|
op.u.newdomain.memory_kb = req_mem;
|
|
strncpy(op.u.newdomain.name, name, MAX_DOMAIN_NAME);
|
|
op.u.newdomain.name[MAX_DOMAIN_NAME-1] = '\0';
|
|
|
|
err = do_dom0_op(&op);
|
|
|
|
return (err < 0) ? err : op.u.newdomain.domain;
|
|
}
|
|
|
|
int main(int argc, char **argv)
|
|
{
|
|
int dom_id;
|
|
|
|
if ( argv[0] != NULL )
|
|
argv0 = argv[0];
|
|
|
|
if ( argc != 3 )
|
|
{
|
|
fprintf(stderr, "Usage: %s <kbytes-mem> <domain-name>\n", argv0);
|
|
return 1;
|
|
}
|
|
|
|
dom_id = create_new_domain(atol(argv[1]), argv[2]);
|
|
if ( dom_id < 0 )
|
|
return 1;
|
|
|
|
printf("%d\n", dom_id);
|
|
return 0;
|
|
}
|