]> xenbits.xensource.com Git - libvirt.git/log
libvirt.git
11 years agoqemu: add macvlan delete to qemuDomainAttachNetDevice cleanup
Matthew Rosato [Mon, 1 Jul 2013 15:04:57 +0000 (17:04 +0200)]
qemu: add macvlan delete to qemuDomainAttachNetDevice cleanup

If an error occurs during qemuDomainAttachNetDevice after the macvtap
was created in qemuPhysIfaceConnect, the macvtap device gets left behind.
This patch adds code to the cleanup routine to delete the macvtap.

Signed-off-by: Matthew Rosato <mjrosato@linux.vnet.ibm.com>
Reviewed-by: Viktor Mihajlovski <mihajlov@linux.vnet.ibm.com>
11 years agopci: make virPCIDeviceReset more autonomous
Laine Stump [Sat, 29 Jun 2013 02:35:21 +0000 (22:35 -0400)]
pci: make virPCIDeviceReset more autonomous

I recently patches the callers to virPCIDeviceReset() to not call it
if the current driver for a device was vfio-pci (since that driver
will always reset the device itself when appropriate. At the time, Dan
Berrange suggested that I could instead modify virPCIDeviceReset
to check the currently bound driver for the device, and decide
for itself whether or not to go ahead with the reset.

This patch removes the previously added checks, and replaces them with
a check down in virPCIDeviceReset(), as suggested.

The functional difference here is that previously we were deciding
based on either the hostdev configuration or the value of
stubDriverName in the virPCIDevice object, but now we are actually
comparing to the "driver" link in the device's sysfs entry
directly. In practice, both should be the same.

11 years agopci: reorder static functions
Laine Stump [Mon, 1 Jul 2013 03:51:00 +0000 (23:51 -0400)]
pci: reorder static functions

virPCIDeviceGetDriverPathAndName is a static function that will need
to be called by another function that occurs above it in the
file. This patch reorders the static functions so that a forward
declaration isn't needed.

11 years agoqemuBuildChrDeviceCommandLine: Don't leak devstr
Michal Privoznik [Fri, 12 Jul 2013 17:18:29 +0000 (19:18 +0200)]
qemuBuildChrDeviceCommandLine: Don't leak devstr

It's caller's responsibility to free return value of
qemuBuildChrDeviceStr().

11 years agopython: return dictionary without value in case of no blockjob
Guannan Ren [Fri, 17 May 2013 06:30:10 +0000 (14:30 +0800)]
python: return dictionary without value in case of no blockjob

Currently, when there is no blockjob, dom.blockJobInfo('vda')
still reports error because it doesn't distinguish return value 0 from -1.
libvirt.libvirtError: virDomainGetBlockJobInfo() failed

virDomainGetBlockJobInfo() API return value:
 -1 in case of failure, 0 when nothing found, 1 found.

And use PyDict_SetItemString instead of PyDict_SetItem when key is
of string type. PyDict_SetItemString increments key/value reference
count, so call Py_DECREF() for value. For key, we don't need to
do this, because PyDict_SetItemString will handle it internally.

11 years agoconf: reject pci-root controllers with non-zero indexes
Ján Tomko [Fri, 12 Jul 2013 13:05:51 +0000 (15:05 +0200)]
conf: reject pci-root controllers with non-zero indexes

https://bugzilla.redhat.com/show_bug.cgi?id=981261

11 years agoChange domain controller index type to unsigned
Jincheng Miao [Fri, 12 Jul 2013 12:17:23 +0000 (14:17 +0200)]
Change domain controller index type to unsigned

Error out on negative index values.

https://bugzilla.redhat.com/show_bug.cgi?id=981261

11 years agovirsh: Mention --driver in man page for nodedev-detach
Peter Krempa [Fri, 12 Jul 2013 09:32:51 +0000 (11:32 +0200)]
virsh: Mention --driver in man page for nodedev-detach

https://bugzilla.redhat.com/show_bug.cgi?id=982987

Commit d923f6c8 introduced the --driver option but didn't document it in
the man page. The docs are borrowed from the public API documentation.

11 years agoAdd a couple of debug statements to LXC driver
Daniel P. Berrange [Fri, 12 Jul 2013 10:04:55 +0000 (11:04 +0100)]
Add a couple of debug statements to LXC driver

When failing to start a container due to inaccessible root
filesystem path, we did not log any meaningful error. Add a
few debug statements to assist diagnosis

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
11 years agoqemu: Introduce qemuBuildChrDeviceStr
Michal Privoznik [Wed, 13 Mar 2013 15:20:34 +0000 (16:20 +0100)]
qemu: Introduce qemuBuildChrDeviceStr

The function being introduced is responsible for creating command
line argument for '-device' for given character device. Based on
the chardev type, it calls appropriate qemuBuild.*ChrDeviceStr(),
e.g.  qemuBuildSerialChrDeviceStr() for serial chardev and so on.

11 years agoqemu_command: Honour chardev alias assignment with a function
Michal Privoznik [Wed, 13 Mar 2013 08:41:33 +0000 (09:41 +0100)]
qemu_command: Honour chardev alias assignment with a function

The chardev alias assignment is going to be needed in a separate
places, so it should be moved into a separate function rather
than copying code randomly around.

11 years agoqemu_monitor: Introduce qemuMonitorDetachCharDev
Michal Privoznik [Tue, 12 Mar 2013 18:57:48 +0000 (19:57 +0100)]
qemu_monitor: Introduce qemuMonitorDetachCharDev

This function wraps 'chardev-remove' qemu monitor command around.
It takes chardev alias as its single argument besides qemu monitor
pointer.

11 years agoqemu_monitor: Introduce qemuMonitorAttachCharDev
Michal Privoznik [Tue, 12 Mar 2013 18:48:04 +0000 (19:48 +0100)]
qemu_monitor: Introduce qemuMonitorAttachCharDev

The function being introduced is responsible for preparing and
executing 'chardev-add' qemu monitor command. Moreover, in case
of PTY chardev, the corresponding pty path is updated.

11 years agoqemu_monitor_json: Move InetSocketAddress build to a separate function
Michal Privoznik [Tue, 12 Mar 2013 18:18:22 +0000 (19:18 +0100)]
qemu_monitor_json: Move InetSocketAddress build to a separate function

Currently, we are building InetSocketAddress qemu json type
within the qemuMonitorJSONNBDServerStart function. However, other
future functions may profit from the code as well. So it should
be moved into a static function.

11 years agodomain_conf: Introduce chardev hotplug helpers
Michal Privoznik [Tue, 12 Mar 2013 14:55:07 +0000 (15:55 +0100)]
domain_conf: Introduce chardev hotplug helpers

For now, only these three helpers are needed:
virDomainChrFind - to find a duplicate chardev within VM def
virDomainChrInsert - wrapper for inserting a new chardev into VM def
virDomainChrRemove - wrapper for removing chardev from VM def

There is, however, one internal helper as well:
virDomainChrGetDomainPtrs which sets given pointers to one of
vmdef->{parallels,serials,consoles,channels} based on passed
chardev type.

11 years agoremote: Improve libssh2 password authentication
Peter Krempa [Tue, 9 Jul 2013 14:46:32 +0000 (16:46 +0200)]
remote: Improve libssh2 password authentication

This patch enables the password authentication in the libssh2 connection
driver. There are a few benefits to this step:

1) Hosts with challenge response authentication will now be supported
with the libssh2 connection driver.

