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.


added back in 32 bit support
[palacios.git] / palacios / src / devices / lnx_virtio_sym.c
index ad5cbbd..2cd3745 100644 (file)
@@ -115,8 +115,9 @@ static int handle_kick(struct vm_device * dev) {
            addr_t page_addr;
            tmp_desc = &(q->desc[desc_idx]);
            
-           PrintDebug("Header Descriptor (ptr=%p) gpa=%p, len=%d, flags=%x, next=%d\n", tmp_desc, 
-                      (void *)(tmp_desc->addr_gpa), tmp_desc->length, 
+           PrintDebug("Header Descriptor (ptr=%p) gpa=%p, len=%d, flags=%x, next=%d\n", 
+                      tmp_desc, 
+                      (void *)(addr_t)(tmp_desc->addr_gpa), tmp_desc->length, 
                       tmp_desc->flags, tmp_desc->next);
        
 
@@ -162,9 +163,10 @@ static int virtio_io_write(uint16_t port, void * src, uint_t length, void * priv
     int port_idx = port % virtio->io_range_size;
 
 
+/*
     PrintDebug("VIRTIO SYMBIOTIC Write for port %d (index=%d) len=%d, value=%x\n", 
               port, port_idx,  length, *(uint32_t *)src);
-
+*/
 
 
     switch (port_idx) {
@@ -270,10 +272,10 @@ static int virtio_io_read(uint16_t port, void * dst, uint_t length, void * priva
     struct virtio_sym_state * virtio = (struct virtio_sym_state *)dev->private_data;
     int port_idx = port % virtio->io_range_size;
 
-
+/*
     PrintDebug("VIRTIO SYMBIOTIC Read  for port %d (index =%d), length=%d\n", 
               port, port_idx, length);
-
+*/
     switch (port_idx) {
        case HOST_FEATURES_PORT:
            if (length != 4) {
@@ -351,10 +353,11 @@ static struct v3_device_ops dev_ops = {
 
 
 
-static int virtio_init(struct guest_info * vm, void * cfg_data) {
-    struct vm_device * pci_bus = v3_find_dev(vm, (char *)cfg_data);
+static int virtio_init(struct guest_info * vm, v3_cfg_tree_t * cfg) {
+    struct vm_device * pci_bus = v3_find_dev(vm, v3_cfg_val(cfg, "bus"));
     struct virtio_sym_state * virtio_state = NULL;
     struct pci_device * pci_dev = NULL;
+    char * name = v3_cfg_val(cfg, "name");
 
     PrintDebug("Initializing VIRTIO Symbiotic device\n");
 
@@ -368,9 +371,9 @@ static int virtio_init(struct guest_info * vm, void * cfg_data) {
     memset(virtio_state, 0, sizeof(struct virtio_sym_state));
 
 
-    struct vm_device * dev = v3_allocate_device("LNX_VIRTIO_SYM", &dev_ops, virtio_state);
+    struct vm_device * dev = v3_allocate_device(name, &dev_ops, virtio_state);
     if (v3_attach_device(vm, dev) == -1) {
-       PrintError("Could not attach device %s\n", "LNX_VIRTIO_SYM");
+       PrintError("Could not attach device %s\n", name);
        return -1;
     }
 
@@ -414,7 +417,7 @@ static int virtio_init(struct guest_info * vm, void * cfg_data) {
        pci_dev = v3_pci_register_device(pci_bus, PCI_STD_DEVICE, 
                                         0, PCI_AUTO_DEV_NUM, 0,
                                         "LNX_VIRTIO_SYM", bars,
-                                        NULL, NULL, NULL, dev, NULL);
+                                        NULL, NULL, NULL, dev);
 
        if (!pci_dev) {
            PrintError("Could not register PCI Device\n");