mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-06 17:23:56 -06:00
ui/vdagent: add a migration blocker
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> Message-Id: <20210805135715.857938-19-marcandre.lureau@redhat.com> Acked-by: Gerd Hoffmann <kraxel@redhat.com>
This commit is contained in:
parent
8038c5b646
commit
90208bc965
1 changed files with 12 additions and 0 deletions
12
ui/vdagent.c
12
ui/vdagent.c
|
@ -6,6 +6,7 @@
|
||||||
#include "qemu/option.h"
|
#include "qemu/option.h"
|
||||||
#include "qemu/units.h"
|
#include "qemu/units.h"
|
||||||
#include "hw/qdev-core.h"
|
#include "hw/qdev-core.h"
|
||||||
|
#include "migration/blocker.h"
|
||||||
#include "ui/clipboard.h"
|
#include "ui/clipboard.h"
|
||||||
#include "ui/console.h"
|
#include "ui/console.h"
|
||||||
#include "ui/input.h"
|
#include "ui/input.h"
|
||||||
|
@ -23,6 +24,9 @@
|
||||||
struct VDAgentChardev {
|
struct VDAgentChardev {
|
||||||
Chardev parent;
|
Chardev parent;
|
||||||
|
|
||||||
|
/* TODO: migration isn't yet supported */
|
||||||
|
Error *migration_blocker;
|
||||||
|
|
||||||
/* config */
|
/* config */
|
||||||
bool mouse;
|
bool mouse;
|
||||||
bool clipboard;
|
bool clipboard;
|
||||||
|
@ -599,6 +603,10 @@ static void vdagent_chr_open(Chardev *chr,
|
||||||
return;
|
return;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
if (migrate_add_blocker(vd->migration_blocker, errp) != 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
vd->mouse = VDAGENT_MOUSE_DEFAULT;
|
vd->mouse = VDAGENT_MOUSE_DEFAULT;
|
||||||
if (cfg->has_mouse) {
|
if (cfg->has_mouse) {
|
||||||
vd->mouse = cfg->mouse;
|
vd->mouse = cfg->mouse;
|
||||||
|
@ -832,14 +840,18 @@ static void vdagent_chr_init(Object *obj)
|
||||||
VDAgentChardev *vd = QEMU_VDAGENT_CHARDEV(obj);
|
VDAgentChardev *vd = QEMU_VDAGENT_CHARDEV(obj);
|
||||||
|
|
||||||
buffer_init(&vd->outbuf, "vdagent-outbuf");
|
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)
|
static void vdagent_chr_fini(Object *obj)
|
||||||
{
|
{
|
||||||
VDAgentChardev *vd = QEMU_VDAGENT_CHARDEV(obj);
|
VDAgentChardev *vd = QEMU_VDAGENT_CHARDEV(obj);
|
||||||
|
|
||||||
|
migrate_del_blocker(vd->migration_blocker);
|
||||||
vdagent_disconnect(vd);
|
vdagent_disconnect(vd);
|
||||||
buffer_free(&vd->outbuf);
|
buffer_free(&vd->outbuf);
|
||||||
|
error_free(vd->migration_blocker);
|
||||||
}
|
}
|
||||||
|
|
||||||
static const TypeInfo vdagent_chr_type_info = {
|
static const TypeInfo vdagent_chr_type_info = {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue