]> xenbits.xensource.com Git - libvirt.git/log
libvirt.git
11 years agoxen: Add interface versions for Xen 4.3
Stefan Bader [Tue, 16 Jul 2013 16:11:16 +0000 (18:11 +0200)]
xen: Add interface versions for Xen 4.3

Xen 4.3 changes sysctl version to 10 and domctl version to 9. Update
the hypervisor driver to work with those.

Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
11 years agolxc_container: Don't call virGetGroupList during exec
Michal Privoznik [Wed, 17 Jul 2013 09:21:09 +0000 (11:21 +0200)]
lxc_container: Don't call virGetGroupList during exec

Commit 75c1256 states that virGetGroupList must not be called
between fork and exec, then commit ee777e99 promptly violated
that for lxc.

Patch originally posted by Eric Blake <eblake@redhat.com>.

11 years agocgroup: reuse buffer for getline
Ján Tomko [Wed, 17 Jul 2013 08:56:05 +0000 (10:56 +0200)]
cgroup: reuse buffer for getline

Reuse the buffer for getline and track buffer allocation
separately from the string length to prevent unlikely
out-of-bounds memory access.

This fixes the following leak that happened when zero bytes were read:

==404== 120 bytes in 1 blocks are definitely lost in loss record 1,344 of 1,671
==404==    at 0x4C2C71B: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==404==    by 0x906F862: getdelim (iogetdelim.c:68)
==404==    by 0x52A48FB: virCgroupPartitionNeedsEscaping (vircgroup.c:1136)
==404==    by 0x52A0FB4: virCgroupPartitionEscape (vircgroup.c:1171)
==404==    by 0x52A0EA4: virCgroupNewDomainPartition (vircgroup.c:1450)

11 years agoqemuDomainGetSchedulerType: Prefer qemuDomObjFromDomain
Michal Privoznik [Wed, 17 Jul 2013 06:07:20 +0000 (08:07 +0200)]
qemuDomainGetSchedulerType: Prefer qemuDomObjFromDomain

In all qemu APIs we tend to prefer qemuDomObjFromDomain over
virDomainObjListFindByUUID. But somehow the
qemuDomainGetSchedulerType left unattended.

11 years agovirSecurityManagerGenLabel: Skip seclabels without model
Michal Privoznik [Mon, 15 Jul 2013 13:50:29 +0000 (15:50 +0200)]
virSecurityManagerGenLabel: Skip seclabels without model

While generating seclabels, we check the seclabel stack if required
driver is in the stack. If not, an error is returned. However, it is
possible for a seclabel to not have any model set (happens with LXC
domains that have just <seclabel type='none'>). If that's the case,
we should just skip the iteration instead of calling STREQ(NULL, ...)
and SIGSEGV-ing subsequently.

11 years agolxcCapsInit: Allocate primary security driver unconditionally
Michal Privoznik [Mon, 15 Jul 2013 13:36:04 +0000 (15:36 +0200)]
lxcCapsInit: Allocate primary security driver unconditionally

Currently, if the primary security driver is 'none', we skip
initializing caps->host.secModels. This means, later, when LXC domain
XML is parsed and <seclabel type='none'/> is found (see
virSecurityLabelDefsParseXML), the model name is not copied to the
seclabel. This leads to subsequent crash in virSecurityManagerGenLabel
where we call STREQ() over the model (note, that we are expecting model
to be !NULL).

11 years agoqemu: Separate host device removal into a standalone function
Jiri Denemark [Thu, 11 Jul 2013 09:14:16 +0000 (11:14 +0200)]
qemu: Separate host device removal into a standalone function

11 years agoqemu: Separate net device removal into a standalone function
Jiri Denemark [Tue, 9 Jul 2013 22:37:12 +0000 (00:37 +0200)]
qemu: Separate net device removal into a standalone function

11 years agoqemu: Separate controller removal into a standalone function
Jiri Denemark [Tue, 9 Jul 2013 22:10:32 +0000 (00:10 +0200)]
qemu: Separate controller removal into a standalone function

11 years agoqemu: Separate disk device removal into a standalone function
Jiri Denemark [Tue, 9 Jul 2013 21:43:22 +0000 (23:43 +0200)]
qemu: Separate disk device removal into a standalone function

11 years agoqemu: Add qemuDomainReleaseDeviceAddress to remove any address
Jiri Denemark [Tue, 9 Jul 2013 20:30:57 +0000 (22:30 +0200)]
qemu: Add qemuDomainReleaseDeviceAddress to remove any address

11 years agoCreate directory for lease files if it's missing
Guido Günther [Sun, 7 Jul 2013 12:59:48 +0000 (14:59 +0200)]
Create directory for lease files if it's missing

If we don't autostart a network it's not being created.

Debian Bug http://bugs.debian.org/715200

11 years agobuild: avoid compiler warning on shadowed name
Eric Blake [Tue, 16 Jul 2013 16:11:32 +0000 (10:11 -0600)]
build: avoid compiler warning on shadowed name

Introduced in commit 24b08219; compilation on RHEL 6.4 complained:
qemu/qemu_hotplug.c: In function 'qemuDomainAttachChrDevice':
qemu/qemu_hotplug.c:1257: error: declaration of 'remove' shadows a global declaration [-Wshadow]
/usr/include/stdio.h:177: error: shadowed declaration is here [-Wshadow]

* src/qemu/qemu_hotplug.c (qemuDomainAttachChrDevice): Avoid the
name 'remove'.

Signed-off-by: Eric Blake <eblake@redhat.com>
11 years agoLXC: Change the owner of live attached host devices
Gao feng [Tue, 16 Jul 2013 02:00:06 +0000 (10:00 +0800)]
LXC: Change the owner of live attached host devices

The owner of this host devices should be the root user of container.

Signed-off-by: Gao feng <gaofeng@cn.fujitsu.com>
11 years agoLXC: Change the owner of host devices to the root of container
Gao feng [Tue, 16 Jul 2013 02:00:05 +0000 (10:00 +0800)]
LXC: Change the owner of host devices to the root of container

These host devices are created for container,
the owner should be the root user of container.

Signed-off-by: Gao feng <gaofeng@cn.fujitsu.com>
11 years agoLXC: Create host devices for container on host side
Gao feng [Tue, 16 Jul 2013 02:00:04 +0000 (10:00 +0800)]
LXC: Create host devices for container on host side

Otherwise the container will fail to start if we
enable user namespace, since there is no rights to
do mknod in uninit user namespace.

Signed-off-by: Gao feng <gaofeng@cn.fujitsu.com>
11 years agoLXC: Change the owner of live attached disk device
Gao feng [Tue, 16 Jul 2013 02:00:03 +0000 (10:00 +0800)]
LXC: Change the owner of live attached disk device

The owner of this disk device should be the root user of container.

Signed-off-by: Gao feng <gaofeng@cn.fujitsu.com>
11 years agoLXC: Move virLXCControllerChown to lxc_container.c
Gao feng [Tue, 16 Jul 2013 02:00:02 +0000 (10:00 +0800)]
LXC: Move virLXCControllerChown to lxc_container.c

lxc driver will use this function to change the owner
of hot added devices.

Move virLXCControllerChown to lxc_container.c and Rename
it to lxcContainerChown.

Signed-off-by: Gao feng <gaofeng@cn.fujitsu.com>
11 years agoLXC: controller: change the owner of disk to the root of container
Gao feng [Tue, 16 Jul 2013 02:00:01 +0000 (10:00 +0800)]
LXC: controller: change the owner of disk to the root of container

These disk devices are created for container,
the owner should be the root user of container.

