On 01/19/2016 11:51 PM, John Snow wrote: > Split apart pick_geometry by creating a pick_drive routine that will only > ever called during device bring-up instead of relying on pick_geometry to > be used in both cases. > > With this change, the drive field is changed to be 'write once'. It is > not altered after the initialization routines exit. > > media_validated does not need to be migrated. The target VM > will just revalidate the media on post_load anyway. > > Signed-off-by: John Snow <js...@redhat.com> > --- > hw/block/fdc.c | 56 ++++++++++++++++++++++++++++++++++++++++++++++---------- > 1 file changed, 46 insertions(+), 10 deletions(-) >
> +++ b/hw/block/fdc.c > @@ -150,6 +150,7 @@ typedef struct FDrive { > uint8_t media_rate; /* Data rate of medium */ > > bool media_inserted; /* Is there a medium in the tray */ > + bool media_validated; /* Have we validated the media? */ > } FDrive; > > static void fd_init(FDrive *drv) > @@ -161,6 +162,8 @@ static void fd_init(FDrive *drv) > drv->disk = FLOPPY_DRIVE_TYPE_NONE; > drv->last_sect = 0; > drv->max_track = 0; > + drv->ro = true; > + drv->media_changed = 1; Not necessarily in this patch, but should media_changed be swapped to 'bool'? Reviewed-by: Eric Blake <ebl...@redhat.com> -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature