@@ -27,6 +27,7 @@
#include "hw/virtio/virtio-gpu-pixman.h"
#include "hw/virtio/virtio-bus.h"
#include "hw/qdev-properties.h"
+#include "migration/blocker.h"
#include "qemu/log.h"
#include "qemu/module.h"
#include "qapi/error.h"
@@ -45,6 +46,8 @@ static void virtio_gpu_cleanup_mapping(VirtIOGPU *g,
struct virtio_gpu_simple_resource *res);
static void virtio_gpu_reset_bh(void *opaque);
+static Error *blob_mig_blocker;
+
void virtio_gpu_update_cursor_data(VirtIOGPU *g,
struct virtio_gpu_scanout *s,
uint32_t resource_id)
@@ -1368,6 +1371,14 @@ void virtio_gpu_device_realize(DeviceState *qdev, Error **errp)
error_setg(errp, "blobs and virgl are not compatible (yet)");
return;
}
+
+ if (!blob_mig_blocker) {
+ error_setg(&blob_mig_blocker,
+ "virtio-gpu blob VMs are currently not migratable.");
+ }
+ if (migrate_add_blocker(blob_mig_blocker, errp)) {
+ return;
+ }
}
if (!virtio_gpu_base_device_realize(qdev,
@@ -1394,6 +1405,9 @@ static void virtio_gpu_device_unrealize(DeviceState *qdev)
{
VirtIOGPU *g = VIRTIO_GPU(qdev);
+ if (virtio_gpu_blob_enabled(g->parent_obj.conf)) {
+ migrate_del_blocker(blob_mig_blocker);
+ }
g_clear_pointer(&g->ctrl_bh, qemu_bh_delete);
g_clear_pointer(&g->cursor_bh, qemu_bh_delete);
g_clear_pointer(&g->reset_bh, qemu_bh_delete);