Signed-off-by: Gao feng <gaofeng@cn.fujitsu.com>
11 years agoLXC: Setup disks for container on host side
Gao feng [Tue, 16 Jul 2013 02:00:00 +0000 (10:00 +0800)]
LXC: Setup disks for container on host side

Since mknod in container is forbidden, we should setup disks
on host side.

Signed-off-by: Gao feng <gaofeng@cn.fujitsu.com>
11 years agoqemu: Fix double free of returned JSON array in qemuAgentGetVCPUs()
Peter Krempa [Tue, 16 Jul 2013 13:39:06 +0000 (15:39 +0200)]
qemu: Fix double free of returned JSON array in qemuAgentGetVCPUs()

A part of the returned monitor response was freed twice and caused
crashes of the daemon when using guest agent cpu count retrieval.

 # virsh vcpucount dom --guest

Introduced in v1.0.6-48-gc6afcb0

11 years agorbd: Do not free the secret if it is not set
Wido den Hollander [Tue, 16 Jul 2013 12:26:07 +0000 (14:26 +0200)]
rbd: Do not free the secret if it is not set

Not all RBD (Ceph) storage pools have cephx authentication turned on,
so "secret" might not be initialized.

It could also be that the secret couldn't be located.

Only call virSecretFree() if "secret" is initialized earlier.

Signed-off-by: Wido den Hollander <wido@widodh.nl>
11 years agoAllow balloon driver collection to be adjusted dynamically
John Ferlan [Mon, 8 Jul 2013 17:19:43 +0000 (13:19 -0400)]
Allow balloon driver collection to be adjusted dynamically

Use the virDomainSetMemoryStatsPeriodFlags() to pass a period defined by
usage of a new --period option in order to set the collection period for the
balloon driver. This may enable or disable the collection based on the value.

Add the --current, --live, & --config options to dommemstat.

11 years agoImplement the virDomainSetMemoryStatsPeriod for QEMU driver
John Ferlan [Mon, 8 Jul 2013 16:47:23 +0000 (12:47 -0400)]
Implement the virDomainSetMemoryStatsPeriod for QEMU driver

Implement the new API that will handle setting the balloon driver statistics
collection period in order to enable or disable the collection dynamically.

11 years agoSpecify remote protocol for virDomainSetMemoryStatsPeriod
John Ferlan [Mon, 8 Jul 2013 16:42:57 +0000 (12:42 -0400)]
Specify remote protocol for virDomainSetMemoryStatsPeriod

Wire up the remote protocol

11 years agoAdd new public API virDomainSetMemoryStatsPeriod
John Ferlan [Mon, 8 Jul 2013 14:22:38 +0000 (10:22 -0400)]
Add new public API virDomainSetMemoryStatsPeriod

Add new API in order to set the balloon memory driver statistics collection
period in order to allow dynamic period adjustment for the virsh dommemstats to
display balloon stats data

11 years agoAdd capability to fetch balloon stats
John Ferlan [Thu, 11 Jul 2013 23:18:48 +0000 (19:18 -0400)]
Add capability to fetch balloon stats

This patch will add the qemuMonitorJSONGetMemoryStats() to execute a
"guest-stats" on the balloonpath using "get-qom" replacing the former
mechanism which looked through the "query-ballon" returned data for
the fields.  The "query-balloon" code only returns 'actual' memory.
Rather than duplicating the existing code, have the JSON API use the
GetBalloonInfo API.

A check in the qemuMonitorGetMemoryStats() will be made to ensure the
balloon driver path has been set.  Since the underlying JSON code can
return data not associated with the balloon driver, we don't fail on
a failure to get the balloonpath.  Of course since we've made the check,
we can then set the ballooninit flag.  Getting the path here is primarily
due to the process reconnect path which doesn't attempt to set the
collection period.

11 years agoDetermine whether to start balloon memory stats gathering.
John Ferlan [Thu, 27 Jun 2013 15:00:31 +0000 (11:00 -0400)]
Determine whether to start balloon memory stats gathering.

