From: Jack Lange Date: Thu, 30 Jul 2009 17:30:35 +0000 (-0500) Subject: build fixes X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=commitdiff_plain;h=ca8c220d24c70ef60564386c085e7c5064d4e744;hp=fd7198bbcdc5240b8f8545741787e51fd69da12a;p=palacios.git build fixes --- diff --git a/palacios/src/devices/lnx_virtio_blk.c b/palacios/src/devices/lnx_virtio_blk.c index 5eefbf8..cdbad38 100644 --- a/palacios/src/devices/lnx_virtio_blk.c +++ b/palacios/src/devices/lnx_virtio_blk.c @@ -18,7 +18,7 @@ */ #include - +#include #include @@ -62,23 +62,23 @@ struct virtio_blk_state { static int virtio_io_write(uint16_t port, void * src, uint_t length, struct vm_device * dev) { - struct virtio_device * virtio_dev = find_virtio_dev(dev); + struct virtio_blk_state * virtio = (struct virtio_blk_state *)dev->private_data; int port_idx = port % virtio->io_range_size; - uint8_t * cfg_ptr = (uint8_t *)cfg; + PrintDebug("VIRTIO BLOCK Write for port %d (index=%d) len=%d, value=%x\n", port, port_idx, length, *(uint32_t *)src); - switch (port_index) { + switch (port_idx) { case VRING_Q_NOTIFY_PORT: // handle output PrintError("Notification\n"); return -1; break; - case VRING_STATUS_PORT: - if (cfg->status == 0) { + case VIRTIO_STATUS_PORT: + if (virtio->virtio_cfg.status == 0) { PrintDebug("Resetting device\n"); return -1; //reset @@ -97,9 +97,9 @@ static int virtio_io_write(uint16_t port, void * src, uint_t length, struct vm_d static int virtio_io_read(uint16_t port, void * dst, uint_t length, struct vm_device * dev) { - struct blk_state * virtio = (struct blk_state *)dev->private_data; + struct virtio_blk_state * virtio = (struct virtio_blk_state *)dev->private_data; int port_idx = port % virtio->io_range_size; - uint8_t * cfg_ptr = (uint8_t *)cfg; + PrintDebug("VIRTIO BLOCK Read for port %d (index =%d), length=%d\n", port, port_idx, length); @@ -115,13 +115,6 @@ static int virtio_io_read(uint16_t port, void * dst, uint_t length, struct vm_de return length; } -struct v3_dev_ops = { - .free = virtio_free, - .reset = NULL, - .stop = NULL, - .start = NULL -}; - static int virtio_free(struct vm_device * dev) { return -1;