[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-ppc] [PATCH 7/8] pseries: savevm support for PAPR virtual SCSI
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-ppc] [PATCH 7/8] pseries: savevm support for PAPR virtual SCSI |
Date: |
Mon, 06 May 2013 09:37:11 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130311 Thunderbird/17.0.4 |
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.
>
> Signed-off-by: David Gibson <address@hidden>
> ---
> hw/scsi/spapr_vscsi.c | 28 ++++++++++++++++++++++++++++
> 1 file changed, 28 insertions(+)
>
> 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[] = {
> DEFINE_PROP_END_OF_LIST(),
> };
>
> +static void spapr_vscsi_pre_save(void *opaque)
> +{
> + VSCSIState *s = opaque;
> + int i;
> +
> + /* Can't save active requests, apparently the general SCSI code
> + * quiesces the queue for us on vmsave */
> + for (i = 0; i < VSCSI_REQ_LIMIT; i++) {
> + assert(!s->reqs[i].active);
> + }
> +}
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.
Paolo
> +static const VMStateDescription vmstate_spapr_vscsi = {
> + .name = "spapr_vscsi",
> + .version_id = 1,
> + .minimum_version_id = 1,
> + .minimum_version_id_old = 1,
> + .pre_save = spapr_vscsi_pre_save,
> + .fields = (VMStateField []) {
> + VMSTATE_SPAPR_VIO(vdev, VSCSIState),
> + /* VSCSI state */
> + /* ???? */
> +
> + VMSTATE_END_OF_LIST()
> + },
> +};
> +
> static void spapr_vscsi_class_init(ObjectClass *klass, void *data)
> {
> DeviceClass *dc = DEVICE_CLASS(klass);
> @@ -968,6 +995,7 @@ static void spapr_vscsi_class_init(ObjectClass *klass,
> void *data)
> k->signal_mask = 0x00000001;
> dc->props = spapr_vscsi_properties;
> k->rtce_window_size = 0x10000000;
> + dc->vmsd = &vmstate_spapr_vscsi;
> }
>
> static const TypeInfo spapr_vscsi_info = {
>
- [Qemu-ppc] [0/8] pseries: savevm / migration support, David Gibson, 2013/05/02
- [Qemu-ppc] [PATCH 1/8] savevm: Implement VMS_DIVIDE flag, David Gibson, 2013/05/02
- [Qemu-ppc] [PATCH 4/8] pseries: savevm support for VIO devices, David Gibson, 2013/05/02
- [Qemu-ppc] [PATCH 6/8] pseries: savevm support for PAPR TCE tables, David Gibson, 2013/05/02
- [Qemu-ppc] [PATCH 5/8] pseries: savevm support for PAPR VIO logical lan, David Gibson, 2013/05/02
- [Qemu-ppc] [PATCH 3/8] pseries: savevm support for XICS interrupt controller, David Gibson, 2013/05/02
- [Qemu-ppc] [PATCH 7/8] pseries: savevm support for PAPR virtual SCSI, David Gibson, 2013/05/02
- Re: [Qemu-ppc] [PATCH 7/8] pseries: savevm support for PAPR virtual SCSI,
Paolo Bonzini <=
- Re: [Qemu-ppc] [PATCH 7/8] pseries: savevm support for PAPR virtual SCSI, David Gibson, 2013/05/06
- Re: [Qemu-ppc] [PATCH 7/8] pseries: savevm support for PAPR virtual SCSI, Alexey Kardashevskiy, 2013/05/27
- Re: [Qemu-ppc] [PATCH 7/8] pseries: savevm support for PAPR virtual SCSI, Paolo Bonzini, 2013/05/27
- Re: [Qemu-ppc] [PATCH 7/8] pseries: savevm support for PAPR virtual SCSI, Alexey Kardashevskiy, 2013/05/31
- Re: [Qemu-ppc] [PATCH 7/8] pseries: savevm support for PAPR virtual SCSI, Paolo Bonzini, 2013/05/31
- Re: [Qemu-ppc] [PATCH 7/8] pseries: savevm support for PAPR virtual SCSI, Alexey Kardashevskiy, 2013/05/31
- Re: [Qemu-ppc] [PATCH 7/8] pseries: savevm support for PAPR virtual SCSI, Paolo Bonzini, 2013/05/31
- Re: [Qemu-ppc] [PATCH 7/8] pseries: savevm support for PAPR virtual SCSI, Alexey Kardashevskiy, 2013/05/31
- Re: [Qemu-ppc] [PATCH 7/8] pseries: savevm support for PAPR virtual SCSI, Paolo Bonzini, 2013/05/31
- Re: [Qemu-ppc] [PATCH 7/8] pseries: savevm support for PAPR virtual SCSI, Benjamin Herrenschmidt, 2013/05/31