At vm startup and attach attempt to set the balloon driver statistics
collection period based on the value found in the domain xml file. This
is not done at reconnect since it's possible that a collection period
was set on the live guest and making the set period call would reset to
whatever value is stored in the config file.

Setting the stats collection period has a side effect of searching through
the qom-list output for the virtio balloon driver and making sure that it
has the right properties in order to allow setting of a collection period
and eventually fetching of statistics.

The walk through the qom-list is expensive and thus the balloonpath will
be saved in the monitor private structure as well as a flag indicating
that the initialization has already been attempted (in the event that a
path is not found, no sense to keep checking).

This processing model conforms to the qom object model model which
requires setting object properties after device startup. That is, it's
not possible to pass the period along via the startup code as it won't
be recognized.

11 years agoAdd 'period' for Memballoon statistics gathering capability
John Ferlan [Wed, 26 Jun 2013 11:00:00 +0000 (07:00 -0400)]
Add 'period' for Memballoon statistics gathering capability

Add a period in seconds to allow/enable statistics gathering from the
Balloon driver for 'virsh dommemstat <domain>'.

11 years agoqemu: Prevent crash of libvirtd without guest agent configuration
Alex Jia [Tue, 16 Jul 2013 09:30:20 +0000 (17:30 +0800)]
qemu: Prevent crash of libvirtd without guest agent configuration

If users haven't configured guest agent then qemuAgentCommand() will
dereference a NULL 'mon' pointer, which causes crash of libvirtd when
using agent based cpu (un)plug.

With the patch, when the qemu-ga service isn't running in the guest,
a expected error "error: Guest agent is not responding: Guest agent
not available for now" will be raised, and the error "error: argument
unsupported: QEMU guest agent is not configured" is raised when the
guest hasn't configured guest agent.

GDB backtrace:

 (gdb) bt
 #0  virNetServerFatalSignal (sig=11, siginfo=<value optimized out>, context=<value optimized out>) at rpc/virnetserver.c:326
 #1  <signal handler called>
 #2  qemuAgentCommand (mon=0x0, cmd=0x7f39300017b0, reply=0x7f394b090910, seconds=-2) at qemu/qemu_agent.c:975
 #3  0x00007f39429507f6 in qemuAgentGetVCPUs (mon=0x0, info=0x7f394b0909b8) at qemu/qemu_agent.c:1475
 #4  0x00007f39429d9857 in qemuDomainGetVcpusFlags (dom=<value optimized out>, flags=9) at qemu/qemu_driver.c:4849
 #5  0x00007f3957dffd8d in virDomainGetVcpusFlags (domain=0x7f39300009c0, flags=8) at libvirt.c:9843

How to reproduce?

 # To start a guest without guest agent configuration
 # then run the following cmdline

 # virsh vcpucount foobar --guest
 error: End of file while reading data: Input/output error
 error: One or more references were leaked after disconnect from the hypervisor
 error: Failed to reconnect to the hypervisor

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

Signed-off-by: Alex Jia <ajia@redhat.com>
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
11 years agoMake logical pools independent on target path
Martin Kletzander [Tue, 30 Apr 2013 11:48:46 +0000 (13:48 +0200)]
Make logical pools independent on target path

When using logical pools, we had to trust the target->path provided.
This parameter, however, can be completely ommited and we can use
'/dev/<source.name>' safely and populate it to target.path.

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

11 years agoqemuhotplugtest: Introduce test for chardev hotplug
Michal Privoznik [Tue, 2 Jul 2013 08:16:30 +0000 (10:16 +0200)]
qemuhotplugtest: Introduce test for chardev hotplug

The test is currently testing just device update function. However,
chardev hotplug is implemented just for device attach and detach. This
fact means, the test needs to be rewritten (the majority of the code is
still shared). Moreover, we are now able to pass VM among multiple test
runs. So for instance, while we add a device in the first run, we can
remove it in the second run.

