[libvirt] [PATCH 00/32] Santize iterator variable names & data types
by Daniel P. Berrange
From: "Daniel P. Berrange" <berrange(a)redhat.com>
The libvirt code has a mixture of data types used for the common
'i', 'j', 'k' variable names, int, unsigned int & size_t. Change
them all to use 'size_t'. In the few cases which actually required
the use of a signed variable, either the use of the unsigned
values was eliminated or the variables were renamed to 'idx' to
better describe their use.
At the same time any loop variables name 'ii', 'jj', 'kk' were
changed to their more normal names 'i', 'j', 'k'.
New syntax-check rules prevent regressions in these conversions.
Daniel P. Berrange (32):
Convert 'int i' to 'size_t i' in daemon/ files
Convert 'int i' to 'size_t i' in src/conf/ files
Convert 'int i' to 'size_t i' in src/util/ files
Convert 'int i' to 'size_t i' in tests/ files
Convert 'int i' to 'size_t i' in tools/ files
Convert 'int i' to 'size_t i' in src/{xen,xenapi,xenxs} files
Convert 'int i' to 'size_t i' in src/{esx,vmx,vmware} files
Convert 'int i' to 'size_t i' in src/storage/ files
Convert 'int i' to 'size_t i' in src/vbox/ files
Convert 'int i' to 'size_t i' in src/uml/ files
Convert 'int i' to 'size_t i' in src/test/ files
Convert 'int i' to 'size_t i' in src/security files
Convert 'int i' to 'size_t i' in src/secret/ files
Convert 'int i' to 'size_t i' in src/rpc/ files
Convert 'int i' to 'size_t i' in src/remote/ files
Convert 'int i' to 'size_t i' in src/qemu files
Convert 'int i' to 'size_t i' in src/phyp/ files
Convert 'int i' to 'size_t i' in src/parallels/ files
Convert 'int i' to 'size_t i' in src/openvz/ files
Convert 'int i' to 'size_t i' in src/nwfilter/ files
Convert 'int i' to 'size_t i' in src/node_device/ files
Convert 'int i' to 'size_t i' in src/lxc/ files
Convert 'int i' to 'size_t i' in src/locking/ files
Convert 'int i' to 'size_t i' in src/libxl/ files
Convert 'int i' to 'size_t i' in src/network/ files
Convert 'int i' to 'size_t i' in src/interface/ files
Convert 'int i' to 'size_t i' in src/hyperv/ files
Convert 'int i' to 'size_t i' in src/cpu/ files
Convert 'int i' to 'size_t i' in src/ files
Convert 'int i' to 'size_t i' in python/ files
Convert 'int i' to 'size_t i' in examples/ files
Prevent use of 'int' data type & 'ii', 'jj', 'kk' var names for loops
cfg.mk | 14 ++
daemon/libvirtd-config.c | 5 +-
daemon/remote.c | 55 ++---
examples/domain-events/events-c/event-test.c | 2 +-
examples/domsuspend/suspend.c | 14 +-
examples/openauth/openauth.c | 2 +-
python/libvirt-lxc-override.c | 2 +-
python/libvirt-override.c | 111 ++++++----
src/conf/capabilities.c | 32 +--
src/conf/cpu_conf.c | 18 +-
src/conf/domain_audit.c | 4 +-
src/conf/domain_conf.c | 266 +++++++++++-----------
src/conf/domain_conf.h | 12 +-
src/conf/domain_event.c | 24 +-
src/conf/domain_nwfilter.c | 2 +-
src/conf/interface_conf.c | 73 +++---
src/conf/netdev_vlan_conf.c | 19 +-
src/conf/network_conf.c | 319 ++++++++++++++-------------
src/conf/node_device_conf.c | 27 ++-
src/conf/nwfilter_conf.c | 43 ++--
src/conf/nwfilter_params.c | 26 ++-
src/conf/snapshot_conf.c | 21 +-
src/conf/storage_conf.c | 42 ++--
src/conf/storage_encryption_conf.c | 3 +-
src/cpu/cpu.c | 22 +-
src/cpu/cpu_generic.c | 6 +-
src/cpu/cpu_powerpc.c | 2 +-
src/cpu/cpu_x86.c | 26 +--
src/esx/esx_driver.c | 10 +-
src/esx/esx_interface_driver.c | 2 +-
src/esx/esx_network_driver.c | 4 +-
src/esx/esx_storage_backend_iscsi.c | 4 +-
src/esx/esx_storage_backend_vmfs.c | 4 +-
src/esx/esx_storage_driver.c | 10 +-
src/esx/esx_util.c | 2 +-
src/esx/esx_vi.c | 18 +-
src/fdstream.c | 2 +-
src/hyperv/hyperv_driver.c | 4 +-
src/hyperv/hyperv_util.c | 2 +-
src/interface/interface_backend_netcf.c | 6 +-
src/interface/interface_backend_udev.c | 4 +-
src/libvirt-lxc.c | 2 +-
src/libvirt.c | 40 ++--
src/libxl/libxl_conf.c | 12 +-
src/libxl/libxl_driver.c | 34 +--
src/locking/domain_lock.c | 6 +-
src/locking/lock_driver.h | 2 +-
src/locking/lock_driver_lockd.c | 6 +-
src/locking/lock_driver_sanlock.c | 10 +-
src/locking/lock_manager.c | 4 +-
src/lxc/lxc_cgroup.c | 3 +-
src/lxc/lxc_container.c | 6 +-
src/lxc/lxc_controller.c | 3 +-
src/lxc/lxc_driver.c | 44 ++--
src/lxc/lxc_process.c | 2 +-
src/network/bridge_driver.c | 281 +++++++++++------------
src/node_device/node_device_driver.c | 6 +-
src/node_device/node_device_hal.c | 9 +-
src/nodeinfo.c | 24 +-
src/nwfilter/nwfilter_driver.c | 5 +-
src/nwfilter/nwfilter_ebiptables_driver.c | 4 +-
src/nwfilter/nwfilter_gentech_driver.c | 21 +-
src/openvz/openvz_driver.c | 10 +-
src/parallels/parallels_driver.c | 15 +-
src/parallels/parallels_network.c | 3 +-
src/parallels/parallels_storage.c | 8 +-
src/phyp/phyp_driver.c | 26 +--
src/qemu/qemu_agent.c | 9 +-
src/qemu/qemu_capabilities.c | 7 +-
src/qemu/qemu_cgroup.c | 12 +-
src/qemu/qemu_command.c | 104 ++++-----
src/qemu/qemu_conf.c | 2 +-
src/qemu/qemu_domain.c | 34 +--
src/qemu/qemu_driver.c | 120 +++++-----
src/qemu/qemu_hostdev.c | 26 ++-
src/qemu/qemu_hotplug.c | 54 ++---
src/qemu/qemu_migration.c | 25 ++-
src/qemu/qemu_monitor.c | 13 +-
src/qemu/qemu_monitor_json.c | 31 +--
src/qemu/qemu_monitor_text.c | 6 +-
src/qemu/qemu_process.c | 48 ++--
src/remote/remote_driver.c | 64 +++---
src/rpc/gendispatch.pl | 7 +-
src/rpc/virnetclient.c | 2 +-
src/rpc/virnetclientprogram.c | 2 +-
src/rpc/virnetserver.c | 10 +-
src/rpc/virnetserverservice.c | 10 +-
src/rpc/virnetsocket.c | 2 +-
src/rpc/virnetsshsession.c | 10 +-
src/rpc/virnettlscontext.c | 7 +-
src/secret/secret_driver.c | 6 +-
src/security/security_dac.c | 4 +-
src/security/security_driver.c | 2 +-
src/security/security_selinux.c | 4 +-
src/security/virt-aa-helper.c | 4 +-
src/storage/storage_backend.c | 8 +-
src/storage/storage_backend_disk.c | 6 +-
src/storage/storage_backend_fs.c | 2 +-
src/storage/storage_backend_iscsi.c | 2 +-
src/storage/storage_backend_logical.c | 10 +-
src/storage/storage_backend_rbd.c | 4 +-
src/storage/storage_driver.c | 19 +-
src/test/test_driver.c | 50 +++--
src/uml/uml_conf.c | 6 +-
src/uml/uml_driver.c | 9 +-
src/util/virbitmap.c | 13 +-
src/util/vircgroup.c | 32 +--
src/util/vircommand.c | 10 +-
src/util/virdnsmasq.c | 16 +-
src/util/virebtables.c | 8 +-
src/util/vireventpoll.c | 28 +--
src/util/virhook.c | 3 +-
src/util/virjson.c | 12 +-
src/util/virkeycode.c | 4 +-
src/util/virlog.c | 30 +--
src/util/virlog.h | 2 +-
src/util/virmacaddr.c | 2 +-
src/util/virnetdevmacvlan.c | 2 +-
src/util/virnetdevopenvswitch.c | 2 +-
src/util/virnetdevtap.c | 4 +-
src/util/virnetdevvportprofile.c | 2 +-
src/util/virnetlink.c | 14 +-
src/util/virnuma.c | 13 +-
src/util/virpci.c | 14 +-
src/util/virportallocator.c | 8 +-
src/util/virprocess.c | 7 +-
src/util/virscsi.c | 6 +-
src/util/virsocketaddr.c | 28 +--
src/util/virstoragefile.c | 7 +-
src/util/virstring.c | 3 +-
src/util/virsysinfo.c | 6 +-
src/util/virthreadwin32.c | 6 +-
src/util/virthreadwin32.h | 2 +-
src/util/virtypedparam.c | 10 +-
src/util/viruri.c | 2 +-
src/util/virusb.c | 6 +-
src/util/virutil.c | 29 +--
src/util/viruuid.c | 7 +-
src/vbox/vbox_XPCOMCGlue.c | 6 +-
src/vbox/vbox_tmpl.c | 159 ++++++-------
src/vmware/vmware_conf.c | 4 +-
src/vmx/vmx.c | 24 +-
src/xen/block_stats.c | 4 +-
src/xen/xen_driver.c | 4 +-
src/xen/xen_hypervisor.c | 14 +-
src/xen/xen_inotify.c | 4 +-
src/xen/xend_internal.c | 12 +-
src/xen/xm_internal.c | 5 +-
src/xen/xs_internal.c | 27 ++-
src/xenapi/xenapi_driver.c | 30 ++-
src/xenapi/xenapi_utils.c | 14 +-
src/xenxs/xen_sxpr.c | 10 +-
src/xenxs/xen_xm.c | 6 +-
tests/commandhelper.c | 4 +-
tests/cputest.c | 6 +-
tests/esxutilstest.c | 9 +-
tests/eventtest.c | 14 +-
tests/nodeinfotest.c | 2 +-
tests/openvzutilstest.c | 2 +-
tests/qemuhelptest.c | 6 +-
tests/qemumonitorjsontest.c | 6 +-
tests/qemumonitortest.c | 4 +-
tests/ssh.c | 2 +-
tests/testutils.c | 13 +-
tests/utiltest.c | 16 +-
tests/viratomictest.c | 4 +-
tests/virbitmaptest.c | 9 +-
tests/vircgrouptest.c | 2 +-
tests/virhashtest.c | 12 +-
tests/virnetsockettest.c | 2 +-
tests/virstoragetest.c | 2 +-
tools/virsh-domain-monitor.c | 17 +-
tools/virsh-domain.c | 41 ++--
tools/virsh-host.c | 8 +-
tools/virsh-interface.c | 6 +-
tools/virsh-network.c | 6 +-
tools/virsh-nodedev.c | 8 +-
tools/virsh-nwfilter.c | 6 +-
tools/virsh-pool.c | 7 +-
tools/virsh-secret.c | 6 +-
tools/virsh-snapshot.c | 12 +-
tools/virsh-volume.c | 6 +-
tools/virsh.c | 15 +-
183 files changed, 1854 insertions(+), 1651 deletions(-)
--
1.8.1.4
11 years, 4 months
[libvirt] [PATCH v2] storage: silently ignore missing files on pool refresh
by Ján Tomko
From: Wei Zhou <w.zhou(a)leaseweb.com>
Make virStorageBackendVolOpenCheckMode return -2 instead of
-1 if volume file is missing.
https://bugzilla.redhat.com/show_bug.cgi?id=977706
Signed-off-by: Ján Tomko <jtomko(a)redhat.com>
---
src/storage/storage_backend.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/src/storage/storage_backend.c b/src/storage/storage_backend.c
index e2527c9..a24e452 100644
--- a/src/storage/storage_backend.c
+++ b/src/storage/storage_backend.c
@@ -1084,7 +1084,7 @@ virStorageBackendForType(int type)
* Allows caller to silently ignore files with improper mode
*
* Returns -1 on error, -2 if file mode is unexpected or the
- * volume is a dangling symbolic link.
+ * volume is a dangling symbolic link or file is missing.
*/
int
virStorageBackendVolOpenCheckMode(const char *path, unsigned int flags)
@@ -1094,10 +1094,10 @@ virStorageBackendVolOpenCheckMode(const char *path, unsigned int flags)
char *base = last_component(path);
if (lstat(path, &sb) < 0) {
- virReportSystemError(errno,
- _("cannot stat file '%s'"),
- path);
- return -1;
+ char ebuf[1024];
+ VIR_WARN(_("cannot stat file '%s': %s"), path,
+ virStrerror(errno, ebuf, sizeof(ebuf)));
+ return -2;
}
if (S_ISFIFO(sb.st_mode)) {
--
1.8.1.5
11 years, 4 months
[libvirt] [PATCH 0/8] Re-enable memballoon driver statistics reporting
by John Ferlan
https://bugzilla.redhat.com/show_bug.cgi?id=904160
The following patches will provide the support and functionality in order
to re-enable getting domain memory statistics from the balloon driver based
on the upstream QEMU patch:
https://lists.gnu.org/archive/html/qemu-devel/2013-01/msg04835.html
Statistics gathering requires usage of the QEMU QObject model, specifically
the qom-list command to find the path to the balloon driver and the qom-get/
qom-set commands in order to get/set properties on the object. A future
possible extension would be to allow 'virsh qemuobject [--list|--get|--put]'
where the --list would list a single path and the get/set would allow
viewing/adjusting a specific object path property.
The QObject model requires setting properties after the domain (and device)
has been started. For the balloon driver, in order to enable collection the
property "guest-stats-polling-interval" is used. Since the QObject model has
been in place for a while and the balloon driver has been part of that, the
capability to gather statistics is only discernible if the property is found.
Once found, the property can be changed at any time after startup in order
to exend/shorted the collection interval or disable the collection by setting
the property back to 0 (zero). Setting the property back does not reset
already generated statistics. If statistics haven't been generated at all
they are initialized to -1. Thus if values are set at -1, they will not
be stored in the output. The only possible visual cue to determine that
statistics are disabled is if the polling interval property was 0 (zero).
Since it wasn't clear whether adjusting the dommemstats output to provide
that visual cue, I left that as a future possible exercise - although it is
possible to add it to this patch set where the output would be extended
to indicate the current collection interval period or that collection is
currently disabled, eg one new row "period #".
The collection period interval is saved in a new memballoon stats field
as 'period'. This is saved in the xml as "<stats period='10'/>". The
capability to dynamically set the period once the domain has started is
controlled by a new '--period <value>' option to the dommemstats command.
The command was extended to support the --live, --current, and --config
options. The implementation uses the existing virDomainSetMemoryFlags with
a new 'VIR_DOMAIN_MEM_PERIOD' flag that the qemuDomainSetMemoryFlags() will
handle. This was methodology was chosen in preference to generating (a)
new driver function(s) to just handle the get/set of the collection period.
John Ferlan (8):
Add qemuMonitorGetObjectListPaths() method for QMP qom-list command
Add qemuMonitorGetObjectProperty() method for QMP qom-get command
Add qemuMonitorSetObjectProperty() method for QMP qom-set command
Add 'period' for Memballoon statistics gathering capability
Determine whether to start balloon memory stats gathering.
Add capability to fetch balloon stats
If available fetch the balloon driver memory stats
Allow balloon driver collection to be adjusted dynamically
docs/formatdomain.html.in | 14 ++
docs/schemas/domaincommon.rng | 7 +
include/libvirt/libvirt.h.in | 1 +
src/conf/domain_conf.c | 27 +++-
src/conf/domain_conf.h | 1 +
src/libvirt.c | 8 +-
src/qemu/qemu_domain.c | 1 +
src/qemu/qemu_domain.h | 2 +
src/qemu/qemu_driver.c | 61 +++++++-
src/qemu/qemu_monitor.c | 79 +++++++++++
src/qemu/qemu_monitor.h | 57 ++++++++
src/qemu/qemu_monitor_json.c | 317 ++++++++++++++++++++++++++++++++++++++++++
src/qemu/qemu_monitor_json.h | 18 +++
src/qemu/qemu_process.c | 164 +++++++++++++++++++++-
tests/qemumonitorjsontest.c | 184 ++++++++++++++++++++++++
tools/virsh-domain-monitor.c | 70 +++++++++-
16 files changed, 1000 insertions(+), 11 deletions(-)
--
1.8.1.4
11 years, 4 months
[libvirt] [PATCH v3 0/9] Chardev hotplug
by Michal Privoznik
The third round of my chardev hotplug patches.
Michal Privoznik (9):
domain_conf: Introduce chardev hotplug helpers
qemu: Implement chardev hotplug on config level
qemu_monitor_json: Move InetSocketAddress build to a separate function
qemu_monitor: Introduce qemuMonitorAttachCharDev
qemu_monitor: Introduce qemuMonitorDetachCharDev
qemu_command: Honour chardev alias assignment with a function
qemu: Introduce qemuBuildChrDeviceStr
qemu: Implement chardev hotplug on live level
qemuhotplugtest: Introduce test for chardev hotplug
src/conf/domain_conf.c | 154 +++++++++++-
src/conf/domain_conf.h | 15 ++
src/libvirt_private.syms | 4 +
src/qemu/qemu_command.c | 277 +++++++++++++++++----
src/qemu/qemu_command.h | 15 +-
src/qemu/qemu_driver.c | 51 +++-
src/qemu/qemu_hotplug.c | 108 ++++++++
src/qemu/qemu_hotplug.h | 6 +
src/qemu/qemu_monitor.c | 41 +++
src/qemu/qemu_monitor.h | 5 +
src/qemu/qemu_monitor_json.c | 252 +++++++++++++++++--
src/qemu/qemu_monitor_json.h | 5 +
tests/qemuhotplugtest.c | 194 ++++++++++++---
.../qemuhotplug-console-virtio.xml | 5 +
.../qemuxml2argv-console-compat-2.xml | 122 +++++++++
15 files changed, 1134 insertions(+), 120 deletions(-)
create mode 100644 tests/qemuhotplugtestdata/qemuhotplug-console-virtio.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-console-compat-2.xml
--
1.8.1.5
11 years, 4 months
[libvirt] Bugs filed in the week for Upstream Qemu and Libvirt
by chandrashekar shastri
Hi,
Below are bugs filed in this week for Upstream qemu and libvirt:
Qemu in Launchpad:
https://bugs.launchpad.net/opensuse/+bug/1199416
Hot-add qcow2 [virtio-scsi] devices doesn't work in SlLES-11-SP2guest
Libvirt Bugs:
Bug 982224 - Attaching of the Virtio-scsi [qcow2] drives fails with
"error: internal error No more available PCI addresses"
Bug 982455 - RHEL Guest fails to boot after attaching 200+ scsi devices
[virtio-scsi qcow2]
Bug 980954 - Virtio-scsi drives in Windows7 shows yellow bang in device
manager though virtio scsi pass through driver is installed
Bug 982630 - Documentation : virsh attach-disk --help shouldbe updated
with proper examples for --type and --driver
Thanks,
Shastri
11 years, 4 months
[libvirt] [PATCH] Fix bridge routines detection on kFreeBSD
by Roman Bogorodskiy
In order to properly detect bridge related definitions such as
BRDGSFD, BRDGADD and BRDGDEL on kFreeBSD we need to include
<stdint.h>.
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=715321
Reported by Laurent Bigonville.
---
configure.ac | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/configure.ac b/configure.ac
index a6ad6a3..015d6c2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2405,7 +2405,8 @@ AC_CHECK_DECLS([BRDGSFD, BRDGADD, BRDGDEL],
[1],
[whether BSD style bridge management is available])],
[],
- [#include <net/if.h>
+ [#include <stdint.h>
+ #include <net/if.h>
#include <net/ethernet.h>
#include <net/if_bridgevar.h>
])
--
1.8.2.3
11 years, 4 months
[libvirt] [PATCH] qemu: fix double free in qemuMigrationPrepareDirect
by Ján Tomko
Remove assignment of the string freed by virURIFree
to hostname, since it's not used anywhere.
Double free introduced by ddf8ad8, useless code
introduced by f03dcc5.
https://bugzilla.redhat.com/show_bug.cgi?id=977961
---
src/qemu/qemu_migration.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
index f9fd64f..fc70f31 100644
--- a/src/qemu/qemu_migration.c
+++ b/src/qemu/qemu_migration.c
@@ -2572,8 +2572,6 @@ qemuMigrationPrepareDirect(virQEMUDriverPtr driver,
virReportError(VIR_ERR_INVALID_ARG, _("missing host in migration"
" URI: %s"), uri_in);
goto cleanup;
- } else {
- hostname = uri->server;
}
if (uri->port == 0) {
--
1.8.1.5
11 years, 4 months
[libvirt] [PATCH v2 00/37] Remove virReportOOMError from almost everywhere
by Michal Privoznik
Make VIR_ALLOC, virAsprintf and friend to report OOM error and subsequently
adapt the code.
Patches available at:
git://gitorious.org/~zippy2/libvirt/michal-staging.git
branch oom2
The first two patches need to be reviewed as they weren't ACKed in the first
run. Then, 36/37 met the same fate. I'm sending the rest for completeness.
Michal Privoznik (37):
viralloc: Report OOM error on failure
Introduce OOM reporting to virAsprintf
Adapt to VIR_ALLOC and virAsprintf in docs/
Adapt to VIR_ALLOC and virAsprintf in daemon/*
Adapt to VIR_ALLOC and virAsprintf in src/access/*
Adapt to VIR_ALLOC and virAsprintf in src/conf/*
Adapt to VIR_ALLOC and virAsprintf in src/cpu/*
Adapt to VIR_ALLOC and virAsprintf in src/esx/*
Adapt to VIR_ALLOC and virAsprintf in src/hyperv/*
Adapt to VIR_ALLOC and virAsprintf in src/interface/*
Adapt to VIR_ALLOC and virAsprintf in src/libxl/*
Adapt to VIR_ALLOC and virAsprintf in src/locking/*
Adapt to VIR_ALLOC and virAsprintf in src/lxc/*
Adapt to VIR_ALLOC and virAsprintf in src/node_device/*
Adapt to VIR_ALLOC and virAsprintf in src/network/*
Adapt to VIR_ALLOC and virAsprintf in src/nwfilter/*
Adapt to VIR_ALLOC and virAsprintf in src/openvz/*
Adapt to VIR_ALLOC and virAsprintf in src/parallels/*
Adapt to VIR_ALLOC and virAsprintf in src/phyp/*
Adapt to VIR_ALLOC and virAsprintf in src/qemu/*
Adapt to VIR_ALLOC and virAsprintf in src/remote/*
Adapt to VIR_ALLOC and virAsprintf in src/rpc/*
Adapt to VIR_ALLOC and virAsprintf in src/secret/*
Adapt to VIR_ALLOC and virAsprintf in src/security/*
Adapt to VIR_ALLOC and virAsprintf in src/storage/*
Adapt to VIR_ALLOC and virAsprintf in src/test/*
Adapt to VIR_ALLOC and virAsprintf in src/uml/*
Adapt to VIR_ALLOC and virAsprintf in src/util/*
Adapt to VIR_ALLOC and virAsprintf in src/vbox/*
Adapt to VIR_ALLOC and virAsprintf in src/vmware/*
Adapt to VIR_ALLOC and virAsprintf in src/vmx/*
Adapt to VIR_ALLOC and virAsprintf in src/xen/*
Adapt to VIR_ALLOC and virAsprintf in src/xenapi/*
Adapt to VIR_ALLOC and virAsprintf in src/xenxs/*
Adapt to VIR_ALLOC and virAsprintf in src/*
Adapt to VIR_ALLOC and virAsprintf in tests/*
Adapt to VIR_ALLOC and virAsprintf in tools/*
HACKING | 20 +-
cfg.mk | 2 +-
daemon/libvirtd-config.c | 12 +-
daemon/libvirtd.c | 24 +-
daemon/remote.c | 234 +++++---------------
daemon/stream.c | 4 +-
docs/hacking.html.in | 20 +-
po/POTFILES.in | 1 +
python/libvirt-override.c | 102 ++++-----
src/access/viraccessdriverpolkit.c | 4 +-
src/access/viraccessdriverstack.c | 4 +-
src/access/viraccessmanager.c | 4 +-
src/conf/cpu_conf.c | 34 +--
src/conf/domain_audit.c | 36 +--
src/conf/domain_conf.c | 334 +++++++++-------------------
src/conf/domain_event.c | 30 +--
src/conf/interface_conf.c | 35 +--
src/conf/netdev_bandwidth_conf.c | 12 +-
src/conf/netdev_vlan_conf.c | 4 +-
src/conf/netdev_vport_profile_conf.c | 4 +-
src/conf/network_conf.c | 120 +++-------
src/conf/node_device_conf.c | 29 +--
src/conf/nwfilter_conf.c | 33 +--
src/conf/nwfilter_ipaddrmap.c | 8 +-
src/conf/nwfilter_params.c | 35 +--
src/conf/secret_conf.c | 4 +-
src/conf/snapshot_conf.c | 47 ++--
src/conf/storage_conf.c | 38 +---
src/conf/storage_encryption_conf.c | 12 +-
src/conf/virchrdev.c | 14 +-
src/cpu/cpu.c | 4 +-
src/cpu/cpu_arm.c | 6 +-
src/cpu/cpu_generic.c | 12 +-
src/cpu/cpu_powerpc.c | 20 +-
src/cpu/cpu_s390.c | 4 +-
src/cpu/cpu_x86.c | 86 +++----
src/driver.c | 4 +-
src/esx/esx_driver.c | 62 ++----
src/esx/esx_network_driver.c | 16 +-
src/esx/esx_storage_backend_iscsi.c | 4 +-
src/esx/esx_storage_backend_vmfs.c | 72 ++----
src/esx/esx_util.c | 4 +-
src/esx/esx_vi.c | 50 ++---
src/esx/esx_vi.h | 3 +-
src/esx/esx_vi_types.c | 3 +-
src/fdstream.c | 4 +-
src/hyperv/hyperv_driver.c | 21 +-
src/hyperv/hyperv_util.c | 4 +-
src/hyperv/hyperv_wmi.c | 8 +-
src/interface/interface_backend_netcf.c | 27 +--
src/interface/interface_backend_udev.c | 33 +--
src/libvirt.c | 21 +-
src/libvirt_private.syms | 4 +-
src/libxl/libxl_conf.c | 18 +-
src/libxl/libxl_driver.c | 49 +---
src/locking/lock_daemon.c | 33 +--
src/locking/lock_daemon_config.c | 8 +-
src/locking/lock_driver_lockd.c | 23 +-
src/locking/lock_driver_sanlock.c | 28 +--
src/locking/lock_manager.c | 16 +-
src/lxc/lxc_cgroup.c | 4 +-
src/lxc/lxc_conf.c | 5 +-
src/lxc/lxc_container.c | 77 ++-----
src/lxc/lxc_controller.c | 47 +---
src/lxc/lxc_driver.c | 92 ++------
src/lxc/lxc_fuse.c | 12 +-
src/lxc/lxc_monitor.c | 4 +-
src/lxc/lxc_process.c | 30 +--
src/network/bridge_driver.c | 138 ++++--------
src/node_device/node_device_driver.c | 4 +-
src/node_device/node_device_udev.c | 18 +-
src/nodeinfo.c | 61 ++---
src/nwfilter/nwfilter_dhcpsnoop.c | 29 +--
src/nwfilter/nwfilter_driver.c | 13 +-
src/nwfilter/nwfilter_ebiptables_driver.c | 46 ++--
src/nwfilter/nwfilter_gentech_driver.c | 24 +-
src/nwfilter/nwfilter_learnipaddr.c | 12 +-
src/openvz/openvz_conf.c | 42 ++--
src/openvz/openvz_driver.c | 10 +-
src/parallels/parallels_driver.c | 65 ++----
src/parallels/parallels_network.c | 24 +-
src/parallels/parallels_storage.c | 50 ++---
src/parallels/parallels_utils.c | 4 +-
src/phyp/phyp_driver.c | 95 ++------
src/qemu/qemu_agent.c | 42 ++--
src/qemu/qemu_capabilities.c | 69 ++----
src/qemu/qemu_cgroup.c | 4 +-
src/qemu/qemu_command.c | 357 ++++++++++--------------------
src/qemu/qemu_conf.c | 88 +++-----
src/qemu/qemu_domain.c | 59 ++---
src/qemu/qemu_driver.c | 124 +++--------
src/qemu/qemu_hotplug.c | 84 ++-----
src/qemu/qemu_migration.c | 94 +++-----
src/qemu/qemu_monitor.c | 33 +--
src/qemu/qemu_monitor_json.c | 118 +++-------
src/qemu/qemu_monitor_text.c | 233 +++++--------------
src/qemu/qemu_process.c | 70 ++----
src/remote/remote_driver.c | 107 +++------
src/rpc/gendispatch.pl | 8 +-
src/rpc/virnetclient.c | 26 +--
src/rpc/virnetclientprogram.c | 12 +-
src/rpc/virnetclientstream.c | 4 +-
src/rpc/virnetmessage.c | 26 +--
src/rpc/virnetserver.c | 23 +-
src/rpc/virnetserverclient.c | 19 +-
src/rpc/virnetservermdns.c | 20 +-
src/rpc/virnetserverprogram.c | 8 +-
src/rpc/virnetserverservice.c | 12 +-
src/rpc/virnetsocket.c | 8 +-
src/rpc/virnetsshsession.c | 21 +-
src/rpc/virnettlscontext.c | 26 +--
src/secret/secret_driver.c | 55 ++---
src/security/security_apparmor.c | 25 +--
src/security/security_dac.c | 12 +-
src/security/security_manager.c | 12 +-
src/security/security_selinux.c | 45 ++--
src/security/security_stack.c | 8 +-
src/security/virt-aa-helper.c | 36 +--
src/storage/storage_backend.c | 35 +--
src/storage/storage_backend_disk.c | 17 +-
src/storage/storage_backend_fs.c | 31 +--
src/storage/storage_backend_iscsi.c | 27 +--
src/storage/storage_backend_logical.c | 48 +---
src/storage/storage_backend_mpath.c | 20 +-
src/storage/storage_backend_rbd.c | 18 +-
src/storage/storage_backend_scsi.c | 21 +-
src/storage/storage_backend_sheepdog.c | 4 +-
src/storage/storage_driver.c | 23 +-
src/test/test_driver.c | 91 +++-----
src/uml/uml_conf.c | 28 +--
src/uml/uml_driver.c | 36 +--
src/util/iohelper.c | 4 +-
src/util/viralloc.c | 166 ++++++++++++--
src/util/viralloc.h | 234 +++++++++++++++++---
src/util/virauth.c | 6 +-
src/util/virauthconfig.c | 16 +-
src/util/virbitmap.c | 5 +-
src/util/virbuffer.c | 8 +-
src/util/vircgroup.c | 11 +-
src/util/vircommand.c | 13 +-
src/util/virconf.c | 10 +-
src/util/virdnsmasq.c | 53 ++---
src/util/virerror.c | 6 +-
src/util/vireventpoll.c | 4 +-
src/util/virfile.c | 34 +--
src/util/virhash.c | 11 +-
src/util/viridentity.c | 4 +-
src/util/virinitctl.c | 4 +-
src/util/viriptables.c | 11 +-
src/util/virkeyfile.c | 4 +-
src/util/virlockspace.c | 37 +---
src/util/virlog.c | 28 +--
src/util/virnetdev.c | 45 +---
src/util/virnetdevbandwidth.c | 21 +-
src/util/virnetdevbridge.c | 8 +-
src/util/virnetdevmacvlan.c | 6 +-
src/util/virnetdevopenvswitch.c | 18 +-
src/util/virnetdevtap.c | 8 +-
src/util/virnetdevveth.c | 8 +-
src/util/virnetdevvlan.c | 4 +-
src/util/virnetdevvportprofile.c | 4 +-
src/util/virnetlink.c | 8 +-
src/util/virobject.c | 8 +-
src/util/virpci.c | 94 ++------
src/util/virportallocator.c | 1 -
src/util/virprocess.c | 17 +-
src/util/virrandom.c | 9 +-
src/util/virscsi.c | 28 +--
src/util/virsexpr.c | 4 +-
src/util/virsocketaddr.c | 6 +-
src/util/virstoragefile.c | 32 +--
src/util/virstring.c | 44 ++--
src/util/virstring.h | 67 +++++-
src/util/virsysinfo.c | 22 +-
src/util/virthreadpool.c | 21 +-
src/util/virthreadpthread.c | 2 +-
src/util/virtime.c | 8 +-
src/util/virtpm.c | 4 +-
src/util/virtypedparam.c | 68 ++----
src/util/viruri.c | 12 +-
src/util/virusb.c | 13 +-
src/util/virutil.c | 107 +++------
src/util/virxml.c | 1 -
src/vbox/vbox_MSCOMGlue.c | 8 +-
src/vbox/vbox_XPCOMCGlue.c | 4 +-
src/vbox/vbox_tmpl.c | 126 +++--------
src/vmware/vmware_conf.c | 33 +--
src/vmware/vmware_driver.c | 4 +-
src/vmx/vmx.c | 88 ++------
src/xen/block_stats.c | 8 +-
src/xen/xen_driver.c | 42 +---
src/xen/xen_hypervisor.c | 18 +-
src/xen/xen_inotify.c | 4 +-
src/xen/xend_internal.c | 38 +---
src/xen/xm_internal.c | 24 +-
src/xen/xs_internal.c | 24 +-
src/xenapi/xenapi_driver.c | 20 +-
src/xenapi/xenapi_utils.c | 13 +-
src/xenxs/xen_sxpr.c | 112 ++++------
src/xenxs/xen_xm.c | 204 ++++++++---------
tests/commandhelper.c | 3 +-
tests/commandtest.c | 8 +-
tests/domainsnapshotxml2xmltest.c | 2 +
tests/fchosttest.c | 2 +
tests/interfacexml2xmltest.c | 2 +
tests/libvirtdconftest.c | 4 +-
tests/lxcxml2xmltest.c | 2 +
tests/networkxml2conftest.c | 2 +
tests/networkxml2xmltest.c | 2 +
tests/nodedevxml2xmltest.c | 2 +
tests/nodeinfotest.c | 2 +
tests/nwfilterxml2xmltest.c | 2 +
tests/qemuargv2xmltest.c | 2 +
tests/qemuhelptest.c | 2 +
tests/qemumonitortestutils.c | 17 +-
tests/qemuxml2xmltest.c | 2 +
tests/securityselinuxlabeltest.c | 24 +-
tests/securityselinuxtest.c | 8 +-
tests/sexpr2xmltest.c | 2 +
tests/storagepoolxml2xmltest.c | 2 +
tests/storagevolxml2argvtest.c | 2 +
tests/storagevolxml2xmltest.c | 2 +
tests/sysinfotest.c | 2 +
tests/test_conf.c | 2 +-
tests/testutils.c | 2 +-
tests/virbuftest.c | 2 +
tests/virhashtest.c | 4 +-
tests/virnetmessagetest.c | 20 +-
tests/virshtest.c | 2 +
tests/virstoragetest.c | 5 +-
tests/xencapstest.c | 2 +
tests/xmconfigtest.c | 2 +
tests/xml2sexprtest.c | 2 +
tools/console.c | 6 +-
tools/virsh-domain-monitor.c | 4 +-
tools/virsh-domain.c | 28 +--
tools/virsh.c | 1 -
tools/virt-host-validate-common.c | 2 +
238 files changed, 2444 insertions(+), 4975 deletions(-)
--
1.8.1.5
11 years, 4 months
[libvirt] [PATCH] RFC: Introduce new domain create APIs to pass pre-opened FDs to LXC
by Daniel P. Berrange
From: "Daniel P. Berrange" <berrange(a)redhat.com>
With container based virt, it is useful to be able to pass
pre-opened file descriptors to the container init process.
This allows for containers to be auto-activated from incoming
socket connections, passing the active socket into the container.
To do this, introduce a pair of new APIs, virDomainCreateXMLWithFiles
and virDomainCreateWithFiles, which accept an array of file
descriptors. For the LXC driver, UNIX file descriptor passing
will be used to send them to libvirtd, which will them pass
them down to libvirt_lxc, which will then pass them to the container
init process.
This will only be implemented for LXC right now, but the design
is generic enough it could work with other hypervisors, hence
I suggest adding this to libvirt.so, rather than libvirt-lxc.so
Signed-off-by: Daniel P. Berrange <berrange(a)redhat.com>
---
include/libvirt/libvirt.h.in | 10 +++
src/driver.h | 13 ++++
src/libvirt.c | 150 +++++++++++++++++++++++++++++++++++++++++++
src/libvirt_public.syms | 6 ++
4 files changed, 179 insertions(+)
diff --git a/include/libvirt/libvirt.h.in b/include/libvirt/libvirt.h.in
index b87255a..150a231 100644
--- a/include/libvirt/libvirt.h.in
+++ b/include/libvirt/libvirt.h.in
@@ -1575,6 +1575,11 @@ virConnectPtr virDomainGetConnect (virDomainPtr domain);
virDomainPtr virDomainCreateXML (virConnectPtr conn,
const char *xmlDesc,
unsigned int flags);
+virDomainPtr virDomainCreateXMLWithFiles(virConnectPtr conn,
+ const char *xmlDesc,
+ unsigned int nfiles,
+ int *files,
+ unsigned int flags);
virDomainPtr virDomainLookupByName (virConnectPtr conn,
const char *name);
virDomainPtr virDomainLookupByID (virConnectPtr conn,
@@ -2175,6 +2180,11 @@ int virDomainCreate (virDomainPtr domain);
int virDomainCreateWithFlags (virDomainPtr domain,
unsigned int flags);
+int virDomainCreateWithFiles (virDomainPtr domain,
+ unsigned int nfiles,
+ int *files,
+ unsigned int flags);
+
int virDomainGetAutostart (virDomainPtr domain,
int *autostart);
int virDomainSetAutostart (virDomainPtr domain,
diff --git a/src/driver.h b/src/driver.h
index 31851cb..f4f5873 100644
--- a/src/driver.h
+++ b/src/driver.h
@@ -136,6 +136,12 @@ typedef virDomainPtr
(*virDrvDomainCreateXML)(virConnectPtr conn,
const char *xmlDesc,
unsigned int flags);
+typedef virDomainPtr
+(*virDrvDomainCreateXMLWithFiles)(virConnectPtr conn,
+ const char *xmlDesc,
+ unsigned int nfiles,
+ int *files,
+ unsigned int flags);
typedef virDomainPtr
(*virDrvDomainLookupByID)(virConnectPtr conn,
@@ -334,6 +340,11 @@ typedef int
typedef int
(*virDrvDomainCreateWithFlags)(virDomainPtr dom,
unsigned int flags);
+typedef int
+(*virDrvDomainCreateWithFiles)(virDomainPtr dom,
+ unsigned int nfiles,
+ int *files,
+ unsigned int flags);
typedef virDomainPtr
(*virDrvDomainDefineXML)(virConnectPtr conn,
@@ -1139,6 +1150,7 @@ struct _virDriver {
virDrvConnectNumOfDomains connectNumOfDomains;
virDrvConnectListAllDomains connectListAllDomains;
virDrvDomainCreateXML domainCreateXML;
+ virDrvDomainCreateXMLWithFiles domainCreateXMLWithFiles;
virDrvDomainLookupByID domainLookupByID;
virDrvDomainLookupByUUID domainLookupByUUID;
virDrvDomainLookupByName domainLookupByName;
@@ -1195,6 +1207,7 @@ struct _virDriver {
virDrvConnectNumOfDefinedDomains connectNumOfDefinedDomains;
virDrvDomainCreate domainCreate;
virDrvDomainCreateWithFlags domainCreateWithFlags;
+ virDrvDomainCreateWithFiles domainCreateWithFiles;
virDrvDomainDefineXML domainDefineXML;
virDrvDomainUndefine domainUndefine;
virDrvDomainUndefineFlags domainUndefineFlags;
diff --git a/src/libvirt.c b/src/libvirt.c
index 8e19c64..a673981 100644
--- a/src/libvirt.c
+++ b/src/libvirt.c
@@ -2005,6 +2005,77 @@ error:
}
/**
+ * virDomainCreateXMLWithFiles:
+ * @conn: pointer to the hypervisor connection
+ * @xmlDesc: string containing an XML description of the domain
+ * @nfiles: number of file descriptors passed
+ * @files: list of file descriptors passed
+ * @flags: bitwise-OR of supported virDomainCreateFlags
+ *
+ * Launch a new guest domain, based on an XML description similar
+ * to the one returned by virDomainGetXMLDesc()
+ * This function may require privileged access to the hypervisor.
+ * The domain is not persistent, so its definition will disappear when it
+ * is destroyed, or if the host is restarted (see virDomainDefineXML() to
+ * define persistent domains).
+ *
+ * @files provides an array of file descriptors which will be
+ * made available to the 'init' process of the guest. This is
+ * only supported for guests which use container based virtualization
+ * technology.
+ *
+ * If the VIR_DOMAIN_START_PAUSED flag is set, the guest domain
+ * will be started, but its CPUs will remain paused. The CPUs
+ * can later be manually started using virDomainResume.
+ *
+ * If the VIR_DOMAIN_START_AUTODESTROY flag is set, the guest
+ * domain will be automatically destroyed when the virConnectPtr
+ * object is finally released. This will also happen if the
+ * client application crashes / loses its connection to the
+ * libvirtd daemon. Any domains marked for auto destroy will
+ * block attempts at migration, save-to-file, or snapshots.
+ *
+ * Returns a new domain object or NULL in case of failure
+ */
+virDomainPtr
+virDomainCreateXMLWithFiles(virConnectPtr conn, const char *xmlDesc,
+ unsigned int nfiles,
+ int *files,
+ unsigned int flags)
+{
+ VIR_DEBUG("conn=%p, xmlDesc=%s, nfiles=%u, files=%p, flags=%x",
+ conn, xmlDesc, nfiles, files, flags);
+
+ virResetLastError();
+
+ if (!VIR_IS_CONNECT(conn)) {
+ virLibConnError(VIR_ERR_INVALID_CONN, __FUNCTION__);
+ virDispatchError(NULL);
+ return NULL;
+ }
+ virCheckNonNullArgGoto(xmlDesc, error);
+ if (conn->flags & VIR_CONNECT_RO) {
+ virLibConnError(VIR_ERR_OPERATION_DENIED, __FUNCTION__);
+ goto error;
+ }
+
+ if (conn->driver->domainCreateXMLWithFiles) {
+ virDomainPtr ret;
+ ret = conn->driver->domainCreateXMLWithFiles(conn, xmlDesc,
+ nfiles, files,
+ flags);
+ if (!ret)
+ goto error;
+ return ret;
+ }
+
+ virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
+error:
+ virDispatchError(conn);
+ return NULL;
+}
+
+/**
* virDomainCreateLinux:
* @conn: pointer to the hypervisor connection
* @xmlDesc: string containing an XML description of the domain
@@ -9362,6 +9433,85 @@ error:
}
/**
+ * virDomainCreateWithFiles:
+ * @domain: pointer to a defined domain
+ * @nfiles: number of file descriptors passed
+ * @files: list of file descriptors passed
+ * @flags: bitwise-OR of supported virDomainCreateFlags
+ *
+ * Launch a defined domain. If the call succeeds the domain moves from the
+ * defined to the running domains pools.
+ *
+ * @files provides an array of file descriptors which will be
+ * made available to the 'init' process of the guest. This is
+ * only supported for guests which use container based virtualization
+ * technology.
+ *
+ * If the VIR_DOMAIN_START_PAUSED flag is set, or if the guest domain
+ * has a managed save image that requested paused state (see
+ * virDomainManagedSave()) the guest domain will be started, but its
+ * CPUs will remain paused. The CPUs can later be manually started
+ * using virDomainResume(). In all other cases, the guest domain will
+ * be running.
+ *
+ * If the VIR_DOMAIN_START_AUTODESTROY flag is set, the guest
+ * domain will be automatically destroyed when the virConnectPtr
+ * object is finally released. This will also happen if the
+ * client application crashes / loses its connection to the
+ * libvirtd daemon. Any domains marked for auto destroy will
+ * block attempts at migration, save-to-file, or snapshots.
+ *
+ * If the VIR_DOMAIN_START_BYPASS_CACHE flag is set, and there is a
+ * managed save file for this domain (created by virDomainManagedSave()),
+ * then libvirt will attempt to bypass the file system cache while restoring
+ * the file, or fail if it cannot do so for the given system; this can allow
+ * less pressure on file system cache, but also risks slowing loads from NFS.
+ *
+ * If the VIR_DOMAIN_START_FORCE_BOOT flag is set, then any managed save
+ * file for this domain is discarded, and the domain boots from scratch.
+ *
+ * Returns 0 in case of success, -1 in case of error
+ */
+int
+virDomainCreateWithFiles(virDomainPtr domain, unsigned int nfiles,
+ int *files, unsigned int flags)
+{
+ virConnectPtr conn;
+
+ VIR_DOMAIN_DEBUG(domain, "nfiles=%u, files=%p, flags=%x",
+ nfiles, files, flags);
+
+ virResetLastError();
+
+ if (!VIR_IS_CONNECTED_DOMAIN(domain)) {
+ virLibDomainError(VIR_ERR_INVALID_DOMAIN, __FUNCTION__);
+ virDispatchError(NULL);
+ return -1;
+ }
+ conn = domain->conn;
+ if (conn->flags & VIR_CONNECT_RO) {
+ virLibDomainError(VIR_ERR_OPERATION_DENIED, __FUNCTION__);
+ goto error;
+ }
+
+ if (conn->driver->domainCreateWithFiles) {
+ int ret;
+ ret = conn->driver->domainCreateWithFiles(domain,
+ nfiles, files,
+ flags);
+ if (ret < 0)
+ goto error;
+ return ret;
+ }
+
+ virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
+
+error:
+ virDispatchError(domain->conn);
+ return -1;
+}
+
+/**
* virDomainGetAutostart:
* @domain: a domain object
* @autostart: the value returned
diff --git a/src/libvirt_public.syms b/src/libvirt_public.syms
index 7c6edf6..20ac87f 100644
--- a/src/libvirt_public.syms
+++ b/src/libvirt_public.syms
@@ -627,4 +627,10 @@ LIBVIRT_1.1.0 {
virDomainMigrateToURI3;
} LIBVIRT_1.0.6;
+LIBVIRT_1.1.1 {
+ global:
+ virDomainCreateWithFiles;
+ virDomainCreateXMLWithFiles;
+} LIBVIRT_1.1.0;
+
# .... define new API here using predicted next version number ....
--
1.8.1.4
11 years, 4 months
[libvirt] [PATCH v2 0/3] libxl: implement some chuncks of the NUMA interface
by Dario Faggioli
Hi everyone,
This is take 2 of the series about introducing (some) NUMA support for the
libxl driver.
What was patch 2 in v1 has been already applied and so it's no longer part of
the series. I think I addressed all the comments raised during v1 review (more
details in the individual changelogs).
Further comments are as usual welcome.
Thanks and Regards,
Dario
---
Dario Faggioli (3):
libxl: implement NUMA capabilities reporting
libxl: advertise the support for VIR_TYPED_PARAM_STRING
libxl: implement virDomainGetNumaParameters
src/libxl/libxl_conf.c | 141 ++++++++++++++++++++++++++++++++++++++++
src/libxl/libxl_driver.c | 161 ++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 300 insertions(+), 2 deletions(-)
--
<<This happens because I choose it to happen!>> (Raistlin Majere)
-----------------------------------------------------------------
Dario Faggioli, Ph.D, http://about.me/dario.faggioli
Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK)
11 years, 4 months