[libvirt] broken api.xml file
by Eric Blake
Nehal discovered by accident that our libvirt-api.xml file is broken,
which in turn leads to broken python bindings.
Right now, if you look at docs/libvirt-api.xml, you'll find:
<enum name='VIR_IP_ADDR_TYPE_IPV4' file='libvirt' value='1'
type='virIPAddrType'/>
but if you look at the libvirt.h.in file, you see:
typedef enum {
VIR_IP_ADDR_TYPE_IPV4,
VIR_IP_ADDR_TYPE_IPV6,
which, by C rules, means that the enum is value 0, not 1. We need to
fix whatever in libvirt is generating the api.xml file, because that in
turn is leading to incorrect code in the python bindings.
We could, of course, work around the bug by adding explicit
'VIR_IP_ADDR_TYPE_IPV4 = 0,' in our libvirt.h.in file, but I'd rather
fix the root cause. It's not my area of expertise, so I'd appreciate a
hand in finding the problem spot, although I'm still trying to take a
look. We'll probably need to backport the patch to stable branches, and
any distro that has picked up broken definitions will want to respin
python bindings. In a quick audit, I found three impacted enums:
virDomainCoreDumpFormat (such as VIR_DOMAIN_CORE_DUMP_FORMAT_RAW)
virDomainEventGraphicsAddressType (such as
VIR_DOMAIN_EVENT_GRAPHICS_ADDRESS_IPV4)
virIPAddrType (such as VIR_IP_ADDR_TYPE_IPV4)
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
10 years, 5 months
[libvirt] [PATCH] domain conf: Fix whitespace around judgement operation when parsing 'managed' attribute.
by Chen Fan
Signed-off-by: Chen Fan <chen.fan.fnst(a)cn.fujitsu.com>
---
src/conf/domain_conf.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 02c394f..b7aa4f5 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -4261,7 +4261,7 @@ virDomainHostdevDefParseXMLSubsys(xmlNodePtr node,
* element that might be (pure hostdev, or higher level device
* (e.g. <interface>) with type='hostdev')
*/
- if ((managed = virXMLPropString(node, "managed"))!= NULL) {
+ if ((managed = virXMLPropString(node, "managed")) != NULL) {
if (STREQ(managed, "yes"))
def->managed = true;
}
--
1.9.3
10 years, 5 months
[libvirt] [PATCH 0/2] Add support for reporting failure on incompatible CPUs
by Jiri Denemark
When CPU virConnectCompareCPU returns VIR_CPU_COMPARE_INCOMPATIBLE, the
caller has no clue why the CPU is considered incompatible with host CPU.
And in some cases, it would be nice to be able to get such info in a
client rather than having to look in logs.
Jiri Denemark (2):
cpuCompare*: Add support for reporting failure on incompatible CPUs
virConnectCompareCPU: Introduce FAIL_INCOMPATIBLE flag
include/libvirt/libvirt.h.in | 5 +++++
include/libvirt/virterror.h | 2 ++
src/bhyve/bhyve_driver.c | 17 +++++++++++++----
src/cpu/cpu.c | 10 ++++++----
src/cpu/cpu.h | 9 ++++++---
src/cpu/cpu_aarch64.c | 3 ++-
src/cpu/cpu_arm.c | 3 ++-
src/cpu/cpu_generic.c | 15 +++++++++++----
src/cpu/cpu_powerpc.c | 10 ++++++++--
src/cpu/cpu_x86.c | 20 ++++++++++++++++++--
src/libvirt.c | 9 +++++++--
src/qemu/qemu_driver.c | 17 +++++++++++++----
src/util/virerror.c | 6 ++++++
tests/cputest.c | 4 ++--
tools/virsh-domain.c | 11 +++++++++--
15 files changed, 110 insertions(+), 31 deletions(-)
--
2.0.0
10 years, 5 months
[libvirt] [python PATCH] Implement new virNetworkGetDHCPLeases{ForMAC} APIs
by Nehal J Wani
These APIs return a list of dhcp leases for all network interfaces connected
to the given virtual network or limited output just for one interface if mac
is specified.
Example Output:
[{'iface': 'virbr3', 'ipaddr': '192.168.150.181', 'hostname': 'ubuntu14',
'expirytime': 1403737495L, 'prefix': 24, 'clientid': None,
'mac': '52:54:00:e8:73:eb', 'iaid': None, 'type': 0},
{'iface': 'virbr3', 'ipaddr': '2001:db8:ca2:2:1::bd', 'hostname': 'fedora20-test',
'expirytime': 1403738587L, 'prefix': 64, 'clientid': '00:04:b1:d8:86:42:e1:6a:aa:cf:d5:86:94:23:6f:94:04:cd',
'mac': '52:54:00:5b:40:98', 'iaid': '5980312', 'type': 1}]
---
examples/README | 1 +
examples/dhcpleases.py | 53 +++++++++++++++
generator.py | 5 ++
libvirt-override-api.xml | 14 ++++
libvirt-override.c | 166 +++++++++++++++++++++++++++++++++++++++++++++++
sanitytest.py | 6 ++
6 files changed, 245 insertions(+)
create mode 100755 examples/dhcpleases.py
diff --git a/examples/README b/examples/README
index f4db76c..5b5d405 100644
--- a/examples/README
+++ b/examples/README
@@ -10,6 +10,7 @@ domsave.py - save all running domU's into a directory
domrestore.py - restore domU's from their saved files in a directory
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
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/dhcpleases.py b/examples/dhcpleases.py
new file mode 100755
index 0000000..c172dc2
--- /dev/null
+++ b/examples/dhcpleases.py
@@ -0,0 +1,53 @@
+#!/usr/bin/env python
+# netdhcpleases - print leases info for given virtual network
+
+import libvirt
+import sys
+import time
+
+def usage():
+ print "Usage: %s [URI] NETWORK" % sys.argv[0]
+ print " Print leases info for a given virtual network"
+
+uri = None
+network = None
+args = len(sys.argv)
+
+if args == 2:
+ network = sys.argv[1]
+elif args == 3:
+ uri = sys.argv[1]
+ network = sys.argv[2]
+else:
+ usage()
+ sys.exit(2)
+
+conn = libvirt.open(uri)
+if conn == None:
+ print "Unable to open connection to libvirt"
+ sys.exit(1)
+
+try:
+ net = conn.networkLookupByName(network)
+except libvirt.libvirtError:
+ print "Network %s not found" % network
+ sys.exit(0)
+
+leases = net.DHCPLeases();
+if (leases == None):
+ print "Failed to get leases for %s" % net.name()
+ sys.exit(0)
+
+def toIPAddrType(addrType):
+ if addrType == libvirt.VIR_IP_ADDR_TYPE_IPV4:
+ return "ipv4"
+ elif addrType == libvirt.VIR_IP_ADDR_TYPE_IPV6:
+ return "ipv6"
+
+print " {0:20} {1:18} {2:9} {3:25} {4:15} {5}".format("Expiry Time", "MAC address", "Protocol", "IP address", "Hostname", "Client ID or DUID")
+print "-"*115
+
+for lease in leases:
+ print " {0:20}".format(time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(lease['expirytime']))),
+ print "{0:18} {1:9}".format(lease['mac'], toIPAddrType(lease['type'])),
+ print "{0:<25} {1:15} {2}".format("{}/{}".format(lease['ipaddr'], lease['prefix']), lease['hostname'], lease['clientid'])
diff --git a/generator.py b/generator.py
index 03027c6..a053022 100755
--- a/generator.py
+++ b/generator.py
@@ -463,6 +463,8 @@ skip_impl = (
'virDomainMigrateToURI3',
'virConnectGetCPUModelNames',
'virNodeGetFreePages',
+ 'virNetworkGetDHCPLeases',
+ 'virNetworkGetDHCPLeasesForMAC',
)
lxc_skip_impl = (
@@ -568,6 +570,8 @@ skip_function = (
"virTypedParamsGetString",
"virTypedParamsGetUInt",
"virTypedParamsGetULLong",
+
+ 'virNetworkDHCPLeaseFree', # only useful in C, python code uses list
)
lxc_skip_function = (
@@ -1115,6 +1119,7 @@ def nameFixup(name, classe, type, file):
elif name[0:13] == "virNetworkGet":
func = name[13:]
func = func[0:1].lower() + func[1:]
+ func = func.replace("dHCP", "DHCP")
elif name[0:10] == "virNetwork":
func = name[10:]
func = func[0:1].lower() + func[1:]
diff --git a/libvirt-override-api.xml b/libvirt-override-api.xml
index bbf0ab1..a1d7c03 100644
--- a/libvirt-override-api.xml
+++ b/libvirt-override-api.xml
@@ -633,5 +633,19 @@
<arg name='flags' type='int' info='unused, pass 0'/>
<return type='char *' info='the list available memory in the cells'/>
</function>
+ <function name="virNetworkGetDHCPLeases" file='python'>
+ <info>Returns a list of dhcp leases for interfaces connected to the given virtual network</info>
+ <arg name='network' type='virNetworkPtr' info='a network object'/>
+ <arg name='flags' type='unsigned int' info='unused, pass 0'/>
+ <return type='char *' info="list of leases"/>
+ </function>
+ <function name="virNetworkGetDHCPLeasesForMAC" file='python'>
+ <info>Returns a list of dhcp leases for a particular interface
+ (specified by mac) connected to the given virtual network</info>
+ <arg name='network' type='virNetworkPtr' info='a network object'/>
+ <arg name='mac' type='const char *' info='mac address'/>
+ <arg name='flags' type='unsigned int' info='unused, pass 0'/>
+ <return type='char *' info="list of leases"/>
+ </function>
</symbols>
</api>
diff --git a/libvirt-override.c b/libvirt-override.c
index 40aefcc..b345b21 100644
--- a/libvirt-override.c
+++ b/libvirt-override.c
@@ -7866,6 +7866,170 @@ libvirt_virNodeGetFreePages(PyObject *self ATTRIBUTE_UNUSED,
VIR_FREE(counts);
return py_retval;
}
+
+static PyObject *
+libvirt_virNetworkGetDHCPLeases(PyObject *self ATTRIBUTE_UNUSED,
+ PyObject *args)
+{
+ PyObject *py_retval = VIR_PY_NONE;
+ virNetworkPtr network;
+ PyObject *pyobj_network;
+ unsigned int flags;
+ virNetworkDHCPLeasePtr *leases = NULL;
+ int leases_count = 0;
+ size_t i;
+ int ret;
+
+ bool full_free = true;
+
+ if (!PyArg_ParseTuple(args, (char *) "Oi:virNetworkDHCPLeasePtr",
+ &pyobj_network, &flags))
+ return NULL;
+
+ network = (virNetworkPtr) PyvirNetwork_Get(pyobj_network);
+
+ LIBVIRT_BEGIN_ALLOW_THREADS;
+ leases_count = virNetworkGetDHCPLeases(network, &leases, flags);
+ ret = leases_count;
+ LIBVIRT_END_ALLOW_THREADS;
+
+ if (ret < 0)
+ goto cleanup;
+
+ if (!(py_retval = PyList_New(leases_count)))
+ goto no_memory;
+
+ for (i = 0; i < leases_count; i++) {
+ virNetworkDHCPLeasePtr lease = leases[i];
+ PyObject *py_lease = NULL;
+
+ if ((py_lease = PyDict_New()) == NULL)
+ goto no_memory;
+
+ PyDict_SetItem(py_lease, libvirt_charPtrWrap("iface"),
+ libvirt_charPtrWrap(lease->iface));
+ PyDict_SetItem(py_lease, libvirt_charPtrWrap("expirytime"),
+ libvirt_longlongWrap(lease->expirytime));
+ PyDict_SetItem(py_lease, libvirt_charPtrWrap("type"),
+ libvirt_intWrap(lease->type));
+ PyDict_SetItem(py_lease, libvirt_charPtrWrap("mac"),
+ libvirt_charPtrWrap(lease->mac));
+ PyDict_SetItem(py_lease, libvirt_charPtrWrap("ipaddr"),
+ libvirt_charPtrWrap(lease->ipaddr));
+ PyDict_SetItem(py_lease, libvirt_charPtrWrap("prefix"),
+ libvirt_uintWrap(lease->prefix));
+ PyDict_SetItem(py_lease, libvirt_charPtrWrap("hostname"),
+ libvirt_charPtrWrap(lease->hostname));
+ PyDict_SetItem(py_lease, libvirt_charPtrWrap("clientid"),
+ libvirt_charPtrWrap(lease->clientid));
+ PyDict_SetItem(py_lease, libvirt_charPtrWrap("iaid"),
+ libvirt_charPtrWrap(lease->iaid));
+
+ PyList_SetItem(py_retval, i, py_lease);
+ }
+
+ full_free = false;
+
+ cleanup:
+ if (leases) {
+ for (i = 0; full_free && i < leases_count; i++)
+ virNetworkDHCPLeaseFree(leases[i]);
+ }
+ VIR_FREE(leases);
+
+ return py_retval;
+
+ no_memory:
+ Py_XDECREF(py_retval);
+ py_retval = PyErr_NoMemory();
+ goto cleanup;
+}
+
+static PyObject *
+libvirt_virNetworkGetDHCPLeasesForMAC(PyObject *self ATTRIBUTE_UNUSED,
+ PyObject *args)
+{
+ PyObject *py_retval = VIR_PY_NONE;
+ virNetworkPtr network;
+ PyObject *pyobj_network;
+ PyObject *pyobj_mac;
+ unsigned int flags;
+ virNetworkDHCPLeasePtr *leases = NULL;
+ int leases_count = 0;
+ char *mac = NULL;
+ size_t i;
+ int ret;
+
+ bool full_free = true;
+
+ if (!PyArg_ParseTuple(args, (char *) "OOi:virNetworkDHCPLeasePtr",
+ &pyobj_network, &pyobj_mac, &flags))
+ return NULL;
+
+ libvirt_charPtrUnwrap(pyobj_mac, &mac);
+
+ network = (virNetworkPtr) PyvirNetwork_Get(pyobj_network);
+
+ LIBVIRT_BEGIN_ALLOW_THREADS;
+ leases_count = virNetworkGetDHCPLeasesForMAC(network, mac, &leases, flags);
+ ret = leases_count;
+ LIBVIRT_END_ALLOW_THREADS;
+
+ if (ret < 0)
+ goto cleanup;
+
+ if (!(py_retval = PyList_New(leases_count)))
+ goto no_memory;
+
+ for (i = 0; i < leases_count; i++) {
+ virNetworkDHCPLeasePtr lease = leases[i];
+ PyObject *py_lease = NULL;
+
+ if (!STREQ(mac, lease->mac))
+ continue;
+
+ if ((py_lease = PyDict_New()) == NULL)
+ goto no_memory;
+
+ PyDict_SetItem(py_lease, libvirt_charPtrWrap("iface"),
+ libvirt_charPtrWrap(lease->iface));
+ PyDict_SetItem(py_lease, libvirt_charPtrWrap("expirytime"),
+ libvirt_longlongWrap(lease->expirytime));
+ PyDict_SetItem(py_lease, libvirt_charPtrWrap("type"),
+ libvirt_intWrap(lease->type));
+ PyDict_SetItem(py_lease, libvirt_charPtrWrap("mac"),
+ libvirt_charPtrWrap(lease->mac));
+ PyDict_SetItem(py_lease, libvirt_charPtrWrap("ipaddr"),
+ libvirt_charPtrWrap(lease->ipaddr));
+ PyDict_SetItem(py_lease, libvirt_charPtrWrap("prefix"),
+ libvirt_uintWrap(lease->prefix));
+ PyDict_SetItem(py_lease, libvirt_charPtrWrap("hostname"),
+ libvirt_charPtrWrap(lease->hostname));
+ PyDict_SetItem(py_lease, libvirt_charPtrWrap("clientid"),
+ libvirt_charPtrWrap(lease->clientid));
+ PyDict_SetItem(py_lease, libvirt_charPtrWrap("iaid"),
+ libvirt_charPtrWrap(lease->iaid));
+
+ PyList_SetItem(py_retval, i, py_lease);
+ }
+
+ full_free = false;
+
+ cleanup:
+ if (leases) {
+ for (i = 0; full_free && i < leases_count; i++)
+ virNetworkDHCPLeaseFree(leases[i]);
+ }
+ VIR_FREE(leases);
+
+ return py_retval;
+
+ no_memory:
+ Py_XDECREF(py_retval);
+ py_retval = PyErr_NoMemory();
+ goto cleanup;
+}
+
#endif /* LIBVIR_CHECK_VERSION(1, 2, 6) */
/************************************************************************
@@ -8051,6 +8215,8 @@ static PyMethodDef libvirtMethods[] = {
#endif /* LIBVIR_CHECK_VERSION(1, 2, 5) */
#if LIBVIR_CHECK_VERSION(1, 2, 6)
{(char *) "virNodeGetFreePages", libvirt_virNodeGetFreePages, METH_VARARGS, NULL},
+ {(char *) "virNetworkGetDHCPLeases", libvirt_virNetworkGetDHCPLeases, METH_VARARGS, NULL},
+ {(char *) "virNetworkGetDHCPLeasesForMAC", libvirt_virNetworkGetDHCPLeasesForMAC, METH_VARARGS, NULL},
#endif /* LIBVIR_CHECK_VERSION(1, 2, 6) */
{NULL, NULL, 0, NULL}
};
diff --git a/sanitytest.py b/sanitytest.py
index 6067a3f..4f4a648 100644
--- a/sanitytest.py
+++ b/sanitytest.py
@@ -78,6 +78,9 @@ for cname in wantfunctions:
if name[0:14] == "virTypedParams":
continue
+ if name[0:23] == "virNetworkDHCPLeaseFree":
+ continue
+
# These aren't functions, they're callback signatures
if name in ["virConnectAuthCallbackPtr", "virConnectCloseFunc",
"virStreamSinkFunc", "virStreamSourceFunc", "virStreamEventCallback",
@@ -210,6 +213,9 @@ for name in sorted(basicklassmap):
if func[0:8] == "fSFreeze" or func[0:6] == "fSThaw":
func = "fs" + func[2:]
+ if klass == "virNetwork":
+ func = func.replace("dHCP", "DHCP")
+
# ...except when they don't. More stupid naming
# decisions we can't fix
if func == "iD":
--
1.9.3
10 years, 5 months
[libvirt] [PATCH] cpu: Cleanup coding style in generic CPU driver
by Jiri Denemark
Signed-off-by: Jiri Denemark <jdenemar(a)redhat.com>
---
src/cpu/cpu_generic.c | 19 ++++++++-----------
1 file changed, 8 insertions(+), 11 deletions(-)
diff --git a/src/cpu/cpu_generic.c b/src/cpu/cpu_generic.c
index 314d1e1..f115c40 100644
--- a/src/cpu/cpu_generic.c
+++ b/src/cpu/cpu_generic.c
@@ -64,8 +64,8 @@ genericCompare(virCPUDefPtr host,
size_t i;
unsigned int reqfeatures;
- if (((cpu->arch != VIR_ARCH_NONE) &&
- (host->arch != cpu->arch)) ||
+ if ((cpu->arch != VIR_ARCH_NONE &&
+ host->arch != cpu->arch) ||
STRNEQ(host->model, cpu->model))
return VIR_CPU_COMPARE_INCOMPATIBLE;
@@ -83,13 +83,10 @@ genericCompare(virCPUDefPtr host,
goto cleanup;
}
reqfeatures++;
- }
- else {
- if (cpu->type == VIR_CPU_TYPE_HOST ||
- cpu->features[i].policy == VIR_CPU_FEATURE_REQUIRE) {
- ret = VIR_CPU_COMPARE_INCOMPATIBLE;
- goto cleanup;
- }
+ } else if (cpu->type == VIR_CPU_TYPE_HOST ||
+ cpu->features[i].policy == VIR_CPU_FEATURE_REQUIRE) {
+ ret = VIR_CPU_COMPARE_INCOMPATIBLE;
+ goto cleanup;
}
}
@@ -99,9 +96,9 @@ genericCompare(virCPUDefPtr host,
ret = VIR_CPU_COMPARE_INCOMPATIBLE;
else
ret = VIR_CPU_COMPARE_SUPERSET;
- }
- else
+ } else {
ret = VIR_CPU_COMPARE_IDENTICAL;
+ }
cleanup:
virHashFree(hash);
--
2.0.0
10 years, 5 months
[libvirt] [PATCH] Remove redundant docs from libvirt.h
by Jiri Denemark
Only types and macros are documented in libvirt.h, APIs are documented
in the *.c file they are implemented in.
Signed-off-by: Jiri Denemark <jdenemar(a)redhat.com>
---
include/libvirt/libvirt.h.in | 24 ------------------------
1 file changed, 24 deletions(-)
diff --git a/include/libvirt/libvirt.h.in b/include/libvirt/libvirt.h.in
index 7e695a3..3f7a201 100644
--- a/include/libvirt/libvirt.h.in
+++ b/include/libvirt/libvirt.h.in
@@ -4122,17 +4122,6 @@ typedef enum {
#endif
} virCPUCompareResult;
-/**
- * virConnectCompareCPU:
- *
- * @conn: virConnect connection
- * @xmlDesc: XML description of either guest or host cpu with <cpu> root tag
- * @flags: comparison flags
- *
- * Compares given CPU with host cpu.
- *
- * Returns virCPUCompareResult.
- */
int virConnectCompareCPU(virConnectPtr conn,
const char *xmlDesc,
unsigned int flags);
@@ -4151,19 +4140,6 @@ typedef enum {
VIR_CONNECT_BASELINE_CPU_EXPAND_FEATURES = (1 << 0), /* show all features */
} virConnectBaselineCPUFlags;
-/**
- * virConnectBaselineCPU:
- *
- * @conn: virConnect connection
- * @ncpus: number of CPUs in xmlCPUs
- * @xmlCPUs: array of XML descriptions of host CPUs
- * @flags: fine-tuning flags
- *
- * Computes the most feature-rich CPU which is compatible with all given
- * host CPUs.
- *
- * Returns XML description of the computed CPU or NULL on error.
- */
char *virConnectBaselineCPU(virConnectPtr conn,
const char **xmlCPUs,
unsigned int ncpus,
--
2.0.0
10 years, 5 months
[libvirt] [PATCH] virsh: Remove bogus stat on log file
by Jiri Denemark
Let's just open the file right away and deal with errors. Moreover,
there's no reason to forbid logging to, e.g., a pipe.
Signed-off-by: Jiri Denemark <jdenemar(a)redhat.com>
---
tools/virsh.c | 20 --------------------
1 file changed, 20 deletions(-)
diff --git a/tools/virsh.c b/tools/virsh.c
index 1bac842..3927120 100644
--- a/tools/virsh.c
+++ b/tools/virsh.c
@@ -2794,29 +2794,9 @@ vshInit(vshControl *ctl)
void
vshOpenLogFile(vshControl *ctl)
{
- struct stat st;
-
if (ctl->logfile == NULL)
return;
- /* check log file */
- if (stat(ctl->logfile, &st) == -1) {
- switch (errno) {
- case ENOENT:
- break;
- default:
- vshError(ctl, "%s",
- _("failed to get the log file information"));
- exit(EXIT_FAILURE);
- }
- } else {
- if (!S_ISREG(st.st_mode)) {
- vshError(ctl, "%s", _("the log path is not a file"));
- exit(EXIT_FAILURE);
- }
- }
-
- /* log file open */
if ((ctl->log_fd = open(ctl->logfile, LOGFILE_FLAGS, FILE_MODE)) < 0) {
vshError(ctl, "%s",
_("failed to open the log file. check the log file path"));
--
2.0.0
10 years, 5 months
[libvirt] [PATCHv5 00/19] block pull/commit on gluster volumes with relative backing
by Peter Krempa
This version is based on Eric's "[PATCH v3 0/5] Next round of active commit support".
Otherwise I've fixed a few nits and just rebased it on top of the said series.
Peter Krempa (19):
util: string: Add helper to free non-NULL terminated string arrays
util: storagefile: Introduce universal function to canonicalize paths
storage: gluster: Add backend to return unique storage file path
util: storage: Add helper to resolve relative path difference
tests: virstoragetest: Remove "expBackingStore" field
storage: Store relative path only for relatively backed storage
tests: virstoragetest: Remove now unused pathAbs
util: storage: Remove now redundant backingRelative from
virStorageSource
tests: virstoragetest: Don't test relative start of backing chains
tests: virstoragetest: Remove unneeded relative test plumbing
storage: Don't canonicalize paths unnecessarily
storage: Don't store parent directory of an image explicitly
qemu: caps: Add capability for change-backing-file command
qemu: monitor: Add argument for specifying backing name for block
commit
qemu: monitor: Add support for backing name specification for
block-stream
lib: Introduce flag VIR_DOMAIN_BLOCK_COMMIT_RELATIVE
lib: Introduce flag VIR_DOMAIN_BLOCK_REBASE_RELATIVE
qemu: Add support for networked disks for block commit
qemu: Add support for networked disks for block pull/block rebase
include/libvirt/libvirt.h.in | 6 +
src/libvirt.c | 10 +
src/libvirt_private.syms | 3 +
src/qemu/qemu_capabilities.c | 4 +-
src/qemu/qemu_capabilities.h | 1 +
src/qemu/qemu_driver.c | 87 ++++++-
src/qemu/qemu_migration.c | 6 +-
src/qemu/qemu_monitor.c | 20 +-
src/qemu/qemu_monitor.h | 4 +-
src/qemu/qemu_monitor_json.c | 17 ++
src/qemu/qemu_monitor_json.h | 2 +
src/storage/storage_backend_gluster.c | 80 ++++++
src/storage/storage_driver.c | 15 +-
src/util/virstoragefile.c | 392 ++++++++++++++++++++++++------
src/util/virstoragefile.h | 20 +-
src/util/virstring.c | 20 ++
src/util/virstring.h | 1 +
tests/qemumonitorjsontest.c | 6 +-
tests/virstoragetest.c | 444 +++++++++++++++++++++-------------
tools/virsh-domain.c | 29 ++-
tools/virsh.pod | 9 +-
21 files changed, 882 insertions(+), 294 deletions(-)
--
1.9.3
10 years, 5 months
[libvirt] [PATCH 0/5] Expose IOMMU and VFIO host capabilities
by Michal Privoznik
This is basically a v2 of one of my previous attempts, but that
was a different set. So practically it's still a v1.
Michal Privoznik (5):
virhostdev: Move IOMMU and VFIO funcs from qemu
conf: Introduce viremulator_capabilities
Introduce virConnectGetEmulatorCapabilities
virsh: Expose virConnectGetEmulatorCapabilities
qemu: Implement virConnectGetEmulatorCapabilities
docs/formatemulatorcaps.html.in | 115 +++++++++++++
docs/schemas/Makefile.am | 1 +
docs/schemas/emulatorcapability.rng | 75 +++++++++
docs/sitemap.html.in | 4 +
include/libvirt/libvirt.h.in | 6 +
libvirt.spec.in | 1 +
mingw-libvirt.spec.in | 2 +
src/Makefile.am | 3 +-
src/conf/viremulator_capabilities.c | 139 +++++++++++++++
src/conf/viremulator_capabilities.h | 47 ++++++
src/driver.h | 7 +
src/libvirt.c | 52 ++++++
src/libvirt_private.syms | 9 +
src/libvirt_public.syms | 2 +
src/qemu/qemu_capabilities.c | 78 +++++----
src/qemu/qemu_capabilities.h | 3 +
src/qemu/qemu_capabilitiespriv.h | 55 ++++++
src/qemu/qemu_driver.c | 96 ++++++++++-
src/qemu/qemu_hostdev.c | 76 +--------
src/qemu/qemu_hostdev.h | 2 -
src/remote/remote_driver.c | 1 +
src/remote/remote_protocol.x | 19 ++-
src/remote_protocol-structs | 10 ++
src/util/virhostdev.c | 73 ++++++++
src/util/virhostdev.h | 4 +
tests/Makefile.am | 28 ++-
.../viremulatorcaps-basic.xml | 5 +
.../viremulatorcaps-qemu-kvm-vfio.xml | 17 ++
tests/viremulatorcapabilitiesschematest | 11 ++
tests/viremulatorcapabilitiestest.c | 187 +++++++++++++++++++++
tests/virhostdevmock.c | 40 +++++
tools/virsh-host.c | 74 ++++++++
tools/virsh.pod | 13 ++
33 files changed, 1143 insertions(+), 112 deletions(-)
create mode 100644 docs/formatemulatorcaps.html.in
create mode 100644 docs/schemas/emulatorcapability.rng
create mode 100644 src/conf/viremulator_capabilities.c
create mode 100644 src/conf/viremulator_capabilities.h
create mode 100644 src/qemu/qemu_capabilitiespriv.h
create mode 100644 tests/viremulatorcapabilitiesdata/viremulatorcaps-basic.xml
create mode 100644 tests/viremulatorcapabilitiesdata/viremulatorcaps-qemu-kvm-vfio.xml
create mode 100755 tests/viremulatorcapabilitiesschematest
create mode 100644 tests/viremulatorcapabilitiestest.c
create mode 100644 tests/virhostdevmock.c
--
1.8.5.5
10 years, 5 months
Re: [libvirt] [Xen-devel] [PATCH RFC OSSTEST 7/9] Toolstack: Abstract away migration support check.
by Jim Fehlig
Jim Fehlig wrote:
> Ian Campbell wrote:
>
>> Jim,
>>
>> What would be the right thing to do for this? The intention is for
>> osstest to skip migration tests when that feature is unimplemented by
>> the toolstack/xen/arch combination.
>>
>> It looks like the output of "virsh capabilities" indicates migration:
>> <migration_features>
>> <live/>
>> <uri_transports>
>> <uri_transport>tcp</uri_transport>
>> </uri_transports>
>> </migration_features>
>> is that the right place to look?
>>
>>
>
> Yes.
>
>
>> Will this capability be automagically suppressed on ARM until we
>> implement it?
>>
>
> Unfortunately, no :-/. Currently, the libvirt libxl driver will include
> <migration_features> and call save, restore, and migrate regardless of arch.
>
>
>> FYI xl uses LIBXL_HAVE_NO_SUSPEND_RESUME to figure this
>> out...
>>
>>
>
> Ah, interesting. Thanks for the tip. I'll need to add similar logic in
> the libxl driver.
>
Something like the attached patch (compile-tested only). You'll need an
updated libvirt.git master to apply cleanly.
Regards,
Jim
10 years, 5 months