diff mbox series

[v3,18/18] ui/vdagent: add a migration blocker

Message ID 20210805135715.857938-19-marcandre.lureau@redhat.com
State New
Headers show
Series Clipboard fixes (for 6.1?) | expand

Commit Message

Marc-André Lureau Aug. 5, 2021, 1:57 p.m. UTC
From: Marc-André Lureau <marcandre.lureau@redhat.com>

The current implementation lacks migration support. After migration,
vdagent support will be broken (even after a restart of the daemons).
Let's try to fix it in 6.2.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
 ui/vdagent.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

Comments

Marc-André Lureau Aug. 5, 2021, 2:57 p.m. UTC | #1
On Thu, Aug 5, 2021 at 6:06 PM <marcandre.lureau@redhat.com> wrote:

> From: Marc-André Lureau <marcandre.lureau@redhat.com>
>
> The current implementation lacks migration support. After migration,
> vdagent support will be broken (even after a restart of the daemons).
> Let's try to fix it in 6.2.
>
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> ---
>  ui/vdagent.c | 11 +++++++++++
>  1 file changed, 11 insertions(+)
>
> diff --git a/ui/vdagent.c b/ui/vdagent.c
> index 7d8cb963ff..603a2a7bd2 100644
> --- a/ui/vdagent.c
> +++ b/ui/vdagent.c
> @@ -6,6 +6,7 @@
>  #include "qemu/option.h"
>  #include "qemu/units.h"
>  #include "hw/qdev-core.h"
> +#include "migration/blocker.h"
>  #include "ui/clipboard.h"
>  #include "ui/console.h"
>  #include "ui/input.h"
> @@ -23,6 +24,9 @@
>  struct VDAgentChardev {
>      Chardev parent;
>
> +    /* TODO: migration isn't yet supported */
> +    Error *migration_blocker;
> +
>      /* config */
>      bool mouse;
>      bool clipboard;
> @@ -599,6 +603,10 @@ static void vdagent_chr_open(Chardev *chr,
>      return;
>  #endif
>
> +    if (migrate_add_blocker(vd->migration_blocker, errp) != 0) {
> +        return;
> +    }
> +
>      vd->mouse = VDAGENT_MOUSE_DEFAULT;
>      if (cfg->has_mouse) {
>          vd->mouse = cfg->mouse;
> @@ -832,6 +840,8 @@ static void vdagent_chr_init(Object *obj)
>      VDAgentChardev *vd = QEMU_VDAGENT_CHARDEV(obj);
>
>      buffer_init(&vd->outbuf, "vdagent-outbuf");
> +    error_setg(&vd->migration_blocker,
> +               "The vdagent chardev doesn't yet support migration");
>  }
>
>  static void vdagent_chr_fini(Object *obj)
> @@ -840,6 +850,7 @@ static void vdagent_chr_fini(Object *obj)
>
>
Missing
 +    migrate_del_blocker(vd->migration_blocker);

     vdagent_disconnect(vd);
>      buffer_free(&vd->outbuf);
> +    error_free(vd->migration_blocker);
>  }
>
>  static const TypeInfo vdagent_chr_type_info = {
> --
> 2.32.0.264.g75ae10bc75
>
>
>
diff mbox series

Patch

diff --git a/ui/vdagent.c b/ui/vdagent.c
index 7d8cb963ff..603a2a7bd2 100644
--- a/ui/vdagent.c
+++ b/ui/vdagent.c
@@ -6,6 +6,7 @@ 
 #include "qemu/option.h"
 #include "qemu/units.h"
 #include "hw/qdev-core.h"
+#include "migration/blocker.h"
 #include "ui/clipboard.h"
 #include "ui/console.h"
 #include "ui/input.h"
@@ -23,6 +24,9 @@ 
 struct VDAgentChardev {
     Chardev parent;
 
+    /* TODO: migration isn't yet supported */
+    Error *migration_blocker;
+
     /* config */
     bool mouse;
     bool clipboard;
@@ -599,6 +603,10 @@  static void vdagent_chr_open(Chardev *chr,
     return;
 #endif
 
+    if (migrate_add_blocker(vd->migration_blocker, errp) != 0) {
+        return;
+    }
+
     vd->mouse = VDAGENT_MOUSE_DEFAULT;
     if (cfg->has_mouse) {
         vd->mouse = cfg->mouse;
@@ -832,6 +840,8 @@  static void vdagent_chr_init(Object *obj)
     VDAgentChardev *vd = QEMU_VDAGENT_CHARDEV(obj);
 
     buffer_init(&vd->outbuf, "vdagent-outbuf");
+    error_setg(&vd->migration_blocker,
+               "The vdagent chardev doesn't yet support migration");
 }
 
 static void vdagent_chr_fini(Object *obj)
@@ -840,6 +850,7 @@  static void vdagent_chr_fini(Object *obj)
 
     vdagent_disconnect(vd);
     buffer_free(&vd->outbuf);
+    error_free(vd->migration_blocker);
 }
 
 static const TypeInfo vdagent_chr_type_info = {