#include "linux-exts.h"
-#ifdef V3_CONFIG_EXT_INSPECTOR
-#include "palacios-inspector.h"
-#endif
#ifdef V3_CONFIG_KEYED_STREAMS
#include "palacios-keyed-stream.h"
palacios_init_graphics_console();
#endif
-#ifdef V3_CONFIG_EXT_INSPECTOR
- palacios_init_inspector();
-#endif
#ifdef V3_CONFIG_SOCKET
palacios_socket_init();
deinit_lnx_extensions();
-#ifdef V3_CONFIG_EXT_INSPECTOR
- palacios_deinit_inspector();
-#endif
#include <interfaces/inspector.h>
#include "palacios.h"
+#include "palacios-vm.h"
+#include "linux-exts.h"
struct dentry * v3_dir = NULL;
-int palacios_init_inspector( void ) {
-
- v3_dir = debugfs_create_dir("v3vee", NULL);
-
- if (IS_ERR(v3_dir)) {
- printk("Error creating v3vee debugfs directory\n");
- return -1;
- }
-
- return 0;
-}
-
-
-int palacios_deinit_inspector( void ) {
- debugfs_remove(v3_dir);
- return 0;
-}
}
-int inspect_vm(struct v3_guest * guest) {
+static int inspect_vm(struct v3_guest * guest, unsigned int cmd, unsigned long arg,
+ void * priv_data) {
v3_inspect_node_t * root = v3_get_inspection_root(guest->v3_ctx);
struct dentry * guest_dir = NULL;
dfs_register_tree(guest_dir, root);
return 0;
}
+
+
+
+static int init_inspector( void ) {
+
+ v3_dir = debugfs_create_dir("v3vee", NULL);
+
+ if (IS_ERR(v3_dir)) {
+ printk("Error creating v3vee debugfs directory\n");
+ return -1;
+ }
+
+ return 0;
+}
+
+
+static int deinit_inspector( void ) {
+ debugfs_remove(v3_dir);
+ return 0;
+}
+
+
+static int guest_init(struct v3_guest * guest, void ** vm_data) {
+
+ add_guest_ctrl(guest, V3_VM_INSPECT, inspect_vm, NULL);
+ return 0;
+}
+
+static int guest_deinit(struct v3_guest * guest, void * vm_data) {
+
+ return 0;
+}
+
+
+struct linux_ext inspector_ext = {
+ .name = "INSPECTOR",
+ .init = init_inspector,
+ .deinit = deinit_inspector,
+ .guest_init = guest_init,
+ .guest_deinit = guest_deinit
+};
+
+
+register_extension(&inspector_ext);
+++ /dev/null
-/*
- * DebugFS interface
- * (c) Jack Lange, 2011
- */
-
-#include "palacios.h"
-
-int palacios_init_inspector( void );
-int palacios_deinit_inspector( void );
-
-
-
-int inspect_vm(struct v3_guest * guest);
-
+++ /dev/null
-/*
- * Palacios Stream interface
- * (c) Lei Xia, 2010
- */
-
-#ifndef __PALACIOS_STREAM_H__
-#define __PALACIOS_STREAM_H__
-
-#include <linux/spinlock.h>
-#include <linux/interrupt.h>
-#include "palacios.h"
-#include "palacios-ringbuffer.h"
-
-#define _V3VEE_
-//#include <palacios/vmm_ringbuffer.h>
-#undef _V3VEE_
-
-#define STREAM_BUF_SIZE 1024
-#define STREAM_NAME_LEN 128
-
-struct stream_buffer {
- char name[STREAM_NAME_LEN];
- struct ringbuf * buf;
-
- wait_queue_head_t intr_queue;
- spinlock_t lock;
-
- struct v3_guest * guest;
- struct list_head stream_node;
-};
-
-
-void palacios_init_stream(void);
-void palacios_deinit_stream(void);
-
-int stream_dequeue(struct stream_buffer * stream, char * buf, int len);
-int stream_datalen(struct stream_buffer * stream);
-
-struct stream_buffer * find_stream_by_name(struct v3_guest * guest, const char * name);
-
-int open_stream(const char * name);
-#endif
-
-#ifdef V3_CONFIG_EXT_INSPECTOR
-#include "palacios-inspector.h"
-#endif
#ifdef V3_CONFIG_GRAPHICS_CONSOLE
#include "palacios-graphics-console.h"
// init linux extensions
-#ifdef V3_CONFIG_EXT_INSPECTOR
- inspect_vm(guest);
-#endif
printk("Creating VM device: Major %d, Minor %d\n", MAJOR(guest->vm_dev), MINOR(guest->vm_dev));
#define V3_VM_STREAM_CONNECT 21
#define V3_VM_STOP 22
+#define V3_VM_INSPECT 30
+
#define V3_VM_FB_INPUT (256+1)
#define V3_VM_FB_QUERY (256+2)