[libvirt] [PATCH] Taint domains using cdrom-passthrough
by John Ferlan
https://bugzilla.redhat.com/show_bug.cgi?id=976387
For a domain configured using the host cdrom, we should taint the domain
due to problems encountered when the host and guest try to control the tray.
Signed-off-by: John Ferlan <jferlan(a)redhat.com>
---
src/conf/domain_conf.c | 3 ++-
src/conf/domain_conf.h | 1 +
src/qemu/qemu_domain.c | 6 ++++++
3 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index add857c..a67e200 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -101,7 +101,8 @@ VIR_ENUM_IMPL(virDomainTaint, VIR_DOMAIN_TAINT_LAST,
"disk-probing",
"external-launch",
"host-cpu",
- "hook-script");
+ "hook-script",
+ "cdrom-passthrough");
VIR_ENUM_IMPL(virDomainVirt, VIR_DOMAIN_VIRT_LAST,
"qemu",
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index 2cd105a7..0867e8b 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -2280,6 +2280,7 @@ typedef enum {
VIR_DOMAIN_TAINT_EXTERNAL_LAUNCH, /* Externally launched guest domain */
VIR_DOMAIN_TAINT_HOST_CPU, /* Host CPU passthrough in use */
VIR_DOMAIN_TAINT_HOOK, /* Domain (possibly) changed via hook script */
+ VIR_DOMAIN_TAINT_CDROM_PASSTHROUGH,/* CDROM passthrough */
VIR_DOMAIN_TAINT_LAST
} virDomainTaintFlags;
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index fa8229f..b66ee89 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -2031,6 +2031,12 @@ void qemuDomainObjCheckDiskTaint(virQEMUDriverPtr driver,
qemuDomainObjTaint(driver, obj, VIR_DOMAIN_TAINT_HIGH_PRIVILEGES,
logFD);
+ if (disk->device == VIR_DOMAIN_DISK_DEVICE_CDROM &&
+ virStorageSourceGetActualType(disk->src) == VIR_STORAGE_TYPE_BLOCK &&
+ disk->src->path)
+ qemuDomainObjTaint(driver, obj, VIR_DOMAIN_TAINT_CDROM_PASSTHROUGH,
+ logFD);
+
virObjectUnref(cfg);
}
--
2.1.0
9 years, 6 months
[libvirt] [PATCH 0/3] Introduce yet another type to SMBIOS
by Michal Privoznik
The specification is here:
http://www.dmtf.org/sites/default/files/standards/documents/DSP0134_3.0.0...
The first two patches rework the code a bit, and the last one adds something
useful.
Michal Privoznik (3):
virSysinfoDef: Exempt BIOS variables
virSysinfoDef: Exempt SYSTEM variables
virSysinfo: Introduce SMBIOS type 2 support
docs/formatdomain.html.in | 37 +-
docs/schemas/domaincommon.rng | 24 ++
src/conf/domain_conf.c | 252 ++++++++---
src/libvirt_private.syms | 3 +
src/qemu/qemu_command.c | 112 +++--
src/util/virsysinfo.c | 528 +++++++++++++++++++-----
src/util/virsysinfo.h | 51 ++-
tests/qemuxml2argvdata/qemuxml2argv-smbios.args | 2 +
tests/qemuxml2argvdata/qemuxml2argv-smbios.xml | 9 +
9 files changed, 804 insertions(+), 214 deletions(-)
--
2.3.6
9 years, 6 months
[libvirt] [python PATCHv2] examples: Add example to make guest agent lifecycle event useful
by Peter Krempa
This example allows to use the guest agent event and metadata to track
vCPU count set via the guest agent (agent-based onlining/offlining) and
keep it persistent accross domain restarts.
The daemon listens for the agent lifecycle event, and if it's received
it looks into doman's metadata to see whether a desired count was set
and issues the guest agent command.
---
MANIFEST.in | 2 +
examples/README | 2 +
examples/guest-vcpus/guest-vcpu-daemon.py | 160 ++++++++++++++++++++++++++++++
examples/guest-vcpus/guest-vcpu.py | 74 ++++++++++++++
4 files changed, 238 insertions(+)
create mode 100755 examples/guest-vcpus/guest-vcpu-daemon.py
create mode 100755 examples/guest-vcpus/guest-vcpu.py
diff --git a/MANIFEST.in b/MANIFEST.in
index ad08207..230baea 100644
--- a/MANIFEST.in
+++ b/MANIFEST.in
@@ -11,6 +11,8 @@ include examples/domsave.py
include examples/domstart.py
include examples/esxlist.py
include examples/event-test.py
+include examples/guest-vcpus/guest-vcpu-daemon.py
+include examples/guest-vcpus/guest-vcpu.py
include examples/topology.py
include generator.py
include libvirt-lxc-override-api.xml
diff --git a/examples/README b/examples/README
index 1d4b425..0cb4513 100644
--- a/examples/README
+++ b/examples/README
@@ -12,6 +12,8 @@ esxlist.py - list active domains of an VMware ESX host and print some info.
also demonstrates how to use the libvirt.openAuth() method
dhcpleases.py - list dhcp leases for a given virtual network
domipaddrs.py - list IP addresses for guest domains
+guest-vcpus - two helpers to make the guest agent event useful with agent based
+ vCPU state modification
The XML files in this directory are examples of the XML format that libvirt
expects, and will have to be adapted for your setup. They are only needed
diff --git a/examples/guest-vcpus/guest-vcpu-daemon.py b/examples/guest-vcpus/guest-vcpu-daemon.py
new file mode 100755
index 0000000..c7c08a8
--- /dev/null
+++ b/examples/guest-vcpus/guest-vcpu-daemon.py
@@ -0,0 +1,160 @@
+#!/usr/bin/env python
+
+import libvirt
+import threading
+from xml.dom import minidom
+import time
+import sys
+import getopt
+import os
+
+uri = "qemu:///system"
+customXMLuri = "guest-cpu.python.libvirt.org"
+connectRetryTimeout = 5
+
+def usage():
+ print("usage: "+os.path.basename(sys.argv[0])+" [-h] [uri]")
+ print(" uri will default to qemu:///system")
+ print(" --help, -h Print(this help message")
+ print("")
+ print("This service waits for the guest agent lifecycle event and reissues " +
+ "guest agent calls to modify the cpu count according to the metadata " +
+ "set by guest-vcpu.py example")
+
+class workerData:
+ def __init__(self):
+ self.doms = list()
+ self.conn = None
+ self.cond = threading.Condition()
+
+ def notify(self):
+ self.cond.acquire()
+ self.cond.notify()
+ self.cond.release()
+
+ def waitNotify(self):
+ self.cond.acquire()
+ self.cond.wait()
+ self.cond.release()
+
+ def addDomainNotify(self, dom):
+ self.doms.append(dom)
+ self.notify()
+
+ def closeConnectNotify(self):
+ conn = self.conn
+ self.conn = None
+ conn.close()
+ self.notify()
+
+ def setConnect(self, conn):
+ self.conn = conn
+
+ def hasConn(self):
+ return self.conn is not None
+
+ def hasDom(self):
+ return len(self.doms) > 0
+
+ def getDom(self):
+ return self.doms.pop()
+
+ def setDoms(self, doms):
+ self.doms = doms
+
+
+def virEventLoopNativeRun():
+ while True:
+ libvirt.virEventRunDefaultImpl()
+
+def handleAgentLifecycleEvent(conn, dom, state, reason, opaque):
+ if state == libvirt.VIR_CONNECT_DOMAIN_EVENT_AGENT_LIFECYCLE_STATE_CONNECTED:
+ opaque.addDomainNotify(dom)
+
+def handleConnectClose(conn, reason, opaque):
+ print('Disconnected from ' + uri)
+ opaque.closeConnectNotify()
+
+def handleLibvirtLibraryError(opaque, error):
+ pass
+
+def processAgentConnect(dom):
+ try:
+ cpus = dom.metadata(libvirt.VIR_DOMAIN_METADATA_ELEMENT, customXMLuri,
+ libvirt.VIR_DOMAIN_AFFECT_LIVE)
+ doc = minidom.parseString(cpus)
+ ncpus = int(doc.getElementsByTagName('ncpus')[0].getAttribute('count'))
+ except:
+ return
+
+ try:
+ dom.setVcpusFlags(ncpus, libvirt.VIR_DOMAIN_AFFECT_LIVE | libvirt.VIR_DOMAIN_VCPU_GUEST)
+ print("set vcpu count for domain " + dom.name() + " to " + str(ncpus))
+ except:
+ print("failed to set vcpu count for domain " + dom.name())
+
+def work():
+ data = workerData()
+
+ print("Using uri: " + uri)
+
+ while True:
+ if not data.hasConn():
+ try:
+ conn = libvirt.open(uri)
+ except:
+ print('Failed to connect to ' + uri + ', retry in ' + str(connectRetryTimeout)) + ' seconds'
+ time.sleep(connectRetryTimeout)
+ continue
+
+ print('Connected to ' + uri)
+
+ data.setConnect(conn)
+ conn.registerCloseCallback(handleConnectClose, data)
+ conn.setKeepAlive(5, 3)
+ conn.domainEventRegisterAny(None,
+ libvirt.VIR_DOMAIN_EVENT_ID_AGENT_LIFECYCLE,
+ handleAgentLifecycleEvent,
+ data)
+
+ data.setDoms(conn.listAllDomains(libvirt.VIR_CONNECT_LIST_DOMAINS_ACTIVE))
+
+ while data.hasConn() and data.hasDom():
+ processAgentConnect(data.getDom())
+
+ data.waitNotify()
+
+def main():
+ libvirt.virEventRegisterDefaultImpl()
+ libvirt.registerErrorHandler(handleLibvirtLibraryError, None)
+
+ worker = threading.Thread(target=work)
+ worker.setDaemon(True)
+ worker.start()
+
+ eventLoop = threading.Thread(target=virEventLoopNativeRun)
+ eventLoop.setDaemon(True)
+ eventLoop.start()
+
+ while True:
+ time.sleep(1)
+
+if __name__ == "__main__":
+ try:
+ opts, args = getopt.getopt(sys.argv[1:], "h", ["help"])
+ except getopt.GetoptError as err:
+ print(str(err))
+ usage()
+ sys.exit(2)
+ for o, a in opts:
+ if o in ("-h", "--help"):
+ usage()
+ sys.exit()
+
+ if len(args) > 1:
+ usage()
+ sys.exit(1)
+ elif len(args) == 1:
+ uri = args[0]
+
+ main()
diff --git a/examples/guest-vcpus/guest-vcpu.py b/examples/guest-vcpus/guest-vcpu.py
new file mode 100755
index 0000000..8faba87
--- /dev/null
+++ b/examples/guest-vcpus/guest-vcpu.py
@@ -0,0 +1,74 @@
+#!/usr/bin/env python
+
+import libvirt
+import sys
+import getopt
+import os
+
+customXMLuri = "guest-cpu.python.libvirt.org"
+
+def usage():
+ print("usage: "+os.path.basename(sys.argv[0])+" [-hcl] domain count [uri]")
+ print(" uri will default to qemu:///system")
+ print(" --help, -h Print(this help message")
+ print(" --config, -c Modify persistent domain configuration")
+ print(" --live, -l Modify live domain configuration")
+ print("")
+ print("Sets the vCPU count via the guest agent and sets the metadata element " +
+ "used by guest-vcpu-daemon.py example")
+
+uri = "qemu:///system"
+flags = 0
+live = False;
+config = False;
+
+try:
+ opts, args = getopt.getopt(sys.argv[1:], "hcl", ["help", "config", "live"])
+except getopt.GetoptError as err:
+ # print help information and exit:
+ print(str(err)) # will print something like "option -a not recognized"
+ usage()
+ sys.exit(2)
+for o, a in opts:
+ if o in ("-h", "--help"):
+ usage()
+ sys.exit()
+ if o in ("-c", "--config"):
+ config = True
+ flags |= libvirt.VIR_DOMAIN_AFFECT_CONFIG
+ if o in ("-l", "--live"):
+ live = True
+ flags |= libvirt.VIR_DOMAIN_AFFECT_LIVE
+
+if len(args) < 2:
+ usage()
+ sys.exit(1)
+elif len(args) >= 3:
+ uri = args[2]
+
+domain = args[0]
+count = int(args[1])
+
+conn = libvirt.open(uri)
+dom = conn.lookupByName(domain)
+
+if flags == 0 or config:
+ confvcpus = dom.vcpusFlags(libvirt.VIR_DOMAIN_AFFECT_CONFIG)
+
+ if confvcpus < count:
+ print("Persistent domain configuration has only " + str(confvcpus) + " vcpus configured")
+ sys.exit(1)
+
+if flags == 0 or live:
+ livevcpus = dom.vcpusFlags(libvirt.VIR_DOMAIN_AFFECT_LIVE)
+
+ if livevcpus < count:
+ print("Live domain configuration has only " + str(livevcpus) + " vcpus configured")
+ sys.exit(1)
+
+if flags == 0 or live:
+ dom.setVcpusFlags(count, libvirt.VIR_DOMAIN_AFFECT_LIVE | libvirt.VIR_DOMAIN_VCPU_GUEST)
+
+meta = "<ncpus count='" + str(count) + "'/>"
+
+dom.setMetadata(libvirt.VIR_DOMAIN_METADATA_ELEMENT, meta, "guestvcpudaemon", customXMLuri, flags)
--
2.3.5
9 years, 6 months
[libvirt] [PATCHv2] docs: add dimm address document in docs
by Luyao Huang
As we have a new device address type 'dimm', add
some document. As we do not want user touch this
address, so no need add an XML example in the doc.
Signed-off-by: Luyao Huang <lhuang(a)redhat.com>
---
v2:
remove the xml example and values range, and point out
no need specified this address by users.
docs/formatdomain.html.in | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
index e0b6ba7..4adf827 100644
--- a/docs/formatdomain.html.in
+++ b/docs/formatdomain.html.in
@@ -2876,6 +2876,14 @@
attributes: <code>iobase</code> and <code>irq</code>.
<span class="since">Since 1.2.1</span>
</dd>
+ <dt><code>type='dimm'</code></dt>
+ <dd>DIMM addresses, for memory device, have the following additional
+ attributes: <code>slot</code> and <code>base</code>. No need specified
+ address when use memory device usually, these 2 attributes' values are
+ determined automatically when start the vm or hot-plug the memory
+ device.
+ <span class="since">Since 1.2.14</span>
+ </dd>
</dl>
<h4><a name="elementsControllers">Controllers</a></h4>
--
1.8.3.1
9 years, 6 months
[libvirt] [PATCH] qemu: Fix numatune nodeset reporting
by Martin Kletzander
Since af2a1f0587d88656f2c14265a63fbc11ecbd924e,
qemuDomainGetNumaParameters() returns invalid value for a running
guest. The problem is that it is getting the information from cgroups,
but the parent cgroup is being left alone since the mentioned commit.
Since the running guest's XML is in sync with cgroups, there is no need
to look into cgroups (unless someone changes the configuration behind
libvirt's back). Returning the info from the definition fixes a bug and
is also a cleanup.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1221047
Signed-off-by: Martin Kletzander <mkletzan(a)redhat.com>
---
src/qemu/qemu_driver.c | 35 ++++++++++-------------------------
1 file changed, 10 insertions(+), 25 deletions(-)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 8c00cdc..0cc0a29 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -10523,7 +10523,7 @@ qemuDomainGetNumaParameters(virDomainPtr dom,
char *nodeset = NULL;
int ret = -1;
virCapsPtr caps = NULL;
- qemuDomainObjPrivatePtr priv;
+ virDomainDefPtr def = NULL;
virCheckFlags(VIR_DOMAIN_AFFECT_LIVE |
VIR_DOMAIN_AFFECT_CONFIG |
@@ -10537,8 +10537,6 @@ qemuDomainGetNumaParameters(virDomainPtr dom,
if (!(vm = qemuDomObjFromDomain(dom)))
return -1;
- priv = vm->privateData;
-
if (virDomainGetNumaParametersEnsureACL(dom->conn, vm->def) < 0)
goto cleanup;
@@ -10555,6 +10553,11 @@ qemuDomainGetNumaParameters(virDomainPtr dom,
goto cleanup;
}
+ if (flags & VIR_DOMAIN_AFFECT_CONFIG)
+ def = persistentDef;
+ else
+ def = vm->def;
+
for (i = 0; i < QEMU_NB_NUMA_PARAM && i < *nparams; i++) {
virMemoryParameterPtr param = ¶ms[i];
@@ -10564,35 +10567,17 @@ qemuDomainGetNumaParameters(virDomainPtr dom,
VIR_TYPED_PARAM_INT, 0) < 0)
goto cleanup;
- if (flags & VIR_DOMAIN_AFFECT_CONFIG)
- param->value.i = virDomainNumatuneGetMode(persistentDef->numa, -1);
- else
- param->value.i = virDomainNumatuneGetMode(vm->def->numa, -1);
+ param->value.i = virDomainNumatuneGetMode(def->numa, -1);
break;
case 1: /* fill numa nodeset here */
- if (flags & VIR_DOMAIN_AFFECT_CONFIG) {
- nodeset = virDomainNumatuneFormatNodeset(persistentDef->numa,
- NULL, -1);
- if (!nodeset)
- goto cleanup;
- } else {
- if (!virCgroupHasController(priv->cgroup,
- VIR_CGROUP_CONTROLLER_CPUSET) ||
- virCgroupGetCpusetMems(priv->cgroup, &nodeset) < 0) {
- nodeset = virDomainNumatuneFormatNodeset(vm->def->numa,
- NULL, -1);
- if (!nodeset)
- goto cleanup;
- }
- }
-
- if (virTypedParameterAssign(param, VIR_DOMAIN_NUMA_NODESET,
+ nodeset = virDomainNumatuneFormatNodeset(def->numa, NULL, -1);
+ if (!nodeset ||
+ virTypedParameterAssign(param, VIR_DOMAIN_NUMA_NODESET,
VIR_TYPED_PARAM_STRING, nodeset) < 0)
goto cleanup;
nodeset = NULL;
-
break;
/* coverity[dead_error_begin] */
--
2.4.0
9 years, 6 months
[libvirt] cpuset / numa and qemu in TCG mode
by Tony Breeds
Hello all,
This is with reference to OpenStack (nova) bug 1439280 [1].
The symptom is when nova(-compute) tries to launch an instance/VM it errors out with:
"libvirtError: Requested operation is not valid: cpu affinity is not supported"
This only happens with using qemu in TCG mode.
After looking at the domain XML and the docs at [2] It seems to me the problem is either:
1) the libvirt driver in nova is generating valid XML that is an invalid
domain description ; or
2) NUMA support in qemu (TCG) mode is broken.
Exploring these options a little further:
Option 1: the libvirt driver in nova is generating valid XML that is an
invalid domain description
====
This is the relevant section of the domain XML
---
<vcpu placement='static' cpuset='0-1'>1</vcpu>
<cputune>
<shares>1024</shares>
</cputune>
---
To my reading of [2] the domain XML should either avoid specifying the 'cpuset'
in the vcpu node ; or include 'emulatorpin' in the cputune node.
Have I understood the documentation correctly? If so it would seem that the
correct fix is in nova to teach the libvirt driver to generate the correct XML
for this virtulisation type.
Option 2: NUMA support in qemu (TCG) mode is broken.
====
Is cpuset and NUMA architecture expected to work in qemu when running in TCG
mode? If it is then clearly we need to dig into this and fix qemu.
Yours Tony.
[1] https://bugs.launchpad.net/ubuntu/+source/libvirt/+bug/1439280
[2] https://libvirt.org/formatdomain.html#elementsCPUAllocation
9 years, 6 months
[libvirt] [PATCH 0/4] xenconfig: fix SPICE parsing/formatting
by Jim Fehlig
This series fixes several bugs related to SPICE parsing and formatting
code in xenconfig. The bugs are mostly due to misinterpretation of the
Xen documenation, which I failed to notice when reviewing the initial
submission.
Jim Fehlig (4):
xenconfig: use local variable for graphics def
xenconfig: format spice listenAddr when formating ports
xenconfig: fix spicepasswd handling
xenconfig: fix spice mousemode and copypaste
src/xenconfig/xen_xl.c | 95 ++++++++++++++++++++----------
tests/xlconfigdata/test-spice-features.cfg | 32 ++++++++++
tests/xlconfigdata/test-spice-features.xml | 48 +++++++++++++++
tests/xlconfigdata/test-spice.cfg | 4 +-
tests/xlconfigdata/test-spice.xml | 2 +
tests/xlconfigtest.c | 1 +
6 files changed, 148 insertions(+), 34 deletions(-)
create mode 100644 tests/xlconfigdata/test-spice-features.cfg
create mode 100644 tests/xlconfigdata/test-spice-features.xml
--
1.8.4.5
9 years, 6 months
[libvirt] [PATCH 0/6] node_device: update sriov/iommu info before dumpxml of a device
by Laine Stump
Patch 5/6 resolves this bug:
https://bugzilla.redhat.com/show_bug.cgi?id=981546
(filed against RHEL7, but existing in every version of libvirt that
supports reporting of SRIOV virtual function info via the NodeDevice
APIs - 0.7.5, believe it or not).
The rest of the series is there to make the bugfix less of a hack (and
make it easier to fix future similar bugs).
Laine Stump (6):
conf: make virNodeDevCapData an official type
nodedev: change if-else if in update_caps to switch
node device: prepare node_device_linux_sysfs.c to add more functions
node_device: new functions to get sriov/iommu info from sysfs
node_device: update sriov/iommu info before dumpxml of a device
node_device: replace duplicated code in hal and udev backends
src/Makefile.am | 5 +-
src/conf/node_device_conf.c | 50 ++++++++--------
src/conf/node_device_conf.h | 16 +++--
src/libxl/libxl_driver.c | 4 +-
src/node_device/node_device_driver.c | 50 ++++++++++++----
src/node_device/node_device_driver.h | 2 -
src/node_device/node_device_hal.c | 39 +++++-------
src/node_device/node_device_linux_sysfs.c | 99 +++++++++++++++++++++++++++++--
src/node_device/node_device_linux_sysfs.h | 32 ++++++++++
src/node_device/node_device_udev.c | 70 +++++++---------------
src/qemu/qemu_driver.c | 2 +-
src/test/test_driver.c | 6 +-
src/xen/xen_driver.c | 4 +-
13 files changed, 247 insertions(+), 132 deletions(-)
create mode 100644 src/node_device/node_device_linux_sysfs.h
--
2.1.0
9 years, 6 months
[libvirt] [PATCH v2 0/4] Enable support for s390 crypto key mgmt operations
by Michal Privoznik
I've taken Tony's patches from here:
https://www.redhat.com/archives/libvir-list/2015-April/msg01395.html
polished them a bit, and resend.
Tony Krowiak (4):
libvirt: docs: XML to enable/disable protected key mgmt ops
libvirt: conf: parse XML for protected key management ops
libvirt: qemu: enable/disable protected key management ops
libvirt: tests: test protected key mgmt ops support
docs/formatdomain.html.in | 37 +++++
docs/schemas/domaincommon.rng | 24 ++++
src/conf/domain_conf.c | 156 +++++++++++++++++++++
src/conf/domain_conf.h | 17 +++
src/libvirt_private.syms | 2 +
src/qemu/qemu_capabilities.c | 4 +
src/qemu/qemu_capabilities.h | 2 +
src/qemu/qemu_command.c | 73 ++++++++++
tests/qemuargv2xmltest.c | 6 +
.../qemuxml2argv-machine-aeskeywrap-off-argv.args | 6 +
.../qemuxml2argv-machine-aeskeywrap-off-argv.xml | 27 ++++
.../qemuxml2argv-machine-aeskeywrap-off-cap.args | 7 +
.../qemuxml2argv-machine-aeskeywrap-off-cap.xml | 28 ++++
.../qemuxml2argv-machine-aeskeywrap-off-caps.args | 7 +
.../qemuxml2argv-machine-aeskeywrap-off-caps.xml | 28 ++++
.../qemuxml2argv-machine-aeskeywrap-on-argv.args | 6 +
.../qemuxml2argv-machine-aeskeywrap-on-argv.xml | 27 ++++
.../qemuxml2argv-machine-aeskeywrap-on-cap.args | 7 +
.../qemuxml2argv-machine-aeskeywrap-on-cap.xml | 28 ++++
.../qemuxml2argv-machine-aeskeywrap-on-caps.args | 7 +
.../qemuxml2argv-machine-aeskeywrap-on-caps.xml | 27 ++++
.../qemuxml2argv-machine-deakeywrap-off-argv.args | 6 +
.../qemuxml2argv-machine-deakeywrap-off-argv.xml | 27 ++++
.../qemuxml2argv-machine-deakeywrap-off-cap.args | 7 +
.../qemuxml2argv-machine-deakeywrap-off-cap.xml | 28 ++++
.../qemuxml2argv-machine-deakeywrap-off-caps.args | 7 +
.../qemuxml2argv-machine-deakeywrap-off-caps.xml | 28 ++++
.../qemuxml2argv-machine-deakeywrap-on-argv.args | 6 +
.../qemuxml2argv-machine-deakeywrap-on-argv.xml | 27 ++++
.../qemuxml2argv-machine-deakeywrap-on-cap.args | 7 +
.../qemuxml2argv-machine-deakeywrap-on-cap.xml | 28 ++++
.../qemuxml2argv-machine-deakeywrap-on-caps.args | 7 +
.../qemuxml2argv-machine-deakeywrap-on-caps.xml | 28 ++++
.../qemuxml2argv-machine-keywrap-none-argv.args | 6 +
.../qemuxml2argv-machine-keywrap-none-argv.xml | 24 ++++
.../qemuxml2argv-machine-keywrap-none-caps.args | 7 +
.../qemuxml2argv-machine-keywrap-none-caps.xml | 25 ++++
.../qemuxml2argv-machine-keywrap-none.args | 7 +
.../qemuxml2argv-machine-keywrap-none.xml | 25 ++++
tests/qemuxml2argvtest.c | 81 +++++++++++
40 files changed, 907 insertions(+)
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-machine-aeskeywrap-off-argv.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-machine-aeskeywrap-off-argv.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-machine-aeskeywrap-off-cap.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-machine-aeskeywrap-off-cap.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-machine-aeskeywrap-off-caps.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-machine-aeskeywrap-off-caps.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-machine-aeskeywrap-on-argv.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-machine-aeskeywrap-on-argv.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-machine-aeskeywrap-on-cap.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-machine-aeskeywrap-on-cap.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-machine-aeskeywrap-on-caps.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-machine-aeskeywrap-on-caps.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-machine-deakeywrap-off-argv.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-machine-deakeywrap-off-argv.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-machine-deakeywrap-off-cap.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-machine-deakeywrap-off-cap.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-machine-deakeywrap-off-caps.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-machine-deakeywrap-off-caps.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-machine-deakeywrap-on-argv.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-machine-deakeywrap-on-argv.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-machine-deakeywrap-on-cap.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-machine-deakeywrap-on-cap.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-machine-deakeywrap-on-caps.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-machine-deakeywrap-on-caps.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-machine-keywrap-none-argv.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-machine-keywrap-none-argv.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-machine-keywrap-none-caps.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-machine-keywrap-none-caps.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-machine-keywrap-none.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-machine-keywrap-none.xml
--
2.3.6
9 years, 6 months
[libvirt] [PATCH] libxl: provide impl for nodeGetSecurityModel
by Jim Fehlig
Currently, the libxl driver does not support any security drivers.
When the qemu driver has no security driver configued,
nodeGetSecurityModel succeeds but returns an empty virSecurityModel
object. Do the same in the libxl driver instead of reporting
this function is not supported by the connection driver:
virNodeGetSecurityModel
Signed-off-by: Jim Fehlig <jfehlig(a)suse.com>
---
I was reminded of this today when looking through a libvirtd log.
The system was running a test script that among other things
called 'virsh dominfo'. Each time dominfo was called, the log
was spammed with "this function is not supported by the connection
driver: virNodeGetSecurityModel".
src/libxl/libxl_driver.c | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c
index 60c139e..d6b20ae 100644
--- a/src/libxl/libxl_driver.c
+++ b/src/libxl/libxl_driver.c
@@ -5027,6 +5027,23 @@ libxlDomainMigrateConfirm3Params(virDomainPtr domain,
return libxlDomainMigrationConfirm(driver, vm, flags, cancelled);
}
+static int libxlNodeGetSecurityModel(virConnectPtr conn,
+ virSecurityModelPtr secmodel)
+{
+ memset(secmodel, 0, sizeof(*secmodel));
+
+ if (virNodeGetSecurityModelEnsureACL(conn) < 0)
+ return -1;
+
+ /*
+ * Currently the libxl driver does not support security model.
+ * Similar to the qemu driver, treat this as success and simply
+ * return no data in secmodel. Avoids spamming the libvirt log
+ * with "this function is not supported by the connection driver:
+ * virNodeGetSecurityModel"
+ */
+ return 0;
+}
static virHypervisorDriver libxlHypervisorDriver = {
.name = LIBXL_DRIVER_NAME,
@@ -5122,6 +5139,7 @@ static virHypervisorDriver libxlHypervisorDriver = {
.domainMigratePerform3Params = libxlDomainMigratePerform3Params, /* 1.2.6 */
.domainMigrateFinish3Params = libxlDomainMigrateFinish3Params, /* 1.2.6 */
.domainMigrateConfirm3Params = libxlDomainMigrateConfirm3Params, /* 1.2.6 */
+ .nodeGetSecurityModel = libxlNodeGetSecurityModel, /* 1.2.16 */
};
static virConnectDriver libxlConnectDriver = {
--
2.3.7
9 years, 6 months