2) Credential for hosts can now be stored in the authentication
credential config file

11 years agolibssh2: Improve password based authentication
Peter Krempa [Tue, 9 Jul 2013 14:34:38 +0000 (16:34 +0200)]
libssh2: Improve password based authentication

The password authentication method wasn't used as there wasn't a
pleasant way to pass the password. This patch adds the option to use
virAuth util functions to request the password either from a config file
or uses the conf callback to request it from the user.

11 years agovirAuth: Don't require virConnectPtr to retrieve authentication creds
Peter Krempa [Tue, 9 Jul 2013 14:14:45 +0000 (16:14 +0200)]
virAuth: Don't require virConnectPtr to retrieve authentication creds

Previously a connection object was required to retrieve the auth
credentials. This patch adds the option to call the retrieval functions
only using the connection URI or path to the configuration file. This
will allow to use this toolkit to request passwords for ssh
authentication in the libssh2 connection driver.

Changes:
*virAuthGetConfigFilePathURI(): use URI to retrieve the config file path
*virAuthGetCredential(): Remove the need to propagate conn object

virAuthGetPasswordPath():
*virAuthGetUsernamePath(): New functions, that use config file path
                           instead of conn object

11 years agonodeinfo: Don't fail on non-contiguous NUMA topologies
hejia hejia [Mon, 8 Jul 2013 14:03:05 +0000 (22:03 +0800)]
nodeinfo: Don't fail on non-contiguous NUMA topologies

nodeGetFreeMemory and nodeGetCellsFreeMemory assumed that the NUMA nodes
are contiguous and starting from 0. Unfortunately there are machines
that don't match this assumption:

available: 1 nodes (1)
node 1 cpus: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
node 1 size: 16340 MB
node 1 free: 11065 MB

Before this patch:
error: internal error Failed to query NUMA free memory
error: internal error Failed to query NUMA free memory for node: 0

After this patch:
Total: 15772580 KiB
0: 0 KiB

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
11 years agoutil: make virSetUIDGID async-signal-safe
Eric Blake [Wed, 22 May 2013 02:59:10 +0000 (20:59 -0600)]
util: make virSetUIDGID async-signal-safe

https://bugzilla.redhat.com/show_bug.cgi?id=964358

POSIX states that multi-threaded apps should not use functions
that are not async-signal-safe between fork and exec, yet we
were using getpwuid_r and initgroups.  Although rare, it is
possible to hit deadlock in the child, when it tries to grab
a mutex that was already held by another thread in the parent.
I actually hit this deadlock when testing multiple domains
being started in parallel with a command hook, with the following
backtrace in the child:

 Thread 1 (Thread 0x7fd56bbf2700 (LWP 3212)):
 #0  __lll_lock_wait ()
     at ../nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S:136
 #1  0x00007fd5761e7388 in _L_lock_854 () from /lib64/libpthread.so.0
 #2  0x00007fd5761e7257 in __pthread_mutex_lock (mutex=0x7fd56be00360)
     at pthread_mutex_lock.c:61
 #3  0x00007fd56bbf9fc5 in _nss_files_getpwuid_r (uid=0, result=0x7fd56bbf0c70,
     buffer=0x7fd55c2a65f0 "", buflen=1024, errnop=0x7fd56bbf25b8)
     at nss_files/files-pwd.c:40
 #4  0x00007fd575aeff1d in __getpwuid_r (uid=0, resbuf=0x7fd56bbf0c70,
     buffer=0x7fd55c2a65f0 "", buflen=1024, result=0x7fd56bbf0cb0)
     at ../nss/getXXbyYY_r.c:253
 #5  0x00007fd578aebafc in virSetUIDGID (uid=0, gid=0) at util/virutil.c:1031
 #6  0x00007fd578aebf43 in virSetUIDGIDWithCaps (uid=0, gid=0, capBits=0,
     clearExistingCaps=true) at util/virutil.c:1388
 #7  0x00007fd578a9a20b in virExec (cmd=0x7fd55c231f10) at util/vircommand.c:654
 #8  0x00007fd578a9dfa2 in virCommandRunAsync (cmd=0x7fd55c231f10, pid=0x0)
     at util/vircommand.c:2247
 #9  0x00007fd578a9d74e in virCommandRun (cmd=0x7fd55c231f10, exitstatus=0x0)
     at util/vircommand.c:2100
 #10 0x00007fd56326fde5 in qemuProcessStart (conn=0x7fd53c000df0,
     driver=0x7fd55c0dc4f0, vm=0x7fd54800b100, migrateFrom=0x0, stdin_fd=-1,
     stdin_path=0x0, snapshot=0x0, vmop=VIR_NETDEV_VPORT_PROFILE_OP_CREATE,
     flags=1) at qemu/qemu_process.c:3694
 ...

