[Qemu-devel] [vhost] vhost_get_vq_desc, vq->iov mapping

2015-05-06 Thread Vasile Catalin-B50542
From what I know, qemu and vhost backends use some functions in order to access the memory between the guest and the backend. From what I see, vhost does this with vhost_get_vq_desc(). How much do vq->iov mappings remain valid? Does it get unmapped at some time (you could answer me within vhost-

Re: [Qemu-devel] [vhost] link new devices

2015-03-03 Thread Vasile Catalin-B50542
I'm not yet very accustomed to qemu sources and I usually associate source code modules integration with type_init(). Related to vhost-net, I later found out that it is an API like source code, it is used/called by virtio-net. On Fri, Feb 13, 2015 at 05:33:25PM +0200, Vasile Catalin-B

[Qemu-devel] [vhost] vq_index from struct vhost_dev

2015-03-03 Thread Vasile Catalin-B50542
Why does the field vq_index exist in each struct vhost_dev? Why isn't each vhost_dev using a vqs pointer starting directly from their first usable vq?

[Qemu-devel] [virtio-net] why does the tx virtqueue have a timer?

2015-03-03 Thread Vasile Catalin-B50542
1. Why does virtio-net have a timer to handle tx virtqueue? 2. Why isn't the virtqueue kick enough? (I see that both are set to handle jobs from virtqueue.) 3. What is the difference between regular timers and bh (bottom halves)? Why would you choose one over another?

[Qemu-devel] net devices

2015-02-25 Thread Vasile Catalin-B50542
I'm looking through the qemu sources and I'm trying to understand how net devices work. What is considered a net_client inside qemu sources? I'm asking about this because I came upon two functions which (because of their name) sound like they should be doing the same thing. The functions' name

[Qemu-devel] [vhost] link new devices

2015-02-13 Thread Vasile Catalin-B50542
How does the vhost API links with vhost devices? I don't see any "*-net" or "*_net" or even "*net" references in vhost API files, nor do I see any registering macros inside vhost-net device code.

Re: [Qemu-devel] [virtio] virtqueue request size

2015-02-13 Thread Vasile Catalin-B50542
I found out what was the problem. I was calling virtqueue_get_avail_bytes() after virtqueue_pop(). On 12.02.2015 15:52, Vasile Catalin-B50542 wrote: I'm trying to work out virtqueue from the virtio API. I've been able to send a message from guest to qemu, but there is something stra

Re: [Qemu-devel] [virtio] virtqueue request size

2015-02-13 Thread Vasile Catalin-B50542
I found what was the problem. virtqueue_get_avail_bytes() must be called before virtqueue_pop(). On 12.02.2015 15:52, Vasile Catalin-B50542 wrote: I'm trying to work out virtqueue from the virtio API. I've been able to send a message from guest to qemu, but there is something stra

[Qemu-devel] [virtio] virtqueue request size

2015-02-12 Thread Vasile Catalin-B50542
I'm trying to work out virtqueue from the virtio API. I've been able to send a message from guest to qemu, but there is something strange that I don't understand. virtqueue_get_avail_bytes() returns 0 number of "in" bytes, but if I hard code iov_to_buf() to get 5 bytes, it actually gets my messa

Re: [Qemu-devel] [virtio] virtqueue allocation and thread-safety

2015-01-16 Thread Vasile Catalin-B50542
Does the guest memory allocation include the descriptor tables allocation? Which part of the structures is the descriptor tables? On 15.01.2015 03:41, Fam Zheng wrote: On Wed, 01/14 14:01, Vasile Catalin-B50542 wrote: Hi, I'm trying to make a new virtio device. I got it running (I m

[Qemu-devel] [virtio] virtqueue allocation and thread-safety

2015-01-14 Thread Vasile Catalin-B50542
Hi, I'm trying to make a new virtio device. I got it running (I made a functional dummy device & guest driver). Now I'm trying to build some communication between the device and guest driver. I can't seem to find where the actual allocation of virtqueues are made. I've looked inside virtio_init

Re: [Qemu-devel] qemu sources and makefile system

2015-01-09 Thread Vasile Catalin-B50542
Thanks. It will be helpful in the future. I managed to make it work. The code was included, but I forgot to register the device type on the virtio-pci bus. static void virtio_pci_register_types(void) { /* ... */ type_register_static(&virtio_src_pci_info); /* ... */ } On 07.01.2015

[Qemu-devel] qemu sources and makefile system

2015-01-06 Thread Vasile Catalin-B50542
Hi, I'm new to qemu-devel and I'm trying to add a ".c" source to qemu. To be more specific, I'm trying to add a file into /hw/virtio/. I've added "common-obj-y += virtio-src.o" to the src>Makefile.objs in that folder and when I'm compiling qemu it seems to compile the sources, but I don't know if

[Qemu-devel] Sources and makefile system

2015-01-06 Thread Vasile Catalin-B50542
I'm new to qemu-devel and I'm trying to add a ".c" source to qemu. To be more specific, I'm trying to add a file into /hw/virtio/. I've added "common-obj-y += virtio-src.o" to the src>Makefile.objs in that folder and when I'm compiling qemu it seems to compile the sources, but I don't know if they

[Qemu-devel] qemu sources and makefile system

2015-01-06 Thread Vasile Catalin-B50542
Hi, I'm new to qemu-devel and I'm trying to add a ".c" source to qemu. To be more specific, I'm trying to add a file into /hw/virtio/. I've added "common-obj-y += virtio-src.o" to the Makefile.objs in that folder and when I'm compiling qemu it seems to compile the sources, but I don't know if

[Qemu-devel] Sources and makefile system

2015-01-06 Thread Vasile Catalin-B50542
I'm new to qemu-devel and I'm trying to add a ".c" source to qemu. To be more specific, I'm trying to add a file into /hw/virtio/. I've added "common-obj-y += virtio-src.o" to the src>Makefile.objs in that folder and when I'm compiling qemu it seems to compile the sources, but I don't know if they