priv = vm->privateData;
if (virDomainObjGetState(vm, NULL) != VIR_DOMAIN_PAUSED) {
- if (libxl_domain_pause(priv->ctx, dom->id) != 0) {
+ if (libxl_domain_pause(priv->ctx, vm->def->id) != 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Failed to suspend domain '%d' with libxenlight"),
- dom->id);
+ vm->def->id);
goto endjob;
}
priv = vm->privateData;
if (virDomainObjGetState(vm, NULL) == VIR_DOMAIN_PAUSED) {
- if (libxl_domain_unpause(priv->ctx, dom->id) != 0) {
+ if (libxl_domain_unpause(priv->ctx, vm->def->id) != 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Failed to resume domain '%d' with libxenlight"),
- dom->id);
+ vm->def->id);
goto endjob;
}
}
priv = vm->privateData;
- if (libxl_domain_shutdown(priv->ctx, dom->id) != 0) {
+ if (libxl_domain_shutdown(priv->ctx, vm->def->id) != 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Failed to shutdown domain '%d' with libxenlight"),
- dom->id);
+ vm->def->id);
goto cleanup;
}
}
priv = vm->privateData;
- if (libxl_domain_reboot(priv->ctx, dom->id) != 0) {
+ if (libxl_domain_reboot(priv->ctx, vm->def->id) != 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Failed to reboot domain '%d' with libxenlight"),
- dom->id);
+ vm->def->id);
goto cleanup;
}
ret = 0;
priv = vm->privateData;
if (libxl_domain_destroy(priv->ctx, vm->def->id, NULL) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Failed to destroy domain '%d'"), dom->id);
+ _("Failed to destroy domain '%d'"), vm->def->id);
goto cleanup;
}
if (flags & VIR_DOMAIN_MEM_LIVE) {
priv = vm->privateData;
- if (libxl_domain_setmaxmem(priv->ctx, dom->id, newmem) < 0) {
+ if (libxl_domain_setmaxmem(priv->ctx, vm->def->id, newmem) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Failed to set maximum memory for domain '%d'"
- " with libxenlight"), dom->id);
+ " with libxenlight"), vm->def->id);
goto endjob;
}
}
priv = vm->privateData;
/* Unlock virDomainObj while ballooning memory */
virObjectUnlock(vm);
- res = libxl_set_memory_target(priv->ctx, dom->id, newmem, 0,
+ res = libxl_set_memory_target(priv->ctx, vm->def->id, newmem, 0,
/* force */ 1);
virObjectLock(vm);
if (res < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Failed to set memory for domain '%d'"
- " with libxenlight"), dom->id);
+ " with libxenlight"), vm->def->id);
goto endjob;
}
}
info->memory = vm->def->mem.cur_balloon;
info->maxMem = vm->def->mem.max_balloon;
} else {
- if (libxl_domain_info(priv->ctx, &d_info, dom->id) != 0) {
+ if (libxl_domain_info(priv->ctx, &d_info, vm->def->id) != 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("libxl_domain_info failed for domain '%d'"), dom->id);
+ _("libxl_domain_info failed for domain '%d'"),
+ vm->def->id);
goto cleanup;
}
info->cpuTime = d_info.cpu_time;
if (!(flags & VIR_DUMP_LIVE) &&
virDomainObjGetState(vm, NULL) == VIR_DOMAIN_RUNNING) {
- if (libxl_domain_pause(priv->ctx, dom->id) != 0) {
+ if (libxl_domain_pause(priv->ctx, vm->def->id) != 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Before dumping core, failed to suspend domain '%d'"
" with libxenlight"),
- dom->id);
+ vm->def->id);
goto endjob;
}
virDomainObjSetState(vm, VIR_DOMAIN_PAUSED, VIR_DOMAIN_PAUSED_DUMP);
/* Unlock virDomainObj while dumping core */
virObjectUnlock(vm);
- ret = libxl_domain_core_dump(priv->ctx, dom->id, to, NULL);
+ ret = libxl_domain_core_dump(priv->ctx, vm->def->id, to, NULL);
virObjectLock(vm);
if (ret != 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Failed to dump core of domain '%d' with libxenlight"),
- dom->id);
+ vm->def->id);
ret = -1;
goto unpause;
}
if (flags & VIR_DUMP_CRASH) {
- if (libxl_domain_destroy(priv->ctx, dom->id, NULL) < 0) {
+ if (libxl_domain_destroy(priv->ctx, vm->def->id, NULL) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Failed to destroy domain '%d'"), dom->id);
+ _("Failed to destroy domain '%d'"), vm->def->id);
goto unpause;
}
unpause:
if (virDomainObjIsActive(vm) && paused) {
- if (libxl_domain_unpause(priv->ctx, dom->id) != 0) {
+ if (libxl_domain_unpause(priv->ctx, vm->def->id) != 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("After dumping core, failed to resume domain '%d' with"
- " libxenlight"), dom->id);
+ " libxenlight"), vm->def->id);
} else {
virDomainObjSetState(vm, VIR_DOMAIN_RUNNING,
VIR_DOMAIN_RUNNING_UNPAUSED);
break;
case VIR_DOMAIN_VCPU_LIVE:
- if (libxl_set_vcpuonline(priv->ctx, dom->id, &map) != 0) {
+ if (libxl_set_vcpuonline(priv->ctx, vm->def->id, &map) != 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Failed to set vcpus for domain '%d'"
- " with libxenlight"), dom->id);
+ " with libxenlight"), vm->def->id);
goto endjob;
}
break;
case VIR_DOMAIN_VCPU_LIVE | VIR_DOMAIN_VCPU_CONFIG:
- if (libxl_set_vcpuonline(priv->ctx, dom->id, &map) != 0) {
+ if (libxl_set_vcpuonline(priv->ctx, vm->def->id, &map) != 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Failed to set vcpus for domain '%d'"
- " with libxenlight"), dom->id);
+ " with libxenlight"), vm->def->id);
goto endjob;
}
def->vcpus = nvcpus;
libxlDomainObjPrivatePtr priv;
priv = vm->privateData;
- if (libxl_set_vcpuaffinity(priv->ctx, dom->id, vcpu, &map) != 0) {
+ if (libxl_set_vcpuaffinity(priv->ctx, vm->def->id, vcpu, &map) != 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Failed to pin vcpu '%d' with libxenlight"),
vcpu);
}
priv = vm->privateData;
- if ((vcpuinfo = libxl_list_vcpu(priv->ctx, dom->id, &maxcpu,
+ if ((vcpuinfo = libxl_list_vcpu(priv->ctx, vm->def->id, &maxcpu,
&hostcpus)) == NULL) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Failed to list vcpus for domain '%d' with libxenlight"),
- dom->id);
+ vm->def->id);
goto cleanup;
}
default:
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Failed to get scheduler id for domain '%d'"
- " with libxenlight"), dom->id);
+ " with libxenlight"), vm->def->id);
goto cleanup;
}
goto cleanup;
}
- if (libxl_domain_sched_params_get(priv->ctx, dom->id, &sc_info) != 0) {
+ if (libxl_domain_sched_params_get(priv->ctx, vm->def->id, &sc_info) != 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Failed to get scheduler parameters for domain '%d'"
- " with libxenlight"), dom->id);
+ " with libxenlight"), vm->def->id);
goto cleanup;
}
goto endjob;
}
- if (libxl_domain_sched_params_get(priv->ctx, dom->id, &sc_info) != 0) {
+ if (libxl_domain_sched_params_get(priv->ctx, vm->def->id, &sc_info) != 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Failed to get scheduler parameters for domain '%d'"
- " with libxenlight"), dom->id);
+ " with libxenlight"), vm->def->id);
goto endjob;
}
sc_info.cap = params[i].value.ui;
}
- if (libxl_domain_sched_params_set(priv->ctx, dom->id, &sc_info) != 0) {
+ if (libxl_domain_sched_params_set(priv->ctx, vm->def->id, &sc_info) != 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Failed to set scheduler parameters for domain '%d'"
- " with libxenlight"), dom->id);
+ " with libxenlight"), vm->def->id);
goto endjob;
}