The solution is to split the work of getpwuid_r/initgroups into the
unsafe portions (getgrouplist, called pre-fork) and safe portions
(setgroups, called post-fork).

* src/util/virutil.h (virSetUIDGID, virSetUIDGIDWithCaps): Adjust
signature.
* src/util/virutil.c (virSetUIDGID): Add parameters.
(virSetUIDGIDWithCaps): Adjust clients.
* src/util/vircommand.c (virExec): Likewise.
* src/util/virfile.c (virFileAccessibleAs, virFileOpenForked)
(virDirCreate): Likewise.
* src/security/security_dac.c (virSecurityDACSetProcessLabel):
Likewise.
* src/lxc/lxc_container.c (lxcContainerSetID): Likewise.
* configure.ac (AC_CHECK_FUNCS_ONCE): Check for setgroups, not
initgroups.

Signed-off-by: Eric Blake <eblake@redhat.com>
11 years agoutil: add virGetGroupList
Eric Blake [Tue, 21 May 2013 23:47:48 +0000 (17:47 -0600)]
util: add virGetGroupList

Since neither getpwuid_r() nor initgroups() are safe to call in
between fork and exec (they obtain a mutex, but if some other
thread in the parent also held the mutex at the time of the fork,
the child will deadlock), we have to split out the functionality
that is unsafe.  At least glibc's initgroups() uses getgrouplist
under the hood, so the ideal split is to expose getgrouplist for
use before a fork.  Gnulib already gives us a nice wrapper via
mgetgroups; we wrap it once more to look up by uid instead of name.

* bootstrap.conf (gnulib_modules): Add mgetgroups.
* src/util/virutil.h (virGetGroupList): New declaration.
* src/util/virutil.c (virGetGroupList): New function.
* src/libvirt_private.syms (virutil.h): Export it.

Signed-off-by: Eric Blake <eblake@redhat.com>
11 years agoutil: improve user lookup helper
Eric Blake [Tue, 9 Jul 2013 23:57:48 +0000 (17:57 -0600)]
util: improve user lookup helper

A future patch needs to look up pw_gid; but it is wasteful
to crawl through getpwuid_r twice for two separate pieces
of information, and annoying to copy that much boilerplate
code for doing the crawl.  The current internal-only
virGetUserEnt is also a rather awkward interface; it's easier
to just design it to let callers request multiple pieces of
data as needed from one traversal.

And while at it, I noticed that virGetXDGDirectory could deref
NULL if the getpwuid_r lookup fails.

* src/util/virutil.c (virGetUserEnt): Alter signature.
(virGetUserDirectory, virGetXDGDirectory, virGetUserName): Adjust
callers.

Signed-off-by: Eric Blake <eblake@redhat.com>
11 years agoqemu_hostdev: Resolve Coverity issue
John Ferlan [Thu, 11 Jul 2013 14:42:30 +0000 (10:42 -0400)]
qemu_hostdev: Resolve Coverity issue

Recent changes uncovered a possibility that 'last_processed_hostdev_vf'
was set to -1 in 'qemuPrepareHostdevPCIDevices' and would cause problems
in for loop end condition in the 'resetvfnetconfig' label if the
variable was never set to 'i' due to 'qemuDomainHostdevNetConfigReplace'
failure.

11 years agostorage_backend: Resolve Coverity issue
John Ferlan [Thu, 11 Jul 2013 14:39:23 +0000 (10:39 -0400)]
storage_backend: Resolve Coverity issue

The switch statement in 'virStorageBackendCreateQemuImgOpts' used the
for loop end condition 'VIR_STORAGE_FILE_FEATURE_LAST' as a possible value,
but since that cannot happen Coverity spits out a DEADCODE message. Adding
the Coverity tag just removes the Coverity message

11 years agovirsh-nodedev: Resolve Coverity issues
John Ferlan [Thu, 11 Jul 2013 14:33:29 +0000 (10:33 -0400)]
virsh-nodedev: Resolve Coverity issues

Recent changes uncovered FORWARD_NULL and NEGATIVE_RETURNS problems with
the processing of the 'ndevices' and its associated allocated arrays in
'vshNodeDeviceListCollect' due to the possibility of returning -1 in a
call and using the returned value as a for loop index end condition.

11 years agovirsh-interface: Resolve Coverity issues
John Ferlan [Thu, 11 Jul 2013 14:31:15 +0000 (10:31 -0400)]
virsh-interface: Resolve Coverity issues

Recent changes uncovered FORWARD_NULL and NEGATIVE_RETURNS problems with
the processing of the 'nActiveIfaces' and 'nInactiveIfaces' and their
associated allocated arrays in 'vshInterfaceListCollect' due to the
possibility of returning -1 in a call and using the return value as a
for loop index end condition.

11 years agovirsh-domain-monitor: Resolve Coverity issues
John Ferlan [Thu, 11 Jul 2013 14:28:44 +0000 (10:28 -0400)]
virsh-domain-monitor: Resolve Coverity issues

Recent changes uncovered a pair of NEGATIVE_RETURNS when processing the
'nnames' in 'vshDomainListCollect' in the for loop due to possible -1 value.

11 years agotestutils: Resolve Coverity issues
John Ferlan [Thu, 11 Jul 2013 11:22:20 +0000 (07:22 -0400)]
testutils: Resolve Coverity issues

Recent changes uncovered a NEGATIVE_RETURNS in the return from sysconf()
when processing a for loop in virtTestCaptureProgramExecChild() in
testutils.c

Code review uncovered 3 other code paths with the same condition that
weren't found by Covirity, so fixed those as well.

11 years agohellolibvirt: Resolve Coverity issues
John Ferlan [Thu, 11 Jul 2013 11:19:37 +0000 (07:19 -0400)]
hellolibvirt: Resolve Coverity issues

Recent changes uncovered a NEGATIVE_RETURNS when processing 'numNames'
in 'showDomains' in the for loop after a possible -1 return.

11 years agomaint: update to latest gnulib
Eric Blake [Thu, 11 Jul 2013 11:07:16 +0000 (05:07 -0600)]
maint: update to latest gnulib

Future patches need LGPLv2+ versions of some modules that had
recent license changes; but separating the gnulib update from
the actual use of the modules makes it easier to backport to
an older version while avoiding a submodule update (assuming,
of course, that the backport is to a system where glibc provides
adequate functionaliy without needing the gnulib module).

* .gnulib: Update to latest, for modules needed in later patches.

Signed-off-by: Eric Blake <eblake@redhat.com>
11 years agoqemu: Fix hot (un-)plug error codes and messages
Michal Privoznik [Thu, 11 Jul 2013 11:24:20 +0000 (13:24 +0200)]
qemu: Fix hot (un-)plug error codes and messages

With current code, error reporting for unsupported devices for hot plug,
unplug and update is total mess. The VIR_ERR_CONFIG_UNSUPPORTED error
code is reported instead of VIR_ERR_OPERATION_UNSUPPORTED. Moreover, the
error messages are not helping to find the root cause (lack of
implementation).

11 years agoconf: Rework virDomainDeviceDefParse
Michal Privoznik [Thu, 11 Jul 2013 10:18:36 +0000 (12:18 +0200)]
conf: Rework virDomainDeviceDefParse

When adding a new domain device, it is fairly easy to forget to add
corresponding piece into virDomainDeviceDefParse. However, if the
internal structure is changed to one bit switch() the compiler will warn
about not handled enum item.

11 years agoconf: Extend device types handled by virDomainDeviceDefParse
Michal Privoznik [Thu, 11 Jul 2013 09:20:34 +0000 (11:20 +0200)]
conf: Extend device types handled by virDomainDeviceDefParse

Not all device types are currently parsed in virDomainDeviceDefParse,
Since all needed functions do exist, nothing holds us back to make the
implementation complete. Similarly, the virDomainDeviceDefFree needs to
be updated as well.

11 years agoLXC: remove some incorrect setting ATTRIBUTE_UNUSED
Gao feng [Thu, 11 Jul 2013 06:05:20 +0000 (14:05 +0800)]
LXC: remove some incorrect setting ATTRIBUTE_UNUSED

these parameters shouldn't be marked as ATTRIBUTE_UNUSED.

Signed-off-by: Gao feng <gaofeng@cn.fujitsu.com>
11 years agostorage: return -1 when fs pool can't be mounted
Ján Tomko [Thu, 11 Jul 2013 10:36:59 +0000 (12:36 +0200)]
storage: return -1 when fs pool can't be mounted

Don't reuse the return value of virStorageBackendFileSystemIsMounted.
If it's 0, we'd return it even if the mount command failed.

Also, don't report another error if it's -1, since one has already
been reported.

Introduced by 258e06c.

https://bugzilla.redhat.com/show_bug.cgi?id=981251

11 years agoqemu: Slightly increase memory limit
Jiri Denemark [Mon, 8 Jul 2013 13:12:27 +0000 (15:12 +0200)]
qemu: Slightly increase memory limit

For low-memory domains (roughly under 400MB) our automatic memory limit
computation comes up with a limit that's too low. This is because the
0.5 multiplication does not add enough for such small values. Let's
increase the constant part of the computation to fix this.

11 years agoutil: add rebase fix that was accidentally omitted from previous patch
Laine Stump [Thu, 11 Jul 2013 03:06:43 +0000 (23:06 -0400)]
util: add rebase fix that was accidentally omitted from previous patch

I had made the change locally, so make check and make syntax-check
were successful, but forgot to add/commit. Unfortunately, git allows a
push when the local directory is dirty, so it didn't catch my mistake.

11 years agoutil: use VIR_(APPEND|DELETE)_ELEMENT for pci/usb device lists
Laine Stump [Fri, 5 Jul 2013 18:46:35 +0000 (14:46 -0400)]
util: use VIR_(APPEND|DELETE)_ELEMENT for pci/usb device lists

Eliminate memmove() by using VIR_*_ELEMENT API instead.

In both pci and usb cases, the count that held the size of the list
was unsigned int so it had to be changed to size_t.

11 years agoPrevent use of 'int' data type & 'ii', 'jj', 'kk' var names for loops
Daniel P. Berrange [Mon, 8 Jul 2013 14:17:29 +0000 (15:17 +0100)]
Prevent use of 'int' data type & 'ii', 'jj', 'kk' var names for loops

Add two syntax-check rules

 - sc_prohibit_int_ijk - block use of 'int' as a data type
   for any variables named 'i', 'j', 'k'
 - sc_prohibit_int_iijjkk - block use of 'ii', 'jj', 'kk'
   for any variable names

11 years agoConvert 'int i' to 'size_t i' in examples/ files
Daniel P. Berrange [Mon, 8 Jul 2013 14:09:33 +0000 (15:09 +0100)]
Convert 'int i' to 'size_t i' in examples/ files

Convert the type of loop iterators named 'i', 'j', k',
'ii', 'jj', 'kk', to be 'size_t' instead of 'int' or
'unsigned int', also santizing 'ii', 'jj', 'kk' to use
the normal 'i', 'j', 'k' naming

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
11 years agoConvert 'int i' to 'size_t i' in python/ files
Daniel P. Berrange [Mon, 8 Jul 2013 14:09:33 +0000 (15:09 +0100)]
Convert 'int i' to 'size_t i' in python/ files

