#include <palacios/vmm.h>
#include <palacios/vmm_dev_mgr.h>
-#include <palacios/vmm_sym_swap.h>
#include <palacios/vm_guest.h>
};
-static int connect_fn(struct guest_info * info,
+static int connect_fn(struct v3_vm_info * vm,
void * frontend_data,
struct v3_dev_blk_ops * ops,
v3_cfg_tree_t * cfg,
model->seek_usecs = seek_time;
model->private_data = private_data;
- if (v3_dev_connect_blk(info, v3_cfg_val(frontend_cfg, "tag"),
+ if (v3_dev_connect_blk(vm, v3_cfg_val(frontend_cfg, "tag"),
&blk_ops, frontend_cfg, model) == -1) {
PrintError("Could not connect to frontend %s\n",
v3_cfg_val(frontend_cfg, "tag"));
return 0;
}
-static int model_init(struct guest_info * vm, v3_cfg_tree_t * cfg) {
+static int model_init(struct v3_vm_info * vm, v3_cfg_tree_t * cfg) {
- char * name = v3_cfg_val(cfg, "name");
+ char * dev_id = v3_cfg_val(cfg, "ID");
- struct vm_device * dev = v3_allocate_device(name, &dev_ops, NULL);
+ struct vm_device * dev = v3_allocate_device(dev_id, &dev_ops, NULL);
if (v3_attach_device(vm, dev) == -1) {
- PrintError("Could not attach device %s\n", name);
+ PrintError("Could not attach device %s\n", dev_id);
return -1;
}
- if (v3_dev_add_blk_frontend(vm, name, connect_fn, NULL) == -1) {
- PrintError("Could not register %s as block frontend\n", name);
+ if (v3_dev_add_blk_frontend(vm, dev_id, connect_fn, NULL) == -1) {
+ PrintError("Could not register %s as block frontend\n", dev_id);
return -1;
}