[libvirt] [PATCH v2] test_driver: implement virDomainGetInterfaceParameters
by Ilias Stamatis
Signed-off-by: Ilias Stamatis <stamatis.iliass(a)gmail.com>
---
The only thing changed since v1 is calling virDomainObjGetOneDef to get
the appropriate def pointer.
src/test/test_driver.c | 104 +++++++++++++++++++++++++++++++++++++++++
1 file changed, 104 insertions(+)
diff --git a/src/test/test_driver.c b/src/test/test_driver.c
index 4b1f2724a0..dd756ed8bd 100755
--- a/src/test/test_driver.c
+++ b/src/test/test_driver.c
@@ -1964,6 +1964,109 @@ static int testDomainGetInfo(virDomainPtr domain,
return ret;
}
+
+static int
+testDomainGetInterfaceParameters(virDomainPtr dom,
+ const char *device,
+ virTypedParameterPtr params,
+ int *nparams,
+ unsigned int flags)
+{
+ size_t i;
+ virDomainObjPtr vm = NULL;
+ virDomainDefPtr def = NULL;
+ virDomainNetDefPtr net = NULL;
+ int ret = -1;
+
+ virCheckFlags(VIR_DOMAIN_AFFECT_LIVE |
+ VIR_DOMAIN_AFFECT_CONFIG |
+ VIR_TYPED_PARAM_STRING_OKAY, -1);
+
+ if ((*nparams) == 0) {
+ *nparams = 7;
+ return 0;
+ }
+
+ if (!(vm = testDomObjFromDomain(dom)))
+ return -1;
+
+ if (!(def = virDomainObjGetOneDef(vm, flags)))
+ goto cleanup;
+
+ if (!(net = virDomainNetFind(def, device)))
+ goto cleanup;
+
+ for (i = 0; i < *nparams && i < 7; i++) {
+ switch (i) {
+ case 0: /* inbound.average */
+ if (virTypedParameterAssign(¶ms[i],
+ VIR_DOMAIN_BANDWIDTH_IN_AVERAGE,
+ VIR_TYPED_PARAM_UINT, 0) < 0)
+ goto cleanup;
+ if (net->bandwidth && net->bandwidth->in)
+ params[i].value.ui = net->bandwidth->in->average;
+ break;
+ case 1: /* inbound.peak */
+ if (virTypedParameterAssign(¶ms[i],
+ VIR_DOMAIN_BANDWIDTH_IN_PEAK,
+ VIR_TYPED_PARAM_UINT, 0) < 0)
+ goto cleanup;
+ if (net->bandwidth && net->bandwidth->in)
+ params[i].value.ui = net->bandwidth->in->peak;
+ break;
+ case 2: /* inbound.burst */
+ if (virTypedParameterAssign(¶ms[i],
+ VIR_DOMAIN_BANDWIDTH_IN_BURST,
+ VIR_TYPED_PARAM_UINT, 0) < 0)
+ goto cleanup;
+ if (net->bandwidth && net->bandwidth->in)
+ params[i].value.ui = net->bandwidth->in->burst;
+ break;
+ case 3: /* inbound.floor */
+ if (virTypedParameterAssign(¶ms[i],
+ VIR_DOMAIN_BANDWIDTH_IN_FLOOR,
+ VIR_TYPED_PARAM_UINT, 0) < 0)
+ goto cleanup;
+ if (net->bandwidth && net->bandwidth->in)
+ params[i].value.ui = net->bandwidth->in->floor;
+ break;
+ case 4: /* outbound.average */
+ if (virTypedParameterAssign(¶ms[i],
+ VIR_DOMAIN_BANDWIDTH_OUT_AVERAGE,
+ VIR_TYPED_PARAM_UINT, 0) < 0)
+ goto cleanup;
+ if (net->bandwidth && net->bandwidth->out)
+ params[i].value.ui = net->bandwidth->out->average;
+ break;
+ case 5: /* outbound.peak */
+ if (virTypedParameterAssign(¶ms[i],
+ VIR_DOMAIN_BANDWIDTH_OUT_PEAK,
+ VIR_TYPED_PARAM_UINT, 0) < 0)
+ goto cleanup;
+ if (net->bandwidth && net->bandwidth->out)
+ params[i].value.ui = net->bandwidth->out->peak;
+ break;
+ case 6: /* outbound.burst */
+ if (virTypedParameterAssign(¶ms[i],
+ VIR_DOMAIN_BANDWIDTH_OUT_BURST,
+ VIR_TYPED_PARAM_UINT, 0) < 0)
+ goto cleanup;
+ if (net->bandwidth && net->bandwidth->out)
+ params[i].value.ui = net->bandwidth->out->burst;
+ break;
+ }
+ }
+
+ if (*nparams > 7)
+ *nparams = 7;
+
+ ret = 0;
+ cleanup:
+ virDomainObjEndAPI(&vm);
+ return ret;
+}
+
+
static int
testDomainGetState(virDomainPtr domain,
int *state,
@@ -7258,6 +7361,7 @@ static virHypervisorDriver testHypervisorDriver = {
.domainSetMemory = testDomainSetMemory, /* 0.1.4 */
.domainGetHostname = testDomainGetHostname, /* 5.5.0 */
.domainGetInfo = testDomainGetInfo, /* 0.1.1 */
+ .domainGetInterfaceParameters = testDomainGetInterfaceParameters, /* 5.6.0 */
.domainGetState = testDomainGetState, /* 0.9.2 */
.domainGetTime = testDomainGetTime, /* 5.4.0 */
.domainSave = testDomainSave, /* 0.3.2 */
--
2.22.0
5 years, 5 months
[libvirt] [PATCH 0/2] Couple of test_driver fixes
by Michal Privoznik
I was too eager to minimize patch 89320788ac4 and did some mistakes.
Here are the fixes.
Michal Prívozník (2):
test_driver: Don't access @vm after it was set to NULL
test_driver: Don't report VIR_DOMAIN_DISK_ERROR_NONE
src/test/test_driver.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
--
2.21.0
5 years, 5 months
[libvirt] [PATCH v2 8/9] docs: Deprecate CPU model runnability guarantees
by Eduardo Habkost
Document that CPU model runnability guarantees won't apply to
unversioned CPU models anymore.
Signed-off-by: Eduardo Habkost <ehabkost(a)redhat.com>
---
Changes v1 -> v2:
* (none)
Cc: libvir-list(a)redhat.com
---
qemu-deprecated.texi | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/qemu-deprecated.texi b/qemu-deprecated.texi
index 9cba82d5ec..18f85f70e1 100644
--- a/qemu-deprecated.texi
+++ b/qemu-deprecated.texi
@@ -276,3 +276,22 @@ Note that if you are exposing the export via /dev/nbd0, it is easier
to just export the entire image and then mount only /dev/nbd0p1 than
it is to reinvoke @command{qemu-nbd -c /dev/nbd0} limited to just a
subset of the image.
+
+@section Backwards compatibility
+
+@subsection Runnability guarantee of CPU models (since 4.1.0)
+
+Previous versions of QEMU never changed existing CPU models in
+ways that introduced additional host software or hardware
+requirements to the VM. This allowed management software to
+safely change the machine type of an existing VM without
+introducing new requirements ("runnability guarantee"). This
+prevented CPU models from being updated to include CPU
+vulnerability mitigations, leaving guests vulnerable in the
+default configuration.
+
+The CPU model runnability guarantee won't apply anymore to
+existing CPU models. Management software that needs runnability
+guarantees must resolve the CPU model aliases using te
+``alias-of'' field returned by the ``query-cpu-definitions'' QMP
+command.
--
2.18.0.rc1.1.g3f1ff2140
5 years, 5 months
[libvirt] [PATCH] qemu: remove a redundant call from qemuDomainGetPerfEvents
by Ilias Stamatis
Calling virDomainObjUpdateModificationImpact directly inside the
function body is redundant, since the same function call is embedded
into virDomainObjGetOneDef.
Signed-off-by: Ilias Stamatis <stamatis.iliass(a)gmail.com>
---
src/qemu/qemu_driver.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index ef2e980216..6bfbc31c1c 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -10339,9 +10339,6 @@ qemuDomainGetPerfEvents(virDomainPtr dom,
if (qemuDomainObjBeginJob(driver, vm, QEMU_JOB_QUERY) < 0)
goto cleanup;
- if (virDomainObjUpdateModificationImpact(vm, &flags) < 0)
- goto endjob;
-
if (!(def = virDomainObjGetOneDef(vm, flags)))
goto endjob;
--
2.22.0
5 years, 5 months
[libvirt] mdevctl: A shoestring mediated device management and persistence utility
by Alex Williamson
Hi,
Currently mediated device management, much like SR-IOV VF management,
is largely left as an exercise for the user. This is an attempt to
provide something and see where it goes. I doubt we'll solve
everyone's needs on the first pass, but maybe we'll solve enough and
provide helpers for the rest. Without further ado, I'll point to what
I have so far:
https://github.com/awilliam/mdevctl
This is inspired by driverctl, which is also a bash utility. mdevctl
uses udev and systemd to record and recreate mdev devices for
persistence and provides a command line utility for querying, listing,
starting, stopping, adding, and removing mdev devices. Currently, for
better or worse, it considers anything created to be persistent. I can
imagine a global configuration option that might disable this and
perhaps an autostart flag per mdev device, such that mdevctl might
simply "know" about some mdevs but not attempt to create them
automatically. Clearly command line usage help, man pages, and
packaging are lacking as well, release early, release often, plus this
is a discussion starter to see if perhaps this is sufficient to meet
some needs.
Originally I thought about making a utility to manage both mdev and
SR-IOV VFs all in one, but it seemed more natural to start here
(besides, I couldn't think of a good name for the combined utility).
If this seems useful, maybe I'll start on a vfctl for SR-IOV and we'll
see whether they have enough synergy to become one.
It would be really useful if s390 folks could help me understand
whether it's possible to glean all the information necessary to
recreate a ccw or ap mdev device from sysfs. I expect the file where
we currently only store the mdev_type to evolve into something that
includes more information to facilitate more complicated devices. For
now I make no claims to maintaining compatibility of recorded mdev
devices, it will absolutely change, but I didn't want to get bogged
down in making sure I don't accidentally source a root kit hidden in an
mdev config file.
I'm also curious how or if libvirt or openstack might use this. If
nothing else, it makes libvirt hook scripts easier to write, especially
if we add an option not to autostart mdevs, or if users don't mind
persistent mdevs, maybe there's nothing more to do.
BTW, feel free to clean up by bash, I'm a brute force and ignorance
shell coder ;) Thanks,
Alex
5 years, 5 months
[libvirt] [PATCH] rpc: Fix build error for virNetServerNew ATTRIBUTE_NONNULL values
by John Ferlan
Commit 5a148ce84 altered the virNetServerNew to remove a parameter
but neglected to update the ATTRIBUTE_NONNULL's which causes a build
failure for when checking is enabled such as when lv_cv_static_analysis
is enabled.
Signed-off-by: John Ferlan <jferlan(a)redhat.com>
---
Pushing as build breaker/trivial
src/rpc/virnetserver.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/rpc/virnetserver.h b/src/rpc/virnetserver.h
index b47b71b4b2..6b2541588c 100644
--- a/src/rpc/virnetserver.h
+++ b/src/rpc/virnetserver.h
@@ -42,7 +42,7 @@ virNetServerPtr virNetServerNew(const char *name,
virNetServerClientPrivPreExecRestart clientPrivPreExecRestart,
virFreeCallback clientPrivFree,
void *clientPrivOpaque)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(11) ATTRIBUTE_NONNULL(13);
+ ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(10) ATTRIBUTE_NONNULL(12);
virNetServerPtr virNetServerNewPostExecRestart(virJSONValuePtr object,
const char *name,
--
2.20.1
5 years, 5 months
[libvirt] [PATCH] tools: Fix permissions for virt-pki-validate.in
by Andrea Bolognani
While the script ultimately needs to be executable, the
source file really shouldn't be.
Signed-off-by: Andrea Bolognani <abologna(a)redhat.com>
---
Pushed as trivial.
tools/virt-pki-validate.in | 0
1 file changed, 0 insertions(+), 0 deletions(-)
mode change 100755 => 100644 tools/virt-pki-validate.in
diff --git a/tools/virt-pki-validate.in b/tools/virt-pki-validate.in
old mode 100755
new mode 100644
--
2.21.0
5 years, 5 months
[libvirt] [PATCH] test_driver: Fix permissions for test_driver.c
by Andrea Bolognani
Introduced in commit 4a6ee53581b3.
Signed-off-by: Andrea Bolognani <abologna(a)redhat.com>
---
Pushed as trivial.
src/test/test_driver.c | 0
1 file changed, 0 insertions(+), 0 deletions(-)
mode change 100755 => 100644 src/test/test_driver.c
diff --git a/src/test/test_driver.c b/src/test/test_driver.c
old mode 100755
new mode 100644
--
2.21.0
5 years, 5 months
[libvirt] [PATCH v2] test_driver: implement virDomainGetNumaParameters
by Ilias Stamatis
Signed-off-by: Ilias Stamatis <stamatis.iliass(a)gmail.com>
---
src/test/test_driver.c | 52 ++++++++++++++++++++++++++++++++++++++++++
1 file changed, 52 insertions(+)
diff --git a/src/test/test_driver.c b/src/test/test_driver.c
index 4b1f2724a0..dc6d3b078c 100755
--- a/src/test/test_driver.c
+++ b/src/test/test_driver.c
@@ -2405,6 +2405,57 @@ testDomainCoreDump(virDomainPtr domain,
}
+static int
+testDomainGetNumaParameters(virDomainPtr dom,
+ virTypedParameterPtr params,
+ int *nparams,
+ unsigned int flags)
+{
+ virDomainObjPtr vm = NULL;
+ virDomainDefPtr def = NULL;
+ virDomainNumatuneMemMode mode = VIR_DOMAIN_NUMATUNE_MEM_STRICT;
+ VIR_AUTOFREE(char *) nodeset = NULL;
+ int ret = -1;
+
+ virCheckFlags(VIR_DOMAIN_AFFECT_LIVE |
+ VIR_DOMAIN_AFFECT_CONFIG |
+ VIR_TYPED_PARAM_STRING_OKAY, -1);
+
+ if ((*nparams) == 0) {
+ *nparams = 2;
+ return 0;
+ }
+
+ if (!(vm = testDomObjFromDomain(dom)))
+ goto cleanup;
+
+ if (!(def = virDomainObjGetOneDef(vm, flags)))
+ goto cleanup;
+
+ ignore_value(virDomainNumatuneGetMode(def->numa, -1, &mode));
+ if (*nparams > 0 &&
+ virTypedParameterAssign(¶ms[0], VIR_DOMAIN_NUMA_MODE, VIR_TYPED_PARAM_INT, mode) < 0)
+ goto cleanup;
+
+ nodeset = virDomainNumatuneFormatNodeset(def->numa, NULL, -1);
+ if (*nparams > 1 && (!nodeset ||
+ virTypedParameterAssign(¶ms[1],
+ VIR_DOMAIN_NUMA_NODESET,
+ VIR_TYPED_PARAM_STRING,
+ nodeset) < 0))
+ goto cleanup;
+ nodeset = NULL;
+
+ if (*nparams > 2)
+ *nparams = 2;
+
+ ret = 0;
+ cleanup:
+ virDomainObjEndAPI(&vm);
+ return ret;
+}
+
+
static char *
testDomainGetOSType(virDomainPtr dom ATTRIBUTE_UNUSED)
{
@@ -7251,6 +7302,7 @@ static virHypervisorDriver testHypervisorDriver = {
.domainReboot = testDomainReboot, /* 0.1.1 */
.domainDestroy = testDomainDestroy, /* 0.1.1 */
.domainDestroyFlags = testDomainDestroyFlags, /* 4.2.0 */
+ .domainGetNumaParameters = testDomainGetNumaParameters, /* 5.6.0 */
.domainGetOSType = testDomainGetOSType, /* 0.1.9 */
.domainGetLaunchSecurityInfo = testDomainGetLaunchSecurityInfo, /* 5.5.0 */
.domainGetMaxMemory = testDomainGetMaxMemory, /* 0.1.4 */
--
2.22.0
5 years, 5 months
[libvirt] [PATCH] docs: fix acl permission docs
by Ján Tomko
We have been grouping network-port and nwfilter-binding permissions
under virNetworkPtr and virNWFilterPtr respectively.
Add the two missing classes that were matched because they contain
a substring of others.
Signed-off-by: Ján Tomko <jtomko(a)redhat.com>
---
docs/genaclperms.pl | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/docs/genaclperms.pl b/docs/genaclperms.pl
index d878321a90..34c526021c 100755
--- a/docs/genaclperms.pl
+++ b/docs/genaclperms.pl
@@ -22,7 +22,8 @@ use warnings;
my @objects = (
"CONNECT", "DOMAIN", "INTERFACE",
- "NETWORK","NODE_DEVICE", "NWFILTER",
+ "NETWORK_PORT", "NETWORK", "NODE_DEVICE",
+ "NWFILTER_BINDING", "NWFILTER",
"SECRET", "STORAGE_POOL", "STORAGE_VOL",
);
--
2.20.1
5 years, 5 months