Convert the type of loop iterators named 'i', 'j', k',
'ii', 'jj', 'kk', to be 'size_t' instead of 'int' or
'unsigned int', also santizing 'ii', 'jj', 'kk' to use
the normal 'i', 'j', 'k' naming

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
11 years agoConvert 'int i' to 'size_t i' in src/ files
Daniel P. Berrange [Mon, 8 Jul 2013 14:09:33 +0000 (15:09 +0100)]
Convert 'int i' to 'size_t i' in src/ files

Convert the type of loop iterators named 'i', 'j', k',
'ii', 'jj', 'kk', to be 'size_t' instead of 'int' or
'unsigned int', also santizing 'ii', 'jj', 'kk' to use
the normal 'i', 'j', 'k' naming

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
11 years agoConvert 'int i' to 'size_t i' in src/cpu/ files
Daniel P. Berrange [Mon, 8 Jul 2013 14:09:33 +0000 (15:09 +0100)]
Convert 'int i' to 'size_t i' in src/cpu/ files

Convert the type of loop iterators named 'i', 'j', k',
'ii', 'jj', 'kk', to be 'size_t' instead of 'int' or
'unsigned int', also santizing 'ii', 'jj', 'kk' to use
the normal 'i', 'j', 'k' naming

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
11 years agoConvert 'int i' to 'size_t i' in src/hyperv/ files
Daniel P. Berrange [Mon, 8 Jul 2013 14:09:33 +0000 (15:09 +0100)]
Convert 'int i' to 'size_t i' in src/hyperv/ files

Convert the type of loop iterators named 'i', 'j', k',
'ii', 'jj', 'kk', to be 'size_t' instead of 'int' or
'unsigned int', also santizing 'ii', 'jj', 'kk' to use
the normal 'i', 'j', 'k' naming

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
11 years agoConvert 'int i' to 'size_t i' in src/interface/ files
Daniel P. Berrange [Mon, 8 Jul 2013 14:09:33 +0000 (15:09 +0100)]
Convert 'int i' to 'size_t i' in src/interface/ files

Convert the type of loop iterators named 'i', 'j', k',
'ii', 'jj', 'kk', to be 'size_t' instead of 'int' or
'unsigned int', also santizing 'ii', 'jj', 'kk' to use
the normal 'i', 'j', 'k' naming

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
11 years agoConvert 'int i' to 'size_t i' in src/network/ files
Daniel P. Berrange [Mon, 8 Jul 2013 14:09:33 +0000 (15:09 +0100)]
Convert 'int i' to 'size_t i' in src/network/ files

Convert the type of loop iterators named 'i', 'j', k',
'ii', 'jj', 'kk', to be 'size_t' instead of 'int' or
'unsigned int', also santizing 'ii', 'jj', 'kk' to use
the normal 'i', 'j', 'k' naming

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
11 years agoConvert 'int i' to 'size_t i' in src/libxl/ files
Daniel P. Berrange [Mon, 8 Jul 2013 14:09:33 +0000 (15:09 +0100)]
Convert 'int i' to 'size_t i' in src/libxl/ files

Convert the type of loop iterators named 'i', 'j', k',
'ii', 'jj', 'kk', to be 'size_t' instead of 'int' or
'unsigned int', also santizing 'ii', 'jj', 'kk' to use
the normal 'i', 'j', 'k' naming

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
11 years agoConvert 'int i' to 'size_t i' in src/locking/ files
Daniel P. Berrange [Mon, 8 Jul 2013 14:09:33 +0000 (15:09 +0100)]
Convert 'int i' to 'size_t i' in src/locking/ files

Convert the type of loop iterators named 'i', 'j', k',
'ii', 'jj', 'kk', to be 'size_t' instead of 'int' or
'unsigned int', also santizing 'ii', 'jj', 'kk' to use
the normal 'i', 'j', 'k' naming

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
11 years agoConvert 'int i' to 'size_t i' in src/lxc/ files
Daniel P. Berrange [Mon, 8 Jul 2013 14:09:33 +0000 (15:09 +0100)]
Convert 'int i' to 'size_t i' in src/lxc/ files

Convert the type of loop iterators named 'i', 'j', k',
'ii', 'jj', 'kk', to be 'size_t' instead of 'int' or
'unsigned int', also santizing 'ii', 'jj', 'kk' to use
the normal 'i', 'j', 'k' naming

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
11 years agoConvert 'int i' to 'size_t i' in src/node_device/ files
Daniel P. Berrange [Mon, 8 Jul 2013 14:09:33 +0000 (15:09 +0100)]
Convert 'int i' to 'size_t i' in src/node_device/ files

Convert the type of loop iterators named 'i', 'j', k',
'ii', 'jj', 'kk', to be 'size_t' instead of 'int' or
'unsigned int', also santizing 'ii', 'jj', 'kk' to use
the normal 'i', 'j', 'k' naming

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
11 years agoConvert 'int i' to 'size_t i' in src/nwfilter/ files
Daniel P. Berrange [Mon, 8 Jul 2013 14:09:33 +0000 (15:09 +0100)]
Convert 'int i' to 'size_t i' in src/nwfilter/ files

Convert the type of loop iterators named 'i', 'j', k',
'ii', 'jj', 'kk', to be 'size_t' instead of 'int' or
'unsigned int', also santizing 'ii', 'jj', 'kk' to use
the normal 'i', 'j', 'k' naming

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
11 years agoConvert 'int i' to 'size_t i' in src/openvz/ files
Daniel P. Berrange [Mon, 8 Jul 2013 14:09:33 +0000 (15:09 +0100)]
Convert 'int i' to 'size_t i' in src/openvz/ files

