Palacios Public Git Repository

To checkout Palacios execute

  git clone http://v3vee.org/palacios/palacios.web/palacios.git
This will give you the master branch. You probably want the devel branch or one of the release branches. To switch to the devel branch, simply execute
  cd palacios
  git checkout --track -b devel origin/devel
The other branches are similar.


Merge branch 'devel' into ide
[palacios.git] / palacios / src / palacios / vmm_config.c
index c0c713e..be73f33 100644 (file)
@@ -33,8 +33,8 @@
 #include <devices/8254.h>
 #include <devices/nvram.h>
 #include <devices/generic.h>
-#include <devices/ramdisk.h>
-#include <devices/cdrom.h>
+#include <devices/ide.h>
+#include <devices/ram_cd.h>
 #include <devices/bochs_debug.h>
 #include <devices/os_debug.h>
 #include <devices/apic.h>
@@ -279,11 +279,9 @@ static int setup_memory_map(struct guest_info * info, struct v3_vm_config * conf
 
 
 static int setup_devices(struct guest_info * info, struct v3_vm_config * config_ptr) {
-    struct vm_device * ramdisk = NULL;
-    struct vm_device * cdrom = NULL;
-#ifdef DEBUG_PCI
+    struct vm_device * ide = NULL;
+    struct vm_device * ram_cd = NULL;
     struct vm_device * pci = v3_create_pci();
-#endif
     struct vm_device * nvram = v3_create_nvram();
     //struct vm_device * timer = v3_create_timer();
     struct vm_device * pic = v3_create_pic();
@@ -301,11 +299,13 @@ static int setup_devices(struct guest_info * info, struct v3_vm_config * config_
     int use_ramdisk = config_ptr->use_ramdisk;
     int use_generic = USE_GENERIC;
 
+    ide = v3_create_ide(pci);
 
     if (use_ramdisk) {
        PrintDebug("Creating Ramdisk\n");
-       ramdisk = v3_create_ramdisk();
-       cdrom = v3_create_cdrom(ramdisk, config_ptr->ramdisk, config_ptr->ramdisk_size);
+       ram_cd = v3_create_ram_cd(ide, 0, 0, 
+                                 (addr_t)(config_ptr->ramdisk), 
+                                 config_ptr->ramdisk_size);
     }
     
     
@@ -313,9 +313,8 @@ static int setup_devices(struct guest_info * info, struct v3_vm_config * config_
        generic = configure_generic(info, config_ptr);
     }
 
-#ifdef DEBUG_PCI
+
     v3_attach_device(info, pci);
-#endif
 
     v3_attach_device(info, nvram);
     //v3_attach_device(info, timer);
@@ -331,9 +330,10 @@ static int setup_devices(struct guest_info * info, struct v3_vm_config * config_
 
     v3_attach_device(info, para_net);
 
+    v3_attach_device(info, ide);
+
     if (use_ramdisk) {
-       v3_attach_device(info, ramdisk);
-       v3_attach_device(info, cdrom);
+       v3_attach_device(info, ram_cd);
     }
 
     if (use_generic) {