[libvirt] [PATCH v2 0/4] Check migration configuration
by Chen Fan
add some check in migration configuration.
Chen Fan (4):
virsocketaddr: return address family in virSocketAddrIsNumeric
migration: add migration_host support for Ipv6 address without
brackets
conf: add virSocketAddrIsLocalhost to Check migration_host
conf: Check migration_address whether is localhost
src/libvirt_private.syms | 1 +
src/qemu/qemu.conf | 2 +-
src/qemu/qemu_conf.c | 15 ++++++++++++
src/qemu/qemu_migration.c | 24 ++++++++++---------
src/qemu/test_libvirtd_qemu.aug.in | 2 +-
src/util/virsocketaddr.c | 48 ++++++++++++++++++++++++++++++++++----
src/util/virsocketaddr.h | 5 +++-
tests/sockettest.c | 2 +-
8 files changed, 80 insertions(+), 19 deletions(-)
--
1.9.3
10 years, 1 month
[libvirt] [PATCH 0/4] Resolve libvirtd crash matching scsi_host
by John Ferlan
https://bugzilla.redhat.com/show_bug.cgi?id=1146837
Not for 1.2.9, but may as well get it in the queue to be reviewed for
post 1.2.9
Although possible to do in one patch - I figured it'd be easier to
review if shown in steps.
Essentially the problem is the scsi_host duplicate checks were causing
a libvirtd crash with the parentaddr/unique_id code. During my investigation
I determined that there was another lurking issue with the two ways in
which the 'name=' property is allowed to be either 'host#' or 'scsi_host#'.
John Ferlan (4):
storage_conf: Create function to perform scsi_host dupe check
storage_conf: Refactor arguments to matchSCSIAdapter
storage_conf: Fix the scsi_host.name comparison
storage_conf: Resolve libvirtd crash matching scsi_host
src/conf/storage_conf.c | 111 ++++++++++++++++++++++++++++++++++++++++++------
1 file changed, 97 insertions(+), 14 deletions(-)
--
1.9.3
10 years, 1 month
[libvirt] [PATCH v2] network: Add network bandwidth support for ethernet interfaces
by Anirban Chakraborty
V2:
Addressed comments raised in review of V1.
Consolidate calls to virNetDevBandwidthSet.
Clear bandwidth settings when the interface is detached or domain
destroyed.
V1:
Ethernet interfaces in libvirt currently do not support bandwidth setting.
For example, following xml file for an interface will not apply these
settings to corresponding qdiscs.
<interface type="ethernet">
<mac address="02:36:1d:18:2a:e4"/>
<model type="virtio"/>
<script path=""/>
<target dev="tap361d182a-e4"/>
<bandwidth>
<inbound average="984" peak="1024" burst="64"/>
<outbound average="2000" peak="2048" burst="128"/>
</bandwidth>
</interface>
Signed-off-by: Anirban Chakraborty <abchak(a)juniper.net>
---
src/lxc/lxc_process.c | 26 +++++++++++++-------------
src/network/bridge_driver.c | 7 ++++---
src/qemu/qemu_command.c | 9 ++++-----
src/qemu/qemu_driver.c | 22 +++++++++++++++++++++-
src/qemu/qemu_hotplug.c | 14 +++++++++++++-
src/util/virnetdevbandwidth.c | 23 ++++++++++++++++++++---
src/util/virnetdevbandwidth.h | 7 ++++---
src/util/virnetdevmacvlan.c | 10 ----------
src/util/virnetdevmacvlan.h | 1 -
tests/virnetdevbandwidthtest.c | 3 ++-
10 files changed, 81 insertions(+), 41 deletions(-)
diff --git a/src/lxc/lxc_process.c b/src/lxc/lxc_process.c
index ed30c37..7f7e4ad 100644
--- a/src/lxc/lxc_process.c
+++ b/src/lxc/lxc_process.c
@@ -274,11 +274,6 @@ char *virLXCProcessSetupInterfaceBridged(virConnectPtr conn,
if (virNetDevSetOnline(parentVeth, true) < 0)
goto cleanup;
- if (virNetDevBandwidthSet(net->ifname,
- virDomainNetGetActualBandwidth(net),
- false) < 0)
- goto cleanup;
-
if (net->filter &&
virDomainConfNWFilterInstantiate(conn, vm->uuid, net) < 0)
goto cleanup;
@@ -300,6 +295,7 @@ char *virLXCProcessSetupInterfaceDirect(virConnectPtr conn,
virNetDevBandwidthPtr bw;
virNetDevVPortProfilePtr prof;
virLXCDriverConfigPtr cfg = virLXCDriverGetConfig(driver);
+ const char *linkdev = virDomainNetGetActualDirectDev(net);
/* XXX how todo bandwidth controls ?
* Since the 'net-ifname' is about to be moved to a different
@@ -329,16 +325,15 @@ char *virLXCProcessSetupInterfaceDirect(virConnectPtr conn,
if (virNetDevMacVLanCreateWithVPortProfile(
net->ifname, &net->mac,
- virDomainNetGetActualDirectDev(net),
+ linkdev,
virDomainNetGetActualDirectMode(net),
false, def->uuid,
- virDomainNetGetActualVirtPortProfile(net),
+ prof,
&res_ifname,
VIR_NETDEV_VPORT_PROFILE_OP_CREATE,
cfg->stateDir,
- virDomainNetGetActualBandwidth(net), 0) < 0)
+ 0) < 0)
goto cleanup;
-
ret = res_ifname;
cleanup:
@@ -368,6 +363,7 @@ static int virLXCProcessSetupInterfaces(virConnectPtr conn,
int ret = -1;
size_t i;
size_t niface = 0;
+ int actualType;
for (i = 0; i < def->nnets; i++) {
char *veth = NULL;
@@ -381,7 +377,8 @@ static int virLXCProcessSetupInterfaces(virConnectPtr conn,
if (VIR_EXPAND_N(*veths, *nveths, 1) < 0)
goto cleanup;
- switch (virDomainNetGetActualType(def->nets[i])) {
+ actualType = virDomainNetGetActualType(def->nets[i]);
+ switch (actualType) {
case VIR_DOMAIN_NET_TYPE_NETWORK: {
virNetworkPtr network;
char *brname = NULL;
@@ -444,11 +441,14 @@ static int virLXCProcessSetupInterfaces(virConnectPtr conn,
case VIR_DOMAIN_NET_TYPE_LAST:
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Unsupported network type %s"),
- virDomainNetTypeToString(
- virDomainNetGetActualType(def->nets[i])
- ));
+ virDomainNetTypeToString(actualType));
goto cleanup;
}
+ /* set network bandwidth */
+ if (virNetDevBandwidthSet(def->nets[i]->ifname,
+ virDomainNetGetActualBandwidth(def->nets[i]), false,
+ actualType) < 0)
+ goto cleanup;
(*veths)[(*nveths)-1] = veth;
diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c
index 979fb13..2e1f821 100644
--- a/src/network/bridge_driver.c
+++ b/src/network/bridge_driver.c
@@ -2082,7 +2082,8 @@ networkStartNetworkVirtual(virNetworkDriverStatePtr driver,
}
if (virNetDevBandwidthSet(network->def->bridge,
- network->def->bandwidth, true) < 0)
+ network->def->bandwidth, true,
+ VIR_DOMAIN_NET_TYPE_BRIDGE) < 0)
goto err5;
VIR_FREE(macTapIfName);
@@ -2090,7 +2091,7 @@ networkStartNetworkVirtual(virNetworkDriverStatePtr driver,
return 0;
err5:
- virNetDevBandwidthClear(network->def->bridge);
+ virNetDevBandwidthClear(network->def->bridge, VIR_DOMAIN_NET_TYPE_BRIDGE);
err4:
if (!save_err)
@@ -2137,7 +2138,7 @@ networkStartNetworkVirtual(virNetworkDriverStatePtr driver,
static int networkShutdownNetworkVirtual(virNetworkDriverStatePtr driver ATTRIBUTE_UNUSED,
virNetworkObjPtr network)
{
- virNetDevBandwidthClear(network->def->bridge);
+ virNetDevBandwidthClear(network->def->bridge, VIR_DOMAIN_NET_TYPE_BRIDGE);
if (network->radvdPid > 0) {
char *radvdpidbase;
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index eb72451..a92fb29 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -191,7 +191,6 @@ qemuPhysIfaceConnect(virDomainDefPtr def,
virDomainNetGetActualVirtPortProfile(net),
&res_ifname,
vmop, cfg->stateDir,
- virDomainNetGetActualBandwidth(net),
macvlan_create_flags);
if (rc >= 0) {
virDomainAuditNetDevice(def, net, res_ifname, true);
@@ -371,10 +370,6 @@ qemuNetworkIfaceConnect(virDomainDefPtr def,
&net->mac) < 0)
goto cleanup;
- if (virNetDevBandwidthSet(net->ifname,
- virDomainNetGetActualBandwidth(net),
- false) < 0)
- goto cleanup;
if (net->filter &&
virDomainConfNWFilterInstantiate(conn, def->uuid, net) < 0) {
@@ -7392,6 +7387,10 @@ qemuBuildInterfaceCommandLine(virCommandPtr cmd,
if (tapfd[0] < 0)
goto cleanup;
}
+ /* Set bandwidth */
+ if (virNetDevBandwidthSet(net->ifname, virDomainNetGetActualBandwidth(net),
+ false, actualType) < 0)
+ goto cleanup;
if ((actualType == VIR_DOMAIN_NET_TYPE_NETWORK ||
actualType == VIR_DOMAIN_NET_TYPE_BRIDGE ||
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 117138a..02eb680 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -186,6 +186,9 @@ qemuVMFilterRebuild(virDomainObjListIterator iter, void *data)
return virDomainObjListForEach(qemu_driver->domains, iter, data);
}
+static void
+qemuDomainClearNetBandwidth(virDomainObjPtr vm);
+
static virNWFilterCallbackDriver qemuCallbackDriver = {
.name = QEMU_DRIVER_NAME,
.vmFilterRebuild = qemuVMFilterRebuild,
@@ -2196,6 +2199,9 @@ qemuDomainDestroyFlags(virDomainPtr dom,
if (virDomainDestroyFlagsEnsureACL(dom->conn, vm->def) < 0)
goto cleanup;
+ /* Clear network bandwidth settings */
+ qemuDomainClearNetBandwidth(vm);
+
qemuDomainSetFakeReboot(driver, vm, false);
@@ -10205,7 +10211,8 @@ qemuDomainSetInterfaceParameters(virDomainPtr dom,
sizeof(*newBandwidth->out));
}
- if (virNetDevBandwidthSet(net->ifname, newBandwidth, false) < 0)
+ if (virNetDevBandwidthSet(net->ifname, newBandwidth, false,
+ virDomainNetGetActualType(net)) < 0)
goto cleanup;
virNetDevBandwidthFree(net->bandwidth);
@@ -18216,6 +18223,19 @@ qemuNodeAllocPages(virConnectPtr conn,
startCell, cellCount, add);
}
+/* Clear the bandwidth setting of all the network interfaces of a vm */
+static void
+qemuDomainClearNetBandwidth(virDomainObjPtr vm)
+{
+ size_t i;
+ int type;
+
+ for (i = 0; i < vm->def->nnets; i++) {
+ type = virDomainNetGetActualType(vm->def->nets[i]);
+ virNetDevBandwidthClear(vm->def->nets[i]->ifname, type);
+ }
+}
+
static virDriver qemuDriver = {
.no = VIR_DRV_QEMU,
diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
index d631887..4002afb 100644
--- a/src/qemu/qemu_hotplug.c
+++ b/src/qemu/qemu_hotplug.c
@@ -947,6 +947,10 @@ int qemuDomainAttachNetDevice(virConnectPtr conn,
if (qemuOpenVhostNet(vm->def, net, priv->qemuCaps, vhostfd, &vhostfdSize) < 0)
goto cleanup;
}
+ /* Set bandwidth */
+ if (virNetDevBandwidthSet(net->ifname, virDomainNetGetActualBandwidth(net),
+ false, actualType) < 0)
+ goto cleanup;
for (i = 0; i < tapfdSize; i++) {
if (virSecurityManagerSetTapFDLabel(driver->securityManager,
@@ -2214,7 +2218,7 @@ qemuDomainChangeNet(virQEMUDriverPtr driver,
if (needBandwidthSet) {
if (virNetDevBandwidthSet(newdev->ifname,
virDomainNetGetActualBandwidth(newdev),
- false) < 0)
+ false, newType) < 0)
goto cleanup;
needReplaceDevDef = true;
}
@@ -3481,6 +3485,7 @@ qemuDomainDetachNetDevice(virConnectPtr conn,
virDomainNetDefPtr detach = NULL;
qemuDomainObjPrivatePtr priv = vm->privateData;
int rc;
+ int actualType;
if ((detachidx = virDomainNetFindIdx(vm->def, dev->data.net)) < 0)
goto cleanup;
@@ -3517,6 +3522,13 @@ qemuDomainDetachNetDevice(virConnectPtr conn,
}
}
+ actualType = virDomainNetGetActualType(detach);
+ if (virNetDevBandwidthClear(detach->ifname, actualType) < 0) {
+ virReportError(VIR_ERR_OPERATION_FAILED,
+ _("cannot clear bandwidth setting for device : %s"),
+ detach->ifname);
+ goto cleanup;
+ }
qemuDomainMarkDeviceForRemoval(vm, &detach->info);
qemuDomainObjEnterMonitor(driver, vm);
diff --git a/src/util/virnetdevbandwidth.c b/src/util/virnetdevbandwidth.c
index 5fa231a..34a224e 100644
--- a/src/util/virnetdevbandwidth.c
+++ b/src/util/virnetdevbandwidth.c
@@ -27,6 +27,7 @@
#include "viralloc.h"
#include "virerror.h"
#include "virstring.h"
+#include "domain_conf.h"
#define VIR_FROM_THIS VIR_FROM_NONE
@@ -47,6 +48,7 @@ virNetDevBandwidthFree(virNetDevBandwidthPtr def)
* @ifname: on which interface
* @bandwidth: rates to set (may be NULL)
* @hierarchical_class: whether to create hierarchical class
+ * @type: interface type
*
* This function enables QoS on specified interface
* and set given traffic limits for both, incoming
@@ -60,7 +62,8 @@ virNetDevBandwidthFree(virNetDevBandwidthPtr def)
int
virNetDevBandwidthSet(const char *ifname,
virNetDevBandwidthPtr bandwidth,
- bool hierarchical_class)
+ bool hierarchical_class,
+ int type)
{
int ret = -1;
virCommandPtr cmd = NULL;
@@ -74,7 +77,14 @@ virNetDevBandwidthSet(const char *ifname,
goto cleanup;
}
- virNetDevBandwidthClear(ifname);
+ if (type != VIR_DOMAIN_NET_TYPE_ETHERNET &&
+ type != VIR_DOMAIN_NET_TYPE_BRIDGE &&
+ type != VIR_DOMAIN_NET_TYPE_NETWORK &&
+ type != VIR_DOMAIN_NET_TYPE_DIRECT)
+ /* bandwidth not set for interfaces other than the above */
+ return 0;
+
+ virNetDevBandwidthClear(ifname, type);
if (bandwidth->in && bandwidth->in->average) {
if (virAsprintf(&average, "%llukbps", bandwidth->in->average) < 0)
@@ -245,6 +255,7 @@ virNetDevBandwidthSet(const char *ifname,
/**
* virNetDevBandwidthClear:
* @ifname: on which interface
+ * @type: interface tyoe
*
* This function tries to disable QoS on specified interface
* by deleting root and ingress qdisc. However, this may fail
@@ -253,12 +264,18 @@ virNetDevBandwidthSet(const char *ifname,
* Return 0 on success, -1 otherwise.
*/
int
-virNetDevBandwidthClear(const char *ifname)
+virNetDevBandwidthClear(const char *ifname, int type)
{
int ret = 0;
int dummy; /* for ignoring the exit status */
virCommandPtr cmd = NULL;
+ if (type != VIR_DOMAIN_NET_TYPE_ETHERNET &&
+ type != VIR_DOMAIN_NET_TYPE_BRIDGE &&
+ type != VIR_DOMAIN_NET_TYPE_NETWORK &&
+ type != VIR_DOMAIN_NET_TYPE_DIRECT)
+ return ret;
+
cmd = virCommandNew(TC);
virCommandAddArgList(cmd, "qdisc", "del", "dev", ifname, "root", NULL);
diff --git a/src/util/virnetdevbandwidth.h b/src/util/virnetdevbandwidth.h
index 4606a07..cc43444 100644
--- a/src/util/virnetdevbandwidth.h
+++ b/src/util/virnetdevbandwidth.h
@@ -43,11 +43,12 @@ struct _virNetDevBandwidth {
void virNetDevBandwidthFree(virNetDevBandwidthPtr def);
-int virNetDevBandwidthSet(const char *ifname,
+int virNetDevBandwidthSet(const char *name,
virNetDevBandwidthPtr bandwidth,
- bool hierarchical_class)
+ bool hierarchical_class,
+ int type)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK;
-int virNetDevBandwidthClear(const char *ifname)
+int virNetDevBandwidthClear(const char *name, int type)
ATTRIBUTE_NONNULL(1);
int virNetDevBandwidthCopy(virNetDevBandwidthPtr *dest,
const virNetDevBandwidth *src)
diff --git a/src/util/virnetdevmacvlan.c b/src/util/virnetdevmacvlan.c
index c83341c..956a96b 100644
--- a/src/util/virnetdevmacvlan.c
+++ b/src/util/virnetdevmacvlan.c
@@ -811,7 +811,6 @@ int virNetDevMacVLanCreateWithVPortProfile(const char *tgifname,
char **res_ifname,
virNetDevVPortProfileOp vmOp,
char *stateDir,
- virNetDevBandwidthPtr bandwidth,
unsigned int flags)
{
const char *type = (flags & VIR_NETDEV_MACVLAN_CREATE_WITH_TAP) ?
@@ -925,14 +924,6 @@ int virNetDevMacVLanCreateWithVPortProfile(const char *tgifname,
rc = 0;
}
- if (virNetDevBandwidthSet(cr_ifname, bandwidth, false) < 0) {
- if (flags & VIR_NETDEV_MACVLAN_CREATE_WITH_TAP)
- VIR_FORCE_CLOSE(rc); /* sets rc to -1 */
- else
- rc = -1;
- goto disassociate_exit;
- }
-
if (vmOp == VIR_NETDEV_VPORT_PROFILE_OP_CREATE ||
vmOp == VIR_NETDEV_VPORT_PROFILE_OP_RESTORE) {
/* Only directly register upon a create or restore (restarting
@@ -1076,7 +1067,6 @@ int virNetDevMacVLanCreateWithVPortProfile(const char *ifname ATTRIBUTE_UNUSED,
char **res_ifname ATTRIBUTE_UNUSED,
virNetDevVPortProfileOp vmop ATTRIBUTE_UNUSED,
char *stateDir ATTRIBUTE_UNUSED,
- virNetDevBandwidthPtr bandwidth ATTRIBUTE_UNUSED,
unsigned int flags)
{
virCheckFlags(0, -1);
diff --git a/src/util/virnetdevmacvlan.h b/src/util/virnetdevmacvlan.h
index 41aa4e2..f08d32b 100644
--- a/src/util/virnetdevmacvlan.h
+++ b/src/util/virnetdevmacvlan.h
@@ -68,7 +68,6 @@ int virNetDevMacVLanCreateWithVPortProfile(const char *ifname,
char **res_ifname,
virNetDevVPortProfileOp vmop,
char *stateDir,
- virNetDevBandwidthPtr bandwidth,
unsigned int flags)
ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3) ATTRIBUTE_NONNULL(6)
ATTRIBUTE_NONNULL(8) ATTRIBUTE_NONNULL(10) ATTRIBUTE_RETURN_CHECK;
diff --git a/tests/virnetdevbandwidthtest.c b/tests/virnetdevbandwidthtest.c
index 384991e..db1f557 100644
--- a/tests/virnetdevbandwidthtest.c
+++ b/tests/virnetdevbandwidthtest.c
@@ -79,7 +79,8 @@ testVirNetDevBandwidthSet(const void *data)
virCommandSetDryRun(&buf, NULL, NULL);
- if (virNetDevBandwidthSet(iface, band, info->hierarchical_class) < 0)
+ if (virNetDevBandwidthSet(iface, band, info->hierarchical_class,
+ VIR_DOMAIN_NET_TYPE_ETHERNET) < 0)
goto cleanup;
if (!(actual_cmd = virBufferContentAndReset(&buf))) {
--
1.9.1
10 years, 1 month
[libvirt] [PATCHv2 0/7] handle NIC_RX_FILTER_CHANGED events from qemu
by Laine Stump
These patches set up an event handler for qemu's NIC_RX_FILTER_CHANGED
event, which is sent whenever a guest makes a change to a network
device's unicast/multicast filter, vlan table, or MAC address (as long
as there has been no previous event of the same type sent for the same
interface without a corresponding query-rx-filter sent back from
qemu).
The handler checks if it is appropriate to respond to the
NIC_RX_FILTER_CHANGED event (based on device type and configuration)
and takes appropriate action. Currently it checks if the guest
interface has been configured with trustGuestRxFilters='yes' (defaults
to 'no' for security reasons), and if the host side device is
macvtap. If so, and the MAC address on the guest has changed, the MAC
address of the macvtap device is changed to match.
The result of this is that networking from the guest will continue to
work if the mac address of a macvtap-connected network device is
changed from within the guest, as long as trustGuestRxFilters='yes'
(previously changing the MAC address in the guest would break
networking).
Changes from V1:
Responded to review comments from John Ferlan, Amos Kong, and Tom
Krowiak, updated to indicate support was added in 1.2.10 rather than
1.2.9, and added an extra patch which puts a new .txt file in the qemu
directory describing the mechanics of a qemu event handler (lifted
from the commit log message of 5/7)
Laine Stump (7):
conf: add trustGuestRxFilters attribute to network and domain
interface
network: set interface actual trustGuestRxFilters from
network/portgroup
util: define virNetDevRxFilter and basic utility functions
qemu: qemuMonitorQueryRxFilter - retrieve guest netdev rx-filter
qemu: setup infrastructure to handle NIC_RX_FILTER_CHANGED event
qemu: change macvtap device MAC address in response to
NIC_RX_FILTER_CHANGED
qemu: add short document on qemu event handlers
docs/formatdomain.html.in | 40 +++-
docs/formatnetwork.html.in | 29 ++-
docs/schemas/domaincommon.rng | 5 +
docs/schemas/network.rng | 10 +
src/conf/domain_conf.c | 42 ++++
src/conf/domain_conf.h | 3 +
src/conf/network_conf.c | 36 ++++
src/conf/network_conf.h | 2 +
src/libvirt_private.syms | 5 +
src/network/bridge_driver.c | 10 +
src/qemu/EVENTHANDLERS.txt | 77 +++++++
src/qemu/qemu_domain.h | 1 +
src/qemu/qemu_driver.c | 105 ++++++++++
src/qemu/qemu_monitor.c | 39 ++++
src/qemu/qemu_monitor.h | 11 +
src/qemu/qemu_monitor_json.c | 232 +++++++++++++++++++++
src/qemu/qemu_monitor_json.h | 3 +
src/qemu/qemu_process.c | 42 ++++
src/util/virnetdev.c | 31 +++
src/util/virnetdev.h | 42 +++-
tests/Makefile.am | 1 +
tests/networkxml2xmlin/vepa-net.xml | 4 +-
tests/networkxml2xmlout/vepa-net.xml | 4 +-
.../qemuxml2argv-net-virtio-network-portgroup.xml | 4 +-
24 files changed, 761 insertions(+), 17 deletions(-)
create mode 100644 src/qemu/EVENTHANDLERS.txt
--
1.9.3
10 years, 1 month
[libvirt] [libvirt-python PATCH] sanitytest: check for exported enums
by Martin Kletzander
We are already collecting list of enums exported and list of enums we
want to have available. Event hough there was an issue with one enum
fixed with 014d9bbaf368b33a881f1d6b2fd8a5dd285a4f71, there was no test
for it and this commit tries to fix that.
Signed-off-by: Martin Kletzander <mkletzan(a)redhat.com>
---
sanitytest.py | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++--
1 file changed, 51 insertions(+), 2 deletions(-)
diff --git a/sanitytest.py b/sanitytest.py
index 3c1568b..8cb0154 100644
--- a/sanitytest.py
+++ b/sanitytest.py
@@ -16,7 +16,10 @@ f = open(xml, "r")
tree = lxml.etree.parse(f)
verbose = False
+fail = False
+enumvals = {}
+second_pass = []
wantenums = []
wantfunctions = []
@@ -25,11 +28,51 @@ set = tree.xpath('/api/files/file/exports[@type="function"]/@symbol')
for n in set:
wantfunctions.append(n)
+set = tree.xpath('/api/symbols/enum')
+for n in set:
+ typ = n.attrib['type']
+ name = n.attrib['name']
+ val = n.attrib['value']
+
+ if typ not in enumvals:
+ enumvals[typ] = {}
+
+ # If the value cannot be converted to int, it is reference to
+ # another enum and needs to be sorted out later on
+ try:
+ val = int(val)
+ except ValueError:
+ second_pass.append(n)
+ continue
+
+ enumvals[typ][name] = int(val)
+
+for n in second_pass:
+ typ = n.attrib['type']
+ name = n.attrib['name']
+ val = n.attrib['value']
+
+ for v in enumvals.values():
+ if val in v:
+ val = int(v[val])
+ break
+
+ if type(val) != int:
+ fail = True
+ print("Cannot get a value of enum %s (originally %s)" % (val, name))
+ enumvals[typ][name] = val
+
set = tree.xpath('/api/files/file/exports[@type="enum"]/@symbol')
for n in set:
+ for enumval in enumvals.values():
+ if n in enumval:
+ enum = enumval
+ break
+ # Eliminate sentinels
+ if n.endswith('_LAST') and enum[n] == max(enum.values()):
+ continue
wantenums.append(n)
-
# Phase 2: Identify all classes and methods in the 'libvirt' python module
gotenums = []
gottypes = []
@@ -51,6 +94,13 @@ for name in dir(libvirt):
else:
pass
+for enum in wantenums:
+ if enum not in gotenums:
+ fail = True
+ for typ, enumval in enumvals.items():
+ if enum in enumval:
+ print("FAIL Missing exported enum %s of type %s" % (enum, typ))
+
for klassname in gottypes:
klassobj = getattr(libvirt, klassname)
for name in dir(klassobj):
@@ -241,7 +291,6 @@ for name in sorted(basicklassmap):
# Phase 5: Validate sure that every C API is mapped to a python API
-fail = False
usedfunctions = {}
for name in sorted(finalklassmap):
klass = finalklassmap[name][0]
--
2.1.2
10 years, 1 month
[libvirt] [PATCH 0/3] Fix hot unplug of scsi_host hostdev
by John Ferlan
https://bugzilla.redhat.com/show_bug.cgi?id=1141732
Attempting to hot unplug a scsi_host device fails. The first patch
resolves the issue (and has some details in the commit message). The
second patch removes the now unnecessary virConnectPtr from various
places. The third patch resolves a potential issue if aliases weren't
defined and debugging is enabled by making the check for NULL first
before trying to message rather than the other way around.
John Ferlan (3):
qemu: Fix hot unplug of SCSI_HOST device
qemu: Remove need for virConnectPtr in hotunplug detach host, net
qemu: Remove possible NULL deref in debug output
src/qemu/qemu_driver.c | 4 +--
src/qemu/qemu_hotplug.c | 70 +++++++++++++++++++++++--------------------------
src/qemu/qemu_hotplug.h | 6 ++---
3 files changed, 37 insertions(+), 43 deletions(-)
--
1.9.3
10 years, 1 month
[libvirt] [PATCH v3 00/14] vbox: rewrite network driver
by Taowei
This seriers of patches rewrite the vbox network driver.
Diff from v2:
*Seperate the network driver from the domain driver.
*Prevent vbox code from being compiled too many times
when building network driver.
Taowei (14):
vbox: Interfaces for register per parties
vbox: Rewrite vboxNetworkOpen
vbox: Rewrite vboxNetworkClose
vbox: Rewrite vboxConnectNumOfNetworks
vbox: Rewrite vboxConnectListNetworks
vbox: Rewrite vboxConnectNumOfDefinedNetworks
vbox: Rewrite vboxConnectListDefinedNetworks
vbox: Rewrite vboxNetworkLookupByUUID
vbox: Rewrite vboxNetworkLookupByName
vbox: Rewrite vboxNetworkDefineCreateXML
vbox: Rewrite vboxNetworkUndefineDestroy
vbox: Rewrite vboxNetworkCreate
vbox: Rewrite vboxNetworkGetXMLDesc
vbox: New network driver
po/POTFILES.in | 1 +
src/Makefile.am | 16 +-
src/vbox/vbox_common.c | 70 +-
src/vbox/vbox_common.h | 16 +
src/vbox/vbox_driver.c | 55 +-
src/vbox/{vbox_install_api.h => vbox_get_driver.h} | 9 +-
src/vbox/vbox_network.c | 1050 ++++++++++++++++
src/vbox/vbox_tmpl.c | 1261 +++++---------------
src/vbox/vbox_uniformed_api.h | 52 +
9 files changed, 1523 insertions(+), 1007 deletions(-)
rename src/vbox/{vbox_install_api.h => vbox_get_driver.h} (79%)
create mode 100644 src/vbox/vbox_network.c
--
1.7.9.5
10 years, 1 month
[libvirt] [PATCH] Include .libs in libdir in source tree pkg-config files
by Ján Tomko
This lets me build against an uninstalled source tree without
libtool.
---
src/libvirt-lxc.pc.in | 2 +-
src/libvirt-qemu.pc.in | 2 +-
src/libvirt.pc.in | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/libvirt-lxc.pc.in b/src/libvirt-lxc.pc.in
index 20f173b..88e431b 100644
--- a/src/libvirt-lxc.pc.in
+++ b/src/libvirt-lxc.pc.in
@@ -4,7 +4,7 @@
prefix=@abs_top_builddir@
exec_prefix=@abs_top_builddir@
-libdir=@abs_top_builddir@/src
+libdir=@abs_top_builddir(a)/src/.libs
includedir=@abs_top_builddir@/include
datarootdir=@abs_top_builddir@
diff --git a/src/libvirt-qemu.pc.in b/src/libvirt-qemu.pc.in
index 1e2cadf..ed1f68a 100644
--- a/src/libvirt-qemu.pc.in
+++ b/src/libvirt-qemu.pc.in
@@ -4,7 +4,7 @@
prefix=@abs_top_builddir@
exec_prefix=@abs_top_builddir@
-libdir=@abs_top_builddir@/src
+libdir=@abs_top_builddir(a)/src/.libs
includedir=@abs_top_builddir@/include
datarootdir=@abs_top_builddir@
diff --git a/src/libvirt.pc.in b/src/libvirt.pc.in
index fa798cf..c2bdbb2 100644
--- a/src/libvirt.pc.in
+++ b/src/libvirt.pc.in
@@ -4,7 +4,7 @@
prefix=@abs_top_builddir@
exec_prefix=@abs_top_builddir@
-libdir=@abs_top_builddir@/src
+libdir=@abs_top_builddir(a)/src/.libs
includedir=@abs_top_builddir@/include
datarootdir=@abs_top_builddir@
--
2.0.4
10 years, 1 month
[libvirt] [PATCH] docs: fix a typo in drvlxc
by Chen Hanxiao
s/the/The
Signed-off-by: Chen Hanxiao <chenhanxiao(a)cn.fujitsu.com>
---
docs/drvlxc.html.in | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/drvlxc.html.in b/docs/drvlxc.html.in
index 31da37c..a094bd9 100644
--- a/docs/drvlxc.html.in
+++ b/docs/drvlxc.html.in
@@ -167,7 +167,7 @@ numbered incrementally from there.
<p>
Since /dev/ttyN and /dev/console are linked to the pts devices. The
-tty device of login program is pts device. the pam module securetty
+tty device of login program is pts device. The pam module securetty
may prevent root user from logging in container. If you want root
user to log in container successfully, add the pts device to the file
/etc/securetty of container.
--
1.9.0
10 years, 1 month