From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35765) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bMyGz-0005F6-5H for qemu-devel@nongnu.org; Tue, 12 Jul 2016 10:02:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bMyGu-0003aN-Cc for qemu-devel@nongnu.org; Tue, 12 Jul 2016 10:02:52 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:2741 helo=mx0a-001b2d01.pphosted.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bMyGu-0003a7-7T for qemu-devel@nongnu.org; Tue, 12 Jul 2016 10:02:48 -0400 Received: from pps.filterd (m0098414.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.11/8.16.0.11) with SMTP id u6CDwnE2044425 for ; Tue, 12 Jul 2016 10:02:46 -0400 Received: from e06smtp14.uk.ibm.com (e06smtp14.uk.ibm.com [195.75.94.110]) by mx0b-001b2d01.pphosted.com with ESMTP id 243eudmcjg-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Tue, 12 Jul 2016 10:02:46 -0400 Received: from localhost by e06smtp14.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 12 Jul 2016 15:02:45 +0100 Received: from b06cxnps4074.portsmouth.uk.ibm.com (d06relay11.portsmouth.uk.ibm.com [9.149.109.196]) by d06dlp03.portsmouth.uk.ibm.com (Postfix) with ESMTP id 82BEC1B08070 for ; Tue, 12 Jul 2016 15:03:58 +0100 (BST) Received: from d06av02.portsmouth.uk.ibm.com (d06av02.portsmouth.uk.ibm.com [9.149.37.228]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id u6CE2bXF16711952 for ; Tue, 12 Jul 2016 14:02:37 GMT Received: from d06av02.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av02.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id u6CE2bS7001681 for ; Tue, 12 Jul 2016 08:02:37 -0600 Date: Tue, 12 Jul 2016 16:02:36 +0200 From: Cornelia Huck In-Reply-To: <1468331697.30552.7.camel@redhat.com> References: <1468325965-22818-1-git-send-email-dgilbert@redhat.com> <1468325965-22818-13-git-send-email-dgilbert@redhat.com> <1468331697.30552.7.camel@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Message-Id: <20160712160236.57c4a2b4.cornelia.huck@de.ibm.com> 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: Gerd Hoffmann Cc: "Dr. David Alan Gilbert (git)" , amit.shah@redhat.com, cornelia.huck@del.ibm.com, quintela@redhat.com, qemu-devel@nongnu.org, mst@redhat.com On Tue, 12 Jul 2016 15:54:57 +0200 Gerd Hoffmann 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.