qemu_monitor: Wire up SPICE_MIGRATE_COMPLETED event

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
This commit is contained in:
Jiri Denemark 2015-05-28 13:35:06 +02:00
parent d814c70b3b
commit bfbbb78ca3
3 changed files with 28 additions and 0 deletions

View File

@ -1485,6 +1485,18 @@ qemuMonitorEmitSerialChange(qemuMonitorPtr mon,
}
int
qemuMonitorEmitSpiceMigrated(qemuMonitorPtr mon)
{
int ret = -1;
VIR_DEBUG("mon=%p", mon);
QEMU_MONITOR_CALLBACK(mon, ret, domainSpiceMigrated, mon->vm);
return ret;
}
int
qemuMonitorSetCapabilities(qemuMonitorPtr mon)
{

View File

@ -182,6 +182,10 @@ typedef int (*qemuMonitorDomainSerialChangeCallback)(qemuMonitorPtr mon,
bool connected,
void *opaque);
typedef int (*qemuMonitorDomainSpiceMigratedCallback)(qemuMonitorPtr mon,
virDomainObjPtr vm,
void *opaque);
typedef struct _qemuMonitorCallbacks qemuMonitorCallbacks;
typedef qemuMonitorCallbacks *qemuMonitorCallbacksPtr;
struct _qemuMonitorCallbacks {
@ -209,6 +213,7 @@ struct _qemuMonitorCallbacks {
qemuMonitorDomainDeviceDeletedCallback domainDeviceDeleted;
qemuMonitorDomainNicRxFilterChangedCallback domainNicRxFilterChanged;
qemuMonitorDomainSerialChangeCallback domainSerialChange;
qemuMonitorDomainSpiceMigratedCallback domainSpiceMigrated;
};
char *qemuMonitorEscapeArg(const char *in);
@ -307,6 +312,7 @@ int qemuMonitorEmitNicRxFilterChanged(qemuMonitorPtr mon,
int qemuMonitorEmitSerialChange(qemuMonitorPtr mon,
const char *devAlias,
bool connected);
int qemuMonitorEmitSpiceMigrated(qemuMonitorPtr mon);
int qemuMonitorStartCPUs(qemuMonitorPtr mon,
virConnectPtr conn);

View File

@ -83,6 +83,7 @@ static void qemuMonitorJSONHandleGuestPanic(qemuMonitorPtr mon, virJSONValuePtr
static void qemuMonitorJSONHandleDeviceDeleted(qemuMonitorPtr mon, virJSONValuePtr data);
static void qemuMonitorJSONHandleNicRxFilterChanged(qemuMonitorPtr mon, virJSONValuePtr data);
static void qemuMonitorJSONHandleSerialChange(qemuMonitorPtr mon, virJSONValuePtr data);
static void qemuMonitorJSONHandleSpiceMigrated(qemuMonitorPtr mon, virJSONValuePtr data);
typedef struct {
const char *type;
@ -107,6 +108,7 @@ static qemuEventHandler eventHandlers[] = {
{ "SPICE_CONNECTED", qemuMonitorJSONHandleSPICEConnect, },
{ "SPICE_DISCONNECTED", qemuMonitorJSONHandleSPICEDisconnect, },
{ "SPICE_INITIALIZED", qemuMonitorJSONHandleSPICEInitialize, },
{ "SPICE_MIGRATE_COMPLETED", qemuMonitorJSONHandleSpiceMigrated, },
{ "STOP", qemuMonitorJSONHandleStop, },
{ "SUSPEND", qemuMonitorJSONHandlePMSuspend, },
{ "SUSPEND_DISK", qemuMonitorJSONHandlePMSuspendDisk, },
@ -914,6 +916,14 @@ qemuMonitorJSONHandleSerialChange(qemuMonitorPtr mon,
}
static void
qemuMonitorJSONHandleSpiceMigrated(qemuMonitorPtr mon,
virJSONValuePtr data ATTRIBUTE_UNUSED)
{
qemuMonitorEmitSpiceMigrated(mon);
}
int
qemuMonitorJSONHumanCommandWithFd(qemuMonitorPtr mon,
const char *cmd_str,