From nobody Sun May 5 18:05:51 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1520514814880649.3521709599777; Thu, 8 Mar 2018 05:13:34 -0800 (PST) Received: from localhost ([::1]:38659 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1etvMU-0000jw-3H for importer@patchew.org; Thu, 08 Mar 2018 08:13:34 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59694) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1etv2Q-0007n0-FI for qemu-devel@nongnu.org; Thu, 08 Mar 2018 07:52:51 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1etv2L-0006oj-Nm for qemu-devel@nongnu.org; Thu, 08 Mar 2018 07:52:50 -0500 Received: from smtp.citrix.com ([66.165.176.89]:28406) by eggs.gnu.org with esmtps (TLS1.0:RSA_ARCFOUR_SHA1:16) (Exim 4.71) (envelope-from ) id 1etv2L-0006o6-Hw for qemu-devel@nongnu.org; Thu, 08 Mar 2018 07:52:45 -0500 X-IronPort-AV: E=Sophos;i="5.47,441,1515456000"; d="scan'208";a="467039514" From: Igor Druzhinin To: , Date: Thu, 8 Mar 2018 12:52:31 +0000 Message-ID: <1520513551-19851-1-git-send-email-igor.druzhinin@citrix.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 66.165.176.89 Subject: [Qemu-devel] [PATCH] xen-pvdevice: Introduce a simplistic xen-pvdevice save state X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Igor Druzhinin , sstabellini@kernel.org, mst@redhat.com, paul.durrant@citrix.com, anthony.perard@citrix.com, pbonzini@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" This should help to avoid problems with accessing the device after migration/resume without PV drivers. Older systems will acquire the new record when migrated which should not change their state for worse. Signed-off-by: Igor Druzhinin Acked-by: Anthony PERARD Reviewed-by: Paul Durrant --- hw/i386/xen/xen_pvdevice.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/hw/i386/xen/xen_pvdevice.c b/hw/i386/xen/xen_pvdevice.c index c093b34..ef22a03 100644 --- a/hw/i386/xen/xen_pvdevice.c +++ b/hw/i386/xen/xen_pvdevice.c @@ -71,6 +71,16 @@ static const MemoryRegionOps xen_pv_mmio_ops =3D { .endianness =3D DEVICE_LITTLE_ENDIAN, }; =20 +static const VMStateDescription vmstate_xen_pvdevice =3D { + .name =3D "xen-pvdevice", + .version_id =3D 1, + .minimum_version_id =3D 1, + .fields =3D (VMStateField[]) { + VMSTATE_PCI_DEVICE(parent_obj, XenPVDevice), + VMSTATE_END_OF_LIST() + } +}; + static void xen_pv_realize(PCIDevice *pci_dev, Error **errp) { XenPVDevice *d =3D XEN_PV_DEVICE(pci_dev); @@ -120,6 +130,7 @@ static void xen_pv_class_init(ObjectClass *klass, void = *data) k->class_id =3D PCI_CLASS_SYSTEM_OTHER; dc->desc =3D "Xen PV Device"; dc->props =3D xen_pv_props; + dc->vmsd =3D &vmstate_xen_pvdevice; } =20 static const TypeInfo xen_pv_type_info =3D { --=20 2.7.4