params->cpu_throttle_increment = s->parameters.cpu_throttle_increment;
params->has_cpu_throttle_tailslow = true;
params->cpu_throttle_tailslow = s->parameters.cpu_throttle_tailslow;
- params->has_tls_creds = true;
params->tls_creds = g_strdup(s->parameters.tls_creds);
- params->has_tls_hostname = true;
params->tls_hostname = g_strdup(s->parameters.tls_hostname);
- params->has_tls_authz = true;
params->tls_authz = g_strdup(s->parameters.tls_authz ?
s->parameters.tls_authz : "");
params->has_max_bandwidth = true;
{
size_t page_size = qemu_target_page_size();
- info->has_ram = true;
info->ram = g_malloc0(sizeof(*info->ram));
info->ram->transferred = stat64_get(&ram_atomic_counters.transferred);
info->ram->total = ram_bytes_total();
info->ram->postcopy_bytes = stat64_get(&ram_atomic_counters.postcopy_bytes);
if (migrate_use_xbzrle()) {
- info->has_xbzrle_cache = true;
info->xbzrle_cache = g_malloc0(sizeof(*info->xbzrle_cache));
info->xbzrle_cache->cache_size = migrate_xbzrle_cache_size();
info->xbzrle_cache->bytes = xbzrle_counters.bytes;
}
if (migrate_use_compression()) {
- info->has_compression = true;
info->compression = g_malloc0(sizeof(*info->compression));
info->compression->pages = compression_counters.pages;
info->compression->busy = compression_counters.busy;
static void populate_disk_info(MigrationInfo *info)
{
if (blk_mig_active()) {
- info->has_disk = true;
info->disk = g_malloc0(sizeof(*info->disk));
info->disk->transferred = blk_mig_bytes_transferred();
info->disk->remaining = blk_mig_bytes_remaining();
case MIGRATION_STATUS_FAILED:
info->has_status = true;
if (s->error) {
- info->has_error_desc = true;
info->error_desc = g_strdup(error_get_pretty(s->error));
}
break;
#ifdef CONFIG_LINUX
if (migrate_use_zero_copy_send() &&
((params->has_multifd_compression && params->multifd_compression) ||
- (params->has_tls_creds && params->tls_creds && *params->tls_creds))) {
+ (params->tls_creds && *params->tls_creds))) {
error_setg(errp,
"Zero copy only available for non-compressed non-TLS multifd migration");
return false;
dest->cpu_throttle_tailslow = params->cpu_throttle_tailslow;
}
- if (params->has_tls_creds) {
+ if (params->tls_creds) {
assert(params->tls_creds->type == QTYPE_QSTRING);
dest->tls_creds = params->tls_creds->u.s;
}
- if (params->has_tls_hostname) {
+ if (params->tls_hostname) {
assert(params->tls_hostname->type == QTYPE_QSTRING);
dest->tls_hostname = params->tls_hostname->u.s;
}
s->parameters.cpu_throttle_tailslow = params->cpu_throttle_tailslow;
}
- if (params->has_tls_creds) {
+ if (params->tls_creds) {
g_free(s->parameters.tls_creds);
assert(params->tls_creds->type == QTYPE_QSTRING);
s->parameters.tls_creds = g_strdup(params->tls_creds->u.s);
}
- if (params->has_tls_hostname) {
+ if (params->tls_hostname) {
g_free(s->parameters.tls_hostname);
assert(params->tls_hostname->type == QTYPE_QSTRING);
s->parameters.tls_hostname = g_strdup(params->tls_hostname->u.s);
}
- if (params->has_tls_authz) {
+ if (params->tls_authz) {
g_free(s->parameters.tls_authz);
assert(params->tls_authz->type == QTYPE_QSTRING);
s->parameters.tls_authz = g_strdup(params->tls_authz->u.s);
MigrationParameters tmp;
/* TODO Rewrite "" to null instead */
- if (params->has_tls_creds
+ if (params->tls_creds
&& params->tls_creds->type == QTYPE_QNULL) {
qobject_unref(params->tls_creds->u.n);
params->tls_creds->type = QTYPE_QSTRING;
params->tls_creds->u.s = strdup("");
}
/* TODO Rewrite "" to null instead */
- if (params->has_tls_hostname
+ if (params->tls_hostname
&& params->tls_hostname->type == QTYPE_QNULL) {
qobject_unref(params->tls_hostname->u.n);
params->tls_hostname->type = QTYPE_QSTRING;
params->has_announce_max = true;
params->has_announce_rounds = true;
params->has_announce_step = true;
- params->has_tls_creds = true;
- params->has_tls_hostname = true;
- params->has_tls_authz = true;
qemu_sem_init(&ms->postcopy_pause_sem, 0);
qemu_sem_init(&ms->postcopy_pause_rp_sem, 0);