[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 5/5] virtio-net: unbreak any layout
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [PATCH 5/5] virtio-net: unbreak any layout |
Date: |
Mon, 13 Jul 2015 08:50:15 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.0.1 |
On 13/07/2015 07:46, Jason Wang wrote:
> - if (out_sg[0].iov_len < n->guest_hdr_len) {
> + s = iov_to_buf(out_sg, out_num, 0, &hdr, sizeof(hdr));
> + if (s != sizeof(hdr)) {
> error_report("virtio-net header incorrect");
> exit(1);
> }
> - virtio_net_hdr_swap(vdev, (void *) out_sg[0].iov_base);
> + virtio_net_hdr_swap(vdev, (void *) &hdr);
> + s = iov_from_buf(out_sg, out_num, 0, &hdr, sizeof(hdr));
> + assert(s == sizeof(hdr));
> }
Are the copies necessary in the common case of no swap? In that case
you can just use iov_size.
Paolo
- Re: [Qemu-devel] [PATCH 2/5] virtio-blk: disable scsi passthrough for 1.0 device, (continued)
[Qemu-devel] [PATCH 3/5] virtio-blk: set VIRTIO_F_ANY_LAYOUT when 1.0 is supported, Jason Wang, 2015/07/13
[Qemu-devel] [PATCH 4/5] Revert "virtio-net: enable virtio 1.0", Jason Wang, 2015/07/13
[Qemu-devel] [PATCH 5/5] virtio-net: unbreak any layout, Jason Wang, 2015/07/13
Re: [Qemu-devel] [PATCH 5/5] virtio-net: unbreak any layout, Jason Wang, 2015/07/13
Re: [Qemu-devel] [PATCH 1/5] virtio-pci: ignore unaligned read/write in virtio_address_space_read()/write(), Michael S. Tsirkin, 2015/07/13