From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:36172) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UZYIH-0000BB-2N for qemu-devel@nongnu.org; Mon, 06 May 2013 23:10:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UZYIC-0006cW-HK for qemu-devel@nongnu.org; Mon, 06 May 2013 23:10:21 -0400 Date: Tue, 7 May 2013 13:07:36 +1000 From: David Gibson Message-ID: <20130507030736.GC13692@truffula.fritz.box> References: <1367545092-19980-1-git-send-email-david@gibson.dropbear.id.au> <1367545092-19980-8-git-send-email-david@gibson.dropbear.id.au> <51875DA7.4090308@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="qjNfmADvan18RZcF" Content-Disposition: inline In-Reply-To: <51875DA7.4090308@redhat.com> Subject: Re: [Qemu-devel] [Qemu-ppc] [PATCH 7/8] pseries: savevm support for PAPR virtual SCSI List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: qemu-ppc@nongnu.org, qemu-devel@nongnu.org, quintela@redhat.com --qjNfmADvan18RZcF Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, May 06, 2013 at 09:37:11AM +0200, Paolo Bonzini wrote: > Il 03/05/2013 03:38, David Gibson ha scritto: > > This patch adds the necessary support for saving the state of the PAPR = VIO > > virtual SCSI device. This turns out to be trivial, because the generiC > > SCSI code already quiesces the attached virtual SCSI bus. > >=20 > > Signed-off-by: David Gibson > > --- > > hw/scsi/spapr_vscsi.c | 28 ++++++++++++++++++++++++++++ > > 1 file changed, 28 insertions(+) > >=20 > > diff --git a/hw/scsi/spapr_vscsi.c b/hw/scsi/spapr_vscsi.c > > index 3d322d5..f416871 100644 > > --- a/hw/scsi/spapr_vscsi.c > > +++ b/hw/scsi/spapr_vscsi.c > > @@ -954,6 +954,33 @@ static Property spapr_vscsi_properties[] =3D { > > DEFINE_PROP_END_OF_LIST(), > > }; > > =20 > > +static void spapr_vscsi_pre_save(void *opaque) > > +{ > > + VSCSIState *s =3D opaque; > > + int i; > > + > > + /* Can't save active requests, apparently the general SCSI code > > + * quiesces the queue for us on vmsave */ > > + for (i =3D 0; i < VSCSI_REQ_LIMIT; i++) { > > + assert(!s->reqs[i].active); > > + } > > +} >=20 > This is only true when the rerror and werror options have the values > "ignore" or "report". See virtio-scsi for an example of how to save the > requests using the save_request and load_request callbacks in > SCSIBusInfo. Ah, bother. Unfortunately the save request is quite a lot more complicated for vscsi, since we have a lot more private data, and I'm not sure which bits can be reconstructed from other information. I'll see what I can come up with. What guarantees _does_ the scsi layer give about the lifecycle state of the requests when we savevm? --=20 David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson --qjNfmADvan18RZcF Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iEYEARECAAYFAlGIb/gACgkQaILKxv3ab8aeSwCeJgVpS5o9/NReKmzl2Gn2N+3Y 6VYAn2z6GgX1sRee1pTpmFqXLt2NAS1q =7B5Y -----END PGP SIGNATURE----- --qjNfmADvan18RZcF--