Convert the type of loop iterators named 'i', 'j', k',
'ii', 'jj', 'kk', to be 'size_t' instead of 'int' or
'unsigned int', also santizing 'ii', 'jj', 'kk' to use
the normal 'i', 'j', 'k' naming

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
11 years agoConvert 'int i' to 'size_t i' in src/parallels/ files
Daniel P. Berrange [Mon, 8 Jul 2013 14:09:33 +0000 (15:09 +0100)]
Convert 'int i' to 'size_t i' in src/parallels/ files

Convert the type of loop iterators named 'i', 'j', k',
'ii', 'jj', 'kk', to be 'size_t' instead of 'int' or
'unsigned int', also santizing 'ii', 'jj', 'kk' to use
the normal 'i', 'j', 'k' naming

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
11 years agoConvert 'int i' to 'size_t i' in src/phyp/ files
Daniel P. Berrange [Mon, 8 Jul 2013 14:09:33 +0000 (15:09 +0100)]
Convert 'int i' to 'size_t i' in src/phyp/ files

Convert the type of loop iterators named 'i', 'j', k',
'ii', 'jj', 'kk', to be 'size_t' instead of 'int' or
'unsigned int', also santizing 'ii', 'jj', 'kk' to use
the normal 'i', 'j', 'k' naming

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
11 years agoConvert 'int i' to 'size_t i' in src/qemu files
Daniel P. Berrange [Mon, 8 Jul 2013 14:09:33 +0000 (15:09 +0100)]
Convert 'int i' to 'size_t i' in src/qemu files

Convert the type of loop iterators named 'i', 'j', k',
'ii', 'jj', 'kk', to be 'size_t' instead of 'int' or
'unsigned int', also santizing 'ii', 'jj', 'kk' to use
the normal 'i', 'j', 'k' naming

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
11 years agoConvert 'int i' to 'size_t i' in src/remote/ files
Daniel P. Berrange [Mon, 8 Jul 2013 14:09:33 +0000 (15:09 +0100)]
Convert 'int i' to 'size_t i' in src/remote/ files

Convert the type of loop iterators named 'i', 'j', k',
'ii', 'jj', 'kk', to be 'size_t' instead of 'int' or
'unsigned int', also santizing 'ii', 'jj', 'kk' to use
the normal 'i', 'j', 'k' naming

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
11 years agoConvert 'int i' to 'size_t i' in src/rpc/ files
Daniel P. Berrange [Mon, 8 Jul 2013 14:09:33 +0000 (15:09 +0100)]
Convert 'int i' to 'size_t i' in src/rpc/ files

Convert the type of loop iterators named 'i', 'j', k',
'ii', 'jj', 'kk', to be 'size_t' instead of 'int' or
'unsigned int', also santizing 'ii', 'jj', 'kk' to use
the normal 'i', 'j', 'k' naming

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
11 years agoConvert 'int i' to 'size_t i' in src/secret/ files
Daniel P. Berrange [Mon, 8 Jul 2013 14:09:33 +0000 (15:09 +0100)]
Convert 'int i' to 'size_t i' in src/secret/ files

Convert the type of loop iterators named 'i', 'j', k',
'ii', 'jj', 'kk', to be 'size_t' instead of 'int' or
'unsigned int', also santizing 'ii', 'jj', 'kk' to use
the normal 'i', 'j', 'k' naming

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
11 years agoConvert 'int i' to 'size_t i' in src/security files
Daniel P. Berrange [Mon, 8 Jul 2013 14:09:33 +0000 (15:09 +0100)]
Convert 'int i' to 'size_t i' in src/security files

Convert the type of loop iterators named 'i', 'j', k',
'ii', 'jj', 'kk', to be 'size_t' instead of 'int' or
'unsigned int', also santizing 'ii', 'jj', 'kk' to use
the normal 'i', 'j', 'k' naming

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
11 years agoConvert 'int i' to 'size_t i' in src/test/ files
Daniel P. Berrange [Mon, 8 Jul 2013 14:09:33 +0000 (15:09 +0100)]
Convert 'int i' to 'size_t i' in src/test/ files

Convert the type of loop iterators named 'i', 'j', k',
'ii', 'jj', 'kk', to be 'size_t' instead of 'int' or
'unsigned int', also santizing 'ii', 'jj', 'kk' to use
the normal 'i', 'j', 'k' naming

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
11 years agoConvert 'int i' to 'size_t i' in src/uml/ files
Daniel P. Berrange [Mon, 8 Jul 2013 14:09:33 +0000 (15:09 +0100)]
Convert 'int i' to 'size_t i' in src/uml/ files

Convert the type of loop iterators named 'i', 'j', k',
'ii', 'jj', 'kk', to be 'size_t' instead of 'int' or
'unsigned int', also santizing 'ii', 'jj', 'kk' to use
the normal 'i', 'j', 'k' naming

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
11 years agoConvert 'int i' to 'size_t i' in src/vbox/ files
Daniel P. Berrange [Mon, 8 Jul 2013 14:09:33 +0000 (15:09 +0100)]
Convert 'int i' to 'size_t i' in src/vbox/ files

Convert the type of loop iterators named 'i', 'j', k',
'ii', 'jj', 'kk', to be 'size_t' instead of 'int' or
'unsigned int', also santizing 'ii', 'jj', 'kk' to use
the normal 'i', 'j', 'k' naming

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
11 years agoConvert 'int i' to 'size_t i' in src/storage/ files
Daniel P. Berrange [Mon, 8 Jul 2013 14:09:33 +0000 (15:09 +0100)]
Convert 'int i' to 'size_t i' in src/storage/ files

