"fsdev-writeout",
"drive-iotune", /* 85 */
+ "system_wakeup",
);
struct qemu_feature_flags {
QEMU_CAPS_CPU_HOST = 83, /* support for -cpu host */
QEMU_CAPS_FSDEV_WRITEOUT = 84, /* -fsdev writeout supported */
QEMU_CAPS_DRIVE_IOTUNE = 85, /* -drive bps= and friends */
+ QEMU_CAPS_WAKEUP = 86, /* system_wakeup monitor command */
QEMU_CAPS_LAST, /* this must always be the last item */
};
-int qemuMonitorSetCapabilities(qemuMonitorPtr mon)
+int qemuMonitorSetCapabilities(qemuMonitorPtr mon,
+ virBitmapPtr qemuCaps)
{
int ret;
+ int json_hmp;
VIR_DEBUG("mon=%p", mon);
if (!mon) {
if (mon->json) {
ret = qemuMonitorJSONSetCapabilities(mon);
- if (ret == 0) {
- int hmp = qemuMonitorJSONCheckHMP(mon);
- if (hmp < 0) {
- /* qemu may quited unexpectedly when we call
- * qemuMonitorJSONCheckHMP() */
- ret = -1;
- } else {
- mon->json_hmp = hmp > 0;
- }
- }
+ if (ret)
+ goto cleanup;
+
+ ret = qemuMonitorJSONCheckCommands(mon, qemuCaps, &json_hmp);
+ mon->json_hmp = json_hmp > 0;
} else {
ret = 0;
}
+
+cleanup:
return ret;
}
# include "domain_conf.h"
# include "qemu_conf.h"
+# include "bitmap.h"
# include "virhash.h"
typedef struct _qemuMonitor qemuMonitor;
void qemuMonitorClose(qemuMonitorPtr mon);
-int qemuMonitorSetCapabilities(qemuMonitorPtr mon);
+int qemuMonitorSetCapabilities(qemuMonitorPtr mon,
+ virBitmapPtr qemuCaps);
int qemuMonitorCheckHMP(qemuMonitorPtr mon, const char *cmd);
#include "qemu_monitor_text.h"
#include "qemu_monitor_json.h"
#include "qemu_command.h"
+#include "qemu_capabilities.h"
#include "memory.h"
#include "logging.h"
#include "driver.h"
* human-monitor-command worked or -1 on failure
*/
int
-qemuMonitorJSONCheckHMP(qemuMonitorPtr mon)
+qemuMonitorJSONCheckCommands(qemuMonitorPtr mon,
+ virBitmapPtr qemuCaps,
+ int *json_hmp)
{
int ret = -1;
virJSONValuePtr cmd = qemuMonitorJSONMakeCommand("query-commands", NULL);
!(name = virJSONValueObjectGetString(entry, "name")))
goto cleanup;
- if (STREQ(name, "human-monitor-command")) {
- ret = 1;
- goto cleanup;
- }
+ if (STREQ(name, "human-monitor-command"))
+ *json_hmp = 1;
+
+ if (STREQ(name, "system_wakeup"))
+ qemuCapsSet(qemuCaps, QEMU_CAPS_WAKEUP);
}
- /* human-monitor-command is not supported */
ret = 0;
cleanup:
# include "internal.h"
# include "qemu_monitor.h"
+# include "bitmap.h"
int qemuMonitorJSONIOProcess(qemuMonitorPtr mon,
const char *data,
int qemuMonitorJSONSetCapabilities(qemuMonitorPtr mon);
-int qemuMonitorJSONCheckHMP(qemuMonitorPtr mon);
+int qemuMonitorJSONCheckCommands(qemuMonitorPtr mon,
+ virBitmapPtr qemuCaps,
+ int *json_hmp);
int qemuMonitorJSONStartCPUs(qemuMonitorPtr mon,
virConnectPtr conn);
qemuDomainObjEnterMonitorWithDriver(driver, vm);
- ret = qemuMonitorSetCapabilities(priv->mon);
+ ret = qemuMonitorSetCapabilities(priv->mon, priv->qemuCaps);
qemuDomainObjExitMonitorWithDriver(driver, vm);
error: