Gleb Natapov [Thu, 22 Oct 2009 16:43:43 +0000 (17:43 +0100)]
net: use qemu_send_packet_raw() in qemu_announce_self()
Use qemu_send_packet_raw to send gratuitous arp. This will ensure that
vnet header is handled properly.
Also, avoid sending the gratuitous packet to the guest. There doesn't
appear to be any reason for doing that and the code will currently just
crash if the NIC is not associated with a vlan.
Signed-off-by: Gleb Natapov <gleb@redhat.com> Signed-off-by: Mark McLoughlin <markmc@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Mark McLoughlin [Thu, 22 Oct 2009 16:43:39 +0000 (17:43 +0100)]
net: add tap_has_vnet_hdr() and tap_using_vnet_hdr() APIs
These lamely named functions allow virtio-net to query whether
IFF_VNET_HDR is enabled on a tap interface and inform the tap code
that virtio-net will supply packets with a vnet header.
Signed-off-by: Mark McLoughlin <markmc@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Mark McLoughlin [Thu, 22 Oct 2009 16:43:38 +0000 (17:43 +0100)]
net: add a client type code
This is so as to allow APIs which operate on specific client types
without having to add a function table entry which is only implemented
by a single client type.
Signed-off-by: Mark McLoughlin <markmc@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Mark McLoughlin [Thu, 22 Oct 2009 16:43:37 +0000 (17:43 +0100)]
net: add a vnet_hdr=on|off parameter
This allows people to disable the IFF_VNET_HDR flag, e.g. for debugging
purposes or if they know they may migrate the guest to a machine without
IFF_VNET_HDR support.
It also allows making the lack of IFF_VNET_HDR support an error
condition, e.g. in the case where a guest is being migrated from a host
which does support it.
Signed-off-by: Mark McLoughlin <markmc@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Mark McLoughlin [Thu, 22 Oct 2009 16:43:36 +0000 (17:43 +0100)]
net: refactor tap initialization
Re-factor things so that there is only one call site for
net_tap_fd_init().
Two concerns about the QemuOpts usage here - firstly, we set the script
arguments to their default value and, secondly, we set the ifname value
to the name allocated by the kernel if none is supplied. Are we okay
with such things ending up in writeconfig output?
Signed-off-by: Mark McLoughlin <markmc@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Mark McLoughlin [Thu, 22 Oct 2009 16:43:35 +0000 (17:43 +0100)]
net: enable IFF_VNET_HDR on tap fds if available
For now, we just add an empty header before writing and strip the header
after reading.
We really only want IFF_VNET_HDR when virtio_net is using it, but it
would significantly complicate matters to try and do that. There should
be little or no performance impact with always adding headers.
Signed-off-by: Mark McLoughlin <markmc@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Mark McLoughlin [Thu, 22 Oct 2009 16:43:34 +0000 (17:43 +0100)]
net: make tap_receive() re-use tap_receive_iov() code
In future we will want to prepend a virtio_net header if the NIC didn't
supply one but IFF_VNET_HDR is enabled on the interface. This is most
easily achived by using writev() in all cases.
Signed-off-by: Mark McLoughlin <markmc@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Mark McLoughlin [Thu, 22 Oct 2009 16:43:33 +0000 (17:43 +0100)]
net: import linux tap ioctl definitions
Making features dependent on the availability of newer versions if_tun.h
is going to get seriously clumsy, so let's just import the definitions
we need. It's only a small handful.
If and when we're comfortable depending on 2.6.30 headers, we can remove
this again.
Signed-off-by: Mark McLoughlin <markmc@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Kevin Wolf [Thu, 22 Oct 2009 15:54:38 +0000 (17:54 +0200)]
Introduce contexts for asynchronous callbacks
Add the possibility to use AIO and BHs without allowing foreign callbacks to be
run. Basically, you put your own AIOs and BHs in a separate context. For
details see the comments in the source.
Signed-off-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Kevin Wolf [Thu, 22 Oct 2009 15:54:36 +0000 (17:54 +0200)]
Add qemu_aio_process_queue()
We'll leave some AIO completions unhandled when we can't call the callback.
qemu_aio_process_queue() is used later to run any callbacks that are left and
can be run then.
Signed-off-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Juan Quintela [Mon, 19 Oct 2009 18:00:36 +0000 (20:00 +0200)]
vmstate: Introduce the concept of sub-arrays
VMSTATE_SUB_ARRAY(..., start, num, ...) saves the num elems starting at
position start of the array Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Juan Quintela [Mon, 19 Oct 2009 13:46:28 +0000 (15:46 +0200)]
vmstate: Add VMSTATE_BUFFER_UNUSED
It allows to have 'things' in savevm format not backed in the device state Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Juan Quintela [Fri, 16 Oct 2009 13:26:53 +0000 (15:26 +0200)]
vmstate: Add version arg to VMSTATE_SINGLE_TEST()
This allows to define VMSTATE_SINGLE with VMSTATE_SINGLE_TEST Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Juan Quintela [Wed, 7 Oct 2009 15:58:34 +0000 (17:58 +0200)]
ide: change identify_data type to uint8_t
It is used everywhere as uint8_t except in one place. Cast to uint16_t
in that place Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Juan Quintela [Wed, 14 Oct 2009 11:12:42 +0000 (13:12 +0200)]
mc146818rtc: remove rtc_mm_init()
It was used for Acer Pica 61 emulation, removed in 2008 Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Kusanagi Kouichi [Fri, 16 Oct 2009 13:31:38 +0000 (22:31 +0900)]
Add chardev option to disable signal.
If I am using vga and serial which is stdio and hit C-c on
serial console, qemu terminates. That is annoying for me.
So make it configurable whether signal is generated when C-c is hit.
Signed-off-by: Kusanagi Kouichi <slash@ac.auone-net.jp> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Gerd Hoffmann [Wed, 14 Oct 2009 13:30:22 +0000 (15:30 +0200)]
hotplug: more fixes for scsi disk hotplug.
Changes:
- create common scsi_hot_add function for adding a scsi disk to
a adapter.
- Add sanity checks. You can't drive_add disks to the VGA any more.
- Ignore the unit value calculated by drive_init, add a comment
explaining why. Review the patch to find the details ;)
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Gerd Hoffmann [Tue, 13 Oct 2009 11:38:39 +0000 (13:38 +0200)]
isa: configure serial+parallel by index.
This patch adds a 'index' property to the isa-parallel and isa-serial
devices. This can be used to create devices with the default isa irqs
and ioports by simply specifying the index, i.e.
-device isa-serial,index=1
instead of
-device isa-serial,iobase=0x2f8,irq=3
for ttyS1 aka com2. Likewise for parallel ports.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>