* [Qemu-devel] [PATCH 0/3] Fix migration (take 2)
@ 2009-11-11 23:39 Juan Quintela
2009-11-11 23:39 ` [Qemu-devel] [PATCH 1/3] fdc: fix vmstate variable passed Juan Quintela
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Juan Quintela @ 2009-11-11 23:39 UTC (permalink / raw)
To: qemu-devel; +Cc: blauwirbel, jan.kiszka, glommer, aliguori
Hi
With this three patches (on top of the one already in staging)
I am able to get migration working with today qemu/master.
- fdc: vmstate+reset qdev change made to use an vmstate that expected
an fdctrl_t variable and received a fdctrl_isabus_t variable. You can guess
what happened.
- qemu_system_reset: moved from main_loop() to before loadvm/incoming migration.
We can't reset "after" having loaded state, otherwise we lost the state that
we have just loaded.
- pci: pcie changes moved config for one array to one pointer. put method was
not updated to deal with it.
With this I have migration working.
ToDo for tomorrow:
- check rest of vmstate+reset conversions.
- rtl8139 and e1000 still don't work with migration. The networking changes
broke them, but I haven't yet found which one.
Juan Quintela (3):
fdc: fix vmstate variable passed
qemu_system_reset: we need to call it before loadvm/migration
pci: fix the conversion of config field from array to pointer
hw/fdc.c | 33 +++++++++++++++++++++++++++++----
hw/pci.c | 4 ++--
vl.c | 2 +-
3 files changed, 32 insertions(+), 7 deletions(-)
^ permalink raw reply [flat|nested] 5+ messages in thread* [Qemu-devel] [PATCH 1/3] fdc: fix vmstate variable passed 2009-11-11 23:39 [Qemu-devel] [PATCH 0/3] Fix migration (take 2) Juan Quintela @ 2009-11-11 23:39 ` Juan Quintela 2009-11-11 23:39 ` [Qemu-devel] [PATCH 2/3] qemu_system_reset: we need to call it before loadvm/migration Juan Quintela 2009-11-11 23:39 ` [Qemu-devel] [PATCH 3/3] pci: fix the conversion of config field from array to pointer Juan Quintela 2 siblings, 0 replies; 5+ messages in thread From: Juan Quintela @ 2009-11-11 23:39 UTC (permalink / raw) To: qemu-devel; +Cc: blauwirbel, jan.kiszka, glommer, aliguori When code was transformed to use qdev_reset/vmstate registration, vmstate was passed a variable of the wrong type Signed-off-by: Juan Quintela <quintela@redhat.com> --- hw/fdc.c | 33 +++++++++++++++++++++++++++++---- 1 files changed, 29 insertions(+), 4 deletions(-) diff --git a/hw/fdc.c b/hw/fdc.c index d2bfa71..e875291 100644 --- a/hw/fdc.c +++ b/hw/fdc.c @@ -661,7 +661,7 @@ static int fdc_post_load(void *opaque, int version_id) } static const VMStateDescription vmstate_fdc = { - .name = "fdc", + .name = "fdctrl", .version_id = 2, .minimum_version_id = 2, .minimum_version_id_old = 2, @@ -699,6 +699,31 @@ static const VMStateDescription vmstate_fdc = { } }; +static const VMStateDescription vmstate_fdc_isa = { + .name = "fdc", + .version_id = 2, + .minimum_version_id = 2, + .minimum_version_id_old = 2, + .fields = (VMStateField []) { + /* Controller State */ + VMSTATE_STRUCT(state, fdctrl_isabus_t, 0, vmstate_fdc, fdctrl_t), + VMSTATE_END_OF_LIST() + } +}; + +static const VMStateDescription vmstate_fdc_sysbus = { + .name = "fdc", + .version_id = 2, + .minimum_version_id = 2, + .minimum_version_id_old = 2, + .fields = (VMStateField []) { + /* Controller State */ + VMSTATE_STRUCT(state, fdctrl_sysbus_t, 0, vmstate_fdc, fdctrl_t), + VMSTATE_END_OF_LIST() + } +}; + + static void fdctrl_external_reset_sysbus(DeviceState *d) { fdctrl_sysbus_t *sys = container_of(d, fdctrl_sysbus_t, busdev.qdev); @@ -1998,7 +2023,7 @@ static ISADeviceInfo isa_fdc_info = { .qdev.name = "isa-fdc", .qdev.size = sizeof(fdctrl_isabus_t), .qdev.no_user = 1, - .qdev.vmsd = &vmstate_fdc, + .qdev.vmsd = &vmstate_fdc_isa, .qdev.reset = fdctrl_external_reset_isa, .qdev.props = (Property[]) { DEFINE_PROP_DRIVE("driveA", fdctrl_isabus_t, state.drives[0].dinfo), @@ -2011,7 +2036,7 @@ static SysBusDeviceInfo sysbus_fdc_info = { .init = sysbus_fdc_init1, .qdev.name = "sysbus-fdc", .qdev.size = sizeof(fdctrl_sysbus_t), - .qdev.vmsd = &vmstate_fdc, + .qdev.vmsd = &vmstate_fdc_sysbus, .qdev.reset = fdctrl_external_reset_sysbus, .qdev.props = (Property[]) { DEFINE_PROP_DRIVE("driveA", fdctrl_sysbus_t, state.drives[0].dinfo), @@ -2024,7 +2049,7 @@ static SysBusDeviceInfo sun4m_fdc_info = { .init = sun4m_fdc_init1, .qdev.name = "SUNW,fdtwo", .qdev.size = sizeof(fdctrl_sysbus_t), - .qdev.vmsd = &vmstate_fdc, + .qdev.vmsd = &vmstate_fdc_sysbus, .qdev.reset = fdctrl_external_reset_sysbus, .qdev.props = (Property[]) { DEFINE_PROP_DRIVE("drive", fdctrl_sysbus_t, state.drives[0].dinfo), -- 1.6.2.5 ^ permalink raw reply related [flat|nested] 5+ messages in thread
* [Qemu-devel] [PATCH 2/3] qemu_system_reset: we need to call it before loadvm/migration 2009-11-11 23:39 [Qemu-devel] [PATCH 0/3] Fix migration (take 2) Juan Quintela 2009-11-11 23:39 ` [Qemu-devel] [PATCH 1/3] fdc: fix vmstate variable passed Juan Quintela @ 2009-11-11 23:39 ` Juan Quintela 2009-11-12 10:30 ` [Qemu-devel] " Glauber Costa 2009-11-11 23:39 ` [Qemu-devel] [PATCH 3/3] pci: fix the conversion of config field from array to pointer Juan Quintela 2 siblings, 1 reply; 5+ messages in thread From: Juan Quintela @ 2009-11-11 23:39 UTC (permalink / raw) To: qemu-devel; +Cc: blauwirbel, jan.kiszka, glommer, aliguori Signed-off-by: Juan Quintela <quintela@redhat.com> --- vl.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/vl.c b/vl.c index bf91ee1..fff8e8d 100644 --- a/vl.c +++ b/vl.c @@ -4044,7 +4044,6 @@ static void main_loop(void) qemu_system_ready = 1; qemu_cond_broadcast(&qemu_system_cond); #endif - qemu_system_reset(); for (;;) { do { @@ -5835,6 +5834,7 @@ int main(int argc, char **argv, char **envp) rom_load_all(); + qemu_system_reset(); if (loadvm) { if (load_vmstate(cur_mon, loadvm) < 0) { autostart = 0; -- 1.6.2.5 ^ permalink raw reply related [flat|nested] 5+ messages in thread
* [Qemu-devel] Re: [PATCH 2/3] qemu_system_reset: we need to call it before loadvm/migration 2009-11-11 23:39 ` [Qemu-devel] [PATCH 2/3] qemu_system_reset: we need to call it before loadvm/migration Juan Quintela @ 2009-11-12 10:30 ` Glauber Costa 0 siblings, 0 replies; 5+ messages in thread From: Glauber Costa @ 2009-11-12 10:30 UTC (permalink / raw) To: Juan Quintela; +Cc: blauwirbel, jan.kiszka, aliguori, qemu-devel On Thu, Nov 12, 2009 at 12:39:13AM +0100, Juan Quintela wrote: > > Signed-off-by: Juan Quintela <quintela@redhat.com> > --- > vl.c | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/vl.c b/vl.c > index bf91ee1..fff8e8d 100644 > --- a/vl.c > +++ b/vl.c > @@ -4044,7 +4044,6 @@ static void main_loop(void) > qemu_system_ready = 1; > qemu_cond_broadcast(&qemu_system_cond); > #endif > - qemu_system_reset(); > > for (;;) { > do { > @@ -5835,6 +5834,7 @@ int main(int argc, char **argv, char **envp) > > rom_load_all(); > > + qemu_system_reset(); > if (loadvm) { > if (load_vmstate(cur_mon, loadvm) < 0) { > autostart = 0; > -- > 1.6.2.5 that seems fine. ^ permalink raw reply [flat|nested] 5+ messages in thread
* [Qemu-devel] [PATCH 3/3] pci: fix the conversion of config field from array to pointer 2009-11-11 23:39 [Qemu-devel] [PATCH 0/3] Fix migration (take 2) Juan Quintela 2009-11-11 23:39 ` [Qemu-devel] [PATCH 1/3] fdc: fix vmstate variable passed Juan Quintela 2009-11-11 23:39 ` [Qemu-devel] [PATCH 2/3] qemu_system_reset: we need to call it before loadvm/migration Juan Quintela @ 2009-11-11 23:39 ` Juan Quintela 2 siblings, 0 replies; 5+ messages in thread From: Juan Quintela @ 2009-11-11 23:39 UTC (permalink / raw) To: qemu-devel; +Cc: blauwirbel, jan.kiszka, glommer, aliguori Signed-off-by: Juan Quintela <quintela@redhat.com> --- hw/pci.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/pci.c b/hw/pci.c index 2ab1117..a326930 100644 --- a/hw/pci.c +++ b/hw/pci.c @@ -273,9 +273,9 @@ static int get_pci_config_device(QEMUFile *f, void *pv, size_t size) /* just put buffer */ static void put_pci_config_device(QEMUFile *f, void *pv, size_t size) { - const uint8_t *v = pv; + const uint8_t **v = pv; assert(size == pci_config_size(container_of(pv, PCIDevice, config))); - qemu_put_buffer(f, v, size); + qemu_put_buffer(f, *v, size); } static VMStateInfo vmstate_info_pci_config = { -- 1.6.2.5 ^ permalink raw reply related [flat|nested] 5+ messages in thread
end of thread, other threads:[~2009-11-12 10:30 UTC | newest] Thread overview: 5+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2009-11-11 23:39 [Qemu-devel] [PATCH 0/3] Fix migration (take 2) Juan Quintela 2009-11-11 23:39 ` [Qemu-devel] [PATCH 1/3] fdc: fix vmstate variable passed Juan Quintela 2009-11-11 23:39 ` [Qemu-devel] [PATCH 2/3] qemu_system_reset: we need to call it before loadvm/migration Juan Quintela 2009-11-12 10:30 ` [Qemu-devel] " Glauber Costa 2009-11-11 23:39 ` [Qemu-devel] [PATCH 3/3] pci: fix the conversion of config field from array to pointer Juan Quintela
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.