[Qemu-devel] Re: [PATCH V3] floppy: save and restore DIR register

2011-04-06 Thread Juan Quintela
Jason Wang jasow...@redhat.com wrote: Paolo Bonzini writes: On 04/01/2011 08:22 AM, Jason Wang wrote: + +if (drive-bs == NULL) { +return 1; Is it okay to return 1 here? Have you tested the case when both the source and the target drives have no floppy?

[Qemu-devel] Re: [PATCH V3] floppy: save and restore DIR register

2011-04-06 Thread Juan Quintela
Jason Wang jasow...@redhat.com wrote: We need to keep DIR register unchanged across migration, but currently it depends on the media_changed flags from block layer. Since we do not save/restore it and the bdrv_open() called in dest node may set the media_changed flag when trying to open floppy

[Qemu-devel] Re: [PATCH V3] floppy: save and restore DIR register

2011-04-01 Thread Jes Sorensen
On 04/01/11 08:22, Jason Wang wrote: We need to keep DIR register unchanged across migration, but currently it depends on the media_changed flags from block layer. Since we do not save/restore it and the bdrv_open() called in dest node may set the media_changed flag when trying to open floppy

[Qemu-devel] Re: [PATCH V3] floppy: save and restore DIR register

2011-04-01 Thread Paolo Bonzini
On 04/01/2011 08:22 AM, Jason Wang wrote: + +if (drive-bs == NULL) { +return 1; Is it okay to return 1 here? Have you tested the case when both the source and the target drives have no floppy? (The media_changed == 2 in my sample code was basically a way to save the media

[Qemu-devel] Re: [PATCH V3] floppy: save and restore DIR register

2011-04-01 Thread Jason Wang
Paolo Bonzini writes: On 04/01/2011 08:22 AM, Jason Wang wrote: + +if (drive-bs == NULL) { +return 1; Is it okay to return 1 here? Have you tested the case when both the source and the target drives have no floppy? Thanks for the reminding, and it could be fixed

[Qemu-devel] Re: [PATCH V3] floppy: save and restore DIR register

2011-04-01 Thread Paolo Bonzini
On 04/01/2011 12:03 PM, Jason Wang wrote: Paolo Bonzini writes: On 04/01/2011 08:22 AM, Jason Wang wrote: + +if (drive-bs == NULL) { +return 1; Is it okay to return 1 here? Have you tested the case when both the source and the target drives have no