X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?p=palacios.git;a=blobdiff_plain;f=palacios%2Fsrc%2Fdevices%2Flnx_virtio_balloon.c;h=fed0c83552e1feba8ed6907c16ed9324881bf0b3;hp=c29d9005c606bc0f5d5af6df1e4097c34745f764;hb=afb2a35b2e15ba0fa932c4e49a3678f958a4502a;hpb=4eb8163fe76127f9748caa43f8ffad1e4d739bb8 diff --git a/palacios/src/devices/lnx_virtio_balloon.c b/palacios/src/devices/lnx_virtio_balloon.c index c29d900..fed0c83 100644 --- a/palacios/src/devices/lnx_virtio_balloon.c +++ b/palacios/src/devices/lnx_virtio_balloon.c @@ -184,7 +184,8 @@ static int handle_kick(struct vm_device * dev) { return 0; } -static int virtio_io_write(uint16_t port, void * src, uint_t length, struct vm_device * dev) { +static int virtio_io_write(uint16_t port, void * src, uint_t length, void * private_data) { + struct vm_device * dev = (struct vm_device *)private_data; struct virtio_balloon_state * virtio = (struct virtio_balloon_state *)dev->private_data; int port_idx = port % virtio->io_range_size; @@ -292,7 +293,8 @@ 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) { +static int virtio_io_read(uint16_t port, void * dst, uint_t length, void * private_data) { + struct vm_device * dev = (struct vm_device *)private_data; struct virtio_balloon_state * virtio = (struct virtio_balloon_state *)dev->private_data; int port_idx = port % virtio->io_range_size; @@ -473,6 +475,8 @@ static int virtio_init(struct guest_info * vm, void * cfg_data) { bars[0].io_read = virtio_io_read; bars[0].io_write = virtio_io_write; + bars[0].private_data = dev; + pci_dev = v3_pci_register_device(pci_bus, PCI_STD_DEVICE, 0, PCI_AUTO_DEV_NUM, 0,