aboutsummaryrefslogtreecommitdiff
path: root/hw/lance.c
diff options
context:
space:
mode:
authorJuan Quintela <quintela@redhat.com>2009-12-02 12:36:46 +0100
committerAnthony Liguori <aliguori@us.ibm.com>2009-12-03 10:05:58 -0600
commitbe73cfe2be9a41de4f97e4847b3f12a7d6d61159 (patch)
tree83419da906307e90aea6146c88f405aeeb32cf7d /hw/lance.c
parent70cca6d87261f3ab330e2be34fbe9596b13342ae (diff)
savevm: Port to qdev.vmsd all devices that have qdev
Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/lance.c')
-rw-r--r--hw/lance.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/hw/lance.c b/hw/lance.c
index 98033a4ed3..b6b04ddb9c 100644
--- a/hw/lance.c
+++ b/hw/lance.c
@@ -96,7 +96,6 @@ static void lance_cleanup(VLANClientState *nc)
{
PCNetState *d = DO_UPCAST(NICState, nc, nc)->opaque;
- vmstate_unregister(&vmstate_pcnet, d);
pcnet_common_cleanup(d);
}
@@ -108,6 +107,17 @@ static NetClientInfo net_lance_info = {
.cleanup = lance_cleanup,
};
+static const VMStateDescription vmstate_lance = {
+ .name = "pcnet",
+ .version_id = 3,
+ .minimum_version_id = 2,
+ .minimum_version_id_old = 2,
+ .fields = (VMStateField []) {
+ VMSTATE_STRUCT(state, SysBusPCNetState, 0, vmstate_pcnet, PCNetState),
+ VMSTATE_END_OF_LIST()
+ }
+};
+
static int lance_init(SysBusDevice *dev)
{
SysBusPCNetState *d = FROM_SYSBUS(SysBusPCNetState, dev);
@@ -124,8 +134,6 @@ static int lance_init(SysBusDevice *dev)
s->phys_mem_read = ledma_memory_read;
s->phys_mem_write = ledma_memory_write;
-
- vmstate_register(-1, &vmstate_pcnet, d);
return pcnet_common_init(&dev->qdev, s, &net_lance_info);
}
@@ -141,6 +149,7 @@ static SysBusDeviceInfo lance_info = {
.qdev.name = "lance",
.qdev.size = sizeof(SysBusPCNetState),
.qdev.reset = lance_reset,
+ .qdev.vmsd = &vmstate_lance,
.qdev.props = (Property[]) {
DEFINE_PROP_PTR("dma", SysBusPCNetState, state.dma_opaque),
DEFINE_NIC_PROPERTIES(SysBusPCNetState, state.conf),