qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH v2 02/16] hw/i386/vmport: Add compatability version field


From: Liran Alon
Subject: [PATCH v2 02/16] hw/i386/vmport: Add compatability version field
Date: Tue, 10 Mar 2020 18:53:18 +0200

No functional change.

This is done as a preparation for the following patches which will change
guest-visible behavior. Adding this version field will allow us to
maintain migration compatability from new QEMU version to old QEMU
version (Given machine-type is the compatabile).

Signed-off-by: Liran Alon <address@hidden>
---
 hw/i386/vmport.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/hw/i386/vmport.c b/hw/i386/vmport.c
index 8d7513e2a23c..ca4d95fc017f 100644
--- a/hw/i386/vmport.c
+++ b/hw/i386/vmport.c
@@ -44,6 +44,8 @@ typedef struct VMPortState {
     MemoryRegion io;
     VMPortReadFunc *func[VMPORT_ENTRIES];
     void *opaque[VMPORT_ENTRIES];
+
+    uint8_t version;
 } VMPortState;
 
 static VMPortState *port_state;
@@ -156,6 +158,12 @@ static void vmport_realizefn(DeviceState *dev, Error 
**errp)
 }
 
 static Property vmport_properties[] = {
+    /*
+     * Used to enforce compatibility for migration.
+     * On every guest-visible change, should make changes conditioned on
+     * version and define proper version for previous machine-types.
+     */
+    DEFINE_PROP_UINT8("version", VMPortState, version, 1),
     DEFINE_PROP_END_OF_LIST(),
 };
 
-- 
2.20.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]