11 years agoqemu: Implement chardev hotplug on live level
Michal Privoznik [Wed, 13 Mar 2013 10:08:55 +0000 (11:08 +0100)]
qemu: Implement chardev hotplug on live level

Since previous patches has prepared everything for us, we may now
implement live hotplug of a character device.

11 years agoqemu: Implement chardev hotplug on config level
Michal Privoznik [Tue, 12 Mar 2013 14:59:25 +0000 (15:59 +0100)]
qemu: Implement chardev hotplug on config level

There are two levels on which a device may be hotplugged: config
and live. The config level requires just an insert or remove from
internal domain definition structure, which is exactly what this
patch does. There is currently no implementation for a chardev
update action, as there's not much to be updated. But more
importantly, the only thing that can be updated is path or socket
address by which chardevs are distinguished. So the update action
is currently not supported.

11 years agodomain_conf: Auto fill chardev port
Michal Privoznik [Fri, 12 Jul 2013 16:52:17 +0000 (18:52 +0200)]
domain_conf: Auto fill chardev port

Now that we have callbacks, we should auto fill in omitted pieces of
information. It's important for chardev hotplug to fill in the correct
/{serial,parallel,console,channel}/target/@port if no value has been
provided by user.

11 years agocpu: Allow fine tuning of "host-model" cpu
Peter Krempa [Mon, 15 Jul 2013 15:38:55 +0000 (17:38 +0200)]
cpu: Allow fine tuning of "host-model" cpu

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

Until now, the "host-model" cpu mode couldn't be influenced. This patch
allows to use the <feature> elements to either enable or disable
specific CPU flags. This can be used to force flags that can be emulated
even if the host CPU doesn't support them.

11 years agocpu: Clean up code style
Peter Krempa [Mon, 15 Jul 2013 13:40:40 +0000 (15:40 +0200)]
cpu: Clean up code style

11 years agocpu: Add virCPUDefUpdateFeature()
Peter Krempa [Mon, 15 Jul 2013 12:36:09 +0000 (14:36 +0200)]
cpu: Add virCPUDefUpdateFeature()

This new function updates or adds a feature to a existing cpu model
definition. This function will be helpful to allow tuning of
"host-model" features in later patches.

11 years agoconf: Clean up error reporting in cpu definition parsing
Peter Krempa [Mon, 15 Jul 2013 09:12:18 +0000 (11:12 +0200)]
conf: Clean up error reporting in cpu definition parsing

Use VIR_ERR_XML_ERROR instead of VIR_ERR_INTERNAL_ERROR in XML parsing
code and move "%s" formating strings right after the error code.

11 years agostorage_conf: Merge AuthChap and AuthCephx into AuthSecret
John Ferlan [Sat, 13 Jul 2013 19:43:46 +0000 (15:43 -0400)]
storage_conf: Merge AuthChap and AuthCephx into AuthSecret

Merge virStoragePoolDefParseAuthChap and virStoragePoolDefParseAuthCephx
into a common virStoragePoolDefParseAuthSecret.  Change the output to be
common for both by putting 'type' first followed by 'username'.

11 years agostorage_conf: Move username processing into common function
John Ferlan [Sat, 13 Jul 2013 19:15:38 +0000 (15:15 -0400)]
storage_conf: Move username processing into common function

Move the auth->username processing into virStoragePoolDefParseAuth
save the resulting username into chap/cephx specific data

11 years agostorage_pool: Rework chap XML to mimic ceph
John Ferlan [Sat, 13 Jul 2013 18:29:55 +0000 (14:29 -0400)]
storage_pool: Rework chap XML to mimic ceph

The existing 'chap' XML logic was never used - just defined.  Rather than
try to insert a square peg into a round hole, blow it up and rewrite the
logic to follow the 'ceph' format.

