sdk/emulator/qemu.git
15 years agoWork around dhclient brokenness
Anthony Liguori [Thu, 22 Oct 2009 16:43:48 +0000 (17:43 +0100)]
Work around dhclient brokenness

With the latest GSO/csum offload patches, any guest using an unpatched version
of dhclient (any Ubuntu guest, for instance), will no longer be able to get
a DHCP address.

dhclient is actually at fault here.  It uses AF_PACKET to receive DHCP responses
but does not check auxdata to see if the packet has a valid csum.  This causes
it to throw out the DHCP responses it gets from the virtio interface as there
is not a valid checksum.

Fedora has carried a patch to fix their dhclient (it's needed for Xen too) but
this patch has not made it into a release of dhclient.  AFAIK, the patch is in
the dhclient CVS but I cannot confirm since their CVS is not public.

This patch, suggested by Rusty, looks for UDP packets (of a normal MTU) and
explicitly adds a checksum to them if they are missing one.

This allows unpatched dhclients to continue to work without needing to update
the guest kernels.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Mark McLoughlin <markmc@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
15 years agovirtio-net: enable tap offload if guest supports it
Mark McLoughlin [Thu, 22 Oct 2009 16:43:47 +0000 (17:43 +0100)]
virtio-net: enable tap offload if guest supports it

We query the guest's feature set to see if it supports offload and,
if so, we enable those features on the tap interface.

Signed-off-by: Mark McLoughlin <markmc@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
15 years agonet: add tap_set_offload()
Mark McLoughlin [Thu, 22 Oct 2009 16:43:46 +0000 (17:43 +0100)]
net: add tap_set_offload()

This API allows virtio-net to enable various offload features on a
tap interface - e.g. to tell the host kernel it can pass up partial
checksums to userspace.

Signed-off-by: Mark McLoughlin <markmc@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
15 years agovirtio-net: add vnet_hdr support
Mark McLoughlin [Thu, 22 Oct 2009 16:43:45 +0000 (17:43 +0100)]
virtio-net: add vnet_hdr support

With '-netdev tap,id=foo -nic model=virtio,netdev=foo' virtio-net can
detect that its peer (i.e. the tap backend) supports vnet headers
and advertise to the guest that it can send packets with partial
checksums and/or TSO packets.

One complication is that if we're migrating and the source host
supports IFF_VNET_HDR but the destination host doesn't, we can't then
stop the guest from using those features. In this scenario, we just
fail the migration.

[v2:
 - add has_vnet_hdr uint32_t field for ease of vmstate conversion
 - use qemu_error()
]

Signed-off-by: Mark McLoughlin <markmc@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
15 years agonet: implement tap support for receive_raw()
Mark McLoughlin [Thu, 22 Oct 2009 16:43:44 +0000 (17:43 +0100)]
net: implement tap support for receive_raw()

tap_receive_raw() always prepends a vnet header if IFF_VNET_HDR is
enabled.

tap_receive() only prepends when the a header is required but the NIC
doesn't supply one.

Signed-off-by: Mark McLoughlin <markmc@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
15 years agonet: use qemu_send_packet_raw() in qemu_announce_self()
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>
15 years agonet: add receive_raw parameter to qemu_new_vlan_client()
Mark McLoughlin [Thu, 22 Oct 2009 16:43:42 +0000 (17:43 +0100)]
net: add receive_raw parameter to qemu_new_vlan_client()

Trivial patch to allow supplying a receive_raw function.

A future cleanup should combine this function pointer parameters into a
table.

Signed-off-by: Mark McLoughlin <markmc@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
15 years agonet: add an API for 'raw' packets
Mark McLoughlin [Thu, 22 Oct 2009 16:43:41 +0000 (17:43 +0100)]
net: add an API for 'raw' packets

In the case where a NIC and backend agree on a packet header format,
this API allows injecting packets which lack the agreed upon header.

We need this for sending our gratuitous ARP.

Signed-off-by: Mark McLoughlin <markmc@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
15 years agonet: add flags parameter to packet queue interface
Mark McLoughlin [Thu, 22 Oct 2009 16:43:40 +0000 (17:43 +0100)]
net: add flags parameter to packet queue interface

This allows for the addition of a raw flag, and leaves the way open
for other flags too.

Signed-off-by: Mark McLoughlin <markmc@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
15 years agonet: add tap_has_vnet_hdr() and tap_using_vnet_hdr() APIs
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>
15 years agonet: add a client type code
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>
15 years agonet: add a vnet_hdr=on|off parameter
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>
15 years agonet: refactor tap initialization
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>
15 years agonet: enable IFF_VNET_HDR on tap fds if available
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>
15 years agonet: make tap_receive() re-use tap_receive_iov() code
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>
15 years agonet: import linux tap ioctl definitions
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>
15 years agonet: remove unused includes of if_tun.h and if_tap.h
Mark McLoughlin [Thu, 22 Oct 2009 16:43:32 +0000 (17:43 +0100)]
net: remove unused includes of if_tun.h and if_tap.h

Looks like these are just artifacts of vl.c being split up.

Signed-off-by: Mark McLoughlin <markmc@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
15 years agoRevert "qcow2: Bring synchronous read/write back to life"
Kevin Wolf [Thu, 22 Oct 2009 15:54:42 +0000 (17:54 +0200)]
Revert "qcow2: Bring synchronous read/write back to life"

It was merely a workaround and the real fix is done now.
This reverts commit ef845c3bf421290153154635dc18eaa677cecb43.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
15 years agolinux-aio: Honour AsyncContext
Kevin Wolf [Thu, 22 Oct 2009 15:54:41 +0000 (17:54 +0200)]
linux-aio: Honour AsyncContext

Also for Linux AIO, don't call callbacks that don't belong to the active
AsyncContext.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
15 years agoposix-aio-compat: Honour AsyncContext
Kevin Wolf [Thu, 22 Oct 2009 15:54:40 +0000 (17:54 +0200)]
posix-aio-compat: Honour AsyncContext

Don't call callbacks that don't belong to the active AsyncContext.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
15 years agoblock: Use new AsyncContext for bdrv_read/write emulation
Kevin Wolf [Thu, 22 Oct 2009 15:54:39 +0000 (17:54 +0200)]
block: Use new AsyncContext for bdrv_read/write emulation

bdrv_read/write emulation is used as the perfect example why we need something
like AsyncContexts. So maybe they better start using it.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
15 years agoIntroduce contexts for asynchronous callbacks
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>
15 years agoSplit out bottom halves
Kevin Wolf [Thu, 22 Oct 2009 15:54:37 +0000 (17:54 +0200)]
Split out bottom halves

Instead of putting more and more stuff into vl.c, let's have the generic
functions that deal with asynchronous callbacks in their own file.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
15 years agoAdd qemu_aio_process_queue()
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>
15 years agoposix-aio-compat: Split out posix_aio_process_queue
Kevin Wolf [Thu, 22 Oct 2009 15:54:35 +0000 (17:54 +0200)]
posix-aio-compat: Split out posix_aio_process_queue

We need to process the request queue and run callbacks separately from reading
out the queue in a later patch, so split it out.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
15 years agomonitor: Convert do_closefd() to QObject
Luiz Capitulino [Fri, 16 Oct 2009 15:23:51 +0000 (12:23 -0300)]
monitor: Convert do_closefd() to QObject

Note that errors are not being converted yet.

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
15 years agomonitor: Convert do_getfd() to QObject
Luiz Capitulino [Fri, 16 Oct 2009 15:23:50 +0000 (12:23 -0300)]
monitor: Convert do_getfd() to QObject

Note that errors are not being converted yet.

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
15 years agomonitor: Convert do_eject() to QObject
Luiz Capitulino [Fri, 16 Oct 2009 15:23:49 +0000 (12:23 -0300)]
monitor: Convert do_eject() to QObject

Note that errors are not being converted yet.

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
15 years agomonitor: Convert do_pci_device_hot_remove() to QObject
Luiz Capitulino [Fri, 16 Oct 2009 15:23:48 +0000 (12:23 -0300)]
monitor: Convert do_pci_device_hot_remove() to QObject

Errors are still directly printed, as we are only converting
regular output.

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
15 years agomonitor: Convert do_migrate_cancel() to QObject
Luiz Capitulino [Fri, 16 Oct 2009 15:23:47 +0000 (12:23 -0300)]
monitor: Convert do_migrate_cancel() to QObject

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
15 years agomonitor: Convert do_migrate_set_speed() to QObject
Luiz Capitulino [Fri, 16 Oct 2009 15:23:46 +0000 (12:23 -0300)]
monitor: Convert do_migrate_set_speed() to QObject

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
15 years agomonitor: Convert do_migrate() to QObject
Luiz Capitulino [Fri, 16 Oct 2009 15:23:45 +0000 (12:23 -0300)]
monitor: Convert do_migrate() to QObject

Error is still directly printed, as we are only converting
regular output.

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
15 years agomonitor: Convert do_physical_memory_save() to QObject
Luiz Capitulino [Fri, 16 Oct 2009 15:23:44 +0000 (12:23 -0300)]
monitor: Convert do_physical_memory_save() to QObject

Note that errors are not being converted yet.

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
15 years agomonitor: Convert do_memory_save() to QObject
Luiz Capitulino [Fri, 16 Oct 2009 15:23:43 +0000 (12:23 -0300)]
monitor: Convert do_memory_save() to QObject

Note that errors are not being converted yet.

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
15 years agolsi_scsi: port to vmstate
Juan Quintela [Tue, 20 Oct 2009 15:56:54 +0000 (17:56 +0200)]
lsi_scsi: port to vmstate

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
15 years agovmstate: Add VMSTATE_BUFFER_UNSAFE
Juan Quintela [Tue, 20 Oct 2009 15:56:13 +0000 (17:56 +0200)]
vmstate: Add VMSTATE_BUFFER_UNSAFE

Just sent <anything> as a buffer.  We put the pointer and the size
code does the rest.

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
15 years agovmware_vga: port to vmstate
Juan Quintela [Wed, 14 Oct 2009 17:30:22 +0000 (19:30 +0200)]
vmware_vga: port to vmstate

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
15 years agovmware_vga: the support to change dinamically depth is not there
Juan Quintela [Wed, 14 Oct 2009 17:25:30 +0000 (19:25 +0200)]
vmware_vga: the support to change dinamically depth is not there

For a start bypp is not changed after vmsvga_reset() and it depends on depth

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
15 years agovmware_vga: scratch is really an array of uint32_t
Juan Quintela [Wed, 14 Oct 2009 17:15:54 +0000 (19:15 +0200)]
vmware_vga: scratch is really an array of uint32_t

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
15 years agovmware_vga: remove !EMBED_STDVGA code
Juan Quintela [Wed, 14 Oct 2009 16:57:40 +0000 (18:57 +0200)]
vmware_vga: remove !EMBED_STDVGA code

It don't compile.  And the trivial fixes (change vga.foo field to foo field
don't work either.  No output

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
15 years agovmware_vga: qemu_malloc() returns void *
Juan Quintela [Wed, 14 Oct 2009 16:16:51 +0000 (18:16 +0200)]
vmware_vga: qemu_malloc() returns void *

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
15 years agovmware_vga: Remove uselss casts from void *
Juan Quintela [Wed, 14 Oct 2009 15:49:08 +0000 (17:49 +0200)]
vmware_vga: Remove uselss casts from void *

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
15 years agovmware_vga: Pass pci_vmsga_state_t arg no VGACommonState
Juan Quintela [Wed, 14 Oct 2009 15:42:32 +0000 (17:42 +0200)]
vmware_vga: Pass pci_vmsga_state_t arg no VGACommonState

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
15 years agovga: remove unused vga_common_save/load
Juan Quintela [Wed, 14 Oct 2009 13:43:42 +0000 (15:43 +0200)]
vga: remove unused vga_common_save/load

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
15 years agovga: port vga-pci to vmstate
Juan Quintela [Wed, 14 Oct 2009 13:42:44 +0000 (15:42 +0200)]
vga: port vga-pci to vmstate

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
15 years agovga: port vmware std vga to vmstate
Juan Quintela [Wed, 14 Oct 2009 13:33:46 +0000 (15:33 +0200)]
vga: port vmware std vga to vmstate

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
15 years agovga: port vga-isa to vmstate
Juan Quintela [Wed, 14 Oct 2009 13:33:26 +0000 (15:33 +0200)]
vga: port vga-isa to vmstate

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
15 years agovga: port vga-isa-mm to vmstate
Juan Quintela [Wed, 14 Oct 2009 13:33:20 +0000 (15:33 +0200)]
vga: port vga-isa-mm to vmstate

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
15 years agovga: port vga_common_save/load to vmstate
Juan Quintela [Wed, 14 Oct 2009 13:25:25 +0000 (15:25 +0200)]
vga: port vga_common_save/load to vmstate

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
15 years agovga: create is_vbe_vmstate field
Juan Quintela [Wed, 14 Oct 2009 12:10:11 +0000 (14:10 +0200)]
vga: create is_vbe_vmstate field

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
15 years agoe1000: port to vmstate
Juan Quintela [Mon, 19 Oct 2009 18:06:05 +0000 (20:06 +0200)]
e1000: port to vmstate

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
15 years agoe1000: unfold mac_regarraystosave array
Juan Quintela [Mon, 19 Oct 2009 17:20:26 +0000 (19:20 +0200)]
e1000: unfold mac_regarraystosave array

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
15 years agoe1000: unfold mac_reg_tosave array
Juan Quintela [Mon, 19 Oct 2009 17:16:16 +0000 (19:16 +0200)]
e1000: unfold mac_reg_tosave array

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
15 years agone2000: port to vmstate
Juan Quintela [Mon, 19 Oct 2009 16:26:11 +0000 (18:26 +0200)]
ne2000: port to vmstate

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
15 years agopcnet: port to vmstate
Juan Quintela [Mon, 19 Oct 2009 16:02:13 +0000 (18:02 +0200)]
pcnet: port to vmstate

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
15 years agoeepro100: port to vmstate
Juan Quintela [Mon, 19 Oct 2009 13:37:57 +0000 (15:37 +0200)]
eepro100: port to vmstate

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
15 years agoeeprom93xx: port to vmstate
Juan Quintela [Fri, 16 Oct 2009 10:13:53 +0000 (12:13 +0200)]
eeprom93xx: port to vmstate

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
15 years agortl8139: port to vmstate
Juan Quintela [Thu, 15 Oct 2009 13:51:26 +0000 (15:51 +0200)]
rtl8139: port to vmstate

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
15 years agortl8139: port TallyCounters to vmstate
Juan Quintela [Thu, 15 Oct 2009 12:44:01 +0000 (14:44 +0200)]
rtl8139: port TallyCounters to vmstate

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
15 years agovmstate: Introduce the concept of sub-arrays
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>
15 years agovmstate: Add VMSTATE_MACADDR for the new type
Juan Quintela [Thu, 22 Oct 2009 18:50:06 +0000 (20:50 +0200)]
vmstate: Add VMSTATE_MACADDR for the new type

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
15 years agovmstate: Add VMSTATE_BUFFER_UNUSED
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>
15 years agovmstate: Add version arg to VMSTATE_SINGLE_TEST()
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>
15 years agovmstate: add VMS_VARRAY_UINT16_UNSAFE (varrays with uint16 indexes)
Juan Quintela [Fri, 16 Oct 2009 09:35:18 +0000 (11:35 +0200)]
vmstate: add VMS_VARRAY_UINT16_UNSAFE (varrays with uint16 indexes)

It don't check types.
Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
15 years agovmstate: Unfold VMSTATE_INT32_VARRAY() only use and remove it
Juan Quintela [Fri, 16 Oct 2009 11:29:48 +0000 (13:29 +0200)]
vmstate: Unfold VMSTATE_INT32_VARRAY() only use and remove it

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
15 years agovmstate: factor VMSTATE_*BUFFER* definitions
Juan Quintela [Fri, 16 Oct 2009 11:05:14 +0000 (13:05 +0200)]
vmstate: factor VMSTATE_*BUFFER* definitions

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
15 years agovmstate: factor vmstate_offset_buffer
Juan Quintela [Fri, 16 Oct 2009 10:53:07 +0000 (12:53 +0200)]
vmstate: factor vmstate_offset_buffer

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
15 years agovmstate: factor vmstate_offset_array
Juan Quintela [Fri, 16 Oct 2009 10:41:15 +0000 (12:41 +0200)]
vmstate: factor vmstate_offset_array

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
15 years agovmstate: factor vmstate_offset_pointer
Juan Quintela [Fri, 16 Oct 2009 10:35:27 +0000 (12:35 +0200)]
vmstate: factor vmstate_offset_pointer

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
15 years agovmstate: factor vmstate_offset_value
Juan Quintela [Fri, 16 Oct 2009 10:34:01 +0000 (12:34 +0200)]
vmstate: factor vmstate_offset_value

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
15 years agovmstate: fix indentation
Juan Quintela [Fri, 16 Oct 2009 09:29:03 +0000 (11:29 +0200)]
vmstate: fix indentation

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
15 years agovmstate: Rename VMS_VARRAY to VMS_VARRAY_INT32
Juan Quintela [Fri, 16 Oct 2009 09:27:17 +0000 (11:27 +0200)]
vmstate: Rename VMS_VARRAY to VMS_VARRAY_INT32

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
15 years agovmstate: add VMSTATE_UINT16_EQUAL[_V]
Juan Quintela [Thu, 15 Oct 2009 21:16:13 +0000 (23:16 +0200)]
vmstate: add VMSTATE_UINT16_EQUAL[_V]

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
15 years agovnmstate: fix name for uint8_equal
Juan Quintela [Thu, 15 Oct 2009 17:16:06 +0000 (19:16 +0200)]
vnmstate: fix name for uint8_equal

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
15 years agoserial: use post_load version_id field and remove pre_load function
Juan Quintela [Fri, 16 Oct 2009 13:39:58 +0000 (15:39 +0200)]
serial: use post_load version_id field and remove pre_load function

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
15 years agovmstate: Add support for partial buffers transmission
Juan Quintela [Wed, 14 Oct 2009 13:24:50 +0000 (15:24 +0200)]
vmstate: Add support for partial buffers transmission

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
15 years agoib700: port to vmstate
Juan Quintela [Wed, 14 Oct 2009 22:57:35 +0000 (00:57 +0200)]
ib700: port to vmstate

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
15 years agoib700: move timer to IB700State
Juan Quintela [Wed, 14 Oct 2009 22:54:28 +0000 (00:54 +0200)]
ib700: move timer to IB700State

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
15 years agoib700: Introduce IB700State
Juan Quintela [Wed, 14 Oct 2009 22:49:17 +0000 (00:49 +0200)]
ib700: Introduce IB700State

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
15 years agowdt_i6300esb: move PCI_DEVICE_IDE_INTEL_ESB_9 to pci_ids.h
Juan Quintela [Wed, 14 Oct 2009 23:12:25 +0000 (01:12 +0200)]
wdt_i6300esb: move PCI_DEVICE_IDE_INTEL_ESB_9 to pci_ids.h

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
15 years agowdt_i6300esb: remove useless casts from void *
Juan Quintela [Wed, 14 Oct 2009 20:58:14 +0000 (22:58 +0200)]
wdt_i6300esb: remove useless casts from void *

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
15 years agowdt_i6300esb: port to vmstate
Juan Quintela [Wed, 14 Oct 2009 20:47:04 +0000 (22:47 +0200)]
wdt_i6300esb: port to vmstate

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
15 years agoide: pre VMState functions are not needed anymore
Juan Quintela [Wed, 7 Oct 2009 18:58:03 +0000 (20:58 +0200)]
ide: pre VMState functions are not needed anymore

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
15 years agoide: port pci ide to vmstate
Juan Quintela [Wed, 7 Oct 2009 18:55:32 +0000 (20:55 +0200)]
ide: port pci ide to vmstate

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
15 years agoide: port pmac ide to vmstate
Juan Quintela [Wed, 7 Oct 2009 17:04:46 +0000 (19:04 +0200)]
ide: port pmac ide to vmstate

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
15 years agoide: port isa ide to vmstate
Juan Quintela [Wed, 7 Oct 2009 17:01:50 +0000 (19:01 +0200)]
ide: port isa ide to vmstate

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
15 years agoide: port ide mmio to vmstate
Juan Quintela [Wed, 7 Oct 2009 16:58:25 +0000 (18:58 +0200)]
ide: port ide mmio to vmstate

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
15 years agoide: include bus in MMIOState
Juan Quintela [Wed, 7 Oct 2009 16:55:36 +0000 (18:55 +0200)]
ide: include bus in MMIOState

Change pointer to struct by embedded struct.

Adjust all callers
Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
15 years agoide: port microdrive to vmstate
Juan Quintela [Wed, 7 Oct 2009 16:52:10 +0000 (18:52 +0200)]
ide: port microdrive to vmstate

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
15 years agoide: add VMSTATE_IDE_BUS and VMSTATE_IDE_DRIVES
Juan Quintela [Wed, 7 Oct 2009 16:51:30 +0000 (18:51 +0200)]
ide: add VMSTATE_IDE_BUS and VMSTATE_IDE_DRIVES

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
15 years agoide: microdrive cycle field is set as uint8_t
Juan Quintela [Wed, 7 Oct 2009 16:18:20 +0000 (18:18 +0200)]
ide: microdrive cycle field is set as uint8_t

Really, it is used as a boolean
Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
15 years agoide: port ide_drive to vmstate
Juan Quintela [Wed, 7 Oct 2009 15:59:47 +0000 (17:59 +0200)]
ide: port ide_drive to vmstate

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
15 years agovmstate: add VMSTATE_BUFFER_TEST
Juan Quintela [Wed, 7 Oct 2009 15:59:31 +0000 (17:59 +0200)]
vmstate: add VMSTATE_BUFFER_TEST

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
15 years agoide: change identify_data type to uint8_t
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>
15 years agoide: port idebus to vmstate
Juan Quintela [Wed, 7 Oct 2009 15:24:31 +0000 (17:24 +0200)]
ide: port idebus to vmstate

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
15 years agomc146818rtc: remove rtc_mm_init()
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>
15 years agomc146818rtc: fix indentation
Juan Quintela [Wed, 7 Oct 2009 22:14:58 +0000 (00:14 +0200)]
mc146818rtc: fix indentation

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
15 years agomc146818rtc: port rtc to vmstate
Juan Quintela [Wed, 7 Oct 2009 22:12:06 +0000 (00:12 +0200)]
mc146818rtc: port rtc to vmstate

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
15 years agomc145818rtc: fix saving of rtc-td hack properly upgrading the version number
Juan Quintela [Wed, 9 Sep 2009 20:17:30 +0000 (22:17 +0200)]
mc145818rtc: fix saving of rtc-td hack properly upgrading the version number

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
15 years agousb-uhci: port to vmstate
Juan Quintela [Wed, 14 Oct 2009 10:49:30 +0000 (12:49 +0200)]
usb-uhci: port to vmstate

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>