[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2 12/13] virtio-gpu: Wrap in vmstate
From: |
Cornelia Huck |
Subject: |
Re: [Qemu-devel] [PATCH v2 12/13] virtio-gpu: Wrap in vmstate |
Date: |
Tue, 12 Jul 2016 16:02:36 +0200 |
On Tue, 12 Jul 2016 15:54:57 +0200
Gerd Hoffmann <address@hidden> wrote:
> > @@ -1170,9 +1166,6 @@ static void virtio_gpu_device_realize(DeviceState
> > *qdev, Error **errp)
> >
> > if (virtio_gpu_virgl_enabled(g->conf)) {
> > vmstate_register(qdev, -1, &vmstate_virtio_gpu_unmigratable, g);
> > - } else {
> > - register_savevm(qdev, "virtio-gpu", -1, VIRTIO_GPU_VM_VERSION,
> > - virtio_gpu_save, virtio_gpu_load, g);
> > }
> > }
> >
> > @@ -1220,6 +1213,9 @@ static void virtio_gpu_reset(VirtIODevice *vdev)
> > #endif
> > }
> >
> > +VMSTATE_VIRTIO_DEVICE(gpu, VIRTIO_GPU_VM_VERSION, virtio_gpu_load,
> > + virtio_gpu_save);
> > +
> > static Property virtio_gpu_properties[] = {
> > DEFINE_PROP_UINT32("max_outputs", VirtIOGPU, conf.max_outputs, 1),
> > #ifdef CONFIG_VIRGL
> > @@ -1245,6 +1241,7 @@ static void virtio_gpu_class_init(ObjectClass *klass,
> > void *data)
> > vdc->reset = virtio_gpu_reset;
> >
> > dc->props = virtio_gpu_properties;
> > + dc->vmsd = &vmstate_virtio_gpu;
> > }
> >
> > static const TypeInfo virtio_gpu_info = {
>
> This is confusing. I think for the virtio_gpu_virgl_enabled() case we
> install *two* vmstates now ...
I don't think that matters, as the unmigratable state already blocks,
no?
>
> I think you should move up VMSTATE_VIRTIO_DEVICE, then simply replace
> the register_savevm() call with a vmstate_register() call.
It would make virtio-gpu look different from all other devices, though.
- [Qemu-devel] [PATCH v2 01/13] virtio-net: Remove old migration version support, (continued)
- [Qemu-devel] [PATCH v2 01/13] virtio-net: Remove old migration version support, Dr. David Alan Gilbert (git), 2016/07/12
- [Qemu-devel] [PATCH v2 05/13] virtio-blk: Wrap in vmstate, Dr. David Alan Gilbert (git), 2016/07/12
- [Qemu-devel] [PATCH v2 07/13] virtio-balloon: Wrap in vmstate, Dr. David Alan Gilbert (git), 2016/07/12
- [Qemu-devel] [PATCH v2 06/13] virtio-rng: Wrap in vmstate, Dr. David Alan Gilbert (git), 2016/07/12
- [Qemu-devel] [PATCH v2 09/13] virtio-serial: Wrap in vmstate, Dr. David Alan Gilbert (git), 2016/07/12
- [Qemu-devel] [PATCH v2 08/13] virtio-net: Wrap in vmstate, Dr. David Alan Gilbert (git), 2016/07/12
- [Qemu-devel] [PATCH v2 10/13] 9pfs: Wrap in vmstate, Dr. David Alan Gilbert (git), 2016/07/12
- [Qemu-devel] [PATCH v2 13/13] virtio: Update migration docs, Dr. David Alan Gilbert (git), 2016/07/12
- [Qemu-devel] [PATCH v2 12/13] virtio-gpu: Wrap in vmstate, Dr. David Alan Gilbert (git), 2016/07/12
[Qemu-devel] [PATCH v2 11/13] virtio-input: Wrap in vmstate, Dr. David Alan Gilbert (git), 2016/07/12