qemu-devel
[Top][All Lists]
Advanced

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

[PATCH 08/26] hw/display/apple-gfx: Adds migration blocker


From: Phil Dennis-Jordan
Subject: [PATCH 08/26] hw/display/apple-gfx: Adds migration blocker
Date: Mon, 15 Jul 2024 23:06:47 +0200

Although the underlying ParavirtualizedGraphics.framework does support
state (de-)serialisation, this is currently not yet integrated. We
therefore add a migration blocker for now.

Signed-off-by: Phil Dennis-Jordan <phil@philjordan.eu>
---
 hw/display/apple-gfx.m | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/hw/display/apple-gfx.m b/hw/display/apple-gfx.m
index 39aba8d143..c97bd40cb5 100644
--- a/hw/display/apple-gfx.m
+++ b/hw/display/apple-gfx.m
@@ -24,6 +24,8 @@
 #include "sysemu/cpus.h"
 #include "ui/console.h"
 #include "monitor/monitor.h"
+#include "qapi/error.h"
+#include "migration/blocker.h"
 #import <ParavirtualizedGraphics/ParavirtualizedGraphics.h>
 
 #define TYPE_APPLE_GFX          "apple-gfx"
@@ -109,6 +111,8 @@ -(void)mmioWriteAtOffset:(size_t) offset 
value:(uint32_t)value;
 
 OBJECT_DECLARE_SIMPLE_TYPE(AppleGFXState, APPLE_GFX)
 
+static Error *apple_gfx_mig_blocker;
+
 static AppleGFXTask *apple_gfx_new_task(AppleGFXState *s, uint64_t len)
 {
     void *base = APPLE_GFX_BASE_VA;
@@ -362,6 +366,8 @@ static void apple_gfx_reset(DeviceState *d)
 static void apple_gfx_init(Object *obj)
 {
     AppleGFXState *s = APPLE_GFX(obj);
+    Error *local_err = NULL;
+    int r;
 
     memory_region_init_io(&s->iomem_gfx, obj, &apple_gfx_ops, s, 
TYPE_APPLE_GFX, 0x4000);
     memory_region_init_io(&s->iomem_iosfc, obj, &apple_iosfc_ops, s, 
TYPE_APPLE_GFX, 0x10000);
@@ -369,6 +375,16 @@ static void apple_gfx_init(Object *obj)
     sysbus_init_mmio(SYS_BUS_DEVICE(s), &s->iomem_iosfc);
     sysbus_init_irq(SYS_BUS_DEVICE(s), &s->irq_gfx);
     sysbus_init_irq(SYS_BUS_DEVICE(s), &s->irq_iosfc);
+
+    /* TODO: PVG framework supports serialising device state: integrate it! */
+    if (apple_gfx_mig_blocker == NULL) {
+        error_setg(&apple_gfx_mig_blocker,
+                  "Migration state blocked by apple-gfx display device");
+        r = migrate_add_blocker(&apple_gfx_mig_blocker, &local_err);
+        if (r < 0) {
+            error_report_err(local_err);
+        }
+    }
 }
 
 static void apple_gfx_realize(DeviceState *dev, Error **errp)
-- 
2.39.3 (Apple Git-146)




reply via email to

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