2 * This file is part of the Palacios Virtual Machine Monitor developed
3 * by the V3VEE Project with funding from the United States National
4 * Science Foundation and the Department of Energy.
6 * The V3VEE Project is a joint project between Northwestern University
7 * and the University of New Mexico. You can find out more at
10 * Copyright (c) 2008, Jack Lange <jarusl@cs.northwestern.edu>
11 * Copyright (c) 2008, The V3VEE Project <http://www.v3vee.org>
12 * All rights reserved.
14 * Author: Jack Lange <jarusl@cs.northwestern.edu>
16 * This is free software. You are permitted to use,
17 * redistribute, and modify it as specified in the file "V3VEE_LICENSE".
20 #include <palacios/vmm_dev_mgr.h>
21 #include <palacios/vm_guest.h>
22 #include <palacios/vmm.h>
23 #include <palacios/vmm_decoder.h>
25 #ifdef V3_CONFIG_CHECKPOINT
26 #include <palacios/vmm_checkpoint.h>
28 #define V3_MAX_DEVICE_NAME 32
33 #ifndef V3_CONFIG_DEBUG_DEV_MGR
35 #define PrintDebug(fmt, args...)
39 static struct hashtable * master_dev_table = NULL;
41 static uint_t dev_hash_fn(addr_t key) {
42 char * name = (char *)key;
43 return v3_hash_buffer((uchar_t *)name, strlen(name));
46 static int dev_eq_fn(addr_t key1, addr_t key2) {
47 char * name1 = (char *)key1;
48 char * name2 = (char *)key2;
50 return (strcmp(name1, name2) == 0);
54 int V3_init_devices() {
55 extern struct v3_device_info __start__v3_devices[];
56 extern struct v3_device_info __stop__v3_devices[];
57 struct v3_device_info * tmp_dev = __start__v3_devices;
60 #ifdef V3_CONFIG_DEBUG_DEV_MGR
62 int num_devices = (__stop__v3_devices - __start__v3_devices) / sizeof(struct v3_device_info);
63 PrintDebug(VM_NONE, VCORE_NONE, "%d Virtual devices registered with Palacios\n", num_devices);
67 PrintDebug(VM_NONE, VCORE_NONE, "Start addres=%p, Stop address=%p\n", __start__v3_devices, __stop__v3_devices);
69 master_dev_table = v3_create_htable(0, dev_hash_fn, dev_eq_fn);
73 while (tmp_dev != __stop__v3_devices) {
74 V3_Print(VM_NONE, VCORE_NONE, "Registering Device: %s\n", tmp_dev->name);
76 if (v3_htable_search(master_dev_table, (addr_t)(tmp_dev->name))) {
77 PrintError(VM_NONE, VCORE_NONE, "Multiple instance of device (%s)\n", tmp_dev->name);
81 if (v3_htable_insert(master_dev_table,
82 (addr_t)(tmp_dev->name),
83 (addr_t)(tmp_dev->init)) == 0) {
84 PrintError(VM_NONE, VCORE_NONE, "Could not add device %s to master list\n", tmp_dev->name);
88 tmp_dev = &(__start__v3_devices[++i]);
96 int V3_deinit_devices() {
97 v3_free_htable(master_dev_table, 0, 0);
102 int v3_init_dev_mgr(struct v3_vm_info * vm) {
103 struct vmm_dev_mgr * mgr = &(vm->dev_mgr);
105 INIT_LIST_HEAD(&(mgr->dev_list));
108 mgr->dev_table = v3_create_htable(0, dev_hash_fn, dev_eq_fn);
110 INIT_LIST_HEAD(&(mgr->blk_list));
111 INIT_LIST_HEAD(&(mgr->net_list));
112 INIT_LIST_HEAD(&(mgr->char_list));
113 INIT_LIST_HEAD(&(mgr->cons_list));
115 mgr->blk_table = v3_create_htable(0, dev_hash_fn, dev_eq_fn);
116 mgr->net_table = v3_create_htable(0, dev_hash_fn, dev_eq_fn);
117 mgr->char_table = v3_create_htable(0, dev_hash_fn, dev_eq_fn);
118 mgr->cons_table = v3_create_htable(0, dev_hash_fn, dev_eq_fn);
124 int v3_free_vm_devices(struct v3_vm_info * vm) {
125 struct vmm_dev_mgr * mgr = &(vm->dev_mgr);
126 struct vm_device * dev;
127 struct vm_device * tmp;
129 list_for_each_entry_safe(dev, tmp, &(mgr->dev_list), dev_link) {
130 v3_remove_device(dev);
136 #ifdef V3_CONFIG_CHECKPOINT
138 int v3_save_vm_devices(struct v3_vm_info * vm, struct v3_chkpt * chkpt) {
139 struct vmm_dev_mgr * mgr = &(vm->dev_mgr);
140 struct vm_device * dev;
141 struct v3_chkpt_ctx * dev_mgr_ctx = NULL;
143 uint32_t num_saved_devs = 0;
144 uint32_t table_len = mgr->num_devs * V3_MAX_DEVICE_NAME;
145 char * name_table = NULL;
146 uint32_t tbl_offset = 0;
148 name_table = V3_Malloc(table_len);
151 PrintError(vm, VCORE_NONE, "Unable to allocate space in device manager save\n");
155 memset(name_table, 0, table_len);
157 dev_mgr_ctx = v3_chkpt_open_ctx(chkpt, "devices");
160 PrintError(vm, VCORE_NONE,"Unable to open device manager context\n");
165 list_for_each_entry(dev, &(mgr->dev_list), dev_link) {
166 if (dev->ops->save) {
167 strncpy(name_table + tbl_offset, dev->name, V3_MAX_DEVICE_NAME);
168 tbl_offset += V3_MAX_DEVICE_NAME;
171 PrintDebug(vm, VCORE_NONE, "Skipping device %s\n", dev->name);
175 if (v3_chkpt_save(dev_mgr_ctx, "num_devs", 4, &num_saved_devs) == -1) {
176 PrintError(vm, VCORE_NONE,"Unable to store num_devs\n");
177 v3_chkpt_close_ctx(dev_mgr_ctx);
182 if (v3_chkpt_save(dev_mgr_ctx, "names", num_saved_devs*V3_MAX_DEVICE_NAME, name_table) == -1) {
183 PrintError(vm, VCORE_NONE,"Unable to store names of devices\n");
184 v3_chkpt_close_ctx(dev_mgr_ctx);
189 v3_chkpt_close_ctx(dev_mgr_ctx);
193 list_for_each_entry(dev, &(mgr->dev_list), dev_link) {
195 if (dev->ops->save_extended) {
197 V3_Print(vm, VCORE_NONE,"Saving state for device (%s) using extended interface\n",dev->name);
199 if (dev->ops->save_extended(chkpt,dev->name,dev->private_data)) {
200 PrintError(vm, VCORE_NONE,"Unable to save device %s\n",dev->name);
204 } else if (dev->ops->save) {
206 struct v3_chkpt_ctx * dev_ctx = NULL;
208 V3_Print(vm, VCORE_NONE,"Saving state for device (%s)\n", dev->name);
210 dev_ctx = v3_chkpt_open_ctx(chkpt, dev->name);
213 PrintError(vm, VCORE_NONE,"Unable to open context for device %s\n",dev->name);
217 if (dev->ops->save(dev_ctx, dev->private_data)) {
218 PrintError(vm, VCORE_NONE,"Unable t save device %s\n",dev->name);
219 v3_chkpt_close_ctx(dev_ctx);
223 v3_chkpt_close_ctx(dev_ctx);
226 PrintError(vm, VCORE_NONE,"Error: %s save() not implemented\n", dev->name);
234 int v3_load_vm_devices(struct v3_vm_info * vm, struct v3_chkpt * chkpt) {
235 struct vm_device * dev;
236 struct v3_chkpt_ctx * dev_mgr_ctx = NULL;
237 uint32_t num_devs = 0;
238 char * name_table = NULL;
241 dev_mgr_ctx = v3_chkpt_open_ctx(chkpt, "devices");
244 PrintError(vm, VCORE_NONE,"Unable to open devices for load\n");
248 if (v3_chkpt_load(dev_mgr_ctx, "num_devs", 4, &num_devs) == -1) {
249 PrintError(vm, VCORE_NONE,"Unable to load num_devs\n");
250 v3_chkpt_close_ctx(dev_mgr_ctx);
254 V3_Print(vm, VCORE_NONE,"Loading State for %d devices\n", num_devs);
256 name_table = V3_Malloc(V3_MAX_DEVICE_NAME * num_devs);
259 PrintError(vm, VCORE_NONE,"Unable to allocate space for device table\n");
260 v3_chkpt_close_ctx(dev_mgr_ctx);
264 if (v3_chkpt_load(dev_mgr_ctx, "names", V3_MAX_DEVICE_NAME * num_devs, name_table) == -1) {
265 PrintError(vm, VCORE_NONE,"Unable to load device name table\n");
266 v3_chkpt_close_ctx(dev_mgr_ctx);
270 v3_chkpt_close_ctx(dev_mgr_ctx);
272 for (i = 0; i < num_devs; i++) {
273 char * name = &(name_table[i * V3_MAX_DEVICE_NAME]);
274 struct v3_chkpt_ctx * dev_ctx = NULL;
275 dev = v3_find_dev(vm, name);
278 PrintError(vm, VCORE_NONE,"Tried to load state into non existant device: %s\n", name);
282 if (dev->ops->load_extended) {
284 V3_Print(vm, VCORE_NONE,"Loading state for device (%s) using extended interface\n",name);
286 if (dev->ops->load_extended(chkpt,name,dev->private_data)) {
287 PrintError(vm, VCORE_NONE,"Load of device %s failed\n",name);
291 } else if (dev->ops->load) {
293 dev_ctx = v3_chkpt_open_ctx(chkpt, name);
296 PrintError(vm, VCORE_NONE,"Error missing device context (%s)\n", name);
300 if (dev->ops->load(dev_ctx, dev->private_data)) {
301 PrintError(vm, VCORE_NONE,"Load of device %s failed\n",name);
302 v3_chkpt_close_ctx(dev_ctx);
306 // should close context regardless of whether load was successful
307 v3_chkpt_close_ctx(dev_ctx);
310 PrintError(vm, VCORE_NONE,"Error Device (%s) does not support load operation\n", name);
323 static int free_frontends(struct v3_vm_info * vm, struct vmm_dev_mgr * mgr);
325 int v3_deinit_dev_mgr(struct v3_vm_info * vm) {
326 struct vmm_dev_mgr * mgr = &(vm->dev_mgr);
328 // clear frontend lists
330 free_frontends(vm, mgr);
332 v3_free_htable(mgr->dev_table, 0, 0);
339 int v3_create_device(struct v3_vm_info * vm, const char * dev_name, v3_cfg_tree_t * cfg) {
340 int (*dev_init)(struct v3_vm_info * vm, void * cfg_data);
342 dev_init = (void *)v3_htable_search(master_dev_table, (addr_t)dev_name);
344 if (dev_init == NULL) {
345 PrintError(vm, VCORE_NONE,"Could not find device %s in master device table\n", dev_name);
350 if (dev_init(vm, cfg) == -1) {
351 PrintError(vm, VCORE_NONE,"Could not initialize Device %s\n", dev_name);
361 struct vm_device * v3_find_dev(struct v3_vm_info * vm, const char * dev_name) {
362 struct vmm_dev_mgr * mgr = &(vm->dev_mgr);
368 return (struct vm_device *)v3_htable_search(mgr->dev_table, (addr_t)dev_name);
372 /****************************************************************/
373 /* The remaining functions are called by the devices themselves */
374 /****************************************************************/
376 typedef enum {DEV_IO_HOOK, DEV_MSR_HOOK, DEV_CPUID_HOOK, DEV_MEM_HOOK, DEV_HCALL_HOOK} dev_rsrc_type_t;
379 dev_rsrc_type_t type;
382 struct list_head node;
387 static int add_resource(struct vm_device * dev, dev_rsrc_type_t type, uint64_t rsrc_id) {
388 struct dev_rsrc * resource = NULL;
390 resource = V3_Malloc(sizeof(struct dev_rsrc));
392 if (resource == NULL) {
393 PrintError(VM_NONE, VCORE_NONE,"Error: Could not allocate device resource\n");
397 resource->rsrc = rsrc_id;
398 resource->type = type;
400 list_add(&(resource->node), &(dev->res_hooks));
404 static int free_resource(struct vm_device * dev, dev_rsrc_type_t type, uint64_t rsrc_id) {
405 struct dev_rsrc * resource = NULL;
406 struct dev_rsrc * tmp;
408 list_for_each_entry_safe(resource, tmp, &(dev->res_hooks), node) {
409 if ((resource->type == type) &&
410 (resource->rsrc == rsrc_id)) {
412 list_del(&(resource->node));
423 int v3_dev_hook_io(struct vm_device * dev, uint16_t port,
424 int (*read)(struct guest_info * core, uint16_t port, void * dst, uint_t length, void * priv_data),
425 int (*write)(struct guest_info * core, uint16_t port, void * src, uint_t length, void * priv_data)) {
428 ret = v3_hook_io_port(dev->vm, port,
429 (int (*)(struct guest_info * core, uint16_t, void *, uint_t, void *))read,
430 (int (*)(struct guest_info * core, uint16_t, void *, uint_t, void *))write,
431 (void *)dev->private_data);
437 if (add_resource(dev, DEV_IO_HOOK, port) == -1) {
438 v3_unhook_io_port(dev->vm, port);
439 PrintError(dev->vm, VCORE_NONE,"Could not allocate io hook dev state\n");
447 int v3_dev_unhook_io(struct vm_device * dev, uint16_t port) {
448 if (free_resource(dev, DEV_IO_HOOK, port) == 0) {
449 return v3_unhook_io_port(dev->vm, port);
456 int v3_dev_hook_msr(struct vm_device * dev, uint32_t msr,
457 int (*read)(struct guest_info * core, uint32_t msr, struct v3_msr * dst, void * priv_data),
458 int (*write)(struct guest_info * core, uint32_t msr, struct v3_msr src, void * priv_data)) {
461 ret = v3_hook_msr(dev->vm, msr, read, write, dev->private_data);
467 if (add_resource(dev, DEV_MSR_HOOK, msr) == -1) {
468 v3_unhook_msr(dev->vm, msr);
475 int v3_dev_unhook_msr(struct vm_device * dev, uint32_t msr) {
476 if (free_resource(dev, DEV_MSR_HOOK, msr) == 0) {
477 return v3_unhook_msr(dev->vm, msr);
486 int v3_remove_device(struct vm_device * dev) {
487 struct vmm_dev_mgr * mgr = &(dev->vm->dev_mgr);
488 struct dev_rsrc * resource = NULL;
489 struct dev_rsrc * tmp;
491 list_for_each_entry_safe(resource, tmp, &(dev->res_hooks), node) {
492 if (resource->type == DEV_IO_HOOK) {
493 v3_unhook_io_port(dev->vm, (uint16_t)(resource->rsrc));
494 } else if (resource->type == DEV_MSR_HOOK) {
495 v3_unhook_msr(dev->vm, (uint32_t)(resource->rsrc));
498 list_del(&(resource->node));
502 if (dev->ops->free) {
503 dev->ops->free(dev->private_data);
505 PrintError(VM_NONE, VCORE_NONE,"Error: %s free() not implemented\n", dev->name);
508 list_del(&(dev->dev_link));
518 struct vm_device * v3_add_device(struct v3_vm_info * vm,
520 struct v3_device_ops * ops,
521 void * private_data) {
522 struct vmm_dev_mgr * mgr = &(vm->dev_mgr);
523 struct vm_device * dev = NULL;
526 // Check if we already registered a device of the same name
527 if (v3_htable_search(mgr->dev_table, (addr_t)name) != (addr_t)NULL) {
528 PrintError(vm, VCORE_NONE,"Device with name (%s) already registered with VM\n", name);
532 dev = (struct vm_device *)V3_Malloc(sizeof(struct vm_device));
535 PrintError(vm, VCORE_NONE,"Cannot allocate in adding a device\n");
539 INIT_LIST_HEAD(&(dev->res_hooks));
541 strncpy(dev->name, name, 32);
543 dev->private_data = private_data;
547 list_add(&(dev->dev_link), &(mgr->dev_list));
550 v3_htable_insert(mgr->dev_table, (addr_t)(dev->name), (addr_t)dev);
556 void v3_print_dev_mgr(struct v3_vm_info * vm) {
557 struct vmm_dev_mgr * mgr = &(vm->dev_mgr);
558 struct vm_device * dev;
560 V3_Print(vm, VCORE_NONE,"%d devices registered with manager\n", mgr->num_devs);
562 list_for_each_entry(dev, &(mgr->dev_list), dev_link) {
563 V3_Print(vm, VCORE_NONE,"Device: %s\n", dev->name);
572 struct blk_frontend {
573 int (*connect)(struct v3_vm_info * vm,
574 void * frontend_data,
575 struct v3_dev_blk_ops * ops,
580 struct list_head blk_node;
587 int v3_dev_add_blk_frontend(struct v3_vm_info * vm,
589 int (*connect)(struct v3_vm_info * vm,
590 void * frontend_data,
591 struct v3_dev_blk_ops * ops,
596 struct blk_frontend * frontend = NULL;
598 frontend = (struct blk_frontend *)V3_Malloc(sizeof(struct blk_frontend));
601 PrintError(vm, VCORE_NONE,"Cannot allocate in adding a block front end\n");
605 memset(frontend, 0, sizeof(struct blk_frontend));
607 frontend->connect = connect;
608 frontend->priv_data = priv_data;
610 list_add(&(frontend->blk_node), &(vm->dev_mgr.blk_list));
611 v3_htable_insert(vm->dev_mgr.blk_table, (addr_t)(name), (addr_t)frontend);
616 int v3_dev_connect_blk(struct v3_vm_info * vm,
617 char * frontend_name,
618 struct v3_dev_blk_ops * ops,
620 void * private_data) {
622 struct blk_frontend * frontend = NULL;
624 frontend = (struct blk_frontend *)v3_htable_search(vm->dev_mgr.blk_table,
625 (addr_t)frontend_name);
627 if (frontend == NULL) {
628 PrintError(vm, VCORE_NONE,"Could not find frontend blk device %s\n", frontend_name);
632 if (frontend->connect(vm, frontend->priv_data, ops, cfg, private_data) == -1) {
633 PrintError(vm, VCORE_NONE,"Error connecting to block frontend %s\n", frontend_name);
642 struct net_frontend {
643 int (*connect)(struct v3_vm_info * vm,
644 void * frontend_data,
645 struct v3_dev_net_ops * ops,
650 struct list_head net_node;
656 int v3_dev_add_net_frontend(struct v3_vm_info * vm,
658 int (*connect)(struct v3_vm_info * vm,
659 void * frontend_data,
660 struct v3_dev_net_ops * ops,
662 void * private_data),
665 struct net_frontend * frontend = NULL;
667 frontend = (struct net_frontend *)V3_Malloc(sizeof(struct net_frontend));
670 PrintError(vm, VCORE_NONE,"Cannot allocate in adding a net front end\n");
674 memset(frontend, 0, sizeof(struct net_frontend));
676 frontend->connect = connect;
677 frontend->priv_data = priv_data;
679 list_add(&(frontend->net_node), &(vm->dev_mgr.net_list));
680 v3_htable_insert(vm->dev_mgr.net_table, (addr_t)(name), (addr_t)frontend);
686 int v3_dev_connect_net(struct v3_vm_info * vm,
687 char * frontend_name,
688 struct v3_dev_net_ops * ops,
692 struct net_frontend * frontend = NULL;
694 frontend = (struct net_frontend *)v3_htable_search(vm->dev_mgr.net_table,
695 (addr_t)frontend_name);
697 if (frontend == NULL) {
698 PrintError(vm, VCORE_NONE,"Could not find frontend net device %s\n", frontend_name);
702 if (frontend->connect(vm, frontend->priv_data, ops, cfg, private_data) == -1) {
703 PrintError(vm, VCORE_NONE,"Error connecting to net frontend %s\n", frontend_name);
711 struct cons_frontend {
712 int (*connect)(struct v3_vm_info * vm,
713 void * frontend_data,
714 struct v3_dev_console_ops * ops,
719 struct list_head cons_node;
724 int v3_dev_add_console_frontend(struct v3_vm_info * vm,
726 int (*connect)(struct v3_vm_info * vm,
727 void * frontend_data,
728 struct v3_dev_console_ops * ops,
730 void * private_data),
733 struct cons_frontend * frontend = NULL;
735 frontend = (struct cons_frontend *)V3_Malloc(sizeof(struct cons_frontend));
738 PrintError(vm, VCORE_NONE,"Cannot allocate in adding a console front end\n");
742 memset(frontend, 0, sizeof(struct cons_frontend));
744 frontend->connect = connect;
745 frontend->priv_data = priv_data;
747 list_add(&(frontend->cons_node), &(vm->dev_mgr.cons_list));
748 v3_htable_insert(vm->dev_mgr.cons_table, (addr_t)(name), (addr_t)frontend);
754 int v3_dev_connect_console(struct v3_vm_info * vm,
755 char * frontend_name,
756 struct v3_dev_console_ops * ops,
760 struct cons_frontend * frontend = NULL;
762 frontend = (struct cons_frontend *)v3_htable_search(vm->dev_mgr.cons_table,
763 (addr_t)frontend_name);
765 if (frontend == NULL) {
766 PrintError(vm, VCORE_NONE,"Could not find frontend console device %s\n", frontend_name);
770 if (frontend->connect(vm, frontend->priv_data, ops, cfg, private_data) == -1) {
771 PrintError(vm, VCORE_NONE,"Error connecting to console frontend %s\n", frontend_name);
778 struct char_frontend {
779 int (*connect)(struct v3_vm_info * vm,
780 void * frontend_data,
781 struct v3_dev_char_ops * ops,
784 void ** push_fn_arg);
787 struct list_head char_node;
792 int v3_dev_add_char_frontend(struct v3_vm_info * vm,
794 int (*connect)(struct v3_vm_info * vm,
795 void * frontend_data,
796 struct v3_dev_char_ops * ops,
799 void ** push_fn_arg),
802 struct char_frontend * frontend = NULL;
804 frontend = (struct char_frontend *)V3_Malloc(sizeof(struct char_frontend));
807 PrintError(vm, VCORE_NONE,"Cannot allocate in adding a char front end\n");
811 memset(frontend, 0, sizeof(struct char_frontend));
813 frontend->connect = connect;
814 frontend->priv_data = priv_data;
816 list_add(&(frontend->char_node), &(vm->dev_mgr.char_list));
817 v3_htable_insert(vm->dev_mgr.char_table, (addr_t)(name), (addr_t)frontend);
823 int v3_dev_connect_char(struct v3_vm_info * vm,
824 char * frontend_name,
825 struct v3_dev_char_ops * ops,
830 struct char_frontend * frontend = NULL;
832 frontend = (struct char_frontend *)v3_htable_search(vm->dev_mgr.char_table,
833 (addr_t)frontend_name);
835 if (frontend == NULL) {
836 PrintError(vm, VCORE_NONE,"Could not find frontend char device %s\n", frontend_name);
840 if (frontend->connect(vm, frontend->priv_data, ops, cfg, private_data, push_fn_arg) == -1) {
841 PrintError(vm, VCORE_NONE,"Error connecting to char frontend %s\n", frontend_name);
850 static int free_frontends(struct v3_vm_info * vm, struct vmm_dev_mgr * mgr) {
851 struct char_frontend * chr = NULL;
852 struct char_frontend * tmp_chr = NULL;
853 struct cons_frontend * cons = NULL;
854 struct cons_frontend * tmp_cons = NULL;
855 struct net_frontend * net = NULL;
856 struct net_frontend * tmp_net = NULL;
857 struct blk_frontend * blk = NULL;
858 struct blk_frontend * tmp_blk = NULL;
862 list_for_each_entry_safe(chr, tmp_chr, &(mgr->char_list), char_node) {
863 list_del(&(chr->char_node));
867 list_for_each_entry_safe(cons, tmp_cons, &(mgr->cons_list), cons_node) {
868 list_del(&(cons->cons_node));
872 list_for_each_entry_safe(net, tmp_net, &(mgr->net_list), net_node) {
873 list_del(&(net->net_node));
877 list_for_each_entry_safe(blk, tmp_blk, &(mgr->blk_list), blk_node) {
878 list_del(&(blk->blk_node));
882 v3_free_htable(mgr->blk_table, 0, 0);
883 v3_free_htable(mgr->net_table, 0, 0);
884 v3_free_htable(mgr->char_table, 0, 0);
885 v3_free_htable(mgr->cons_table, 0, 0);
891 int v3_attach_device(struct v3_vm_info * vm, struct vm_device * dev)
893 PrintError(vm, VCORE_NONE, "v3_attach_device is deprecated and no longer works\n");
897 int v3_detach_device(struct vm_device * dev)
899 PrintError(VM_NONE, VCORE_NONE, "v3_detach_device is deprecated and no longer works\n");
903 struct vm_device * v3_allocate_device(char * name, struct v3_device_ops * ops, void * private_data)
905 PrintError(VM_NONE, VCORE_NONE, "v3_allocate_device is deprecated and no longer works\n");