[libvirt] [PATCH] qemu: domain: update only newly detected images in qemuDomainDetermineDiskChain
by Peter Krempa
The processing code which prepares images should be executed really only
for the images which were detected. The code actually tried to update
the last user-specified layer as well. Thankfully we don't do anything
that would be a problem at this point.
Signed-off-by: Peter Krempa <pkrempa(a)redhat.com>
---
src/qemu/qemu_domain.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index f8a662f747..0fe9bc4b2a 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -8377,7 +8377,7 @@ qemuDomainDetermineDiskChain(virQEMUDriverPtr driver,
if (virStorageFileGetMetadata(src, uid, gid, report_broken) < 0)
goto cleanup;
- for (n = src; virStorageSourceIsBacking(n); n = n->backingStore) {
+ for (n = src->backingStore; virStorageSourceIsBacking(n); n = n->backingStore) {
if (qemuDomainValidateStorageSource(n, priv->qemuCaps) < 0)
goto cleanup;
--
2.16.2
6 years, 3 months
[libvirt] [PATCH] esx_driver: Simplify IsEncrypted and IsSecure
by Marcos Paulo de Souza
Signed-off-by: Marcos Paulo de Souza <marcos.souza.org(a)gmail.com>
---
src/esx/esx_driver.c | 12 ++----------
1 file changed, 2 insertions(+), 10 deletions(-)
diff --git a/src/esx/esx_driver.c b/src/esx/esx_driver.c
index 60aa5fc252..bb8eeecd42 100644
--- a/src/esx/esx_driver.c
+++ b/src/esx/esx_driver.c
@@ -4000,11 +4000,7 @@ esxConnectIsEncrypted(virConnectPtr conn)
{
esxPrivate *priv = conn->privateData;
- if (STRCASEEQ(priv->parsedUri->transport, "https")) {
- return 1;
- } else {
- return 0;
- }
+ return STRCASEEQ(priv->parsedUri->transport, "https");
}
@@ -4014,11 +4010,7 @@ esxConnectIsSecure(virConnectPtr conn)
{
esxPrivate *priv = conn->privateData;
- if (STRCASEEQ(priv->parsedUri->transport, "https")) {
- return 1;
- } else {
- return 0;
- }
+ return STRCASEEQ(priv->parsedUri->transport, "https");
}
--
2.17.1
6 years, 3 months
[libvirt] [PATCH] nwfilter: Remove redundant check if object exists
by Pavel Hrdina
The same check is done by virNWFilterBindingObjListAdd(). The main
issue with the current code is that if the object already exists we
would leak 'def' because 'obj' would be set and the cleanup code frees
'def' only if 'obj' is NULL.
Signed-off-by: Pavel Hrdina <phrdina(a)redhat.com>
---
src/nwfilter/nwfilter_driver.c | 7 -------
1 file changed, 7 deletions(-)
diff --git a/src/nwfilter/nwfilter_driver.c b/src/nwfilter/nwfilter_driver.c
index ed34586105..ac3a964388 100644
--- a/src/nwfilter/nwfilter_driver.c
+++ b/src/nwfilter/nwfilter_driver.c
@@ -752,13 +752,6 @@ nwfilterBindingCreateXML(virConnectPtr conn,
if (virNWFilterBindingCreateXMLEnsureACL(conn, def) < 0)
goto cleanup;
- obj = virNWFilterBindingObjListFindByPortDev(driver->bindings, def->portdevname);
- if (obj) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Filter already present for NIC %s"), def->portdevname);
- goto cleanup;
- }
-
obj = virNWFilterBindingObjListAdd(driver->bindings,
def);
if (!obj)
--
2.17.1
6 years, 3 months
[libvirt] [PATCH] nwfilter: variable 'obj' must be initialized inside nwfilterBindingCreateXML().
by Julio Faracco
The function nwfilterBindingCreateXML() is failing to compile due to a
conditional branch which leads to a undefined 'obj' variable. So 'obj'
must have a initial value to avoid compilation errors. See the problem:
CC nwfilter/libvirt_driver_nwfilter_impl_la-nwfilter_driver.lo
nwfilter/nwfilter_driver.c:752:9: error: variable 'obj' is used uninitialized whenever 'if' condition is true [-Werror,-Wsometimes-uninitialized]
if (virNWFilterBindingCreateXMLEnsureACL(conn, def) < 0)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
nwfilter/nwfilter_driver.c:779:10: note: uninitialized use occurs here
if (!obj)
^~~
nwfilter/nwfilter_driver.c:752:5: note: remove the 'if' if its condition is always false
if (virNWFilterBindingCreateXMLEnsureACL(conn, def) < 0)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
nwfilter/nwfilter_driver.c:742:33: note: initialize the variable 'obj' to silence this warning
virNWFilterBindingObjPtr obj;
^
= NULL
This commit initialized 'obj' with NULL to fix the error properly.
Signed-off-by: Julio Faracco <jcfaracco(a)gmail.com>
---
src/nwfilter/nwfilter_driver.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/nwfilter/nwfilter_driver.c b/src/nwfilter/nwfilter_driver.c
index d385b46f5f..ed34586105 100644
--- a/src/nwfilter/nwfilter_driver.c
+++ b/src/nwfilter/nwfilter_driver.c
@@ -739,8 +739,8 @@ nwfilterBindingCreateXML(virConnectPtr conn,
const char *xml,
unsigned int flags)
{
- virNWFilterBindingObjPtr obj;
virNWFilterBindingDefPtr def;
+ virNWFilterBindingObjPtr obj = NULL;
virNWFilterBindingPtr ret = NULL;
virCheckFlags(0, NULL);
--
2.17.1
6 years, 3 months
[libvirt] [python PATCH] Add support for nwfilter binding objects / apis
by Daniel P. Berrangé
Signed-off-by: Daniel P. Berrangé <berrange(a)redhat.com>
---
generator.py | 33 ++++++++++++++++++++--
libvirt-override-api.xml | 6 ++++
libvirt-override-virConnect.py | 12 ++++++++
libvirt-override.c | 51 ++++++++++++++++++++++++++++++++++
typewrappers.c | 13 +++++++++
typewrappers.h | 10 +++++++
6 files changed, 122 insertions(+), 3 deletions(-)
diff --git a/generator.py b/generator.py
index 353adab..ae0e45c 100755
--- a/generator.py
+++ b/generator.py
@@ -356,6 +356,10 @@ py_types = {
'virNWFilter *': ('O', "virNWFilter", "virNWFilterPtr", "virNWFilterPtr"),
'const virNWFilter *': ('O', "virNWFilter", "virNWFilterPtr", "virNWFilterPtr"),
+ 'virNWFilterBindingPtr': ('O', "virNWFilterBinding", "virNWFilterBindingPtr", "virNWFilterBindingPtr"),
+ 'virNWFilterBinding *': ('O', "virNWFilterBinding", "virNWFilterBindingPtr", "virNWFilterBindingPtr"),
+ 'const virNWFilterBinding *': ('O', "virNWFilterBinding", "virNWFilterBindingPtr", "virNWFilterBindingPtr"),
+
'virStreamPtr': ('O', "virStream", "virStreamPtr", "virStreamPtr"),
'virStream *': ('O', "virStream", "virStreamPtr", "virStreamPtr"),
'const virStream *': ('O', "virStream", "virStreamPtr", "virStreamPtr"),
@@ -539,6 +543,7 @@ skip_function = (
'virConnectListAllInterfaces', # overridden in virConnect.py
'virConnectListAllNodeDevices', # overridden in virConnect.py
'virConnectListAllNWFilters', # overridden in virConnect.py
+ 'virConnectListAllNWFilterBindings', # overridden in virConnect.py
'virConnectListAllSecrets', # overridden in virConnect.py
'virConnectGetAllDomainStats', # overridden in virConnect.py
'virDomainListGetStats', # overriden in virConnect.py
@@ -572,6 +577,7 @@ skip_function = (
"virNodeDeviceRef",
"virSecretRef",
"virNWFilterRef",
+ "virNWFilterBindingRef",
"virStoragePoolRef",
"virStorageVolRef",
"virStreamRef",
@@ -1010,6 +1016,8 @@ classes_type = {
"virSecret *": ("._o", "virSecret(self, _obj=%s)", "virSecret"),
"virNWFilterPtr": ("._o", "virNWFilter(self, _obj=%s)", "virNWFilter"),
"virNWFilter *": ("._o", "virNWFilter(self, _obj=%s)", "virNWFilter"),
+ "virNWFilterBindingPtr": ("._o", "virNWFilterBinding(self, _obj=%s)", "virNWFilterBinding"),
+ "virNWFilterBinding *": ("._o", "virNWFilterBinding(self, _obj=%s)", "virNWFilterBinding"),
"virStreamPtr": ("._o", "virStream(self, _obj=%s)", "virStream"),
"virStream *": ("._o", "virStream(self, _obj=%s)", "virStream"),
"virConnectPtr": ("._o", "virConnect(_obj=%s)", "virConnect"),
@@ -1021,7 +1029,8 @@ classes_type = {
primary_classes = ["virDomain", "virNetwork", "virInterface",
"virStoragePool", "virStorageVol",
"virConnect", "virNodeDevice", "virSecret",
- "virNWFilter", "virStream", "virDomainSnapshot"]
+ "virNWFilter", "virNWFilterBinding",
+ "virStream", "virDomainSnapshot"]
classes_destructors = {
"virDomain": "virDomainFree",
@@ -1032,6 +1041,7 @@ classes_destructors = {
"virNodeDevice" : "virNodeDeviceFree",
"virSecret": "virSecretFree",
"virNWFilter": "virNWFilterFree",
+ "virNWFilterBinding": "virNWFilterBindingFree",
"virDomainSnapshot": "virDomainSnapshotFree",
# We hand-craft __del__ for this one
#"virStream": "virStreamFree",
@@ -1058,6 +1068,8 @@ functions_noexcept = {
'virSecretGetUsageType': True,
'virSecretGetUsageID': True,
'virNWFilterGetName': True,
+ 'virNWFilterBindingGetFilterName': True,
+ 'virNWFilterBindingGetPortDev': True,
}
function_classes = {}
@@ -1113,6 +1125,15 @@ def nameFixup(name, classe, type, file):
elif name[0:15] == "virSecretLookup":
func = name[3:]
func = func[0:1].lower() + func[1:]
+ elif name[0:27] == "virNWFilterBindingCreateXML":
+ func = name[3:]
+ func = func[0:1].lower() + func[1:]
+ elif name[0:24] == "virNWFilterBindingDefine":
+ func = name[3:]
+ func = func[0:3].lower() + func[3:]
+ elif name[0:24] == "virNWFilterBindingLookup":
+ func = name[3:]
+ func = func[0:3].lower() + func[3:]
elif name[0:17] == "virNWFilterDefine":
func = name[3:]
func = func[0:3].lower() + func[3:]
@@ -1189,6 +1210,12 @@ def nameFixup(name, classe, type, file):
elif name[0:9] == 'virSecret':
func = name[9:]
func = func[0:1].lower() + func[1:]
+ elif name[0:21] == 'virNWFilterBindingGet':
+ func = name[21:]
+ func = func[0:1].lower() + func[1:]
+ elif name[0:18] == 'virNWFilterBinding':
+ func = name[18:]
+ func = func[0:1].lower() + func[1:]
elif name[0:14] == 'virNWFilterGet':
func = name[14:]
func = func[0:1].lower() + func[1:]
@@ -1468,7 +1495,7 @@ def buildWrappers(module):
classes.write("class %s(object):\n" % (classname))
if classname in [ "virDomain", "virNetwork", "virInterface", "virStoragePool",
"virStorageVol", "virNodeDevice", "virSecret","virStream",
- "virNWFilter" ]:
+ "virNWFilter", "virNWFilterBinding" ]:
classes.write(" def __init__(self, conn, _obj=None):\n")
elif classname in [ 'virDomainSnapshot' ]:
classes.write(" def __init__(self, dom, _obj=None):\n")
@@ -1476,7 +1503,7 @@ def buildWrappers(module):
classes.write(" def __init__(self, _obj=None):\n")
if classname in [ "virDomain", "virNetwork", "virInterface",
"virNodeDevice", "virSecret", "virStream",
- "virNWFilter" ]:
+ "virNWFilter", "virNWFilterBinding" ]:
classes.write(" self._conn = conn\n")
elif classname in [ "virStorageVol", "virStoragePool" ]:
classes.write(" self._conn = conn\n" + \
diff --git a/libvirt-override-api.xml b/libvirt-override-api.xml
index ecbdac2..4e8d6c0 100644
--- a/libvirt-override-api.xml
+++ b/libvirt-override-api.xml
@@ -485,6 +485,12 @@
<arg name='flags' type='unsigned int' info='optional flags'/>
<return type='char *' info='the list of network filters or None in case of error'/>
</function>
+ <function name='virConnectListAllNWFilterBindings' file='python'>
+ <info>returns list of all network fitler bindings</info>
+ <arg name='conn' type='virConnectPtr' info='pointer to the hypervisor connection'/>
+ <arg name='flags' type='unsigned int' info='optional flags'/>
+ <return type='char *' info='the list of network filter bindings or None in case of error'/>
+ </function>
<function name='virNWFilterLookupByUUID' file='python'>
<info>Try to lookup a network filter on the given hypervisor based on its UUID.</info>
<return type='virNWFilterPtr' info='a new network filter object or NULL in case of failure'/>
diff --git a/libvirt-override-virConnect.py b/libvirt-override-virConnect.py
index a24eae7..7fe08e0 100644
--- a/libvirt-override-virConnect.py
+++ b/libvirt-override-virConnect.py
@@ -531,6 +531,18 @@
return retlist
+ def listAllNWFilterBindings(self, flags=0):
+ """Returns a list of network filter binding objects"""
+ ret = libvirtmod.virConnectListAllNWFilterBindings(self._o, flags)
+ if ret is None:
+ raise libvirtError("virConnectListAllNWFilterBindings() failed", conn=self)
+
+ retlist = list()
+ for filter_ptr in ret:
+ retlist.append(virNWFilterBinding(self, _obj=filter_ptr))
+
+ return retlist
+
def listAllSecrets(self, flags=0):
"""Returns a list of secret objects"""
ret = libvirtmod.virConnectListAllSecrets(self._o, flags)
diff --git a/libvirt-override.c b/libvirt-override.c
index 012de3f..e74c7dd 100644
--- a/libvirt-override.c
+++ b/libvirt-override.c
@@ -4446,6 +4446,54 @@ libvirt_virConnectListAllNWFilters(PyObject *self ATTRIBUTE_UNUSED,
}
#endif /* LIBVIR_CHECK_VERSION(0, 10, 2) */
+#if LIBVIR_CHECK_VERSION(4, 5, 0)
+static PyObject *
+libvirt_virConnectListAllNWFilterBindings(PyObject *self ATTRIBUTE_UNUSED,
+ PyObject *args)
+{
+ PyObject *pyobj_conn;
+ PyObject *py_retval = NULL;
+ virConnectPtr conn;
+ virNWFilterBindingPtr *bindings = NULL;
+ int c_retval = 0;
+ ssize_t i;
+ unsigned int flags;
+
+ if (!PyArg_ParseTuple(args, (char *)"OI:virConnectListAllNWFilterBindings",
+ &pyobj_conn, &flags))
+ return NULL;
+ conn = (virConnectPtr) PyvirConnect_Get(pyobj_conn);
+
+ LIBVIRT_BEGIN_ALLOW_THREADS;
+ c_retval = virConnectListAllNWFilterBindings(conn, &bindings, flags);
+ LIBVIRT_END_ALLOW_THREADS;
+
+ if (c_retval < 0)
+ return VIR_PY_NONE;
+
+ if (!(py_retval = PyList_New(c_retval)))
+ goto cleanup;
+
+ for (i = 0; i < c_retval; i++) {
+ VIR_PY_LIST_SET_GOTO(py_retval, i,
+ libvirt_virNWFilterBindingPtrWrap(bindings[i]), error);
+ /* python steals the pointer */
+ bindings[i] = NULL;
+ }
+
+ cleanup:
+ for (i = 0; i < c_retval; i++)
+ if (bindings[i])
+ virNWFilterBindingFree(bindings[i]);
+ VIR_FREE(bindings);
+ return py_retval;
+
+ error:
+ Py_CLEAR(py_retval);
+ goto cleanup;
+}
+#endif /* LIBVIR_CHECK_VERSION(4, 5, 0) */
+
static PyObject *
libvirt_virConnectListInterfaces(PyObject *self ATTRIBUTE_UNUSED,
PyObject *args)
@@ -9971,6 +10019,9 @@ static PyMethodDef libvirtMethods[] = {
#if LIBVIR_CHECK_VERSION(0, 10, 2)
{(char *) "virConnectListAllNWFilters", libvirt_virConnectListAllNWFilters, METH_VARARGS, NULL},
#endif /* LIBVIR_CHECK_VERSION(0, 10, 2) */
+#if LIBVIR_CHECK_VERSION(4, 5, 0)
+ {(char *) "virConnectListAllNWFilterBindings", libvirt_virConnectListAllNWFilterBindings, METH_VARARGS, NULL},
+#endif /* LIBVIR_CHECK_VERSION(4, 5, 0) */
{(char *) "virConnectListInterfaces", libvirt_virConnectListInterfaces, METH_VARARGS, NULL},
{(char *) "virConnectListDefinedInterfaces", libvirt_virConnectListDefinedInterfaces, METH_VARARGS, NULL},
#if LIBVIR_CHECK_VERSION(0, 10, 2)
diff --git a/typewrappers.c b/typewrappers.c
index 99a8fb8..9ba14b4 100644
--- a/typewrappers.c
+++ b/typewrappers.c
@@ -542,6 +542,19 @@ libvirt_virNWFilterPtrWrap(virNWFilterPtr node)
return ret;
}
+PyObject *
+libvirt_virNWFilterBindingPtrWrap(virNWFilterBindingPtr node)
+{
+ PyObject *ret;
+
+ if (node == NULL) {
+ return VIR_PY_NONE;
+ }
+
+ ret = libvirt_buildPyObject(node, "virNWFilterBindingPtr", NULL);
+ return ret;
+}
+
PyObject *
libvirt_virStreamPtrWrap(virStreamPtr node)
{
diff --git a/typewrappers.h b/typewrappers.h
index ed1e4a3..1570c6a 100644
--- a/typewrappers.h
+++ b/typewrappers.h
@@ -106,6 +106,15 @@ typedef struct {
} PyvirNWFilter_Object;
+#define PyvirNWFilterBinding_Get(v) (((v) == Py_None) ? NULL : \
+ (((PyvirNWFilterBinding_Object *)(v))->obj))
+
+typedef struct {
+ PyObject_HEAD
+ virNWFilterBindingPtr obj;
+} PyvirNWFilterBinding_Object;
+
+
#define PyvirStream_Get(v) (((v) == Py_None) ? NULL : \
(((PyvirStream_Object *)(v))->obj))
@@ -189,6 +198,7 @@ PyObject * libvirt_virVoidPtrWrap(void* node);
PyObject * libvirt_virNodeDevicePtrWrap(virNodeDevicePtr node);
PyObject * libvirt_virSecretPtrWrap(virSecretPtr node);
PyObject * libvirt_virNWFilterPtrWrap(virNWFilterPtr node);
+PyObject * libvirt_virNWFilterBindingPtrWrap(virNWFilterBindingPtr node);
PyObject * libvirt_virStreamPtrWrap(virStreamPtr node);
PyObject * libvirt_virDomainSnapshotPtrWrap(virDomainSnapshotPtr node);
--
2.17.1
6 years, 3 months
[libvirt] [PATCH v2 00/12] PCI passthrough support on s390
by Yi Min Zhao
Abstract
========
The PCI representation in QEMU has recently been extended for S390
allowing configuration of zPCI attributes like uid (user-defined
identifier) and fid (PCI function identifier).
The details can be found here:
https://lists.gnu.org/archive/html/qemu-devel/2016-06/msg07262.html
To support the new zPCI feature of the S390 platform, two new XML
attributes, @uid and @fid, are introduced for device addresses of type
'pci', i.e.:
<hostdev mode='subsystem' type='pci'>
<driver name='vfio'/>
<source>
<address domain='0x0001' bus='0x00' slot='0x00' function='0x0'/>
</source>
<address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'
uid='0x0003' fid='0x00000027'/>
</hostdev>
uid and fid are optional attributes. If they are defined by the user,
unique values within the guest domain must be used. If they are not
specified and the architecture requires them, they are automatically
generated with non-conflicting values.
Current implementation is the most seamless one for the user as it
unites the address specific data of a PCI device on one XML element.
It could accommodate both specifying our special parameters (uid and fid)
and re-using standard statements (domain, bus, slot and function) for
PCI devices. User can still specify bus/slot/function for the virtualized
PCI devices in the XML.
Thus uid/fid act as an extension to the PCI address and are stored in
a new structure 'virZPCIDeviceAddress' which is a member of common PCI
Address structure. Additionally, two hashtables are used for assignment
and reservation of uid/fid.
In support of extending the PCI address, a new PCI address extension flag is
introduced. This extension flag allows is not only dedicated for the S390
platform but also other architectures needing certain extensions to PCI
address space.
Code Base
=========
commit in master:
0c4408c832368b45c8246175e2a75132d3ff0302
qemu: Don't use asyncJob after stop during snapshot revert
Change Log
==========
v1->v2:
1. Separate test commit and merge testcases into corresponding commits that
introduce the functionalities firstly.
2. Spare some checks for zpci device.
3. Add vsock and controller support.
4. Add uin32 type schema.
5. Rename zpciuid and zpcifid to zpci_uid and zpci_fid.
6. Always return multibus support on S390.
Yi Min Zhao (12):
conf: Add definitions for 'uid' and 'fid' PCI address attributes
qemu: Introduce zPCI capability
conf: Introduce a new PCI address extension flag
qemu: Enable PCI multi bus for S390 guests
qemu: Auto add pci-root for s390/s390x guests
conf: Introduce address caching for PCI extensions
conf: Introduce parser, formatter for uid and fid
conf: Allocate/release 'uid' and 'fid' in PCI address
qemu: Generate and use zPCI device in QEMU command line
qemu: Add hotpluging support for PCI devices on S390 guests
docs: Add 'uid' and 'fid' information
news: Update news for PCI address extension attributes
docs/formatdomain.html.in | 9 +-
docs/news.xml | 11 +
docs/schemas/basictypes.rng | 31 ++
docs/schemas/domaincommon.rng | 1 +
src/conf/device_conf.c | 73 +++++
src/conf/device_conf.h | 1 +
src/conf/domain_addr.c | 346 +++++++++++++++++++++
src/conf/domain_addr.h | 29 ++
src/conf/domain_conf.c | 6 +
src/libvirt_private.syms | 4 +
src/qemu/qemu_capabilities.c | 6 +
src/qemu/qemu_capabilities.h | 1 +
src/qemu/qemu_command.c | 105 +++++++
src/qemu/qemu_command.h | 4 +
src/qemu/qemu_domain.c | 1 +
src/qemu/qemu_domain_address.c | 181 ++++++++++-
src/qemu/qemu_hotplug.c | 201 ++++++++++--
src/util/virpci.h | 13 +
tests/qemucapabilitiesdata/caps_2.10.0.s390x.xml | 1 +
tests/qemucapabilitiesdata/caps_2.11.0.s390x.xml | 1 +
tests/qemucapabilitiesdata/caps_2.12.0.s390x.xml | 1 +
tests/qemucapabilitiesdata/caps_2.7.0.s390x.xml | 1 +
tests/qemucapabilitiesdata/caps_2.8.0.s390x.xml | 1 +
tests/qemucapabilitiesdata/caps_2.9.0.s390x.xml | 1 +
tests/qemuxml2argvdata/disk-virtio-s390-zpci.args | 27 ++
tests/qemuxml2argvdata/disk-virtio-s390-zpci.xml | 17 +
.../hostdev-vfio-zpci-autogenerate.args | 26 ++
.../hostdev-vfio-zpci-autogenerate.xml | 18 ++
.../hostdev-vfio-zpci-boundaries.args | 30 ++
.../hostdev-vfio-zpci-boundaries.xml | 26 ++
.../hostdev-vfio-zpci-multidomain-many.args | 40 +++
.../hostdev-vfio-zpci-multidomain-many.xml | 67 ++++
tests/qemuxml2argvdata/hostdev-vfio-zpci.args | 26 ++
tests/qemuxml2argvdata/hostdev-vfio-zpci.xml | 19 ++
tests/qemuxml2argvtest.c | 14 +
tests/qemuxml2xmloutdata/disk-virtio-s390-zpci.xml | 29 ++
tests/qemuxml2xmloutdata/hostdev-vfio-zpci.xml | 30 ++
tests/qemuxml2xmltest.c | 3 +
38 files changed, 1377 insertions(+), 24 deletions(-)
create mode 100644 tests/qemuxml2argvdata/disk-virtio-s390-zpci.args
create mode 100644 tests/qemuxml2argvdata/disk-virtio-s390-zpci.xml
create mode 100644 tests/qemuxml2argvdata/hostdev-vfio-zpci-autogenerate.args
create mode 100644 tests/qemuxml2argvdata/hostdev-vfio-zpci-autogenerate.xml
create mode 100644 tests/qemuxml2argvdata/hostdev-vfio-zpci-boundaries.args
create mode 100644 tests/qemuxml2argvdata/hostdev-vfio-zpci-boundaries.xml
create mode 100644 tests/qemuxml2argvdata/hostdev-vfio-zpci-multidomain-many.args
create mode 100644 tests/qemuxml2argvdata/hostdev-vfio-zpci-multidomain-many.xml
create mode 100644 tests/qemuxml2argvdata/hostdev-vfio-zpci.args
create mode 100644 tests/qemuxml2argvdata/hostdev-vfio-zpci.xml
create mode 100644 tests/qemuxml2xmloutdata/disk-virtio-s390-zpci.xml
create mode 100644 tests/qemuxml2xmloutdata/hostdev-vfio-zpci.xml
--
Yi Min
6 years, 3 months
[libvirt] [dbus PATCH] mailmap: Add mailmap file
by Andrea Bolognani
The AUTHORS file included in releases contains some
duplicated or incorrect information; having a mailmap
file will make sure future ones wont't suffer from
the same issue.
Signed-off-by: Andrea Bolognani <abologna(a)redhat.com>
---
.mailmap | 9 +++++++++
1 file changed, 9 insertions(+)
create mode 100644 .mailmap
diff --git a/.mailmap b/.mailmap
new file mode 100644
index 0000000..9a35b7c
--- /dev/null
+++ b/.mailmap
@@ -0,0 +1,9 @@
+# 'git shortlog --help' and look for mailmap for the format of each line
+
+# Email consolidation:
+# <Preferred address in AUTHORS> <other alias used by same author>
+<martin(a)piware.de> <martinpitt(a)users.noreply.github.com>
+
+# Name consolidation:
+# Preferred author spelling <preferred email>
+Daniel P. Berrangé <berrange(a)redhat.com>
--
2.17.1
6 years, 3 months
[libvirt] [PATCH v2 0/3] Deny live device alias change
by Michal Privoznik
v2 of:
https://www.redhat.com/archives/libvir-list/2018-June/msg00971.html
Note that 1/3 is already reviewed (not pushed though, yet).
diff to v1:
- Fixed <interface/> hotplug issue raised during review of v1,
- Removed alias change checks for disks and interfaces since there's one
common place for that now.
Michal Privoznik (3):
qemuDomainUpdateDeviceFlags: Parse device as live if needed
conf: Reintroduce action to virDomainDefCompatibleDevice
conf: Forbid device alias change on device-update
src/conf/domain_conf.c | 14 +++++++++++++-
src/conf/domain_conf.h | 4 +++-
src/lxc/lxc_driver.c | 12 +++++++++---
src/qemu/qemu_domain.c | 8 --------
src/qemu/qemu_driver.c | 44 ++++++++++++++++++++++++++++++++------------
src/qemu/qemu_hotplug.c | 5 -----
6 files changed, 57 insertions(+), 30 deletions(-)
--
2.16.4
6 years, 3 months
[libvirt] [PATCH python] libvirtaio: Fix compat with python 3.7
by Cole Robinson
In python 3.7, async is now a keyword, so this throws a syntax error:
File "/usr/lib64/python3.7/site-packages/libvirtaio.py", line 49
from asyncio import async as ensure_future
^
SyntaxError: invalid syntax
Switch to getattr trickery to accomplish the same goal
Signed-off-by: Cole Robinson <crobinso(a)redhat.com>
---
libvirtaio.py | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
If we don't care about python3 < 3.4.4 compat, we can just do
from asyncio import ensure_future
diff --git a/libvirtaio.py b/libvirtaio.py
index 1c432dd..9d517e6 100644
--- a/libvirtaio.py
+++ b/libvirtaio.py
@@ -43,10 +43,12 @@ import warnings
import libvirt
-try:
- from asyncio import ensure_future
-except ImportError:
- from asyncio import async as ensure_future
+# python < 3.4.4: we want 'async'
+# python >= 3.4.4 < 3.7, we want 'ensure_future'
+# python >= 3.7, 'async' is a reserved keyword, so we can't import it
+ensure_future = getattr(asyncio, "ensure_future", None)
+if not ensure_future:
+ ensure_future = getattr(asyncio, "async")
class Callback(object):
--
2.17.1
6 years, 3 months
[libvirt] [PATCH] Fix syntax error on Python 3.7
by Miro Hrončok
From 0d3b7cc9ba787a139ecbe6dac490b1f5bb021b7f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= <miro(a)hroncok.cz>
Date: Wed, 27 Jun 2018 13:00:28 +0200
Subject: [PATCH] Fix syntax error on Python 3.7
async is a keyword now.
`asyncio import ensure_future` works on Python 3.4 to 3.7
`from asyncio import async as ensure_future` is not needed.
---
libvirtaio.py | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/libvirtaio.py b/libvirtaio.py
index 1c432dd..b100a5f 100644
--- a/libvirtaio.py
+++ b/libvirtaio.py
@@ -43,10 +43,7 @@ import warnings
import libvirt
-try:
- from asyncio import ensure_future
-except ImportError:
- from asyncio import async as ensure_future
+from asyncio import ensure_future
class Callback(object):
--
2.17.0
6 years, 3 months