From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33682) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bMy9S-0006RU-TV for qemu-devel@nongnu.org; Tue, 12 Jul 2016 09:55:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bMy9N-0001pc-90 for qemu-devel@nongnu.org; Tue, 12 Jul 2016 09:55:05 -0400 Received: from mx1.redhat.com ([209.132.183.28]:52751) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bMy9N-0001pO-3V for qemu-devel@nongnu.org; Tue, 12 Jul 2016 09:55:01 -0400 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7ED063B741 for ; Tue, 12 Jul 2016 13:55:00 +0000 (UTC) Message-ID: <1468331697.30552.7.camel@redhat.com> From: Gerd Hoffmann Date: Tue, 12 Jul 2016 15:54:57 +0200 In-Reply-To: <1468325965-22818-13-git-send-email-dgilbert@redhat.com> References: <1468325965-22818-1-git-send-email-dgilbert@redhat.com> <1468325965-22818-13-git-send-email-dgilbert@redhat.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH v2 12/13] virtio-gpu: Wrap in vmstate List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Dr. David Alan Gilbert (git)" Cc: qemu-devel@nongnu.org, mst@redhat.com, amit.shah@redhat.com, quintela@redhat.com, cornelia.huck@del.ibm.com > @@ -1170,9 +1166,6 @@ static void virtio_gpu_device_realize(DeviceState *= qdev, Error **errp) > =20 > 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); > } > } > =20 > @@ -1220,6 +1213,9 @@ static void virtio_gpu_reset(VirtIODevice *vdev) > #endif > } > =20 > +VMSTATE_VIRTIO_DEVICE(gpu, VIRTIO_GPU_VM_VERSION, virtio_gpu_load, > + virtio_gpu_save); > + > static Property virtio_gpu_properties[] =3D { > DEFINE_PROP_UINT32("max_outputs", VirtIOGPU, conf.max_outputs, 1), > #ifdef CONFIG_VIRGL > @@ -1245,6 +1241,7 @@ static void virtio_gpu_class_init(ObjectClass *klas= s, void *data) > vdc->reset =3D virtio_gpu_reset; > =20 > dc->props =3D virtio_gpu_properties; > + dc->vmsd =3D &vmstate_virtio_gpu; > } > =20 > static const TypeInfo virtio_gpu_info =3D { This is confusing. I think for the virtio_gpu_virgl_enabled() case we install *two* vmstates now ... I think you should move up VMSTATE_VIRTIO_DEVICE, then simply replace the register_savevm() call with a vmstate_register() call. cheers, Gerd