Convert the type of loop iterators named 'i', 'j', k',
'ii', 'jj', 'kk', to be 'size_t' instead of 'int' or
'unsigned int', also santizing 'ii', 'jj', 'kk' to use
the normal 'i', 'j', 'k' naming

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
11 years agoConvert 'int i' to 'size_t i' in src/{esx,vmx,vmware} files
Daniel P. Berrange [Mon, 8 Jul 2013 14:09:33 +0000 (15:09 +0100)]
Convert 'int i' to 'size_t i' in src/{esx,vmx,vmware} files

Convert the type of loop iterators named 'i', 'j', k',
'ii', 'jj', 'kk', to be 'size_t' instead of 'int' or
'unsigned int', also santizing 'ii', 'jj', 'kk' to use
the normal 'i', 'j', 'k' naming

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
11 years agoConvert 'int i' to 'size_t i' in src/{xen,xenapi,xenxs} files
Daniel P. Berrange [Mon, 8 Jul 2013 14:09:33 +0000 (15:09 +0100)]
Convert 'int i' to 'size_t i' in src/{xen,xenapi,xenxs} files

Convert the type of loop iterators named 'i', 'j', k',
'ii', 'jj', 'kk', to be 'size_t' instead of 'int' or
'unsigned int', also santizing 'ii', 'jj', 'kk' to use
the normal 'i', 'j', 'k' naming

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
11 years agoConvert 'int i' to 'size_t i' in tools/ files
Daniel P. Berrange [Mon, 8 Jul 2013 14:09:33 +0000 (15:09 +0100)]
Convert 'int i' to 'size_t i' in tools/ files

Convert the type of loop iterators named 'i', 'j', k',
'ii', 'jj', 'kk', to be 'size_t' instead of 'int' or
'unsigned int', also santizing 'ii', 'jj', 'kk' to use
the normal 'i', 'j', 'k' naming

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
11 years agoConvert 'int i' to 'size_t i' in tests/ files
Daniel P. Berrange [Mon, 8 Jul 2013 14:09:33 +0000 (15:09 +0100)]
Convert 'int i' to 'size_t i' in tests/ files

Convert the type of loop iterators named 'i', 'j', k',
'ii', 'jj', 'kk', to be 'size_t' instead of 'int' or
'unsigned int', also santizing 'ii', 'jj', 'kk' to use
the normal 'i', 'j', 'k' naming

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
11 years agoConvert 'int i' to 'size_t i' in src/util/ files
Daniel P. Berrange [Mon, 8 Jul 2013 14:09:33 +0000 (15:09 +0100)]
Convert 'int i' to 'size_t i' in src/util/ files

Convert the type of loop iterators named 'i', 'j', k',
'ii', 'jj', 'kk', to be 'size_t' instead of 'int' or
'unsigned int', also santizing 'ii', 'jj', 'kk' to use
the normal 'i', 'j', 'k' naming

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
11 years agoConvert 'int i' to 'size_t i' in src/conf/ files
Daniel P. Berrange [Mon, 8 Jul 2013 14:09:33 +0000 (15:09 +0100)]
Convert 'int i' to 'size_t i' in src/conf/ files

Convert the type of loop iterators named 'i', 'j', k',
'ii', 'jj', 'kk', to be 'size_t' instead of 'int' or
'unsigned int', also santizing 'ii', 'jj', 'kk' to use
the normal 'i', 'j', 'k' naming

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
11 years agoFix bridge routines detection on kFreeBSD
Roman Bogorodskiy [Wed, 10 Jul 2013 09:38:06 +0000 (13:38 +0400)]
Fix bridge routines detection on kFreeBSD

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.

11 years agoFix crash when multiple event callbacks were registered
Ján Tomko [Tue, 2 Jul 2013 13:17:09 +0000 (15:17 +0200)]
Fix crash when multiple event callbacks were registered

CVE-2013-2230

Don't overwrite the callback ID returned by
virDomainEventStateRegisterID in ret by 0.

Introduced by abf75aea.

11 years agoqemu: fix double free in qemuMigrationPrepareDirect
Ján Tomko [Wed, 10 Jul 2013 10:33:29 +0000 (12:33 +0200)]
qemu: fix double free in qemuMigrationPrepareDirect

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

11 years agoConvert 'int i' to 'size_t i' in daemon/ files
Daniel P. Berrange [Mon, 8 Jul 2013 14:09:33 +0000 (15:09 +0100)]
Convert 'int i' to 'size_t i' in daemon/ files

