Rather mechanical in nature. * src/driver.h: Use newer virTypedParameter API names. * src/libvirt.c: Likewise. * daemon/remote.c: Likewise. * src/esx/esx_driver.c: Likewise. * src/libxl/libxl_driver.c: Likewise. * src/lxc/lxc_driver.c: Likewise. * src/qemu/qemu_driver.c: Likewise. * src/remote/remote_driver.c: Likewise. * src/test/test_driver.c: Likewise. * src/xen/xen_driver.c: Likewise. * src/xen/xen_hypervisor.c: Likewise. * src/xen/xen_hypervisor.h: Likewise. * src/xen/xend_internal.c: Likewise. * tools/virsh.c: Likewise. --- daemon/remote.c | 14 ++++---- src/driver.h | 14 ++++---- src/esx/esx_driver.c | 36 +++++++++++----------- src/libvirt.c | 20 ++++++------ src/libxl/libxl_driver.c | 14 ++++---- src/lxc/lxc_driver.c | 26 ++++++++-------- src/qemu/qemu_driver.c | 40 +++++++++++++------------- src/remote/remote_driver.c | 20 ++++++------ src/test/test_driver.c | 8 ++-- src/xen/xen_driver.c | 6 ++- src/xen/xen_hypervisor.c | 14 ++++---- src/xen/xen_hypervisor.h | 6 ++-- src/xen/xend_internal.c | 12 ++++---- tools/virsh.c | 68 ++++++++++++++++++++++---------------------- 14 files changed, 150 insertions(+), 148 deletions(-) diff --git a/daemon/remote.c b/daemon/remote.c index 0b7a9f5..90572c2 100644 --- a/daemon/remote.c +++ b/daemon/remote.c @@ -505,7 +505,7 @@ remoteDispatchDomainGetSchedulerParameters(struct qemud_server *server ATTRIBUTE remote_domain_get_scheduler_parameters_ret *ret) { virDomainPtr dom = NULL; - virSchedParameterPtr params = NULL; + virTypedParameterPtr params = NULL; int i; int nparams = args->nparams; int rv = -1; @@ -590,7 +590,7 @@ remoteDispatchDomainSetSchedulerParameters(struct qemud_server *server ATTRIBUTE void *ret ATTRIBUTE_UNUSED) { virDomainPtr dom = NULL; - virSchedParameterPtr params = NULL; + virTypedParameterPtr params = NULL; int i, nparams; int rv = -1; @@ -661,7 +661,7 @@ remoteDispatchDomainSetSchedulerParametersFlags(struct qemud_server *server ATTR void *ret ATTRIBUTE_UNUSED) { virDomainPtr dom = NULL; - virSchedParameterPtr params = NULL; + virTypedParameterPtr params = NULL; int i, nparams; int rv = -1; @@ -1227,7 +1227,7 @@ remoteDispatchDomainSetMemoryParameters(struct qemud_server *server * args, void *ret ATTRIBUTE_UNUSED) { virDomainPtr dom = NULL; - virMemoryParameterPtr params = NULL; + virTypedParameterPtr params = NULL; int i, nparams; unsigned int flags; int rv = -1; @@ -1325,7 +1325,7 @@ remoteDispatchDomainGetMemoryParameters(struct qemud_server *server * ret) { virDomainPtr dom = NULL; - virMemoryParameterPtr params = NULL; + virTypedParameterPtr params = NULL; int i; int nparams = args->nparams; unsigned int flags; @@ -1445,7 +1445,7 @@ remoteDispatchDomainSetBlkioParameters(struct qemud_server *server * args, void *ret ATTRIBUTE_UNUSED) { virDomainPtr dom = NULL; - virBlkioParameterPtr params = NULL; + virTypedParameterPtr params = NULL; int i, nparams; unsigned int flags; int rv = -1; @@ -1543,7 +1543,7 @@ remoteDispatchDomainGetBlkioParameters(struct qemud_server *server * ret) { virDomainPtr dom = NULL; - virBlkioParameterPtr params = NULL; + virTypedParameterPtr params = NULL; int i; int nparams = args->nparams; unsigned int flags; diff --git a/src/driver.h b/src/driver.h index dcd4894..6ef19af 100644 --- a/src/driver.h +++ b/src/driver.h @@ -141,25 +141,25 @@ typedef int typedef int (*virDrvDomainSetMemoryParameters) (virDomainPtr domain, - virMemoryParameterPtr params, + virTypedParameterPtr params, int nparams, unsigned int flags); typedef int (*virDrvDomainGetMemoryParameters) (virDomainPtr domain, - virMemoryParameterPtr params, + virTypedParameterPtr params, int *nparams, unsigned int flags); typedef int (*virDrvDomainSetBlkioParameters) (virDomainPtr domain, - virBlkioParameterPtr params, + virTypedParameterPtr params, int nparams, unsigned int flags); typedef int (*virDrvDomainGetBlkioParameters) (virDomainPtr domain, - virBlkioParameterPtr params, + virTypedParameterPtr params, int *nparams, unsigned int flags); typedef int @@ -276,19 +276,19 @@ typedef char * typedef int (*virDrvDomainGetSchedulerParameters) (virDomainPtr domain, - virSchedParameterPtr params, + virTypedParameterPtr params, int *nparams); typedef int (*virDrvDomainSetSchedulerParameters) (virDomainPtr domain, - virSchedParameterPtr params, + virTypedParameterPtr params, int nparams); typedef int (*virDrvDomainSetSchedulerParametersFlags) (virDomainPtr domain, - virSchedParameterPtr params, + virTypedParameterPtr params, int nparams, unsigned int flags); diff --git a/src/esx/esx_driver.c b/src/esx/esx_driver.c index 845dd4a..89df457 100644 --- a/src/esx/esx_driver.c +++ b/src/esx/esx_driver.c @@ -3492,12 +3492,12 @@ esxDomainSetAutostart(virDomainPtr domain, int autostart) * * Available parameters: * - * - reservation (VIR_DOMAIN_SCHED_FIELD_LLONG >= 0, in megaherz) + * - reservation (VIR_TYPED_PARAM_LLONG >= 0, in megaherz) * * The amount of CPU resource that is guaranteed to be available to the domain. * * - * - limit (VIR_DOMAIN_SCHED_FIELD_LLONG >= 0, or -1, in megaherz) + * - limit (VIR_TYPED_PARAM_LLONG >= 0, or -1, in megaherz) * * The CPU utilization of the domain will be limited to this value, even if * more CPU resources are available. If the limit is set to -1, the CPU @@ -3505,7 +3505,7 @@ esxDomainSetAutostart(virDomainPtr domain, int autostart) * must be greater than or equal to the reservation. * * - * - shares (VIR_DOMAIN_SCHED_FIELD_INT >= 0, or in {-1, -2, -3}, no unit) + * - shares (VIR_TYPED_PARAM_INT >= 0, or in {-1, -2, -3}, no unit) * * Shares are used to determine relative CPU allocation between domains. In * general, a domain with more shares gets proportionally more of the CPU @@ -3533,7 +3533,7 @@ esxDomainGetSchedulerType(virDomainPtr domain ATTRIBUTE_UNUSED, int *nparams) static int esxDomainGetSchedulerParameters(virDomainPtr domain, - virSchedParameterPtr params, int *nparams) + virTypedParameterPtr params, int *nparams) { int result = -1; esxPrivate *priv = domain->conn->privateData; @@ -3569,10 +3569,10 @@ esxDomainGetSchedulerParameters(virDomainPtr domain, dynamicProperty = dynamicProperty->_next) { if (STREQ(dynamicProperty->name, "config.cpuAllocation.reservation") && ! (mask & (1 << 0))) { - snprintf (params[i].field, VIR_DOMAIN_SCHED_FIELD_LENGTH, "%s", + snprintf (params[i].field, VIR_TYPED_PARAM_FIELD_LENGTH, "%s", "reservation"); - params[i].type = VIR_DOMAIN_SCHED_FIELD_LLONG; + params[i].type = VIR_TYPED_PARAM_LLONG; if (esxVI_AnyType_ExpectType(dynamicProperty->val, esxVI_Type_Long) < 0) { @@ -3585,10 +3585,10 @@ esxDomainGetSchedulerParameters(virDomainPtr domain, } else if (STREQ(dynamicProperty->name, "config.cpuAllocation.limit") && ! (mask & (1 << 1))) { - snprintf (params[i].field, VIR_DOMAIN_SCHED_FIELD_LENGTH, "%s", + snprintf (params[i].field, VIR_TYPED_PARAM_FIELD_LENGTH, "%s", "limit"); - params[i].type = VIR_DOMAIN_SCHED_FIELD_LLONG; + params[i].type = VIR_TYPED_PARAM_LLONG; if (esxVI_AnyType_ExpectType(dynamicProperty->val, esxVI_Type_Long) < 0) { @@ -3601,10 +3601,10 @@ esxDomainGetSchedulerParameters(virDomainPtr domain, } else if (STREQ(dynamicProperty->name, "config.cpuAllocation.shares") && ! (mask & (1 << 2))) { - snprintf (params[i].field, VIR_DOMAIN_SCHED_FIELD_LENGTH, "%s", + snprintf (params[i].field, VIR_TYPED_PARAM_FIELD_LENGTH, "%s", "shares"); - params[i].type = VIR_DOMAIN_SCHED_FIELD_INT; + params[i].type = VIR_TYPED_PARAM_INT; if (esxVI_SharesInfo_CastFromAnyType(dynamicProperty->val, &sharesInfo) < 0) { @@ -3658,7 +3658,7 @@ esxDomainGetSchedulerParameters(virDomainPtr domain, static int esxDomainSetSchedulerParameters(virDomainPtr domain, - virSchedParameterPtr params, int nparams) + virTypedParameterPtr params, int nparams) { int result = -1; esxPrivate *priv = domain->conn->privateData; @@ -3684,7 +3684,7 @@ esxDomainSetSchedulerParameters(virDomainPtr domain, for (i = 0; i < nparams; ++i) { if (STREQ (params[i].field, "reservation") && - params[i].type == VIR_DOMAIN_SCHED_FIELD_LLONG) { + params[i].type == VIR_TYPED_PARAM_LLONG) { if (esxVI_Long_Alloc(&spec->cpuAllocation->reservation) < 0) { goto cleanup; } @@ -3698,7 +3698,7 @@ esxDomainSetSchedulerParameters(virDomainPtr domain, spec->cpuAllocation->reservation->value = params[i].value.l; } else if (STREQ (params[i].field, "limit") && - params[i].type == VIR_DOMAIN_SCHED_FIELD_LLONG) { + params[i].type == VIR_TYPED_PARAM_LLONG) { if (esxVI_Long_Alloc(&spec->cpuAllocation->limit) < 0) { goto cleanup; } @@ -3713,7 +3713,7 @@ esxDomainSetSchedulerParameters(virDomainPtr domain, spec->cpuAllocation->limit->value = params[i].value.l; } else if (STREQ (params[i].field, "shares") && - params[i].type == VIR_DOMAIN_SCHED_FIELD_INT) { + params[i].type == VIR_TYPED_PARAM_INT) { if (esxVI_SharesInfo_Alloc(&sharesInfo) < 0 || esxVI_Int_Alloc(&sharesInfo->shares) < 0) { goto cleanup; @@ -4506,7 +4506,7 @@ esxDomainSnapshotDelete(virDomainSnapshotPtr snapshot, unsigned int flags) static int -esxDomainSetMemoryParameters(virDomainPtr domain, virMemoryParameterPtr params, +esxDomainSetMemoryParameters(virDomainPtr domain, virTypedParameterPtr params, int nparams, unsigned int flags) { int result = -1; @@ -4534,7 +4534,7 @@ esxDomainSetMemoryParameters(virDomainPtr domain, virMemoryParameterPtr params, for (i = 0; i < nparams; ++i) { if (STREQ (params[i].field, VIR_DOMAIN_MEMORY_MIN_GUARANTEE) && - params[i].type == VIR_DOMAIN_SCHED_FIELD_ULLONG) { + params[i].type == VIR_TYPED_PARAM_ULLONG) { if (esxVI_Long_Alloc(&spec->memoryAllocation->reservation) < 0) { goto cleanup; } @@ -4578,7 +4578,7 @@ esxDomainSetMemoryParameters(virDomainPtr domain, virMemoryParameterPtr params, static int -esxDomainGetMemoryParameters(virDomainPtr domain, virMemoryParameterPtr params, +esxDomainGetMemoryParameters(virDomainPtr domain, virTypedParameterPtr params, int *nparams, unsigned int flags) { int result = -1; @@ -4622,7 +4622,7 @@ esxDomainGetMemoryParameters(virDomainPtr domain, virMemoryParameterPtr params, goto cleanup; } - params[0].type = VIR_DOMAIN_SCHED_FIELD_ULLONG; + params[0].type = VIR_TYPED_PARAM_ULLONG; params[0].value.ul = reservation->value * 1024; /* Scale from megabytes to kilobytes */ *nparams = 1; diff --git a/src/libvirt.c b/src/libvirt.c index 39c3213..54fc1fa 100644 --- a/src/libvirt.c +++ b/src/libvirt.c @@ -3003,7 +3003,7 @@ error: */ int virDomainSetMemoryParameters(virDomainPtr domain, - virMemoryParameterPtr params, + virTypedParameterPtr params, int nparams, unsigned int flags) { virConnectPtr conn; @@ -3057,15 +3057,15 @@ error: * As the value of @nparams is dynamic, call the API setting @nparams to 0 and * @params as NULL, the API returns the number of parameters supported by the * HV by updating @nparams on SUCCESS. The caller should then allocate @params - * array, i.e. (sizeof(@virMemoryParameter) * @nparams) bytes and call the API + * array, i.e. (sizeof(@virTypedParameter) * @nparams) bytes and call the API * again. * * Here is the sample code snippet: * * if ((virDomainGetMemoryParameters(dom, NULL, &nparams, 0) == 0) && * (nparams != 0)) { - * params = vshMalloc(ctl, sizeof(virMemoryParameter) * nparams); - * memset(params, 0, sizeof(virMemoryParameter) * nparams); + * params = vshMalloc(ctl, sizeof(*params) * nparams); + * memset(params, 0, sizeof(*params) * nparams); * if (virDomainGetMemoryParameters(dom, params, &nparams, 0)) { * vshError(ctl, "%s", _("Unable to get memory parameters")); * goto error; @@ -3079,7 +3079,7 @@ error: */ int virDomainGetMemoryParameters(virDomainPtr domain, - virMemoryParameterPtr params, + virTypedParameterPtr params, int *nparams, unsigned int flags) { virConnectPtr conn; @@ -3130,7 +3130,7 @@ error: */ int virDomainSetBlkioParameters(virDomainPtr domain, - virBlkioParameterPtr params, + virTypedParameterPtr params, int nparams, unsigned int flags) { virConnectPtr conn; @@ -3189,7 +3189,7 @@ error: */ int virDomainGetBlkioParameters(virDomainPtr domain, - virBlkioParameterPtr params, + virTypedParameterPtr params, int *nparams, unsigned int flags) { virConnectPtr conn; @@ -5434,7 +5434,7 @@ error: */ int virDomainGetSchedulerParameters(virDomainPtr domain, - virSchedParameterPtr params, int *nparams) + virTypedParameterPtr params, int *nparams) { virConnectPtr conn; @@ -5484,7 +5484,7 @@ error: */ int virDomainSetSchedulerParameters(virDomainPtr domain, - virSchedParameterPtr params, int nparams) + virTypedParameterPtr params, int nparams) { virConnectPtr conn; @@ -5540,7 +5540,7 @@ error: */ int virDomainSetSchedulerParametersFlags(virDomainPtr domain, - virSchedParameterPtr params, + virTypedParameterPtr params, int nparams, unsigned int flags) { diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c index 0d48da2..492f61a 100644 --- a/src/libxl/libxl_driver.c +++ b/src/libxl/libxl_driver.c @@ -2950,7 +2950,7 @@ cleanup: } static int -libxlDomainGetSchedulerParameters(virDomainPtr dom, virSchedParameterPtr params, +libxlDomainGetSchedulerParameters(virDomainPtr dom, virTypedParameterPtr params, int *nparams) { libxlDriverPrivatePtr driver = dom->conn->privateData; @@ -3002,7 +3002,7 @@ libxlDomainGetSchedulerParameters(virDomainPtr dom, virSchedParameterPtr params, } params[0].value.ui = sc_info.weight; - params[0].type = VIR_DOMAIN_SCHED_FIELD_UINT; + params[0].type = VIR_TYPED_PARAM_UINT; if (virStrcpyStatic(params[0].field, "weight") == NULL) { libxlError(VIR_ERR_INTERNAL_ERROR, "%s", _("Field weight too long for destination")); @@ -3010,7 +3010,7 @@ libxlDomainGetSchedulerParameters(virDomainPtr dom, virSchedParameterPtr params, } params[1].value.ui = sc_info.cap; - params[1].type = VIR_DOMAIN_SCHED_FIELD_UINT; + params[1].type = VIR_TYPED_PARAM_UINT; if (virStrcpyStatic(params[1].field, "cap") == NULL) { libxlError(VIR_ERR_INTERNAL_ERROR, "%s", _("Field cap too long for destination")); @@ -3027,7 +3027,7 @@ cleanup: } static int -libxlDomainSetSchedulerParameters(virDomainPtr dom, virSchedParameterPtr params, +libxlDomainSetSchedulerParameters(virDomainPtr dom, virTypedParameterPtr params, int nparams) { libxlDriverPrivatePtr driver = dom->conn->privateData; @@ -3075,10 +3075,10 @@ libxlDomainSetSchedulerParameters(virDomainPtr dom, virSchedParameterPtr params, } for (i = 0; i < nparams; ++i) { - virSchedParameterPtr param = ¶ms[i]; + virTypedParameterPtr param = ¶ms[i]; if (STREQ(param->field, "weight")) { - if (param->type != VIR_DOMAIN_SCHED_FIELD_UINT) { + if (param->type != VIR_TYPED_PARAM_UINT) { libxlError(VIR_ERR_INVALID_ARG, "%s", _("invalid type for weight tunable, expected a 'uint'")); goto cleanup; @@ -3086,7 +3086,7 @@ libxlDomainSetSchedulerParameters(virDomainPtr dom, virSchedParameterPtr params, sc_info.weight = params[i].value.ui; } else if (STREQ(param->field, "cap")) { - if (param->type != VIR_DOMAIN_SCHED_FIELD_UINT) { + if (param->type != VIR_TYPED_PARAM_UINT) { libxlError(VIR_ERR_INVALID_ARG, "%s", _("invalid type for cap tunable, expected a 'uint'")); goto cleanup; diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c index 9e09c95..00e3f2a 100644 --- a/src/lxc/lxc_driver.c +++ b/src/lxc/lxc_driver.c @@ -745,7 +745,7 @@ cleanup: } static int lxcDomainSetMemoryParameters(virDomainPtr dom, - virMemoryParameterPtr params, + virTypedParameterPtr params, int nparams, unsigned int flags ATTRIBUTE_UNUSED) { @@ -774,11 +774,11 @@ static int lxcDomainSetMemoryParameters(virDomainPtr dom, ret = 0; for (i = 0; i < nparams; i++) { - virMemoryParameterPtr param = ¶ms[i]; + virTypedParameterPtr param = ¶ms[i]; if (STREQ(param->field, VIR_DOMAIN_MEMORY_HARD_LIMIT)) { int rc; - if (param->type != VIR_DOMAIN_MEMORY_PARAM_ULLONG) { + if (param->type != VIR_TYPED_PARAM_ULLONG) { lxcError(VIR_ERR_INVALID_ARG, "%s", _("invalid type for memory hard_limit tunable, expected a 'ullong'")); ret = -1; @@ -793,7 +793,7 @@ static int lxcDomainSetMemoryParameters(virDomainPtr dom, } } else if (STREQ(param->field, VIR_DOMAIN_MEMORY_SOFT_LIMIT)) { int rc; - if (param->type != VIR_DOMAIN_MEMORY_PARAM_ULLONG) { + if (param->type != VIR_TYPED_PARAM_ULLONG) { lxcError(VIR_ERR_INVALID_ARG, "%s", _("invalid type for memory soft_limit tunable, expected a 'ullong'")); ret = -1; @@ -808,7 +808,7 @@ static int lxcDomainSetMemoryParameters(virDomainPtr dom, } } else if (STREQ(param->field, VIR_DOMAIN_MEMORY_SWAP_HARD_LIMIT)) { int rc; - if (param->type != VIR_DOMAIN_MEMORY_PARAM_ULLONG) { + if (param->type != VIR_TYPED_PARAM_ULLONG) { lxcError(VIR_ERR_INVALID_ARG, "%s", _("invalid type for swap_hard_limit tunable, expected a 'ullong'")); ret = -1; @@ -842,7 +842,7 @@ cleanup: } static int lxcDomainGetMemoryParameters(virDomainPtr dom, - virMemoryParameterPtr params, + virTypedParameterPtr params, int *nparams, unsigned int flags ATTRIBUTE_UNUSED) { @@ -884,10 +884,10 @@ static int lxcDomainGetMemoryParameters(virDomainPtr dom, } for (i = 0; i < LXC_NB_MEM_PARAM; i++) { - virMemoryParameterPtr param = ¶ms[i]; + virTypedParameterPtr param = ¶ms[i]; val = 0; param->value.ul = 0; - param->type = VIR_DOMAIN_MEMORY_PARAM_ULLONG; + param->type = VIR_TYPED_PARAM_ULLONG; switch(i) { case 0: /* fill memory hard limit here */ @@ -2162,7 +2162,7 @@ static char *lxcGetSchedulerType(virDomainPtr domain ATTRIBUTE_UNUSED, } static int lxcSetSchedulerParameters(virDomainPtr domain, - virSchedParameterPtr params, + virTypedParameterPtr params, int nparams) { lxc_driver_t *driver = domain->conn->privateData; @@ -2189,7 +2189,7 @@ static int lxcSetSchedulerParameters(virDomainPtr domain, goto cleanup; for (i = 0; i < nparams; i++) { - virSchedParameterPtr param = ¶ms[i]; + virTypedParameterPtr param = ¶ms[i]; if (STRNEQ(param->field, "cpu_shares")) { lxcError(VIR_ERR_INVALID_ARG, @@ -2197,7 +2197,7 @@ static int lxcSetSchedulerParameters(virDomainPtr domain, goto cleanup; } - if (param->type != VIR_DOMAIN_SCHED_FIELD_ULLONG) { + if (param->type != VIR_TYPED_PARAM_ULLONG) { lxcError(VIR_ERR_INVALID_ARG, "%s", _("Invalid type for cpu_shares tunable, expected a 'ullong'")); goto cleanup; @@ -2223,7 +2223,7 @@ cleanup: } static int lxcGetSchedulerParameters(virDomainPtr domain, - virSchedParameterPtr params, + virTypedParameterPtr params, int *nparams) { lxc_driver_t *driver = domain->conn->privateData; @@ -2263,7 +2263,7 @@ static int lxcGetSchedulerParameters(virDomainPtr domain, "%s", _("Field cpu_shares too big for destination")); goto cleanup; } - params[0].type = VIR_DOMAIN_SCHED_FIELD_ULLONG; + params[0].type = VIR_TYPED_PARAM_ULLONG; *nparams = 1; ret = 0; diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index c7cd99b..7922ae6 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -4656,7 +4656,7 @@ cleanup: } static int qemuDomainSetBlkioParameters(virDomainPtr dom, - virBlkioParameterPtr params, + virTypedParameterPtr params, int nparams, unsigned int flags) { @@ -4695,11 +4695,11 @@ static int qemuDomainSetBlkioParameters(virDomainPtr dom, ret = 0; for (i = 0; i < nparams; i++) { - virBlkioParameterPtr param = ¶ms[i]; + virTypedParameterPtr param = ¶ms[i]; if (STREQ(param->field, VIR_DOMAIN_BLKIO_WEIGHT)) { int rc; - if (param->type != VIR_DOMAIN_BLKIO_PARAM_UINT) { + if (param->type != VIR_TYPED_PARAM_UINT) { qemuReportError(VIR_ERR_INVALID_ARG, "%s", _("invalid type for blkio weight tunable, expected a 'unsigned int'")); ret = -1; @@ -4735,7 +4735,7 @@ cleanup: } static int qemuDomainGetBlkioParameters(virDomainPtr dom, - virBlkioParameterPtr params, + virTypedParameterPtr params, int *nparams, unsigned int flags) { @@ -4789,10 +4789,10 @@ static int qemuDomainGetBlkioParameters(virDomainPtr dom, } for (i = 0; i < *nparams; i++) { - virBlkioParameterPtr param = ¶ms[i]; + virTypedParameterPtr param = ¶ms[i]; val = 0; param->value.ui = 0; - param->type = VIR_DOMAIN_BLKIO_PARAM_UINT; + param->type = VIR_TYPED_PARAM_UINT; switch (i) { case 0: /* fill blkio weight here */ @@ -4828,7 +4828,7 @@ cleanup: } static int qemuDomainSetMemoryParameters(virDomainPtr dom, - virMemoryParameterPtr params, + virTypedParameterPtr params, int nparams, unsigned int flags ATTRIBUTE_UNUSED) { @@ -4867,11 +4867,11 @@ static int qemuDomainSetMemoryParameters(virDomainPtr dom, ret = 0; for (i = 0; i < nparams; i++) { - virMemoryParameterPtr param = ¶ms[i]; + virTypedParameterPtr param = ¶ms[i]; if (STREQ(param->field, VIR_DOMAIN_MEMORY_HARD_LIMIT)) { int rc; - if (param->type != VIR_DOMAIN_MEMORY_PARAM_ULLONG) { + if (param->type != VIR_TYPED_PARAM_ULLONG) { qemuReportError(VIR_ERR_INVALID_ARG, "%s", _("invalid type for memory hard_limit tunable, expected a 'ullong'")); ret = -1; @@ -4886,7 +4886,7 @@ static int qemuDomainSetMemoryParameters(virDomainPtr dom, } } else if (STREQ(param->field, VIR_DOMAIN_MEMORY_SOFT_LIMIT)) { int rc; - if (param->type != VIR_DOMAIN_MEMORY_PARAM_ULLONG) { + if (param->type != VIR_TYPED_PARAM_ULLONG) { qemuReportError(VIR_ERR_INVALID_ARG, "%s", _("invalid type for memory soft_limit tunable, expected a 'ullong'")); ret = -1; @@ -4901,7 +4901,7 @@ static int qemuDomainSetMemoryParameters(virDomainPtr dom, } } else if (STREQ(param->field, VIR_DOMAIN_MEMORY_SWAP_HARD_LIMIT)) { int rc; - if (param->type != VIR_DOMAIN_MEMORY_PARAM_ULLONG) { + if (param->type != VIR_TYPED_PARAM_ULLONG) { qemuReportError(VIR_ERR_INVALID_ARG, "%s", _("invalid type for swap_hard_limit tunable, expected a 'ullong'")); ret = -1; @@ -4934,7 +4934,7 @@ cleanup: } static int qemuDomainGetMemoryParameters(virDomainPtr dom, - virMemoryParameterPtr params, + virTypedParameterPtr params, int *nparams, unsigned int flags ATTRIBUTE_UNUSED) { @@ -4988,10 +4988,10 @@ static int qemuDomainGetMemoryParameters(virDomainPtr dom, } for (i = 0; i < QEMU_NB_MEM_PARAM; i++) { - virMemoryParameterPtr param = ¶ms[i]; + virTypedParameterPtr param = ¶ms[i]; val = 0; param->value.ul = 0; - param->type = VIR_DOMAIN_MEMORY_PARAM_ULLONG; + param->type = VIR_TYPED_PARAM_ULLONG; switch (i) { case 0: /* fill memory hard limit here */ @@ -5058,7 +5058,7 @@ cleanup: } static int qemuSetSchedulerParametersFlags(virDomainPtr dom, - virSchedParameterPtr params, + virTypedParameterPtr params, int nparams, unsigned int flags) { @@ -5119,11 +5119,11 @@ static int qemuSetSchedulerParametersFlags(virDomainPtr dom, } for (i = 0; i < nparams; i++) { - virSchedParameterPtr param = ¶ms[i]; + virTypedParameterPtr param = ¶ms[i]; if (STREQ(param->field, "cpu_shares")) { int rc; - if (param->type != VIR_DOMAIN_SCHED_FIELD_ULLONG) { + if (param->type != VIR_TYPED_PARAM_ULLONG) { qemuReportError(VIR_ERR_INVALID_ARG, "%s", _("invalid type for cpu_shares tunable, expected a 'ullong'")); goto cleanup; @@ -5173,7 +5173,7 @@ cleanup: } static int qemuSetSchedulerParameters(virDomainPtr dom, - virSchedParameterPtr params, + virTypedParameterPtr params, int nparams) { return qemuSetSchedulerParametersFlags(dom, @@ -5183,7 +5183,7 @@ static int qemuSetSchedulerParameters(virDomainPtr dom, } static int qemuGetSchedulerParameters(virDomainPtr dom, - virSchedParameterPtr params, + virTypedParameterPtr params, int *nparams) { struct qemud_driver *driver = dom->conn->privateData; @@ -5233,7 +5233,7 @@ static int qemuGetSchedulerParameters(virDomainPtr dom, } out: params[0].value.ul = val; - params[0].type = VIR_DOMAIN_SCHED_FIELD_ULLONG; + params[0].type = VIR_TYPED_PARAM_ULLONG; if (virStrcpyStatic(params[0].field, "cpu_shares") == NULL) { qemuReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("Field cpu_shares too long for destination")); diff --git a/src/remote/remote_driver.c b/src/remote/remote_driver.c index b4208a3..489cdfa 100644 --- a/src/remote/remote_driver.c +++ b/src/remote/remote_driver.c @@ -1781,7 +1781,7 @@ done: static int remoteDomainSetMemoryParameters (virDomainPtr domain, - virMemoryParameterPtr params, + virTypedParameterPtr params, int nparams, unsigned int flags) { @@ -1856,7 +1856,7 @@ done: static int remoteDomainGetMemoryParameters (virDomainPtr domain, - virMemoryParameterPtr params, int *nparams, + virTypedParameterPtr params, int *nparams, unsigned int flags) { int rv = -1; @@ -1950,9 +1950,9 @@ done: static int remoteDomainSetBlkioParameters (virDomainPtr domain, - virBlkioParameterPtr params, - int nparams, - unsigned int flags) + virTypedParameterPtr params, + int nparams, + unsigned int flags) { int rv = -1; remote_domain_set_blkio_parameters_args args; @@ -2025,8 +2025,8 @@ done: static int remoteDomainGetBlkioParameters (virDomainPtr domain, - virBlkioParameterPtr params, int *nparams, - unsigned int flags) + virTypedParameterPtr params, int *nparams, + unsigned int flags) { int rv = -1; remote_domain_get_blkio_parameters_args args; @@ -2470,7 +2470,7 @@ done: static int remoteDomainGetSchedulerParameters (virDomainPtr domain, - virSchedParameterPtr params, int *nparams) + virTypedParameterPtr params, int *nparams) { int rv = -1; remote_domain_get_scheduler_parameters_args args; @@ -2540,7 +2540,7 @@ done: static int remoteDomainSetSchedulerParameters (virDomainPtr domain, - virSchedParameterPtr params, int nparams) + virTypedParameterPtr params, int nparams) { int rv = -1; remote_domain_set_scheduler_parameters_args args; @@ -2605,7 +2605,7 @@ done: static int remoteDomainSetSchedulerParametersFlags(virDomainPtr domain, - virSchedParameterPtr params, + virTypedParameterPtr params, int nparams, unsigned int flags) { diff --git a/src/test/test_driver.c b/src/test/test_driver.c index e86bc4e..f1cc681 100644 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c @@ -2635,7 +2635,7 @@ static char *testDomainGetSchedulerType(virDomainPtr domain ATTRIBUTE_UNUSED, } static int testDomainGetSchedulerParams(virDomainPtr domain, - virSchedParameterPtr params, + virTypedParameterPtr params, int *nparams) { testConnPtr privconn = domain->conn->privateData; @@ -2657,7 +2657,7 @@ static int testDomainGetSchedulerParams(virDomainPtr domain, goto cleanup; } strcpy(params[0].field, "weight"); - params[0].type = VIR_DOMAIN_SCHED_FIELD_UINT; + params[0].type = VIR_TYPED_PARAM_UINT; /* XXX */ /*params[0].value.ui = privdom->weight;*/ params[0].value.ui = 50; @@ -2673,7 +2673,7 @@ cleanup: static int testDomainSetSchedulerParams(virDomainPtr domain, - virSchedParameterPtr params, + virTypedParameterPtr params, int nparams) { testConnPtr privconn = domain->conn->privateData; @@ -2695,7 +2695,7 @@ static int testDomainSetSchedulerParams(virDomainPtr domain, testError(VIR_ERR_INVALID_ARG, "field"); goto cleanup; } - if (params[i].type != VIR_DOMAIN_SCHED_FIELD_UINT) { + if (params[i].type != VIR_TYPED_PARAM_UINT) { testError(VIR_ERR_INVALID_ARG, "type"); goto cleanup; } diff --git a/src/xen/xen_driver.c b/src/xen/xen_driver.c index fea8548..f527a7a 100644 --- a/src/xen/xen_driver.c +++ b/src/xen/xen_driver.c @@ -1677,7 +1677,8 @@ xenUnifiedDomainGetSchedulerType (virDomainPtr dom, int *nparams) static int xenUnifiedDomainGetSchedulerParameters (virDomainPtr dom, - virSchedParameterPtr params, int *nparams) + virTypedParameterPtr params, + int *nparams) { GET_PRIVATE(dom->conn); int i, ret; @@ -1694,7 +1695,8 @@ xenUnifiedDomainGetSchedulerParameters (virDomainPtr dom, static int xenUnifiedDomainSetSchedulerParameters (virDomainPtr dom, - virSchedParameterPtr params, int nparams) + virTypedParameterPtr params, + int nparams) { GET_PRIVATE(dom->conn); int i, ret; diff --git a/src/xen/xen_hypervisor.c b/src/xen/xen_hypervisor.c index 253164e..21e6645 100644 --- a/src/xen/xen_hypervisor.c +++ b/src/xen/xen_hypervisor.c @@ -1,7 +1,7 @@ /* * xen_internal.c: direct access to Xen hypervisor level * - * Copyright (C) 2005-2010 Red Hat, Inc. + * Copyright (C) 2005-2011 Red Hat, Inc. * * See COPYING.LIB for the License of this software * @@ -1242,7 +1242,7 @@ static const char *str_cap = "cap"; */ int xenHypervisorGetSchedulerParameters(virDomainPtr domain, - virSchedParameterPtr params, int *nparams) + virTypedParameterPtr params, int *nparams) { xenUnifiedPrivatePtr priv; @@ -1317,7 +1317,7 @@ xenHypervisorGetSchedulerParameters(virDomainPtr domain, "Weight %s too big for destination", str_weight); return -1; } - params[0].type = VIR_DOMAIN_SCHED_FIELD_UINT; + params[0].type = VIR_TYPED_PARAM_UINT; params[0].value.ui = op_dom.u.getschedinfo.u.credit.weight; if (virStrcpyStatic(params[1].field, str_cap) == NULL) { @@ -1325,7 +1325,7 @@ xenHypervisorGetSchedulerParameters(virDomainPtr domain, "Cap %s too big for destination", str_cap); return -1; } - params[1].type = VIR_DOMAIN_SCHED_FIELD_UINT; + params[1].type = VIR_TYPED_PARAM_UINT; params[1].value.ui = op_dom.u.getschedinfo.u.credit.cap; *nparams = XEN_SCHED_CRED_NPARAM; @@ -1351,7 +1351,7 @@ xenHypervisorGetSchedulerParameters(virDomainPtr domain, */ int xenHypervisorSetSchedulerParameters(virDomainPtr domain, - virSchedParameterPtr params, int nparams) + virTypedParameterPtr params, int nparams) { int i; unsigned int val; @@ -1424,7 +1424,7 @@ xenHypervisorSetSchedulerParameters(virDomainPtr domain, for (i = 0; i < nparams; i++) { memset(&buf, 0, sizeof(buf)); if (STREQ (params[i].field, str_weight) && - params[i].type == VIR_DOMAIN_SCHED_FIELD_UINT) { + params[i].type == VIR_TYPED_PARAM_UINT) { val = params[i].value.ui; if ((val < 1) || (val > USHRT_MAX)) { snprintf(buf, sizeof(buf), _("Credit scheduler weight parameter (%d) is out of range (1-65535)"), val); @@ -1433,7 +1433,7 @@ xenHypervisorSetSchedulerParameters(virDomainPtr domain, } op_dom.u.getschedinfo.u.credit.weight = val; } else if (STREQ (params[i].field, str_cap) && - params[i].type == VIR_DOMAIN_SCHED_FIELD_UINT) { + params[i].type == VIR_TYPED_PARAM_UINT) { val = params[i].value.ui; if (val >= USHRT_MAX) { snprintf(buf, sizeof(buf), _("Credit scheduler cap parameter (%d) is out of range (0-65534)"), val); diff --git a/src/xen/xen_hypervisor.h b/src/xen/xen_hypervisor.h index f7e7699..02ff63a 100644 --- a/src/xen/xen_hypervisor.h +++ b/src/xen/xen_hypervisor.h @@ -1,7 +1,7 @@ /* * xen_internal.h: internal API for direct access to Xen hypervisor level * - * Copyright (C) 2005, 2010 Red Hat, Inc. + * Copyright (C) 2005, 2010-2011 Red Hat, Inc. * * See COPYING.LIB for the License of this software * @@ -101,12 +101,12 @@ char * xenHypervisorGetSchedulerType (virDomainPtr domain, ATTRIBUTE_NONNULL (1); int xenHypervisorGetSchedulerParameters(virDomainPtr domain, - virSchedParameterPtr params, + virTypedParameterPtr params, int *nparams) ATTRIBUTE_NONNULL (1); int xenHypervisorSetSchedulerParameters(virDomainPtr domain, - virSchedParameterPtr params, + virTypedParameterPtr params, int nparams) ATTRIBUTE_NONNULL (1); diff --git a/src/xen/xend_internal.c b/src/xen/xend_internal.c index 1a3c3b4..f94dd8b 100644 --- a/src/xen/xend_internal.c +++ b/src/xen/xend_internal.c @@ -3597,7 +3597,7 @@ static const char *str_cap = "cap"; */ static int xenDaemonGetSchedulerParameters(virDomainPtr domain, - virSchedParameterPtr params, int *nparams) + virTypedParameterPtr params, int *nparams) { xenUnifiedPrivatePtr priv; struct sexpr *root; @@ -3667,7 +3667,7 @@ xenDaemonGetSchedulerParameters(virDomainPtr domain, str_weight); goto error; } - params[0].type = VIR_DOMAIN_SCHED_FIELD_UINT; + params[0].type = VIR_TYPED_PARAM_UINT; params[0].value.ui = sexpr_int(root, "domain/cpu_weight"); if (virStrcpyStatic(params[1].field, str_cap) == NULL) { @@ -3675,7 +3675,7 @@ xenDaemonGetSchedulerParameters(virDomainPtr domain, _("Cap %s too big for destination"), str_cap); goto error; } - params[1].type = VIR_DOMAIN_SCHED_FIELD_UINT; + params[1].type = VIR_TYPED_PARAM_UINT; params[1].value.ui = sexpr_int(root, "domain/cpu_cap"); *nparams = XEN_SCHED_CRED_NPARAM; ret = 0; @@ -3703,7 +3703,7 @@ error: */ static int xenDaemonSetSchedulerParameters(virDomainPtr domain, - virSchedParameterPtr params, int nparams) + virTypedParameterPtr params, int nparams) { xenUnifiedPrivatePtr priv; struct sexpr *root; @@ -3754,10 +3754,10 @@ xenDaemonSetSchedulerParameters(virDomainPtr domain, memset(&buf_cap, 0, VIR_UUID_BUFLEN); for (i = 0; i < nparams; i++) { if (STREQ (params[i].field, str_weight) && - params[i].type == VIR_DOMAIN_SCHED_FIELD_UINT) { + params[i].type == VIR_TYPED_PARAM_UINT) { snprintf(buf_weight, sizeof(buf_weight), "%u", params[i].value.ui); } else if (STREQ (params[i].field, str_cap) && - params[i].type == VIR_DOMAIN_SCHED_FIELD_UINT) { + params[i].type == VIR_TYPED_PARAM_UINT) { snprintf(buf_cap, sizeof(buf_cap), "%u", params[i].value.ui); } else { virXendError(VIR_ERR_INVALID_ARG, __FUNCTION__); diff --git a/tools/virsh.c b/tools/virsh.c index b43c167..1779843 100644 --- a/tools/virsh.c +++ b/tools/virsh.c @@ -1617,13 +1617,13 @@ static const vshCmdOptDef opts_schedinfo[] = { static int cmdSchedInfoUpdate(vshControl *ctl, const vshCmd *cmd, - virSchedParameterPtr param) + virTypedParameterPtr param) { const char *data = NULL; /* Legacy 'weight' parameter */ if (STREQ(param->field, "weight") && - param->type == VIR_DOMAIN_SCHED_FIELD_UINT && + param->type == VIR_TYPED_PARAM_UINT && vshCommandOptBool(cmd, "weight")) { int val; if (vshCommandOptInt(cmd, "weight", &val) <= 0) { @@ -1637,7 +1637,7 @@ cmdSchedInfoUpdate(vshControl *ctl, const vshCmd *cmd, /* Legacy 'cap' parameter */ if (STREQ(param->field, "cap") && - param->type == VIR_DOMAIN_SCHED_FIELD_UINT && + param->type == VIR_TYPED_PARAM_UINT && vshCommandOptBool(cmd, "cap")) { int val; if (vshCommandOptInt(cmd, "cap", &val) <= 0) { @@ -1665,41 +1665,41 @@ cmdSchedInfoUpdate(vshControl *ctl, const vshCmd *cmd, return 0; switch (param->type) { - case VIR_DOMAIN_SCHED_FIELD_INT: + case VIR_TYPED_PARAM_INT: if (virStrToLong_i(val, NULL, 10, ¶m->value.i) < 0) { vshError(ctl, "%s", _("Invalid value for parameter, expecting an int")); return -1; } break; - case VIR_DOMAIN_SCHED_FIELD_UINT: + case VIR_TYPED_PARAM_UINT: if (virStrToLong_ui(val, NULL, 10, ¶m->value.ui) < 0) { vshError(ctl, "%s", _("Invalid value for parameter, expecting an unsigned int")); return -1; } break; - case VIR_DOMAIN_SCHED_FIELD_LLONG: + case VIR_TYPED_PARAM_LLONG: if (virStrToLong_ll(val, NULL, 10, ¶m->value.l) < 0) { vshError(ctl, "%s", _("Invalid value for parameter, expecting a long long")); return -1; } break; - case VIR_DOMAIN_SCHED_FIELD_ULLONG: + case VIR_TYPED_PARAM_ULLONG: if (virStrToLong_ull(val, NULL, 10, ¶m->value.ul) < 0) { vshError(ctl, "%s", _("Invalid value for parameter, expecting an unsigned long long")); return -1; } break; - case VIR_DOMAIN_SCHED_FIELD_DOUBLE: + case VIR_TYPED_PARAM_DOUBLE: if (virStrToDouble(val, NULL, ¶m->value.d) < 0) { vshError(ctl, "%s", _("Invalid value for parameter, expecting a double")); return -1; } break; - case VIR_DOMAIN_SCHED_FIELD_BOOLEAN: + case VIR_TYPED_PARAM_BOOLEAN: param->value.b = STREQ(val, "0") ? 0 : 1; } return 1; @@ -1714,7 +1714,7 @@ cmdSchedinfo(vshControl *ctl, const vshCmd *cmd) { char *schedulertype; virDomainPtr dom; - virSchedParameterPtr params = NULL; + virTypedParameterPtr params = NULL; int nparams = 0; int update = 0; int i, ret; @@ -1755,9 +1755,9 @@ cmdSchedinfo(vshControl *ctl, const vshCmd *cmd) } if (nparams) { - params = vshMalloc(ctl, sizeof(virSchedParameter)* nparams); + params = vshMalloc(ctl, sizeof(*params) * nparams); - memset(params, 0, sizeof(virSchedParameter)* nparams); + memset(params, 0, sizeof(*params) * nparams); ret = virDomainGetSchedulerParameters(dom, params, &nparams); if (ret == -1) goto cleanup; @@ -1800,22 +1800,22 @@ cmdSchedinfo(vshControl *ctl, const vshCmd *cmd) ret_val = true; for (i = 0; i < nparams; i++){ switch (params[i].type) { - case VIR_DOMAIN_SCHED_FIELD_INT: + case VIR_TYPED_PARAM_INT: vshPrint(ctl, "%-15s: %d\n", params[i].field, params[i].value.i); break; - case VIR_DOMAIN_SCHED_FIELD_UINT: + case VIR_TYPED_PARAM_UINT: vshPrint(ctl, "%-15s: %u\n", params[i].field, params[i].value.ui); break; - case VIR_DOMAIN_SCHED_FIELD_LLONG: + case VIR_TYPED_PARAM_LLONG: vshPrint(ctl, "%-15s: %lld\n", params[i].field, params[i].value.l); break; - case VIR_DOMAIN_SCHED_FIELD_ULLONG: + case VIR_TYPED_PARAM_ULLONG: vshPrint(ctl, "%-15s: %llu\n", params[i].field, params[i].value.ul); break; - case VIR_DOMAIN_SCHED_FIELD_DOUBLE: + case VIR_TYPED_PARAM_DOUBLE: vshPrint(ctl, "%-15s: %f\n", params[i].field, params[i].value.d); break; - case VIR_DOMAIN_SCHED_FIELD_BOOLEAN: + case VIR_TYPED_PARAM_BOOLEAN: vshPrint(ctl, "%-15s: %d\n", params[i].field, params[i].value.b); break; default: @@ -3181,7 +3181,7 @@ cmdBlkiotune(vshControl * ctl, const vshCmd * cmd) int weight = 0; int nparams = 0; unsigned int i = 0; - virBlkioParameterPtr params = NULL, temp = NULL; + virTypedParameterPtr params = NULL, temp = NULL; bool ret = false; if (!vshConnectionUsability(ctl, ctl->conn)) @@ -3228,27 +3228,27 @@ cmdBlkiotune(vshControl * ctl, const vshCmd * cmd) for (i = 0; i < nparams; i++) { switch (params[i].type) { - case VIR_DOMAIN_BLKIO_PARAM_INT: + case VIR_TYPED_PARAM_INT: vshPrint(ctl, "%-15s: %d\n", params[i].field, params[i].value.i); break; - case VIR_DOMAIN_BLKIO_PARAM_UINT: + case VIR_TYPED_PARAM_UINT: vshPrint(ctl, "%-15s: %u\n", params[i].field, params[i].value.ui); break; - case VIR_DOMAIN_BLKIO_PARAM_LLONG: + case VIR_TYPED_PARAM_LLONG: vshPrint(ctl, "%-15s: %lld\n", params[i].field, params[i].value.l); break; - case VIR_DOMAIN_BLKIO_PARAM_ULLONG: + case VIR_TYPED_PARAM_ULLONG: vshPrint(ctl, "%-15s: %llu\n", params[i].field, params[i].value.ul); break; - case VIR_DOMAIN_BLKIO_PARAM_DOUBLE: + case VIR_TYPED_PARAM_DOUBLE: vshPrint(ctl, "%-15s: %f\n", params[i].field, params[i].value.d); break; - case VIR_DOMAIN_BLKIO_PARAM_BOOLEAN: + case VIR_TYPED_PARAM_BOOLEAN: vshPrint(ctl, "%-15s: %d\n", params[i].field, params[i].value.b); break; @@ -3264,7 +3264,7 @@ cmdBlkiotune(vshControl * ctl, const vshCmd * cmd) for (i = 0; i < nparams; i++) { temp = ¶ms[i]; - temp->type = VIR_DOMAIN_BLKIO_PARAM_UINT; + temp->type = VIR_TYPED_PARAM_UINT; if (weight) { temp->value.ui = weight; @@ -3318,7 +3318,7 @@ cmdMemtune(vshControl * ctl, const vshCmd * cmd) long long min_guarantee = 0; int nparams = 0; unsigned int i = 0; - virMemoryParameterPtr params = NULL, temp = NULL; + virTypedParameterPtr params = NULL, temp = NULL; bool ret = false; if (!vshConnectionUsability(ctl, ctl->conn)) @@ -3371,30 +3371,30 @@ cmdMemtune(vshControl * ctl, const vshCmd * cmd) for (i = 0; i < nparams; i++) { switch (params[i].type) { - case VIR_DOMAIN_MEMORY_PARAM_INT: + case VIR_TYPED_PARAM_INT: vshPrint(ctl, "%-15s: %d\n", params[i].field, params[i].value.i); break; - case VIR_DOMAIN_MEMORY_PARAM_UINT: + case VIR_TYPED_PARAM_UINT: vshPrint(ctl, "%-15s: %u\n", params[i].field, params[i].value.ui); break; - case VIR_DOMAIN_MEMORY_PARAM_LLONG: + case VIR_TYPED_PARAM_LLONG: vshPrint(ctl, "%-15s: %lld\n", params[i].field, params[i].value.l); break; - case VIR_DOMAIN_MEMORY_PARAM_ULLONG: + case VIR_TYPED_PARAM_ULLONG: if (params[i].value.ul == VIR_DOMAIN_MEMORY_PARAM_UNLIMITED) vshPrint(ctl, "%-15s: unlimited\n", params[i].field); else vshPrint(ctl, "%-15s: %llu kB\n", params[i].field, params[i].value.ul); break; - case VIR_DOMAIN_MEMORY_PARAM_DOUBLE: + case VIR_TYPED_PARAM_DOUBLE: vshPrint(ctl, "%-15s: %f\n", params[i].field, params[i].value.d); break; - case VIR_DOMAIN_MEMORY_PARAM_BOOLEAN: + case VIR_TYPED_PARAM_BOOLEAN: vshPrint(ctl, "%-15s: %d\n", params[i].field, params[i].value.b); break; @@ -3410,7 +3410,7 @@ cmdMemtune(vshControl * ctl, const vshCmd * cmd) for (i = 0; i < nparams; i++) { temp = ¶ms[i]; - temp->type = VIR_DOMAIN_MEMORY_PARAM_ULLONG; + temp->type = VIR_TYPED_PARAM_ULLONG; /* * Some magic here, this is used to fill the params structure with -- 1.7.4.4 -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list