From: Jack Lange Date: Wed, 20 Jun 2012 19:00:27 +0000 (-0400) Subject: cleaned up ioctl linux interfaces X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?p=palacios.git;a=commitdiff_plain;h=9d3c2538b9deab4c102cc9c4312517e1df752488 cleaned up ioctl linux interfaces --- diff --git a/linux_module/iface-stream.c b/linux_module/iface-stream.c index e064b94..2463f56 100644 --- a/linux_module/iface-stream.c +++ b/linux_module/iface-stream.c @@ -18,12 +18,12 @@ #include "linux-exts.h" #include "util-ringbuffer.h" #include "vm.h" -#include "iface-stream.h" + // This is probably overkill #define STREAM_RING_LEN 4096 - +#define STREAM_NAME_LEN 128 diff --git a/linux_module/iface-stream.h b/linux_module/iface-stream.h deleted file mode 100644 index aba5dd7..0000000 --- a/linux_module/iface-stream.h +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Stream - * (c) Lei Xia 2010 - */ - - -#ifndef __IFACE_STREAM_H__ -#define __IFACE_STREAM_H__ - - -// Stream Connection IOCTL number -#define V3_VM_STREAM_CONNECT 21 - -// Buffer size of the stream name being connected to -#define STREAM_NAME_LEN 128 - - -#endif diff --git a/linux_module/ioctls.txt b/linux_module/ioctls.txt index 661a2fe..95ea1e6 100644 --- a/linux_module/ioctls.txt +++ b/linux_module/ioctls.txt @@ -3,20 +3,30 @@ To add a new ioctl find an available number and add it to this list. Global commands (/dev/v3vee) -10 -- (VMM) Start guest +12 -- (VMM) Create VM +13 -- (VMM) Free VM 50 -- (VMM) Add physical memory to VMM manager +55 -- (IFACE) Add PCI HW Device +56 -- (IFACE) Add PCI User Device VM Commands (/dev/v3-vm*) 20 -- (IFACE) Connect CGA Console 21 -- (IFACE) Connect Stream -22 -- (VMM) Stop Guest +23 -- (VMM) Pause VM +24 -- (VMM) Continue VM +25 -- (VMM) Launch VM +26 -- (VMM) Stop VM +27 -- (VMM) Load VM +28 -- (VMM) Save VM 29 -- (VMM) Simulate guest 30 -- (EXT) Activate Inspector +31 -- (VMM) Debug VM +33 -- (VMM) Move VM core 257 -- (IFACE) VGA Console Framebuf Input 258 -- (IFACE) VGA Console Framebuf Query diff --git a/linux_module/palacios-stubs.c b/linux_module/palacios-stubs.c index de6dddd..554fb9b 100644 --- a/linux_module/palacios-stubs.c +++ b/linux_module/palacios-stubs.c @@ -206,12 +206,12 @@ static int lnx_thread_target(void * arg) { ret = thread_info->fn(thread_info->arg); + + INFO("Palacios Thread (%s) EXITTING\n", thread_info->name); + kfree(thread_info); // handle cleanup - - printk("Palacios Thread (%s) EXITTING\n", thread_info->name); - do_exit(ret); return 0; // should not get here. @@ -411,7 +411,7 @@ palacios_hook_interrupt(struct v3_vm_info * vm, if (error) { ERROR("error code for request_irq is %d\n", error); - panic("request vector %d failed",vector); + panic("request vector %d failed", vector); } } @@ -429,7 +429,7 @@ palacios_ack_interrupt( ) { ack_APIC_irq(); - DEBUG("Pretending to ack interrupt, vector=%d\n",vector); + DEBUG("Pretending to ack interrupt, vector=%d\n", vector); return 0; } @@ -439,7 +439,7 @@ palacios_ack_interrupt( static unsigned int palacios_get_cpu_khz(void) { - INFO("cpu_khz is %u\n",cpu_khz); + INFO("cpu_khz is %u\n", cpu_khz); if (cpu_khz == 0) { INFO("faking cpu_khz to 1000000\n"); diff --git a/linux_module/palacios.h b/linux_module/palacios.h index 6bb7271..11d3314 100644 --- a/linux_module/palacios.h +++ b/linux_module/palacios.h @@ -15,7 +15,7 @@ /* VM Specific IOCTLs */ #define V3_VM_CONSOLE_CONNECT 20 - +#define V3_VM_STREAM_CONNECT 21 #define V3_VM_PAUSE 23 #define V3_VM_CONTINUE 24 @@ -27,15 +27,16 @@ #define V3_VM_SIMULATE 29 #define V3_VM_INSPECT 30 +#define V3_VM_DEBUG 31 #define V3_VM_MOVE_CORE 33 -#define V3_VM_FB_INPUT (256+1) -#define V3_VM_FB_QUERY (256+2) +#define V3_VM_FB_INPUT 257 +#define V3_VM_FB_QUERY 258 -#define V3_VM_HOST_DEV_CONNECT (10244+1) +#define V3_VM_HOST_DEV_CONNECT 10245 -#define V3_VM_KSTREAM_USER_CONNECT (11244+1) +#define V3_VM_KSTREAM_USER_CONNECT 11245 // KERN_EMERG "<0>" /* system is unusable */ // KERN_ALERT "<1>" /* action must be taken immediately */ @@ -81,6 +82,7 @@ struct v3_chkpt_info { + void * trace_malloc(size_t size, gfp_t flags); void trace_free(const void * objp); diff --git a/linux_usr/v3_ctrl.h b/linux_usr/v3_ctrl.h index 442c2d9..e904263 100644 --- a/linux_usr/v3_ctrl.h +++ b/linux_usr/v3_ctrl.h @@ -10,6 +10,9 @@ #define V3_FREE_GUEST 13 +/* VM Specific ioctls */ +#define V3_VM_CONSOLE_CONNECT 20 +#define V3_VM_SERIAL_CONNECT 21 #define V3_VM_PAUSE 23 #define V3_VM_CONTINUE 24 @@ -17,14 +20,21 @@ #define V3_VM_STOP 26 #define V3_VM_LOAD 27 #define V3_VM_SAVE 28 +#define V3_VM_SIMULATE 29 +#define V3_VM_INSPECT 30 +#define V3_VM_DEBUG 31 #define V3_ADD_MEMORY 50 -#define V3_VM_CONSOLE_CONNECT 20 -#define V3_VM_SERIAL_CONNECT 21 - #define V3_VM_MOVE_CORE 33 +#define V3_VM_FB_INPUT 257 +#define V3_VM_FB_QUERY 258 + +#define V3_VM_HOST_DEV_CONNECT 10245 +#define V3_VM_KSTREAM_USER_CONNECT 11245 + + static const char * v3_dev = "/dev/v3vee"; struct v3_guest_img {