[libvirt] [PATCH] news: Update for 5.5.0 release
by Andrea Bolognani
Signed-off-by: Andrea Bolognani <abologna(a)redhat.com>
---
docs/news.xml | 84 +++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 84 insertions(+)
diff --git a/docs/news.xml b/docs/news.xml
index cada389092..c6cc27faae 100644
--- a/docs/news.xml
+++ b/docs/news.xml
@@ -40,6 +40,18 @@
<libvirt>
<release version="v5.5.0" date="unreleased">
+ <section title="Security">
+ <change>
+ <summary>
+ api: Prevent access to several APIs over read-only connections
+ </summary>
+ <description>
+ Certain APIs give root-equivalent access to the host, and as such
+ should be limited to privileged users. CVE-2019-10161,
+ CVE-2019-10166, CVE-2019-10167, CVE-2019-10168.
+ </description>
+ </change>
+ </section>
<section title="New features">
<change>
<summary>
@@ -49,6 +61,16 @@
SMMUv3 is an IOMMU implementation for ARM virt guests.
</description>
</change>
+ <change>
+ <summary>
+ network: Introduce the network port API
+ </summary>
+ <description>
+ This new public API can be used by virtualization drivers to
+ manage network resources associated with guests, and is a further
+ step towards splitting libvirtd into multiple daemons.
+ </description>
+ </change>
</section>
<section title="Removed features">
<change>
@@ -62,10 +84,72 @@
from libvirt or otherwise.
</description>
</change>
+ <change>
+ <summary>
+ Stop supporting migration of config files from pre-XDG layout
+ </summary>
+ <description>
+ The new layout was introduced with libvirt 0.9.13 (Jul 2012).
+ </description>
+ </change>
+ <change>
+ <summary>
+ Remove Avahi mDNS support
+ </summary>
+ <description>
+ This feature was never used outside of virt-manager, which has
+ itself stopped using it a while ago.
+ </description>
+ </change>
</section>
<section title="Improvements">
+ <change>
+ <summary>
+ sysinfo: Report SMBIOS information on aarch64
+ </summary>
+ <description>
+ While SMBIOS support has historically been limited to x86_64, modern
+ aarch64 machines often offer access to the same information as well,
+ and libvirt now exposes it to the user when that's the case.
+ </description>
+ </change>
+ <change>
+ <summary>
+ test driver: Expand API coverage
+ </summary>
+ <description>
+ Even more APIs that were missing from the test driver have now been
+ implemented.
+ </description>
+ </change>
+ <change>
+ <summary>
+ virt-xml-validate: Allow input to be read from stdin
+ </summary>
+ </change>
+ <change>
+ <summary>
+ qemu: Validate spapr-vio addresses as 32-bit
+ </summary>
+ <description>
+ libvirt has always considered these addresses (used for pSeries
+ guests) as 64-bit, but the sPAPR specification says that they're
+ 32-bit instead.
+ </description>
+ </change>
</section>
<section title="Bug fixes">
+ <change>
+ <summary>
+ qemu: Set process affinity correctly when using <numatune>
+ </summary>
+ <description>
+ libvirt would mistakenly interpret the <code>nodeset</code>
+ attribute as a list of CPUs instead of as a list of NUMA node, and
+ the process affinity would be set incorrectly as a result; this has
+ now been fixed.
+ </description>
+ </change>
</section>
</release>
<release version="v5.4.0" date="2019-06-03">
--
2.21.0
5 years, 5 months
[libvirt] [PATCH] test_driver: implement virDomainGetNumaParameters
by Ilias Stamatis
Signed-off-by: Ilias Stamatis <stamatis.iliass(a)gmail.com>
---
src/test/test_driver.c | 48 ++++++++++++++++++++++++++++++++++++++++++
1 file changed, 48 insertions(+)
diff --git a/src/test/test_driver.c b/src/test/test_driver.c
index 4b1f2724a0..d0d4d9e270 100755
--- a/src/test/test_driver.c
+++ b/src/test/test_driver.c
@@ -2405,6 +2405,53 @@ testDomainCoreDump(virDomainPtr domain,
}
+static int
+testDomainGetNumaParameters(virDomainPtr dom,
+ virTypedParameterPtr params,
+ int *nparams,
+ unsigned int flags)
+{
+ virDomainObjPtr vm = NULL;
+ virDomainNumatuneMemMode mode = VIR_DOMAIN_NUMATUNE_MEM_STRICT;
+ VIR_AUTOFREE(char *) nodeset = NULL;
+ int ret = -1;
+
+ virCheckFlags(VIR_DOMAIN_AFFECT_CURRENT |
+ 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;
+
+ ignore_value(virDomainNumatuneGetMode(vm->def->numa, -1, &mode));
+ if (0 < *nparams && virTypedParameterAssign(¶ms[0], VIR_DOMAIN_NUMA_MODE,
+ VIR_TYPED_PARAM_INT, mode) < 0)
+ goto cleanup;
+
+ nodeset = virDomainNumatuneFormatNodeset(vm->def->numa, NULL, -1);
+ if (1 < *nparams && (!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 +7298,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] [BUG] virHostCPUGetInfoPopulateLinux statistics CPU socket inaccuracy
by Yuchen
only the last numa node /sys/devices/system/node/node*/cpu*/topology/physical_package_id
nodeinfo 'CPU socket(s)' is not equal to lscpu 'Socket(s)'
# virsh nodeinfo
CPU model: x86_64
CPU(s): 32
CPU frequency: 2393 MHz
CPU socket(s): 1
Core(s) per socket: 8
Thread(s) per core: 2
NUMA cell(s): 2
Memory size: 131150200 KiB
# lscpu
Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
CPU(s): 32
On-line CPU(s) list: 0-31
Thread(s) per core: 2
Core(s) per socket: 8
Socket(s): 2
NUMA node(s): 2
Vendor ID: GenuineIntel
CPU family: 6
Model: 85
Stepping: 4
CPU MHz: 820.151
BogoMIPS: 4201.57
Virtualization: VT-x
L1d cache: 32K
L1i cache: 32K
L2 cache: 1024K
L3 cache: 11264K
NUMA node0 CPU(s): 0-7,16-23
NUMA node1 CPU(s): 8-15,24-31
-------------------------------------------------------------------------------------------------------------------------------------
本邮件及其附件含有新华三集团的保密信息,仅限于发送给上面地址中列出
的个人或群组。禁止任何其他人以任何形式使用(包括但不限于全部或部分地泄露、复制、
或散发)本邮件中的信息。如果您错收了本邮件,请您立即电话或邮件通知发件人并删除本
邮件!
This e-mail and its attachments contain confidential information from New H3C, which is
intended only for the person or entity whose address is listed above. Any use of the
information contained herein in any way (including, but not limited to, total or partial
disclosure, reproduction, or dissemination) by persons other than the intended
recipient(s) is prohibited. If you receive this e-mail in error, please notify the sender
by phone or email immediately and delete it!
5 years, 5 months
[libvirt] [PATCH 0/2] cgroups v2 fixes
by Pavel Hrdina
Pavel Hrdina (2):
Revert "util: vircgroup: pass parent cgroup into
virCgroupDetectControllersCB"
util: vircgroupv2: stop enabling missing controllers with systemd
src/util/vircgroup.c | 4 ++--
src/util/vircgroupbackend.h | 6 ++++--
src/util/vircgroupv1.c | 3 +--
src/util/vircgroupv2.c | 22 +++++++++++-----------
4 files changed, 18 insertions(+), 17 deletions(-)
--
2.21.0
5 years, 5 months
[libvirt] [PATCH] test_driver: call virCheckFlags on testDomainReboot
by Ilias Stamatis
Currently the flags argument is completely ignored, but it should be
checked for any unsupported flags that might have been passed.
Signed-off-by: Ilias Stamatis <stamatis.iliass(a)gmail.com>
---
src/test/test_driver.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/test/test_driver.c b/src/test/test_driver.c
index 2a0ffbc6c5..6b1d53b06d 100755
--- a/src/test/test_driver.c
+++ b/src/test/test_driver.c
@@ -1850,13 +1850,16 @@ static int testDomainShutdown(virDomainPtr domain)
/* Similar behaviour as shutdown */
static int testDomainReboot(virDomainPtr domain,
- unsigned int action ATTRIBUTE_UNUSED)
+ unsigned int flags)
{
testDriverPtr privconn = domain->conn->privateData;
virDomainObjPtr privdom;
virObjectEventPtr event = NULL;
int ret = -1;
+ virCheckFlags(VIR_DOMAIN_REBOOT_DEFAULT | VIR_DOMAIN_REBOOT_ACPI_POWER_BTN |
+ VIR_DOMAIN_REBOOT_GUEST_AGENT | VIR_DOMAIN_REBOOT_INITCTL |
+ VIR_DOMAIN_REBOOT_SIGNAL | VIR_DOMAIN_REBOOT_PARAVIRT, -1);
if (!(privdom = testDomObjFromDomain(domain)))
goto cleanup;
--
2.22.0
5 years, 5 months
[libvirt] [PATCH] qemu: Validate disk against domain def on coldplug
by Michal Privoznik
https://bugzilla.redhat.com/show_bug.cgi?id=1692296#c7
This is a counterpart for ddc72f99027 and implements the same
check for coldplug.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
src/qemu/qemu_driver.c | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index d6ab134196..ed5f832f59 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -8082,6 +8082,21 @@ qemuDomainUpdateDeviceLive(virDomainObjPtr vm,
return ret;
}
+
+static int
+qemuCheckDiskConfigAgainstDomain(const virDomainDef *def,
+ const virDomainDiskDef *disk)
+{
+ if (virDomainSCSIDriveAddressIsUsed(def, &disk->info.addr.drive)) {
+ virReportError(VIR_ERR_OPERATION_INVALID, "%s",
+ _("Domain already contains a disk with that address"));
+ return -1;
+ }
+
+ return 0;
+}
+
+
static int
qemuDomainAttachDeviceConfig(virDomainDefPtr vmdef,
virDomainDeviceDefPtr dev,
@@ -8110,6 +8125,8 @@ qemuDomainAttachDeviceConfig(virDomainDefPtr vmdef,
return -1;
if (qemuCheckDiskConfig(disk, NULL) < 0)
return -1;
+ if (qemuCheckDiskConfigAgainstDomain(vmdef, disk) < 0)
+ return -1;
if (virDomainDiskInsert(vmdef, disk) < 0)
return -1;
/* vmdef has the pointer. Generic codes for vmdef will do all jobs */
--
2.21.0
5 years, 5 months
[libvirt] [PATCH] snapshot: Store both config and live XML in the snapshot domain
by Maxiwell S. Garcia
The snapshot-create operation of running guests saves the live
XML and uses it to replace the active and inactive domain in
case of revert. So, the config XML is ignored by the snapshot
process. This commit changes it and adds the config XML in the
snapshot XML as the <inactive/domain> entry.
In case of offline guest, the behavior remains the same and the
config XML is saved in the snapshot XML as <domain> entry. The
behavior of older snapshots of running guests, that don't have
the new <inactive/domain>, remains the same too. The revert, in
this case, overrides both active and inactive domain with the
<domain> entry. So, the <inactive/domain> in the snapshot XML is
not required to snapshot work, but it's useful to preserve the
config XML of running guests.
Signed-off-by: Maxiwell S. Garcia <maxiwell(a)linux.ibm.com>
---
src/conf/moment_conf.c | 1 +
src/conf/moment_conf.h | 1 +
src/conf/snapshot_conf.c | 42 ++++++++++++++++++++++++++++++++++++++++
src/qemu/qemu_driver.c | 29 ++++++++++++++++++++++-----
4 files changed, 68 insertions(+), 5 deletions(-)
diff --git a/src/conf/moment_conf.c b/src/conf/moment_conf.c
index fea13f0f97..f54a44b33e 100644
--- a/src/conf/moment_conf.c
+++ b/src/conf/moment_conf.c
@@ -66,6 +66,7 @@ virDomainMomentDefDispose(void *obj)
VIR_FREE(def->description);
VIR_FREE(def->parent_name);
virDomainDefFree(def->dom);
+ virDomainDefFree(def->inactiveDom);
}
/* Provide defaults for creation time and moment name after parsing XML */
diff --git a/src/conf/moment_conf.h b/src/conf/moment_conf.h
index 00ec1c1904..b8bec7e456 100644
--- a/src/conf/moment_conf.h
+++ b/src/conf/moment_conf.h
@@ -38,6 +38,7 @@ struct _virDomainMomentDef {
long long creationTime; /* in seconds */
virDomainDefPtr dom;
+ virDomainDefPtr inactiveDom;
};
virClassPtr virClassForDomainMomentDef(void);
diff --git a/src/conf/snapshot_conf.c b/src/conf/snapshot_conf.c
index c7f29360e7..c66ee997a4 100644
--- a/src/conf/snapshot_conf.c
+++ b/src/conf/snapshot_conf.c
@@ -294,6 +294,28 @@ virDomainSnapshotDefParse(xmlXPathContextPtr ctxt,
} else {
VIR_WARN("parsing older snapshot that lacks domain");
}
+
+ /* /inactive/domain entry saves the config XML present in a running
+ * VM. In case of absent, leave parent.inactiveDom NULL and use
+ * parent.dom for config and live XML. */
+ if ((tmp = virXPathString("string(./inactive/domain/@type)", ctxt))) {
+ int domainflags = VIR_DOMAIN_DEF_PARSE_INACTIVE |
+ VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE;
+ xmlNodePtr domainNode = virXPathNode("./inactive/domain", ctxt);
+
+ VIR_FREE(tmp);
+ if (!domainNode) {
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("missing inactive domain in snapshot"));
+
+ goto cleanup;
+ }
+ def->parent.inactiveDom = virDomainDefParseNode(ctxt->node->doc, domainNode,
+ caps, xmlopt, NULL, domainflags);
+ if (!def->parent.inactiveDom)
+ goto cleanup;
+ }
+
} else if (virDomainXMLOptionRunMomentPostParse(xmlopt, &def->parent) < 0) {
goto cleanup;
}
@@ -511,6 +533,16 @@ virDomainSnapshotRedefineValidate(virDomainSnapshotDefPtr def,
VIR_STEAL_PTR(def->parent.dom, otherdef->parent.dom);
}
}
+ if (otherdef->parent.inactiveDom) {
+ if (def->parent.inactiveDom) {
+ if (!virDomainDefCheckABIStability(otherdef->parent.inactiveDom,
+ def->parent.inactiveDom, xmlopt))
+ return -1;
+ } else {
+ /* Transfer the inactive domain def */
+ VIR_STEAL_PTR(def->parent.inactiveDom, otherdef->parent.inactiveDom);
+ }
+ }
}
if (def->parent.dom) {
@@ -876,6 +908,16 @@ virDomainSnapshotDefFormatInternal(virBufferPtr buf,
virBufferAddLit(buf, "</domain>\n");
}
+ if (def->parent.inactiveDom) {
+ virBufferAddLit(buf, "<inactive>\n");
+ virBufferAdjustIndent(buf, 2);
+ if (virDomainDefFormatInternal(def->parent.inactiveDom, caps,
+ domainflags, buf, xmlopt) < 0)
+ goto error;
+ virBufferAdjustIndent(buf, -2);
+ virBufferAddLit(buf, "</inactive>\n");
+ }
+
if (virSaveCookieFormatBuf(buf, def->cookie,
virDomainXMLOptionGetSaveCookie(xmlopt)) < 0)
goto error;
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 42b1ce2521..1ce7aa7b42 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -15707,6 +15707,15 @@ qemuDomainSnapshotCreateXML(virDomainPtr domain,
VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE)))
goto endjob;
+ if (vm->newDef) {
+ if (!(xml = qemuDomainDefFormatLive(driver, vm->newDef, priv->origCPU,
+ true, true)) ||
+ !(def->parent.inactiveDom = virDomainDefParseString(xml, caps, driver->xmlopt, NULL,
+ VIR_DOMAIN_DEF_PARSE_INACTIVE |
+ VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE)))
+ goto endjob;
+ }
+
if (flags & VIR_DOMAIN_SNAPSHOT_CREATE_DISK_ONLY) {
align_location = VIR_DOMAIN_SNAPSHOT_LOCATION_EXTERNAL;
align_match = false;
@@ -16241,6 +16250,7 @@ qemuDomainRevertToSnapshot(virDomainSnapshotPtr snapshot,
qemuDomainObjPrivatePtr priv;
int rc;
virDomainDefPtr config = NULL;
+ virDomainDefPtr inactiveConfig = NULL;
virQEMUDriverConfigPtr cfg = NULL;
virCapsPtr caps = NULL;
bool was_stopped = false;
@@ -16341,17 +16351,22 @@ qemuDomainRevertToSnapshot(virDomainSnapshotPtr snapshot,
* in the failure cases where we know there was no change? */
}
- /* Prepare to copy the snapshot inactive xml as the config of this
- * domain.
- *
- * XXX Should domain snapshots track live xml rather
- * than inactive xml? */
+ /* Prepare to copy the snapshot inactive domain as the config XML
+ * and the snapshot domain as the live XML. In case of inactive domain
+ * NULL, both config and live XML will be copied from snapshot domain.
+ */
if (snap->def->dom) {
config = virDomainDefCopy(snap->def->dom, caps,
driver->xmlopt, NULL, true);
if (!config)
goto endjob;
}
+ if (snap->def->inactiveDom) {
+ inactiveConfig = virDomainDefCopy(snap->def->inactiveDom, caps,
+ driver->xmlopt, NULL, true);
+ if (!inactiveConfig)
+ goto endjob;
+ }
cookie = (qemuDomainSaveCookiePtr) snapdef->cookie;
@@ -16602,6 +16617,10 @@ qemuDomainRevertToSnapshot(virDomainSnapshotPtr snapshot,
goto endjob;
}
+ if (inactiveConfig) {
+ virDomainDefFree(vm->newDef);
+ VIR_STEAL_PTR(vm->newDef, inactiveConfig);
+ }
ret = 0;
endjob:
--
2.20.1
5 years, 5 months
[libvirt] Encrypted vTPM state
by Stefan Berger
Hello!
Marc-André told me there was interest in encrypting the vTPM state.
I do have some patches along these lines from a long time ago that I
haven't upstreamed. I'd be curious about some feedback on some corner
stones of the design to support this:
- Encryption of the vTPM state must be added when a vTPM's XML is
created. It's not possible to convert existing not-encrypted vTPM state
to encrypted vTPM state. This is due to a limitation of 'swtpm.'
- vTPM state encryption would be based on libvirt's Secret support. I
assume the secrets can migrate along the domain XML.
- The XML for vTPM state encryption is similar to XML used for 'luks':
https://libvirt.org/formatstorageencryption.html#example
- The XML for an encrypted vTPM state could look like this:
<devices>
[...]
<tpm model='tpm-tis'>
<backend type='emulator' version='2.0'>
<encryption format='vtpm'>
<secret type='passphrase'
uuid='32ee7e76-2178-47a1-ab7b-269e6e348015'/>
</encryption>
</backend>
</tpm>
</devices>
Here the user is referencing an already existing Secret. This secret
would NOT be automatically undefined when a VM is undefined.
- Another possibility may be this XML here:
<devices>
[...]
<tpm model='tpm-tis'>
<backend type='emulator' version='2.0'>
<encryption format='default'/>
</backend>
</tpm>
</devices>
In this case the Secret would be automatically generated and this domain
XML be rewritten to look like the one in the first example. The domain
XML would then reference the created secret via usage=vtpm-<vmuuid>,
which would be an indication that this secret can be deleted when the VM
is undefined.
- The Secret XML to be passed to virsh secret-define would look like this:
<secret ephemeral='no' private='yes'>
<description>vTPM passphrase example</description>
<usage type='vtpm'>
<name>vtpm_example</name>
</usage>
</secret>
Regards,
Stefan
5 years, 5 months
[libvirt] [PATCH] test_driver: implement virDomainGetInterfaceParameters
by Ilias Stamatis
Signed-off-by: Ilias Stamatis <stamatis.iliass(a)gmail.com>
---
This is almost identical to the QEMU's driver implementation. I wonder
if we can somehow avoid copying that much code.
src/test/test_driver.c | 100 +++++++++++++++++++++++++++++++++++++++++
1 file changed, 100 insertions(+)
diff --git a/src/test/test_driver.c b/src/test/test_driver.c
index 4b1f2724a0..37634dd771 100755
--- a/src/test/test_driver.c
+++ b/src/test/test_driver.c
@@ -1964,6 +1964,105 @@ 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;
+ 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 (!(net = virDomainNetFind(vm->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 +7357,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