Convert the type of loop iterators named 'i', 'j', k',
'ii', 'jj', 'kk', to be 'size_t' instead of 'int' or
'unsigned int', also santizing 'ii', 'jj', 'kk' to use
the normal 'i', 'j', 'k' naming

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
11 years agoAdapt to VIR_ALLOC and virAsprintf in tools/*
Michal Privoznik [Thu, 4 Jul 2013 10:20:45 +0000 (12:20 +0200)]
Adapt to VIR_ALLOC and virAsprintf in tools/*

11 years agoAdapt to VIR_ALLOC and virAsprintf in tests/*
Michal Privoznik [Thu, 4 Jul 2013 10:20:21 +0000 (12:20 +0200)]
Adapt to VIR_ALLOC and virAsprintf in tests/*

11 years agoAdapt to VIR_ALLOC and virAsprintf in src/*
Michal Privoznik [Thu, 4 Jul 2013 10:20:00 +0000 (12:20 +0200)]
Adapt to VIR_ALLOC and virAsprintf in src/*

11 years agoAdapt to VIR_ALLOC and virAsprintf in src/xenxs/*
Michal Privoznik [Thu, 4 Jul 2013 10:19:27 +0000 (12:19 +0200)]
Adapt to VIR_ALLOC and virAsprintf in src/xenxs/*

11 years agoAdapt to VIR_ALLOC and virAsprintf in src/xenapi/*
Michal Privoznik [Thu, 4 Jul 2013 10:19:05 +0000 (12:19 +0200)]
Adapt to VIR_ALLOC and virAsprintf in src/xenapi/*

11 years agoAdapt to VIR_ALLOC and virAsprintf in src/xen/*
Michal Privoznik [Thu, 4 Jul 2013 10:18:49 +0000 (12:18 +0200)]
Adapt to VIR_ALLOC and virAsprintf in src/xen/*

11 years agoAdapt to VIR_ALLOC and virAsprintf in src/vmx/*
Michal Privoznik [Thu, 4 Jul 2013 10:18:18 +0000 (12:18 +0200)]
Adapt to VIR_ALLOC and virAsprintf in src/vmx/*

11 years agoAdapt to VIR_ALLOC and virAsprintf in src/vmware/*
Michal Privoznik [Thu, 4 Jul 2013 10:17:55 +0000 (12:17 +0200)]
Adapt to VIR_ALLOC and virAsprintf in src/vmware/*

11 years agoAdapt to VIR_ALLOC and virAsprintf in src/vbox/*
Michal Privoznik [Thu, 4 Jul 2013 10:17:38 +0000 (12:17 +0200)]
Adapt to VIR_ALLOC and virAsprintf in src/vbox/*

11 years agoAdapt to VIR_ALLOC and virAsprintf in src/util/*
Michal Privoznik [Thu, 4 Jul 2013 10:17:18 +0000 (12:17 +0200)]
Adapt to VIR_ALLOC and virAsprintf in src/util/*

11 years agoAdapt to VIR_ALLOC and virAsprintf in src/uml/*
Michal Privoznik [Thu, 4 Jul 2013 10:17:01 +0000 (12:17 +0200)]
Adapt to VIR_ALLOC and virAsprintf in src/uml/*

11 years agoAdapt to VIR_ALLOC and virAsprintf in src/test/*
Michal Privoznik [Thu, 4 Jul 2013 10:16:47 +0000 (12:16 +0200)]
Adapt to VIR_ALLOC and virAsprintf in src/test/*

11 years agoAdapt to VIR_ALLOC and virAsprintf in src/storage/*
Michal Privoznik [Thu, 4 Jul 2013 10:16:29 +0000 (12:16 +0200)]
Adapt to VIR_ALLOC and virAsprintf in src/storage/*

11 years agoAdapt to VIR_ALLOC and virAsprintf in src/security/*
Michal Privoznik [Thu, 4 Jul 2013 10:15:50 +0000 (12:15 +0200)]
Adapt to VIR_ALLOC and virAsprintf in src/security/*

11 years agoAdapt to VIR_ALLOC and virAsprintf in src/secret/*
Michal Privoznik [Thu, 4 Jul 2013 10:15:29 +0000 (12:15 +0200)]
Adapt to VIR_ALLOC and virAsprintf in src/secret/*

11 years agoAdapt to VIR_ALLOC and virAsprintf in src/rpc/*
Michal Privoznik [Thu, 4 Jul 2013 10:15:05 +0000 (12:15 +0200)]
Adapt to VIR_ALLOC and virAsprintf in src/rpc/*

11 years agoAdapt to VIR_ALLOC and virAsprintf in src/remote/*
Michal Privoznik [Thu, 4 Jul 2013 10:14:34 +0000 (12:14 +0200)]
Adapt to VIR_ALLOC and virAsprintf in src/remote/*

11 years agoAdapt to VIR_ALLOC and virAsprintf in src/qemu/*
Michal Privoznik [Thu, 4 Jul 2013 10:14:12 +0000 (12:14 +0200)]
Adapt to VIR_ALLOC and virAsprintf in src/qemu/*

11 years agoAdapt to VIR_ALLOC and virAsprintf in src/phyp/*
Michal Privoznik [Thu, 4 Jul 2013 10:13:48 +0000 (12:13 +0200)]
Adapt to VIR_ALLOC and virAsprintf in src/phyp/*

11 years agoAdapt to VIR_ALLOC and virAsprintf in src/parallels/*
Michal Privoznik [Thu, 4 Jul 2013 10:13:24 +0000 (12:13 +0200)]
Adapt to VIR_ALLOC and virAsprintf in src/parallels/*

11 years agoAdapt to VIR_ALLOC and virAsprintf in src/openvz/*
Michal Privoznik [Thu, 4 Jul 2013 10:13:02 +0000 (12:13 +0200)]
Adapt to VIR_ALLOC and virAsprintf in src/openvz/*

11 years agoAdapt to VIR_ALLOC and virAsprintf in src/nwfilter/*
Michal Privoznik [Thu, 4 Jul 2013 10:12:44 +0000 (12:12 +0200)]
Adapt to VIR_ALLOC and virAsprintf in src/nwfilter/*

11 years agoAdapt to VIR_ALLOC and virAsprintf in src/network/*
Michal Privoznik [Thu, 4 Jul 2013 10:12:21 +0000 (12:12 +0200)]
Adapt to VIR_ALLOC and virAsprintf in src/network/*

11 years agoAdapt to VIR_ALLOC and virAsprintf in src/node_device/*
Michal Privoznik [Thu, 4 Jul 2013 10:11:59 +0000 (12:11 +0200)]
Adapt to VIR_ALLOC and virAsprintf in src/node_device/*

11 years agoAdapt to VIR_ALLOC and virAsprintf in src/lxc/*
Michal Privoznik [Thu, 4 Jul 2013 10:11:37 +0000 (12:11 +0200)]
Adapt to VIR_ALLOC and virAsprintf in src/lxc/*

11 years agoAdapt to VIR_ALLOC and virAsprintf in src/locking/*
Michal Privoznik [Thu, 4 Jul 2013 10:11:02 +0000 (12:11 +0200)]
Adapt to VIR_ALLOC and virAsprintf in src/locking/*

11 years agoAdapt to VIR_ALLOC and virAsprintf in src/libxl/*
Michal Privoznik [Thu, 4 Jul 2013 10:10:38 +0000 (12:10 +0200)]
Adapt to VIR_ALLOC and virAsprintf in src/libxl/*