[libvirt] [PATCH] build: check correct protocol.o file
by Eric Blake
By default, libtool builds two .o files for every .lo rule:
src/foo.o - static builds
src/.libs/foo.o - shared library builds
But since commit ad42b34b disabled static builds, src/foo.o is
no longer built by default. On a fresh checkout, this means our
protocol check rules using pdwtags were testing a missing file,
and thanks a lousy behavior of pdwtags happily giving no output
and 0 exit status (http://bugzilla.redhat.com/949034), we were
merely claiming that "dwarves is too old" and skipping the test.
However, if you swap between branches and do incremental builds,
such as building v0.10.2-maint and then switching back to master,
you end up with src/foo.o being leftover from its 0.10.2 state,
and then 'make check' fails because the .o file does not match
the protocol-structs file due to API additions in the meantime.
A simpler fix would be to always look in .libs for the .o to
be parsed; but since it is possible to pass ./configure options
to tell libtool to do a static-only build with no shared .o,
I went with the approach of finding the newest of the two files,
whenever both exist.
* src/Makefile.am (PDWTAGS): Ensure we test just-built file.
---
Pushing under the build-breaker rule.
src/Makefile.am | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/src/Makefile.am b/src/Makefile.am
index 78b4ab6..5dc58f9 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -341,9 +341,16 @@ r1 = /\* \d+ \*/
r2 = /\* <[[:xdigit:]]+> \S+:\d+ \*/
struct_prefix = (remote_|qemu_|lxc_|virNet|keepalive_)
+# Depending on configure options, libtool creates one or both of
+# {,.libs/}libvirt_remote_driver_la-remote_protocol.o. We want the
+# newest of the two, in case configure options changed and a stale
+# file is left around from an earlier build.
PDWTAGS = \
$(AM_V_GEN)if (pdwtags --help) > /dev/null 2>&1; then \
- pdwtags --verbose $(<:.lo=.$(OBJEXT)) > $(@F)-t1 2> $(@F)-t2; \
+ file=`ls -t $(<:.lo=.$(OBJEXT)) .libs/$(<:.lo=.$(OBJEXT)) \
+ 2>/dev/null | sed -n 1p`; \
+ test -f $$file || { echo ".o for $< not found" >&2; exit 1; };\
+ pdwtags --verbose $$file > $(@F)-t1 2> $(@F)-t2; \
if test -s $(@F)-t2; then \
rm -rf $(@F)-t?; \
echo 'WARNING: pdwtags appears broken; skipping the $@ test' >&2;\
--
1.8.1.4
11 years, 7 months
[libvirt] [PATCH] Add a test suite for keycode mapping functions
by Daniel P. Berrange
From: "Daniel P. Berrange" <berrange(a)redhat.com>
Validate that translations between different keycode sets
are functioning.
Signed-off-by: Daniel P. Berrange <berrange(a)redhat.com>
---
tests/virkeycodetest.c | 107 +++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 107 insertions(+)
create mode 100644 tests/virkeycodetest.c
diff --git a/tests/virkeycodetest.c b/tests/virkeycodetest.c
new file mode 100644
index 0000000..d3c5975
--- /dev/null
+++ b/tests/virkeycodetest.c
@@ -0,0 +1,107 @@
+/*
+ * Copyright (C) 2013 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * Author: Daniel P. Berrange <berrange(a)redhat.com>
+ */
+
+#include <config.h>
+
+#include <stdlib.h>
+
+#include "testutils.h"
+
+#include "virkeycode.h"
+#include "virutil.h"
+#include "virerror.h"
+#include "viralloc.h"
+#include "virlog.h"
+
+#include "virlockspace.h"
+
+#define VIR_FROM_THIS VIR_FROM_NONE
+
+
+static int testKeycodeMapping(const void *data ATTRIBUTE_UNUSED)
+{
+ int ret = -1;
+ int got;
+
+#define TRANSLATE(from, to, val, want) \
+ do { \
+ if ((got = virKeycodeValueTranslate(VIR_KEYCODE_SET_##from, \
+ VIR_KEYCODE_SET_##to, \
+ val)) != want) { \
+ fprintf(stderr, "Translating %d from %s to %s, got %d want %d\n", \
+ val, #from, #to, got, want); \
+ goto cleanup; \
+ } \
+ } while (0)
+
+ TRANSLATE(LINUX, LINUX, 111, 111);
+ TRANSLATE(LINUX, USB, 111, 76);
+ TRANSLATE(LINUX, RFB, 88, 88);
+ TRANSLATE(LINUX, RFB, 160, 163);
+ TRANSLATE(ATSET2, ATSET3, 259, 55);
+
+#undef TRANSLATE
+
+ ret = 0;
+cleanup:
+ return ret;
+}
+
+
+static int testKeycodeStrings(const void *data ATTRIBUTE_UNUSED)
+{
+ int ret = -1;
+ int got;
+
+#define TRANSLATE(from, str, want) \
+ do { \
+ if ((got = virKeycodeValueFromString(VIR_KEYCODE_SET_##from, \
+ str)) != want) { \
+ fprintf(stderr, "Converting %s from %s, got %d want %d\n", \
+ str, #from, got, want); \
+ goto cleanup; \
+ } \
+ } while (0)
+
+ TRANSLATE(LINUX, "KEY_DELETE", 111);
+ TRANSLATE(OSX, "Function", 0x3f);
+ TRANSLATE(WIN32, "VK_UP", 0x26);
+
+#undef TRANSLATE
+
+ ret = 0;
+cleanup:
+ return ret;
+}
+
+static int
+mymain(void)
+{
+ int ret = 0;
+
+ if (virtTestRun("Keycode mapping ", 1, testKeycodeMapping, NULL) < 0)
+ ret = -1;
+ if (virtTestRun("Keycode strings ", 1, testKeycodeStrings, NULL) < 0)
+ ret = -1;
+
+ return ret==0 ? EXIT_SUCCESS : EXIT_FAILURE;
+}
+
+VIRT_TEST_MAIN(mymain)
--
1.8.1.4
11 years, 7 months
[libvirt] [PATCH] build: use proper pod for nested bulleted VIRSH_DEBUG list
by Eric Blake
Newer pod (hello rawhide) complains if you attempt to mix bullets
and non-bullets in the same list:
virsh.pod around line 3177: Expected text after =item, not a bullet
As our intent was to nest an inner list, we make that explicit to
keep pod happy.
* tools/virsh.pod (ENVIRONMENT): Use correct pod syntax.
---
Pushing under the build-breaker rule.
tools/virsh.pod | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/tools/virsh.pod b/tools/virsh.pod
index 1c8f9ee..89467f6 100644
--- a/tools/virsh.pod
+++ b/tools/virsh.pod
@@ -3174,6 +3174,8 @@ of C<virsh>
Turn on verbose debugging of virsh commands. Valid levels are
+=over 4
+
=item * VIRSH_DEBUG=0
DEBUG - Messages at ALL levels get logged
@@ -3194,6 +3196,8 @@ WARNING - Logs messages at levels WARNING and ERROR
ERROR - Messages at only ERROR level gets logged.
+=back
+
=item VIRSH_LOG_FILE=C<LOGFILE>
The file to log virsh debug messages.
--
1.8.1.4
11 years, 7 months
[libvirt] [PATCH] qemu: Don't require a block or file when looking for an alias.
by Wido den Hollander
From: root <root(a)kvm01.(none)>
This for example prohibits you to use iotune for Ceph or Sheepdog devices.
Signed-off-by: Wido den Hollander <wido(a)widodh.nl>
---
src/qemu/qemu_driver.c | 4 ----
1 file changed, 4 deletions(-)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 552a81b..464d30a 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -13032,10 +13032,6 @@ qemuDiskPathToAlias(virDomainObjPtr vm, const char *path, int *idx)
if (idx)
*idx = i;
- if (disk->type != VIR_DOMAIN_DISK_TYPE_BLOCK &&
- disk->type != VIR_DOMAIN_DISK_TYPE_FILE)
- goto cleanup;
-
if (disk->src) {
if (virAsprintf(&ret, "drive-%s", disk->info.alias) < 0) {
virReportOOMError();
--
1.7.9.5
11 years, 7 months
[libvirt] [PATCH] Make guest OS bootable when hardware failure happens in log disk
by Seiji Aguchi
[Problem]
Currently, guest OS's messages can be logged to a local disk of host OS
by creating chadevs with options below.
-chardev file,id=charserial0,path=<log file's path> -device isa-serial,chardev=chardevserial0,id=serial0
When a hardware failure happens in the disk, qemu-kvm can't create the chardevs.
In this case, guest OS doesn't boot up.
Actually, there are users who don't desire that guest OS goes down due to a hardware failure
of a log disk only.Therefore, libvirt should offer some way to boot guest OS up even if the log
disk is broken.
[Solution]
This patch changes a destination to /dev/null in case a log file can't be opened.
Signed-off-by: Seiji Aguchi <seiji.aguchi(a)hds.com>
---
src/qemu/qemu_process.c | 20 +++++++++++++++++++-
1 files changed, 19 insertions(+), 1 deletions(-)
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index 8c4bfb7..fdf26ad 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -2440,7 +2440,25 @@ qemuProcessPrepareChardevDevice(virDomainDefPtr def ATTRIBUTE_UNUSED,
virReportSystemError(errno,
_("Unable to pre-create chardev file '%s'"),
dev->source.data.file.path);
- return -1;
+ VIR_FREE(dev->source.data.file.path);
+ /*
+ * Change a destination to /dev/null to boot guest OS up
+ * even if a log disk is broken.
+ */
+ dev->source.data.file.path = strdup("/dev/null");
+
+ if (!dev->source.data.file.path) {
+ virReportOOMError();
+ return -1;
+ }
+
+ if ((fd = open(dev->source.data.file.path,
+ O_CREAT | O_APPEND, S_IRUSR|S_IWUSR)) < 0) {
+ virReportSystemError(errno,
+ _("Unable to pre-create chardev file '%s'"),
+ dev->source.data.file.path);
+ return -1;
+ }
}
VIR_FORCE_CLOSE(fd);
-- 1.7.1
11 years, 7 months
[libvirt] [PATCH] qemu: Remove maximum cpu limit when setting processor count using the API
by Peter Krempa
When setting processor count for a domain using the API libvirt enforced
a maximum processor count, while it isn't enforced when taking the XML path.
This patch removes the check to match the API.
---
src/qemu/qemu_driver.c | 24 +++---------------------
1 file changed, 3 insertions(+), 21 deletions(-)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 3f62414..833bf7f 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -3737,8 +3737,6 @@ qemuDomainSetVcpusFlags(virDomainPtr dom, unsigned int nvcpus,
virQEMUDriverPtr driver = dom->conn->privateData;
virDomainObjPtr vm = NULL;
virDomainDefPtr persistentDef;
- const char * type;
- int max;
int ret = -1;
bool maximum;
virQEMUDriverConfigPtr cfg = NULL;
@@ -3778,27 +3776,11 @@ qemuDomainSetVcpusFlags(virDomainPtr dom, unsigned int nvcpus,
goto endjob;
}
- if (!(type = virDomainVirtTypeToString(vm->def->virtType))) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("unknown virt type in domain definition '%d'"),
- vm->def->virtType);
- goto endjob;
- }
-
- if ((max = qemuGetMaxVCPUs(NULL, type)) < 0) {
- virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("could not determine max vcpus for the domain"));
- goto endjob;
- }
-
- if (!maximum && vm->def->maxvcpus < max) {
- max = vm->def->maxvcpus;
- }
-
- if (nvcpus > max) {
+ if (!maximum && nvcpus > vm->def->maxvcpus) {
virReportError(VIR_ERR_INVALID_ARG,
_("requested vcpus is greater than max allowable"
- " vcpus for the domain: %d > %d"), nvcpus, max);
+ " vcpus for the domain: %d > %d"),
+ nvcpus, vm->def->maxvcpus);
goto endjob;
}
--
1.8.1.5
11 years, 7 months
[libvirt] [PATCH 0/5] Drop virReportOOMReport from almost everywhere
by Michal Privoznik
You can find these patches applied on:
git://gitorious.org/~zippy2/libvirt/michal-staging.git
branch is called 'oom'.
The patch 2/5 is totally mechaninc: s/strdup/VIR_STRDUP/ (not for all files,
obviously). That's why I've trimmed it before sending.
Michal Privoznik (5):
virutil: Move string related functions to virstring.c
Introduce VIR_STRDUP to replace strdup
virstring: Introduce virVasprintfNOOM and make virVasprintf report OOM
viralloc: Introduce OOM error reporting to VIR_ALLOC and friends
Adapt to new OOM error reporting
HACKING | 33 +-
cfg.mk | 12 +-
daemon/libvirtd-config.c | 61 ++--
daemon/libvirtd.c | 60 ++--
daemon/remote.c | 397 ++++++++---------------
daemon/stream.c | 4 +-
docs/hacking.html.in | 36 ++-
po/POTFILES.in | 1 +
python/libvirt-override.c | 108 ++++---
src/conf/capabilities.c | 29 +-
src/conf/cpu_conf.c | 55 ++--
src/conf/cpu_conf.h | 6 +-
src/conf/device_conf.c | 11 +-
src/conf/device_conf.h | 4 +-
src/conf/domain_audit.c | 5 +-
src/conf/domain_conf.c | 422 ++++++++----------------
src/conf/domain_conf.h | 1 -
src/conf/domain_event.c | 61 ++--
src/conf/domain_nwfilter.h | 2 +
src/conf/interface_conf.c | 36 +--
src/conf/interface_conf.h | 2 +-
src/conf/netdev_bandwidth_conf.c | 18 +-
src/conf/netdev_vlan_conf.c | 4 +-
src/conf/netdev_vport_profile_conf.c | 7 +-
src/conf/network_conf.c | 92 ++----
src/conf/node_device_conf.c | 38 +--
src/conf/node_device_conf.h | 4 +-
src/conf/nwfilter_conf.c | 55 +---
src/conf/nwfilter_conf.h | 1 -
src/conf/nwfilter_ipaddrmap.c | 8 +-
src/conf/nwfilter_params.c | 58 ++--
src/conf/secret_conf.c | 5 +-
src/conf/snapshot_conf.c | 63 ++--
src/conf/storage_conf.c | 54 +---
src/conf/storage_conf.h | 1 -
src/conf/storage_encryption_conf.c | 13 +-
src/conf/virchrdev.c | 23 +-
src/cpu/cpu.c | 4 +-
src/cpu/cpu_arm.c | 4 +-
src/cpu/cpu_generic.c | 24 +-
src/cpu/cpu_map.c | 7 +-
src/cpu/cpu_map.h | 2 +-
src/cpu/cpu_powerpc.c | 44 +--
src/cpu/cpu_s390.c | 4 +-
src/cpu/cpu_x86.c | 73 ++---
src/datatypes.c | 37 +--
src/driver.c | 4 +-
src/esx/esx_device_monitor.c | 2 -
src/esx/esx_device_monitor.h | 1 -
src/esx/esx_driver.c | 130 +++-----
src/esx/esx_driver.h | 1 -
src/esx/esx_interface_driver.c | 25 +-
src/esx/esx_interface_driver.h | 1 -
src/esx/esx_network_driver.c | 57 ++--
src/esx/esx_network_driver.h | 1 -
src/esx/esx_nwfilter_driver.c | 2 -
src/esx/esx_nwfilter_driver.h | 1 -
src/esx/esx_private.h | 1 -
src/esx/esx_secret_driver.c | 2 -
src/esx/esx_secret_driver.h | 1 -
src/esx/esx_storage_backend_iscsi.c | 28 +-
src/esx/esx_storage_backend_iscsi.h | 1 -
src/esx/esx_storage_backend_vmfs.c | 113 ++-----
src/esx/esx_storage_backend_vmfs.h | 1 -
src/esx/esx_storage_driver.c | 1 -
src/esx/esx_storage_driver.h | 1 -
src/esx/esx_util.c | 49 +--
src/esx/esx_vi.c | 126 +++-----
src/esx/esx_vi.h | 1 -
src/esx/esx_vi_methods.c | 1 -
src/esx/esx_vi_methods.h | 1 -
src/esx/esx_vi_types.c | 33 +-
src/esx/esx_vi_types.h | 1 -
src/fdstream.c | 13 +-
src/hyperv/hyperv_device_monitor.c | 4 -
src/hyperv/hyperv_device_monitor.h | 1 -
src/hyperv/hyperv_driver.c | 84 ++---
src/hyperv/hyperv_driver.h | 1 -
src/hyperv/hyperv_interface_driver.c | 4 -
src/hyperv/hyperv_interface_driver.h | 1 -
src/hyperv/hyperv_network_driver.c | 4 -
src/hyperv/hyperv_network_driver.h | 1 -
src/hyperv/hyperv_nwfilter_driver.c | 4 -
src/hyperv/hyperv_nwfilter_driver.h | 1 -
src/hyperv/hyperv_private.h | 1 -
src/hyperv/hyperv_secret_driver.c | 4 -
src/hyperv/hyperv_secret_driver.h | 1 -
src/hyperv/hyperv_storage_driver.c | 4 -
src/hyperv/hyperv_storage_driver.h | 1 -
src/hyperv/hyperv_util.c | 27 +-
src/hyperv/hyperv_util.h | 1 -
src/hyperv/hyperv_wmi.c | 21 +-
src/hyperv/hyperv_wmi.h | 3 -
src/hyperv/hyperv_wmi_classes.c | 1 -
src/hyperv/hyperv_wmi_classes.h | 1 -
src/hyperv/openwsman.h | 1 -
src/interface/interface_backend_netcf.c | 12 +-
src/interface/interface_backend_udev.c | 72 ++---
src/libvirt.c | 45 ++-
src/libvirt_private.syms | 34 +-
src/libxl/libxl_conf.c | 82 ++---
src/libxl/libxl_driver.c | 98 ++----
src/locking/lock_daemon.c | 75 ++---
src/locking/lock_daemon_config.c | 28 +-
src/locking/lock_daemon_dispatch.c | 6 +-
src/locking/lock_driver_lockd.c | 80 ++---
src/locking/lock_driver_sanlock.c | 41 +--
src/locking/lock_manager.c | 35 +-
src/lxc/lxc_cgroup.c | 7 +-
src/lxc/lxc_conf.c | 39 +--
src/lxc/lxc_container.c | 139 +++-----
src/lxc/lxc_controller.c | 67 ++--
src/lxc/lxc_driver.c | 131 +++-----
src/lxc/lxc_fuse.c | 19 +-
src/lxc/lxc_fuse.h | 1 -
src/lxc/lxc_monitor.c | 7 +-
src/lxc/lxc_process.c | 53 ++-
src/network/bridge_driver.c | 180 ++++-------
src/node_device/node_device_driver.c | 40 +--
src/node_device/node_device_hal.c | 6 +-
src/node_device/node_device_linux_sysfs.c | 5 +-
src/node_device/node_device_udev.c | 116 +++----
src/nodeinfo.c | 73 ++---
src/nwfilter/nwfilter_dhcpsnoop.c | 58 ++--
src/nwfilter/nwfilter_dhcpsnoop.h | 2 +
src/nwfilter/nwfilter_driver.c | 27 +-
src/nwfilter/nwfilter_ebiptables_driver.c | 45 +--
src/nwfilter/nwfilter_ebiptables_driver.h | 2 +
src/nwfilter/nwfilter_gentech_driver.c | 43 +--
src/nwfilter/nwfilter_learnipaddr.c | 37 +--
src/openvz/openvz_conf.c | 98 +++---
src/openvz/openvz_driver.c | 37 +--
src/parallels/parallels_driver.c | 122 +++----
src/parallels/parallels_network.c | 49 +--
src/parallels/parallels_storage.c | 115 +++----
src/parallels/parallels_utils.c | 7 +-
src/phyp/phyp_driver.c | 158 +++------
src/qemu/qemu_agent.c | 31 +-
src/qemu/qemu_bridge_filter.c | 1 -
src/qemu/qemu_bridge_filter.h | 1 +
src/qemu/qemu_capabilities.c | 108 +++----
src/qemu/qemu_cgroup.c | 1 -
src/qemu/qemu_command.c | 521 +++++++++++++-----------------
src/qemu/qemu_conf.c | 124 +++----
src/qemu/qemu_domain.c | 63 ++--
src/qemu/qemu_driver.c | 255 +++++----------
src/qemu/qemu_hotplug.c | 103 ++----
src/qemu/qemu_migration.c | 135 +++-----
src/qemu/qemu_monitor.c | 44 +--
src/qemu/qemu_monitor_json.c | 159 +++------
src/qemu/qemu_monitor_text.c | 258 ++++-----------
src/qemu/qemu_process.c | 127 +++-----
src/remote/remote_driver.c | 229 +++++--------
src/rpc/gendispatch.pl | 26 +-
src/rpc/virkeepalive.c | 1 -
src/rpc/virnetclient.c | 44 +--
src/rpc/virnetclientprogram.c | 16 +-
src/rpc/virnetclientstream.c | 4 +-
src/rpc/virnetmessage.c | 31 +-
src/rpc/virnetsaslcontext.c | 9 +-
src/rpc/virnetserver.c | 34 +-
src/rpc/virnetserverclient.c | 34 +-
src/rpc/virnetservermdns.c | 26 +-
src/rpc/virnetserverprogram.c | 8 +-
src/rpc/virnetserverservice.c | 12 +-
src/rpc/virnetsocket.c | 25 +-
src/rpc/virnetsshsession.c | 49 ++-
src/rpc/virnettlscontext.c | 26 +-
src/secret/secret_driver.c | 62 ++--
src/security/security_apparmor.c | 55 +---
src/security/security_dac.c | 26 +-
src/security/security_manager.c | 8 +-
src/security/security_nop.c | 6 +-
src/security/security_selinux.c | 115 ++-----
src/security/security_stack.c | 8 +-
src/security/virt-aa-helper.c | 20 +-
src/storage/parthelper.c | 2 +-
src/storage/storage_backend.c | 78 ++---
src/storage/storage_backend_disk.c | 49 +--
src/storage/storage_backend_fs.c | 74 ++---
src/storage/storage_backend_iscsi.c | 43 +--
src/storage/storage_backend_logical.c | 73 ++---
src/storage/storage_backend_mpath.c | 33 +-
src/storage/storage_backend_rbd.c | 23 +-
src/storage/storage_backend_scsi.c | 38 +--
src/storage/storage_backend_sheepdog.c | 9 +-
src/storage/storage_driver.c | 55 ++--
src/test/test_driver.c | 203 ++++--------
src/uml/uml_conf.c | 55 ++--
src/uml/uml_driver.c | 70 ++--
src/util/iohelper.c | 13 +-
src/util/viralloc.c | 91 +++++-
src/util/viralloc.h | 52 ++-
src/util/viraudit.c | 10 +-
src/util/virauth.c | 36 +--
src/util/virauthconfig.c | 31 +-
src/util/virbitmap.c | 11 +-
src/util/virbuffer.c | 8 +-
src/util/vircgroup.c | 12 +-
src/util/vircommand.c | 46 ++-
src/util/vircommand.h | 1 -
src/util/virconf.c | 24 +-
src/util/virdnsmasq.c | 48 +--
src/util/virebtables.c | 33 +-
src/util/virerror.c | 11 +-
src/util/vireventpoll.c | 14 +-
src/util/virfile.c | 15 +-
src/util/virhash.c | 18 +-
src/util/virhook.c | 10 +-
src/util/virhook.h | 1 -
src/util/viridentity.c | 11 +-
src/util/virinitctl.c | 19 +-
src/util/viriptables.c | 21 +-
src/util/virjson.c | 12 +-
src/util/virkeyfile.c | 10 +-
src/util/virlockspace.c | 65 ++--
src/util/virlog.c | 19 +-
src/util/virnetdev.c | 58 +---
src/util/virnetdevbandwidth.c | 26 +-
src/util/virnetdevbridge.c | 17 +-
src/util/virnetdevmacvlan.c | 27 +-
src/util/virnetdevopenvswitch.c | 17 +-
src/util/virnetdevopenvswitch.h | 1 -
src/util/virnetdevtap.c | 18 +-
src/util/virnetdevveth.c | 14 +-
src/util/virnetdevvlan.c | 4 +-
src/util/virnetdevvportprofile.c | 13 +-
src/util/virnetdevvportprofile.h | 4 +-
src/util/virnetlink.c | 8 +-
src/util/virobject.c | 12 +-
src/util/virpci.c | 88 ++---
src/util/virpidfile.c | 15 +-
src/util/virportallocator.c | 1 -
src/util/virprocess.c | 31 +-
src/util/virrandom.c | 13 +-
src/util/virsexpr.c | 18 +-
src/util/virsocketaddr.c | 13 +-
src/util/virstatslinux.c | 1 -
src/util/virstoragefile.c | 50 +--
src/util/virstring.c | 384 +++++++++++++++++++++-
src/util/virstring.h | 62 ++++
src/util/virsysinfo.c | 16 +-
src/util/virsysinfo.h | 2 +-
src/util/virthreadpool.c | 21 +-
src/util/virthreadpthread.c | 2 +-
src/util/virtime.c | 9 +-
src/util/virtypedparam.c | 49 +--
src/util/viruri.c | 45 ++-
src/util/virusb.c | 20 +-
src/util/virutil.c | 512 ++++-------------------------
src/util/virutil.h | 49 +--
src/util/viruuid.c | 2 +-
src/util/virxml.c | 15 +-
src/vbox/vbox_MSCOMGlue.c | 9 +-
src/vbox/vbox_XPCOMCGlue.c | 17 +-
src/vbox/vbox_driver.c | 1 -
src/vbox/vbox_tmpl.c | 369 +++++++--------------
src/vmware/vmware_conf.c | 59 +---
src/vmware/vmware_driver.c | 25 +-
src/vmx/vmx.c | 125 +++----
src/xen/block_stats.c | 14 +-
src/xen/xen_driver.c | 59 ++--
src/xen/xen_hypervisor.c | 73 ++---
src/xen/xen_inotify.c | 29 +-
src/xen/xend_internal.c | 130 +++-----
src/xen/xm_internal.c | 54 ++--
src/xen/xs_internal.c | 48 +--
src/xenapi/xenapi_driver.c | 76 ++---
src/xenapi/xenapi_utils.c | 44 ++-
src/xenxs/xen_sxpr.c | 232 ++++++-------
src/xenxs/xen_xm.c | 283 ++++++++--------
tests/commandhelper.c | 6 +-
tests/commandtest.c | 14 +-
tests/cputest.c | 11 +-
tests/domainsnapshotxml2xmltest.c | 3 +-
tests/esxutilstest.c | 1 -
tests/eventtest.c | 6 +-
tests/interfacexml2xmltest.c | 4 +-
tests/libvirtdconftest.c | 13 +-
tests/lxcxml2xmltest.c | 3 +-
tests/networkxml2conftest.c | 9 +-
tests/networkxml2xmltest.c | 3 +-
tests/nodedevxml2xmltest.c | 3 +-
tests/nodeinfotest.c | 4 +-
tests/nwfilterxml2xmltest.c | 9 +-
tests/openvzutilstest.c | 8 +-
tests/qemuargv2xmltest.c | 4 +-
tests/qemuhelptest.c | 3 +-
tests/qemumonitortest.c | 1 -
tests/qemumonitortestutils.c | 11 +-
tests/qemuxml2argvtest.c | 10 +-
tests/qemuxml2xmltest.c | 3 +-
tests/qemuxmlnstest.c | 8 +-
tests/securityselinuxlabeltest.c | 7 +-
tests/securityselinuxtest.c | 7 +-
tests/sexpr2xmltest.c | 7 +-
tests/storagepoolxml2xmltest.c | 3 +-
tests/storagevolxml2argvtest.c | 5 +-
tests/storagevolxml2xmltest.c | 3 +-
tests/sysinfotest.c | 7 +-
tests/test_conf.c | 2 +-
tests/testutils.c | 26 +-
tests/utiltest.c | 3 +-
tests/virauthconfigtest.c | 1 -
tests/virbuftest.c | 4 +-
tests/virdrivermoduletest.c | 1 -
tests/virhashtest.c | 7 +-
tests/viridentitytest.c | 1 -
tests/virkeyfiletest.c | 1 -
tests/virlockspacetest.c | 10 +-
tests/virnetmessagetest.c | 1 -
tests/virnetsockettest.c | 10 +-
tests/virnettlscontexttest.c | 10 +-
tests/virportallocatortest.c | 5 +-
tests/virshtest.c | 4 +-
tests/virstoragetest.c | 1 +
tests/virstringtest.c | 1 -
tests/virtimetest.c | 1 -
tests/viruritest.c | 1 -
tests/vmx2xmltest.c | 3 +-
tests/xencapstest.c | 5 +-
tests/xmconfigtest.c | 11 +-
tests/xml2sexprtest.c | 5 +-
tests/xml2vmxtest.c | 3 +-
tools/console.c | 1 -
tools/virsh-domain-monitor.c | 3 +-
tools/virsh-domain.c | 1 -
tools/virsh-host.c | 6 +-
tools/virsh-interface.c | 3 +-
tools/virsh-network.c | 1 -
tools/virsh-nodedev.c | 1 -
tools/virsh-nwfilter.c | 2 +-
tools/virsh-pool.c | 6 +-
tools/virsh-secret.c | 4 +-
tools/virsh-snapshot.c | 1 -
tools/virsh-volume.c | 5 +-
tools/virsh.c | 26 +-
tools/virt-host-validate-common.c | 3 +-
338 files changed, 4797 insertions(+), 8145 deletions(-)
--
1.8.1.5
11 years, 7 months
[libvirt] [PATCH v2 2/2] Implement support for <hostdev caps=net>
by Bogdan Purcareata
This allows a container-type domain to have exclusive access to one of
the host's NICs.
Wire <hostdev caps=net> with the lxc_controller - when moving the newly
created veth devices into a new namespace, also look for any hostdev
devices that should be moved. Note: once the container domain has been
destroyed, there is no code that moves the interfaces back to the
original namespace. This does happen, though, probably due to default
cleanup on namespace destruction.
Signed-off-by: Bogdan Purcareata <bogdan.purcareata(a)freescale.com>
---
src/lxc/lxc_container.c | 4 +++-
src/lxc/lxc_controller.c | 16 ++++++++++++++++
src/lxc/lxc_hostdev.c | 1 +
3 files changed, 20 insertions(+), 1 deletion(-)
diff --git a/src/lxc/lxc_container.c b/src/lxc/lxc_container.c
index 002ba9e..e59bfdf 100644
--- a/src/lxc/lxc_container.c
+++ b/src/lxc/lxc_container.c
@@ -1551,7 +1551,6 @@ cleanup:
return ret;
}
-
static int lxcContainerSetupHostdevSubsys(virDomainDefPtr vmDef,
virDomainHostdevDefPtr def,
const char *dstprefix,
@@ -1582,6 +1581,9 @@ static int lxcContainerSetupHostdevCaps(virDomainDefPtr vmDef,
case VIR_DOMAIN_HOSTDEV_CAPS_TYPE_MISC:
return lxcContainerSetupHostdevCapsMisc(vmDef, def, dstprefix, securityDriver);
+ case VIR_DOMAIN_HOSTDEV_CAPS_TYPE_NET:
+ return 0; // case is handled in virLXCControllerMoveInterfaces
+
default:
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("Unsupported host device mode %s"),
diff --git a/src/lxc/lxc_controller.c b/src/lxc/lxc_controller.c
index cede445..edd99bf 100644
--- a/src/lxc/lxc_controller.c
+++ b/src/lxc/lxc_controller.c
@@ -1050,12 +1050,28 @@ cleanup2:
static int virLXCControllerMoveInterfaces(virLXCControllerPtr ctrl)
{
size_t i;
+ virDomainDefPtr def = ctrl->def;
for (i = 0 ; i < ctrl->nveths ; i++) {
if (virNetDevSetNamespace(ctrl->veths[i], ctrl->initpid) < 0)
return -1;
}
+ for (i = 0; i < def->nhostdevs; i ++) {
+ virDomainHostdevDefPtr hdev = def->hostdevs[i];
+
+ if (hdev->mode != VIR_DOMAIN_HOSTDEV_MODE_CAPABILITIES)
+ continue;
+
+ virDomainHostdevCaps hdcaps = hdev->source.caps;
+
+ if (hdcaps.type != VIR_DOMAIN_HOSTDEV_CAPS_TYPE_NET)
+ continue;
+
+ if (virNetDevSetNamespace(hdcaps.u.net.iface, ctrl->initpid) < 0)
+ return -1;
+ }
+
return 0;
}
diff --git a/src/lxc/lxc_hostdev.c b/src/lxc/lxc_hostdev.c
index 33b0b60..53a1a31 100644
--- a/src/lxc/lxc_hostdev.c
+++ b/src/lxc/lxc_hostdev.c
@@ -307,6 +307,7 @@ int virLXCPrepareHostDevices(virLXCDriverPtr driver,
switch (dev->source.subsys.type) {
case VIR_DOMAIN_HOSTDEV_CAPS_TYPE_STORAGE:
case VIR_DOMAIN_HOSTDEV_CAPS_TYPE_MISC:
+ case VIR_DOMAIN_HOSTDEV_CAPS_TYPE_NET:
break;
default:
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
--
1.7.11.7
11 years, 7 months
[libvirt] [PATCH v5.1 00/11] Introduce driver specific XML parsing callbacks
by Peter Krempa
In this respin the renaming patch is moved to be first in the series. The
argument rearrangement patch was too complicated to move.
Unfortunately this rebase operation caused my "git notes" to be lost for the
individual patches, so please see v5 for more specific comments.
Patches 5 to 11 except for 10 were ACKed in previous versions.
Peter Krempa (11):
maint: Rename xmlconf to xmlopt and virDomainXMLConfing to
virDomainXMLOption
conf: Add post XML parse callbacks and prepare for cleaning of virCaps
conf callback: Rearrange function parameters
qemu: Record the default NIC model in the domain XML
virCaps: get rid of "defaultInitPath" value in the virCaps struct
virCaps: get rid of defaultDiskDriverName
virCaps: get rid of emulatorRequired
virCaps: get rid of defaultDiskDriverType
virCaps: get rid of hasWideScsiBus
virCaps: get rid of macPrefix field
virCaps: get rid of defaultConsoleTargetType callback
src/conf/capabilities.c | 24 -
src/conf/capabilities.h | 23 -
src/conf/domain_conf.c | 660 ++++++++++++---------
src/conf/domain_conf.h | 102 ++--
src/conf/snapshot_conf.c | 4 +-
src/conf/snapshot_conf.h | 2 +-
src/esx/esx_driver.c | 32 +-
src/esx/esx_private.h | 2 +-
src/libvirt_private.syms | 10 +-
src/libvirt_vmx.syms | 1 +
src/libxl/libxl_conf.c | 13 -
src/libxl/libxl_conf.h | 2 +-
src/libxl/libxl_driver.c | 103 ++--
src/lxc/lxc_conf.c | 21 +-
src/lxc/lxc_conf.h | 4 +-
src/lxc/lxc_controller.c | 10 +-
src/lxc/lxc_domain.c | 34 ++
src/lxc/lxc_domain.h | 1 +
src/lxc/lxc_driver.c | 71 ++-
src/lxc/lxc_process.c | 8 +-
src/openvz/openvz_conf.c | 16 +-
src/openvz/openvz_conf.h | 2 +-
src/openvz/openvz_driver.c | 64 +-
src/parallels/parallels_driver.c | 37 +-
src/parallels/parallels_utils.h | 2 +-
src/phyp/phyp_driver.c | 24 +-
src/phyp/phyp_driver.h | 2 +-
src/qemu/qemu_capabilities.c | 19 -
src/qemu/qemu_command.c | 27 +-
src/qemu/qemu_command.h | 6 +-
src/qemu/qemu_conf.c | 18 +-
src/qemu/qemu_conf.h | 5 +-
src/qemu/qemu_domain.c | 98 ++-
src/qemu/qemu_domain.h | 1 +
src/qemu/qemu_driver.c | 147 +++--
src/qemu/qemu_migration.c | 21 +-
src/qemu/qemu_process.c | 34 +-
src/security/virt-aa-helper.c | 19 +-
src/test/test_driver.c | 67 +--
src/uml/uml_conf.c | 9 -
src/uml/uml_conf.h | 2 +-
src/uml/uml_driver.c | 69 ++-
src/vbox/vbox_tmpl.c | 33 +-
src/vmware/vmware_conf.c | 21 +-
src/vmware/vmware_conf.h | 2 +-
src/vmware/vmware_driver.c | 24 +-
src/vmx/vmx.c | 39 +-
src/vmx/vmx.h | 12 +-
src/xen/xen_driver.c | 37 +-
src/xen/xen_driver.h | 4 +-
src/xen/xen_hypervisor.c | 13 -
src/xen/xend_internal.c | 20 +-
src/xen/xm_internal.c | 16 +-
src/xenapi/xenapi_driver.c | 40 +-
src/xenapi/xenapi_driver_private.h | 2 +-
tests/domainsnapshotxml2xmltest.c | 6 +-
tests/lxcxml2xmldata/lxc-hostdev.xml | 1 +
tests/lxcxml2xmldata/lxc-systemd.xml | 1 +
tests/lxcxml2xmltest.c | 8 +-
tests/qemuargv2xmltest.c | 6 +-
tests/qemumonitorjsontest.c | 28 +-
tests/qemumonitortestutils.c | 4 +-
tests/qemumonitortestutils.h | 2 +-
...qemuxml2argv-disk-drive-network-nbd-export.args | 3 +-
.../qemuxml2argv-disk-drive-network-nbd-export.xml | 1 +
...ml2argv-disk-drive-network-nbd-ipv6-export.args | 3 +-
...xml2argv-disk-drive-network-nbd-ipv6-export.xml | 1 +
.../qemuxml2argv-disk-drive-network-nbd-ipv6.args | 3 +-
.../qemuxml2argv-disk-drive-network-nbd-ipv6.xml | 1 +
.../qemuxml2argv-disk-drive-network-nbd-unix.args | 3 +-
.../qemuxml2argv-disk-drive-network-nbd-unix.xml | 1 +
.../qemuxml2argv-disk-drive-network-nbd.args | 5 +-
.../qemuxml2argv-disk-drive-network-nbd.xml | 1 +
.../qemuxml2argv-disk-drive-network-rbd-auth.args | 2 +-
.../qemuxml2argv-disk-drive-network-rbd-ipv6.args | 2 +-
.../qemuxml2argv-disk-drive-network-rbd-ipv6.xml | 1 +
.../qemuxml2argv-disk-drive-network-rbd.args | 2 +-
.../qemuxml2argv-disk-drive-network-rbd.xml | 1 +
.../qemuxml2argv-disk-drive-network-sheepdog.args | 3 +-
.../qemuxml2argv-disk-drive-network-sheepdog.xml | 1 +
.../qemuxml2argv-net-bandwidth.xml | 1 +
.../qemuxml2argvdata/qemuxml2argv-net-client.args | 4 +-
.../qemuxml2argv-net-eth-ifname.args | 4 +-
.../qemuxml2argv-net-eth-ifname.xml | 1 +
.../qemuxml2argv-net-eth-names.args | 8 +-
tests/qemuxml2argvdata/qemuxml2argv-net-eth.args | 4 +-
tests/qemuxml2argvdata/qemuxml2argv-net-eth.xml | 1 +
.../qemuxml2argvdata/qemuxml2argv-net-hostdev.xml | 1 +
tests/qemuxml2argvdata/qemuxml2argv-net-mcast.args | 4 +-
.../qemuxml2argv-net-openvswitch.xml | 1 +
.../qemuxml2argvdata/qemuxml2argv-net-server.args | 4 +-
tests/qemuxml2argvdata/qemuxml2argv-net-user.args | 3 +-
tests/qemuxml2argvdata/qemuxml2argv-net-user.xml | 1 +
.../qemuxml2argv-net-virtio-network-portgroup.xml | 2 +
tests/qemuxml2argvtest.c | 6 +-
.../qemuxml2xmlout-graphics-spice-timeout.xml | 1 +
tests/qemuxml2xmltest.c | 6 +-
tests/qemuxmlnstest.c | 6 +-
tests/securityselinuxlabeltest.c | 6 +-
tests/testutilslxc.c | 9 -
tests/testutilsqemu.c | 11 -
tests/testutilsqemu.h | 2 +-
tests/testutilsxen.c | 16 -
tests/testutilsxen.h | 2 -
tests/vmx2xmltest.c | 17 +-
tests/xmconfigtest.c | 8 +-
tests/xml2sexprtest.c | 9 +-
tests/xml2vmxtest.c | 20 +-
108 files changed, 1275 insertions(+), 1052 deletions(-)
--
1.8.1.5
11 years, 7 months