if (params) {
assert(params->has_compress_level);
- monitor_printf(mon, "%s: %" PRId64 "\n",
+ monitor_printf(mon, "%s: %u\n",
MigrationParameter_str(MIGRATION_PARAMETER_COMPRESS_LEVEL),
params->compress_level);
assert(params->has_compress_threads);
- monitor_printf(mon, "%s: %" PRId64 "\n",
+ monitor_printf(mon, "%s: %u\n",
MigrationParameter_str(MIGRATION_PARAMETER_COMPRESS_THREADS),
params->compress_threads);
assert(params->has_decompress_threads);
- monitor_printf(mon, "%s: %" PRId64 "\n",
+ monitor_printf(mon, "%s: %u\n",
MigrationParameter_str(MIGRATION_PARAMETER_DECOMPRESS_THREADS),
params->decompress_threads);
assert(params->has_cpu_throttle_initial);
- monitor_printf(mon, "%s: %" PRId64 "\n",
+ monitor_printf(mon, "%s: %u\n",
MigrationParameter_str(MIGRATION_PARAMETER_CPU_THROTTLE_INITIAL),
params->cpu_throttle_initial);
assert(params->has_cpu_throttle_increment);
- monitor_printf(mon, "%s: %" PRId64 "\n",
+ monitor_printf(mon, "%s: %u\n",
MigrationParameter_str(MIGRATION_PARAMETER_CPU_THROTTLE_INCREMENT),
params->cpu_throttle_increment);
assert(params->has_tls_creds);
MigrationParameter_str(MIGRATION_PARAMETER_TLS_HOSTNAME),
params->tls_hostname);
assert(params->has_max_bandwidth);
- monitor_printf(mon, "%s: %" PRId64 " bytes/second\n",
+ monitor_printf(mon, "%s: %" PRIu64 " bytes/second\n",
MigrationParameter_str(MIGRATION_PARAMETER_MAX_BANDWIDTH),
params->max_bandwidth);
assert(params->has_downtime_limit);
- monitor_printf(mon, "%s: %" PRId64 " milliseconds\n",
+ monitor_printf(mon, "%s: %" PRIu64 " milliseconds\n",
MigrationParameter_str(MIGRATION_PARAMETER_DOWNTIME_LIMIT),
params->downtime_limit);
assert(params->has_x_checkpoint_delay);
- monitor_printf(mon, "%s: %" PRId64 "\n",
+ monitor_printf(mon, "%s: %u\n",
MigrationParameter_str(MIGRATION_PARAMETER_X_CHECKPOINT_DELAY),
params->x_checkpoint_delay);
assert(params->has_block_incremental);
monitor_printf(mon, "%s: %s\n",
MigrationParameter_str(MIGRATION_PARAMETER_BLOCK_INCREMENTAL),
params->block_incremental ? "on" : "off");
- monitor_printf(mon, "%s: %" PRId64 "\n",
+ monitor_printf(mon, "%s: %u\n",
MigrationParameter_str(MIGRATION_PARAMETER_X_MULTIFD_CHANNELS),
params->x_multifd_channels);
- monitor_printf(mon, "%s: %" PRId64 "\n",
+ monitor_printf(mon, "%s: %u\n",
MigrationParameter_str(MIGRATION_PARAMETER_X_MULTIFD_PAGE_COUNT),
params->x_multifd_page_count);
+ monitor_printf(mon, "%s: %" PRIu64 "\n",
+ MigrationParameter_str(MIGRATION_PARAMETER_XBZRLE_CACHE_SIZE),
+ params->xbzrle_cache_size);
}
qapi_free_MigrationParameters(params);
info2l = qmp_query_vnc_servers(&err);
if (err) {
- error_report_err(err);
+ hmp_handle_error(mon, &err);
return;
}
if (!info2l) {
info = qmp_query_balloon(&err);
if (err) {
- error_report_err(err);
+ hmp_handle_error(mon, &err);
return;
}
Error *err = NULL;
unsigned int c = 0;
TPMPassthroughOptions *tpo;
+ TPMEmulatorOptions *teo;
info_list = qmp_query_tpm(&err);
if (err) {
tpo->has_cancel_path ? ",cancel-path=" : "",
tpo->has_cancel_path ? tpo->cancel_path : "");
break;
+ case TPM_TYPE_OPTIONS_KIND_EMULATOR:
+ teo = ti->options->u.emulator.data;
+ monitor_printf(mon, ",chardev=%s", teo->chardev);
+ break;
case TPM_TYPE_OPTIONS_KIND__MAX:
break;
}
data = qmp_ringbuf_read(chardev, size, false, 0, &err);
if (err) {
- error_report_err(err);
+ hmp_handle_error(mon, &err);
return;
}
Error *err = NULL;
qmp_balloon(value, &err);
- if (err) {
- error_report_err(err);
- }
+ hmp_handle_error(mon, &err);
}
void hmp_block_resize(Monitor *mon, const QDict *qdict)
qmp_migrate_cancel(NULL);
}
+void hmp_migrate_continue(Monitor *mon, const QDict *qdict)
+{
+ Error *err = NULL;
+ const char *state = qdict_get_str(qdict, "state");
+ int val = qapi_enum_parse(&MigrationStatus_lookup, state, -1, &err);
+
+ if (val >= 0) {
+ qmp_migrate_continue(val, &err);
+ }
+
+ hmp_handle_error(mon, &err);
+}
+
void hmp_migrate_incoming(Monitor *mon, const QDict *qdict)
{
Error *err = NULL;
Error *err = NULL;
qmp_migrate_set_cache_size(value, &err);
- if (err) {
- error_report_err(err);
- return;
- }
+ hmp_handle_error(mon, &err);
}
/* Kept for backwards compatibility */
end:
qapi_free_MigrationCapabilityStatusList(caps);
-
- if (err) {
- error_report_err(err);
- }
+ hmp_handle_error(mon, &err);
}
void hmp_migrate_set_parameter(Monitor *mon, const QDict *qdict)
Visitor *v = string_input_visitor_new(valuestr);
MigrateSetParameters *p = g_new0(MigrateSetParameters, 1);
uint64_t valuebw = 0;
+ uint64_t cache_size;
Error *err = NULL;
int val, ret;
p->has_x_multifd_page_count = true;
visit_type_int(v, param, &p->x_multifd_page_count, &err);
break;
+ case MIGRATION_PARAMETER_XBZRLE_CACHE_SIZE:
+ p->has_xbzrle_cache_size = true;
+ visit_type_size(v, param, &cache_size, &err);
+ if (err || cache_size > INT64_MAX
+ || (size_t)cache_size != cache_size) {
+ error_setg(&err, "Invalid size %s", valuestr);
+ break;
+ }
+ p->xbzrle_cache_size = cache_size;
+ break;
default:
assert(0);
}
cleanup:
qapi_free_MigrateSetParameters(p);
visit_free(v);
- if (err) {
- error_report_err(err);
- }
+ hmp_handle_error(mon, &err);
}
void hmp_client_migrate_info(Monitor *mon, const QDict *qdict)
qmp_migrate(uri, !!blk, blk, !!inc, inc, false, false, &err);
if (err) {
- error_report_err(err);
+ hmp_handle_error(mon, &err);
return;
}
{
BlockBackend *blk;
BlockBackend *local_blk = NULL;
- AioContext *aio_context;
const char* device = qdict_get_str(qdict, "device");
const char* command = qdict_get_str(qdict, "command");
Error *err = NULL;
}
}
- aio_context = blk_get_aio_context(blk);
- aio_context_acquire(aio_context);
-
/*
* Notably absent: Proper permission management. This is sad, but it seems
* almost impossible to achieve without changing the semantics and thereby
*/
qemuio_command(blk, command);
- aio_context_release(aio_context);
-
fail:
blk_unref(local_blk);
hmp_handle_error(mon, &err);
monitor_printf(mon, "\n");
qapi_free_MemdevList(memdev_list);
+ hmp_handle_error(mon, &err);
}
void hmp_info_memory_devices(Monitor *mon, const QDict *qdict)
}
qapi_free_MemoryDeviceInfoList(info_list);
+ hmp_handle_error(mon, &err);
}
void hmp_info_iothreads(Monitor *mon, const QDict *qdict)