X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?p=palacios.git;a=blobdiff_plain;f=palacios%2Fsrc%2Fdevices%2Fnvram.c;h=565c183d1ea2eb5f35c66d61bab01d4176ed9372;hp=36da2aacd973cf52ac62d54e063a3037393b6fc7;hb=123a1ba27ea09c8fa77a1b36ce625b43d7c48b14;hpb=82b8b87c344fcd1eab22e3f3be5ad54cbb3f8f68 diff --git a/palacios/src/devices/nvram.c b/palacios/src/devices/nvram.c index 36da2aa..565c183 100644 --- a/palacios/src/devices/nvram.c +++ b/palacios/src/devices/nvram.c @@ -25,6 +25,9 @@ #include #include +#include +#include +#include #ifndef CONFIG_DEBUG_NVRAM #undef PrintDebug @@ -791,9 +794,10 @@ static struct v3_device_ops dev_ops = { -static int nvram_init(struct guest_info * vm, void * cfg_data) { +static int nvram_init(struct guest_info * vm, v3_cfg_tree_t * cfg) { struct nvram_internal * nvram_state = NULL; - struct vm_device * ide = v3_find_dev(vm, (char *)cfg_data); + struct vm_device * ide = v3_find_dev(vm, v3_cfg_val(cfg, "storage")); + char * name = v3_cfg_val(cfg, "name"); if (!ide) { PrintError("Could not find IDE device\n"); @@ -807,11 +811,11 @@ static int nvram_init(struct guest_info * vm, void * cfg_data) { nvram_state->ide = ide; - struct vm_device * dev = v3_allocate_device("NVRAM", &dev_ops, nvram_state); + struct vm_device * dev = v3_allocate_device(name, &dev_ops, nvram_state); if (v3_attach_device(vm, dev) == -1) { - PrintError("Could not attach device %s\n", "NVRAM"); + PrintError("Could not attach device %s\n", name); return -1; }