From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38910) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aM1HC-0008J2-O5 for qemu-devel@nongnu.org; Wed, 20 Jan 2016 17:30:55 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aM1HB-0005Hi-N0 for qemu-devel@nongnu.org; Wed, 20 Jan 2016 17:30:54 -0500 References: <1453272694-17106-1-git-send-email-jsnow@redhat.com> <1453272694-17106-7-git-send-email-jsnow@redhat.com> From: Eric Blake Message-ID: <56A00A96.7060804@redhat.com> Date: Wed, 20 Jan 2016 15:30:46 -0700 MIME-Version: 1.0 In-Reply-To: <1453272694-17106-7-git-send-email-jsnow@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="mnE1rBGWecO25IBjaO6Wk5RtKXiuRRKnC" Subject: Re: [Qemu-devel] [PATCH v4 06/12] fdc: add pick_drive List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: John Snow , qemu-block@nongnu.org Cc: kwolf@redhat.com, armbru@redhat.com, qemu-devel@nongnu.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --mnE1rBGWecO25IBjaO6Wk5RtKXiuRRKnC Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 01/19/2016 11:51 PM, John Snow wrote: > Split apart pick_geometry by creating a pick_drive routine that will on= ly > ever called during device bring-up instead of relying on pick_geometry = to > be used in both cases. >=20 > With this change, the drive field is changed to be 'write once'. It is > not altered after the initialization routines exit. >=20 > media_validated does not need to be migrated. The target VM > will just revalidate the media on post_load anyway. >=20 > Signed-off-by: John Snow > --- > hw/block/fdc.c | 56 ++++++++++++++++++++++++++++++++++++++++++++++----= ------ > 1 file changed, 46 insertions(+), 10 deletions(-) >=20 > +++ b/hw/block/fdc.c > @@ -150,6 +150,7 @@ typedef struct FDrive { > uint8_t media_rate; /* Data rate of medium */ > =20 > bool media_inserted; /* Is there a medium in the tray */ > + bool media_validated; /* Have we validated the media? */ > } FDrive; > =20 > static void fd_init(FDrive *drv) > @@ -161,6 +162,8 @@ static void fd_init(FDrive *drv) > drv->disk =3D FLOPPY_DRIVE_TYPE_NONE; > drv->last_sect =3D 0; > drv->max_track =3D 0; > + drv->ro =3D true; > + drv->media_changed =3D 1; Not necessarily in this patch, but should media_changed be swapped to 'bool'? Reviewed-by: Eric Blake --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --mnE1rBGWecO25IBjaO6Wk5RtKXiuRRKnC Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJWoAqWAAoJEKeha0olJ0NqdFMH/Ayj3Rl5qWYjWeGL7fjixPZx YRkv8mSYEMAw2bb0qEVPuf1YS5RagBiGtojAdJnHu0nBkUJlc4LpYCOkU5ibBZVU fJb1/voNIf+8UNva/Ll2whq6s4AytVZdoRWf0YwuoF3D8dLx83+bDBjz+JMUCxoT kjAf6xlOloxnJtuZyNiSJjK4dqnnkw/VLYp5hvh/7DS+SLhmXRUa+usEsgb4LY5N 5Z03iutMG0njWUSHFep/24UUNDiJvsob/5r9bPRVQseT6OvC1906D2bmhCSTmMeG 8LfvoQvmbLFt72+H7CsDJSk7deBcKALl5JVYpjPb2nARRsJfnN+xwVOvIlFg/xA= =TnGs -----END PGP SIGNATURE----- --mnE1rBGWecO25IBjaO6Wk5RtKXiuRRKnC--