Remove the former "chap.login" and "chap.passwd" fields and replace
with "chap.username" and "chap.secret" in _virStoragePoolAuthChap.
Adjust the virStoragePoolDefParseAuthChap() to process.

Change the rng file to describe the new layout

Update the formatstorage.html to describe the usage of the secret element
to mention that the secret type "iscsi" and "ceph" can be used
to storage pool too.

Update the formatsecret.html to include a reference to the storage pool

Update tests to handle the changes from 'login' and 'passwd' to 'username'
and '<secret>' format

11 years agostorage_conf: Move auth processing into virStoragePoolDefParseAuth
John Ferlan [Sat, 13 Jul 2013 18:23:38 +0000 (14:23 -0400)]
storage_conf: Move auth processing into virStoragePoolDefParseAuth

Split processing of "<auth" into its own function

11 years agostorage_conf: Introduce virStoragePoolAuthSecretPtr
John Ferlan [Sat, 13 Jul 2013 18:15:15 +0000 (14:15 -0400)]
storage_conf: Introduce virStoragePoolAuthSecretPtr

Split out the _virStoragePoolAuthSecret data from _virStoragePoolAuthCephx
into its own structure

11 years agostorage_conf: Adjust virStoragePoolAuthType enum
John Ferlan [Sat, 13 Jul 2013 18:14:00 +0000 (14:14 -0400)]
storage_conf: Adjust virStoragePoolAuthType enum

Generate and use the virStoragePoolAuthTypeType{To|From}String helpers

11 years agoAdd qemuMonitorJSONSetObjectProperty() method for QMP qom-set command
John Ferlan [Wed, 3 Jul 2013 18:42:40 +0000 (14:42 -0400)]
Add qemuMonitorJSONSetObjectProperty() method for QMP qom-set command

Add a new qemuMonitorJSONSetObjectProperty() method to support invocation
of the 'qom-set' JSON monitor command with a provided path, property, and
expected data type to set.

NOTE: The set API was added only for the purpose of the qemumonitorjsontest

The test code uses the same "/machine/i440fx" property as the get test and
attempts to set the "realized" property to "true" (which it should be set
at anyway).

11 years agoAdd qemuMonitorJSONGetObjectProperty() method for QMP qom-get command
John Ferlan [Wed, 3 Jul 2013 18:15:07 +0000 (14:15 -0400)]
Add qemuMonitorJSONGetObjectProperty() method for QMP qom-get command

Add a new qemuMonitorJSONGetObjectProperty() method to support invocation
of the 'qom-get' JSON monitor command with a provided path, property, and
expected data type return. The qemuMonitorJSONObjectProperty is similar to
virTypedParameter; however, a future patch will extend it a bit to include
a void pointer to balloon driver statistic data.

NOTE: The ObjectProperty structures and API are added only for the
      purpose of the qemumonitorjsontest

The provided test will execute a qom-get on "/machine/i440fx" which will
return a property "realized".

11 years agoAdd qemuMonitorJSONGetObjectListPaths() method for QMP qom-list command
John Ferlan [Mon, 24 Jun 2013 17:51:56 +0000 (13:51 -0400)]
Add qemuMonitorJSONGetObjectListPaths() method for QMP qom-list command

Add a new qemuMonitorJSONGetObjectListPaths() method to support invocation
of the 'qom-list' JSON monitor command with a provided path.

NOTE: The ListPath structures and API's are added only for the
      purpose of the qemumonitorjsontest

The returned list of paired data fields of "name" and "type" that can
be used to peruse QOM configuration data and eventually utilize for the
balloon statistics.

The test does a "{"execute":"qom-list", "arguments": { "path": "/"}}" which
returns "{"return": [{"name": "machine", "type": "child<container>"},
{"name": "type", "type": "string"}]}" resulting in a return of an array
of 2 elements with [0].name="machine", [0].type="child<container>".  The [1]
entry appears to be a header that could be used some day via a command such
as "virsh qemuobject --list" to format output.

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>