[libvirt] [PATCH] S390: Add fake PCI root
by Viktor Mihajlovski
For the time being add a PCI root for s390 to avoid getting issues
later on with PCI address checking. I don't want to unconditionally
switch off PCI for s390.
Signed-off-by: Viktor Mihajlovski <mihajlov(a)linux.vnet.ibm.com>
---
src/qemu/qemu_domain.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index d927716..a00536f 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -700,6 +700,8 @@ qemuDomainDefPostParse(virDomainDefPtr def,
case VIR_ARCH_PPCEMB:
case VIR_ARCH_SH4:
case VIR_ARCH_SH4EB:
+ case VIR_ARCH_S390:
+ case VIR_ARCH_S390X:
addPCIRoot = true;
break;
default:
--
1.7.9.5
11 years, 7 months
[libvirt] [PATCH] qemu: assume virtio-memballon without an address to be PCI
by Ján Tomko
When doing XML-to-native conversion, addresses are not assigned.
The code building memballon device string assumed they are and
returned an error without reporting any error message, leading to:
error: An error occurred, but the cause is unknown
Assume that address type none means it's a PCI device, as we do
for other virtio devices.
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=957077
---
This still leaves XML-to-native conversion broken for S390
machines, not just for memballon, but for other virtio devices
as well. Should we assign addresses in DomainXMLToNative as well,
or just decide which virtio device to add based on the machine type?
src/qemu/qemu_command.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 6f6b61b..6e1fff2 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -4083,14 +4083,12 @@ qemuBuildMemballoonDevStr(virDomainMemballoonDefPtr dev,
virBuffer buf = VIR_BUFFER_INITIALIZER;
switch (dev->info.type) {
- case VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI:
- virBufferAddLit(&buf, "virtio-balloon-pci");
- break;
case VIR_DOMAIN_DEVICE_ADDRESS_TYPE_CCW:
virBufferAddLit(&buf, "virtio-balloon-ccw");
break;
default:
- goto error;
+ virBufferAddLit(&buf, "virtio-balloon-pci");
+ break;
}
virBufferAsprintf(&buf, ",id=%s", dev->info.alias);
--
1.8.1.5
11 years, 7 months
[libvirt] [PATCH v2] test: Add JSON test for query-tpm-types
by Stefan Berger
Add a test case for query-tpm-models QMP command.
Signed-off-by: Stefan Berger <stefanb(a)linux.vnet.ibm.com>
---
tests/qemumonitorjsontest.c | 55 +++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 55 insertions(+)
diff --git a/tests/qemumonitorjsontest.c b/tests/qemumonitorjsontest.c
index 24685c7..6f42598 100644
--- a/tests/qemumonitorjsontest.c
+++ b/tests/qemumonitorjsontest.c
@@ -25,6 +25,7 @@
#include "qemu/qemu_conf.h"
#include "virthread.h"
#include "virerror.h"
+#include "virstring.h"
#define VIR_FROM_THIS VIR_FROM_NONE
@@ -440,6 +441,59 @@ cleanup:
static int
+testQemuMonitorJSONGetTPMModels(const void *data)
+{
+ const virDomainXMLOptionPtr xmlopt = (virDomainXMLOptionPtr)data;
+ qemuMonitorTestPtr test = qemuMonitorTestNew(true, xmlopt);
+ int ret = -1;
+ char **tpmmodels = NULL;
+ int ntpmmodels = 0;
+
+ if (!test)
+ return -1;
+
+ if (qemuMonitorTestAddItem(test, "query-tpm-models",
+ "{ "
+ " \"return\": [ "
+ " \"passthrough\""
+ " ]"
+ "}") < 0)
+ goto cleanup;
+
+ if ((ntpmmodels = qemuMonitorGetTPMModels(qemuMonitorTestGetMonitor(test),
+ &tpmmodels)) < 0)
+ goto cleanup;
+
+ if (ntpmmodels != 1) {
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ "ntpmmodels %d is not 1", ntpmmodels);
+ goto cleanup;
+ }
+
+#define CHECK(i, wantname) \
+ do { \
+ if (STRNEQ(tpmmodels[i], (wantname))) { \
+ virReportError(VIR_ERR_INTERNAL_ERROR, \
+ "name %s is not %s", \
+ tpmmodels[i], (wantname)); \
+ goto cleanup; \
+ } \
+ } while (0)
+
+ CHECK(0, "passthrough");
+
+#undef CHECK
+
+ ret = 0;
+
+cleanup:
+ qemuMonitorTestFree(test);
+ virStringFreeList(tpmmodels);
+ return ret;
+}
+
+
+static int
mymain(void)
{
int ret = 0;
@@ -465,6 +519,7 @@ mymain(void)
DO_TEST(GetMachines);
DO_TEST(GetCPUDefinitions);
DO_TEST(GetCommands);
+ DO_TEST(GetTPMModels);
virObjectUnref(xmlopt);
--
1.7.11.7
11 years, 7 months
[libvirt] [PATCH] virsh: suppress aliases in group help
by Eric Blake
'virsh help | grep nodedev-det' shows only nodedev-detach,
but 'virsh help nodedev | grep nodedev-det' also shows the
older alias that we intentionally hid in commit af3f9aab.
See also commit 787f4fe and this bug report:
https://bugzilla.redhat.com/show_bug.cgi?id=956966
* tools/virsh.c (vshCmdGrpHelp): Copy suppression of vshCmdHelp.
Signed-off-by: Eric Blake <eblake(a)redhat.com>
---
tools/virsh.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/tools/virsh.c b/tools/virsh.c
index 4cd93ca..6ec2f7b 100644
--- a/tools/virsh.c
+++ b/tools/virsh.c
@@ -1177,6 +1177,8 @@ vshCmdGrpHelp(vshControl *ctl, const char *grpname)
grp->keyword);
for (cmd = grp->commands; cmd->name; cmd++) {
+ if (cmd->flags & VSH_CMD_FLAG_ALIAS)
+ continue;
vshPrint(ctl, " %-30s %s\n", cmd->name,
_(vshCmddefGetInfo(cmd, "help")));
}
--
1.8.1.4
11 years, 7 months
[libvirt] [question] Why doesn't virsh command support an optional parameter
by Zhang Xiaohe
hi guys,
It's hard for me to understand why doesn't virsh command support an
optional parameter because I think omitting a parameter and offering
a default value sometimes is quite convenient.
For example:
$ virsh shutdown guest --mode acpi
The option --mode only accept string "acpi", "agent", "initctl" and
"signal", assuming that "acpi" is the most frequently used parameter
when --mode is specified, why not just using
$ virsh shutdown guest --mode acpi
instead.
Maybe this example is not very precise, but what I mean is if there is
an option which only accepts several candidate values and one of the
value is always used when it is specified, then we can make it the
default parameter of this option. This would be convenient and save
some typing.
Of course, this can also result in ambiguity to people who is not
familiar with the command. But with the help, it won't trap one very
long, will it?
So, why doesn't virsh support this and what do you think of adding
this feature?
Thanks
Zhang Xiaohe
11 years, 7 months
[libvirt] [libvirt-perl][PATCH] Fix typo in domain help page
by Zhe Peng
The help page of $dom->set_metadata have a typo,this patch fix it.
---
lib/Sys/Virt/Domain.pm | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/lib/Sys/Virt/Domain.pm b/lib/Sys/Virt/Domain.pm
index a502029..053f127 100644
--- a/lib/Sys/Virt/Domain.pm
+++ b/lib/Sys/Virt/Domain.pm
@@ -112,7 +112,7 @@ C<$flags> parameter defaults to zero.
Sets the metadata element of type C<$type> to hold the value
C<$val>. If C<$type> is C<Sys::Virt::Domain::METADATA_ELEMENT>
then the C<$key> and C<$uri> elements specify an XML namespace
-to use, otherwise they should both be C<nudef>. The optional
+to use, otherwise they should both be C<undef>. The optional
C<$flags> parameter defaults to zero.
=item $dom->is_active()
--
1.7.7.6
11 years, 7 months
[libvirt] [PATCH 0/8] VDIO support part 3
by Laine Stump
This *almost* completes VFIO support. I still need to add a couple of
xml/args test cases.
Laine Stump (8):
util: new function virPCIDeviceGetVFIOGroupDev
security: update hostdev labelling functions for VFIO
qemu: add VFIO devices to cgroup ACL
qemu: add QEMU_CAPS_VFIO_PCI_BOOTINDEX
qemu: use vfio-pci on commandline when appropriate
util: new virCommandSetMax(MemLock|Processes|Files)
qemu: use new virCommandSetMax(Processes|Files)
qemu: set qemu process' RLIMIT_MEMLOCK when VFIO is used
configure.ac | 2 +-
src/libvirt_private.syms | 7 ++
src/qemu/qemu_capabilities.c | 7 ++
src/qemu/qemu_capabilities.h | 2 +-
src/qemu/qemu_cgroup.c | 11 +++
src/qemu/qemu_command.c | 56 ++++++++++++---
src/qemu/qemu_hotplug.c | 23 +++++-
src/qemu/qemu_process.c | 38 +---------
src/security/security_apparmor.c | 12 +++-
src/security/security_dac.c | 27 +++++++-
src/security/security_selinux.c | 24 ++++++-
src/util/vircommand.c | 38 ++++++++++
src/util/vircommand.h | 4 ++
src/util/virpci.c | 34 +++++++++
src/util/virpci.h | 2 +
src/util/virutil.c | 146 +++++++++++++++++++++++++++++++++++++++
src/util/virutil.h | 4 ++
17 files changed, 382 insertions(+), 55 deletions(-)
--
1.7.11.7
11 years, 7 months
[libvirt] [PATCH 0/7] VFIO support part 2
by Laine Stump
More patches to go on top of the 3 patches yesterday. These patches
add a new API that I just learned was necessary -
virNodeDeviceDetachFlags() (explanation in patches), implement it for
xen and qemu, and use it in virsh.
Laine Stump (7):
pci: keep a stubDriver in each virPCIDevice
qemu: bind/unbind stub driver according to config <driver name='x'/>
hypervisor api: new virNodeDeviceDetachFlags
hypervisor api: implement RPC calls for virNodeDeviceDetachFlags
qemu: implement virNodeDeviceDetachFlags backend
xen: implement virNodeDeviceDetachFlags backend
virsh: use new virNodeDeviceDetachFlags
include/libvirt/libvirt.h.in | 5 +++-
src/driver.h | 6 ++++
src/libvirt.c | 69 ++++++++++++++++++++++++++++++++++++++++++++
src/libvirt_private.syms | 2 ++
src/libvirt_public.syms | 5 ++++
src/qemu/qemu_driver.c | 25 ++++++++++++++--
src/qemu/qemu_hostdev.c | 22 ++++++++++++--
src/remote/remote_driver.c | 34 +++++++++++++++++++++-
src/remote/remote_protocol.x | 15 ++++++++--
src/remote_protocol-structs | 6 ++++
src/util/virpci.c | 19 ++++++++++++
src/util/virpci.h | 5 +++-
src/xen/xen_driver.c | 25 ++++++++++++++--
tools/virsh-nodedev.c | 28 +++++++++++++-----
14 files changed, 246 insertions(+), 20 deletions(-)
--
1.7.11.7
11 years, 7 months
[libvirt] [PATCH 0/3] start of patches to support VFIO device assignment
by Laine Stump
This work isn't finished, but since there's a freeze coming up in a
few days, I thought I should send these patches that *are* finished to
get them out of the way before the last minute rush.
Patch 1 is trivial.
Patch 2 is longer, but completely mechanical (NOTE: there may be some
uses of that struct living in code that I lack the environment to
compile for, so test builds by people with odd platforms would be
appreciated!)
Patch 3 is standard parser/formatter/RNG/docs for the new XML. I
haven't added any test cases, because lacking backend functionality I
could only test xml-to-xml, which would require adding yet another
test xml file, and I'd rather wait until the backend
commandline-building code is in place, then simply add the new element
to a few existing test XML files.
In email awhile ago, danpb had suggested
<driver name='vfio|qemu'/>
I've used
<driver name='kvm'/>
because, unlike vhost-net where <driver name='qemu'/> indicates that
the driver used is in the usermode qemu process (and *not* in the
kernel), in this case <driver name='kvm'/> indicates that the driver
used is in the kernel (and I've seen it referenced in several places
as being "done by KVM", but never as "done by QEMU" (makes sense,
since qemu is all in userland)
Laine Stump (3):
qemu: detect vfio-pci device assignment support
conf: put hostdev pci address in a struct
conf: formatter/parser/RNG/docs for hostdev <driver name='kvm|vfio'/>
docs/formatdomain.html.in | 42 ++++++++++++++++++++-
docs/formatnetwork.html.in | 15 ++++++++
docs/schemas/domaincommon.rng | 79 ++++++++++++++++++++++++++--------------
docs/schemas/network.rng | 11 ++++++
src/conf/domain_audit.c | 8 ++--
src/conf/domain_conf.c | 48 +++++++++++++++++++++---
src/conf/domain_conf.h | 15 +++++++-
src/network/bridge_driver.c | 24 ++++++------
src/qemu/qemu_capabilities.c | 3 ++
src/qemu/qemu_capabilities.h | 1 +
src/qemu/qemu_command.c | 34 ++++++++---------
src/qemu/qemu_hostdev.c | 42 ++++++++++-----------
src/qemu/qemu_hotplug.c | 14 +++----
src/security/security_apparmor.c | 8 ++--
src/security/security_dac.c | 16 ++++----
src/security/security_selinux.c | 16 ++++----
src/security/virt-aa-helper.c | 10 ++---
src/xen/xend_internal.c | 10 ++---
src/xenxs/xen_sxpr.c | 16 ++++----
src/xenxs/xen_xm.c | 16 ++++----
20 files changed, 286 insertions(+), 142 deletions(-)
--
1.7.11.7
11 years, 7 months