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.


OpenBSD reads the century byte, which wasn't being initialized.
[palacios.git] / palacios / src / devices / lnx_virtio_nic.c
index b6fd304..d0ac9a5 100644 (file)
@@ -115,11 +115,7 @@ struct virtio_net_state {
 #define ERR_VIRTIO_TXQ_DISABLED 6
 
 
-static int virtio_free(struct vm_device * dev) 
-{
-       
-    return 0;
-}
+
 
 static int virtio_init_state(struct virtio_net_state * virtio) 
 {
@@ -651,9 +647,17 @@ exit:
     return ret_val;
 }
 
+static int virtio_free(struct virtio_net_state * virtio) {
+       
+    // unregister from PCI
+
+    V3_Free(virtio);
+    return 0;
+}
+
 
 static struct v3_device_ops dev_ops = {
-    .free = virtio_free,
+    .free = (int (*)(void *))virtio_free,
 };
 
 
@@ -780,6 +784,8 @@ static int connect_fn(struct v3_vm_info * info,
 
     net_state->net_ops = ops;
     net_state->backend_data = private_data;
+    net_state->virtio_dev = virtio;
+       
 
     ops->recv = virtio_rx;
     ops->poll = virtio_nic_poll;