mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 07:43:54 -06:00
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>
This commit is contained in:
parent
70cca6d872
commit
be73cfe2be
26 changed files with 60 additions and 37 deletions
15
hw/lance.c
15
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),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue