Commit Graph

1457 Commits

Author SHA1 Message Date
Eric Blake
87c0eab48d build: fix shunloadtest breakage
Commit 93ec384 was tested on mingw, but broke the build on Linux:

  CCLD     shunloadtest
shunloadtest.o: In function `main':
/home/eblake/libvirt/tests/shunloadtest.c:106: undefined reference to `virFilePrintf'
...
ssh.o: In function `main':
/home/eblake/libvirt/tests/ssh.c:43: undefined reference to `virFilePrintf'
/home/eblake/libvirt/tests/ssh.c:49: undefined reference to `virFilePrintf'

* tests/testutils.h (fprintf): Provide escape hatch.
* tests/shunloadtest.c: Use it.
* tests/ssh.c: Likewise.

Signed-off-by: Eric Blake <eblake@redhat.com>
2013-07-29 13:09:39 -06:00
Eric Blake
93ec384b66 tests: consistently use virFilePrintf
Commit a2619962 introduced virFilePrintf to work around the fact
that gnulib doesn't (yet) provide guarantees about fprintf() vs.
%z, which in turn causes all sorts of mingw compilation errors:

../../tests/testutils.c: In function 'virtTestResult':
../../tests/testutils.c:101:9: error: unknown conversion type character 'z' in format [-Werror=format=]
         fprintf(stderr, "%3zu) %-60s ", testCounter, name);
         ^

Rather than s/fprintf/virFilePrintf/ (and reformatting loads of
lines) across multiple files, it's easier to just hack the entire
testsuite to take advantage of our helper function.

* tests/testutils.c: s/fprintf/virFilePrintf/ for mingw.

Signed-off-by: Eric Blake <eblake@redhat.com>
2013-07-29 12:06:05 -06:00
Eric Blake
524f52c305 build: skip systemd mock on non-Linux
A cross-compile to mingw failed:

  CC       virsystemdmock_la-virsystemdmock.lo
../../tests/virsystemdmock.c:29:6: error: 'dbus_connection_set_change_sigpipe' redeclared without dllimport attribute: previous dllimport ignored [-Werror=attributes]
 void dbus_connection_set_change_sigpipe(dbus_bool_t will_modify_sigpipe ATTRIBUTE_UNUSED)
      ^

But when you think about it, systemd is Linux-only, and even our
use of LD_PRELOAD to provide mock syscalls is Linux-only.

* tests/virsystemdmock.c: Avoid compilation outside Linux.

Signed-off-by: Eric Blake <eblake@redhat.com>
2013-07-29 11:28:43 -06:00
Daniel P. Berrange
9ed3e6c117 Fix dbus message reading code on big endian hosts
The way we were casting small (<32bit) integers was broken
on big endian hosts, causing stack smashing. This was detected
in the test suite either by test failures due to incorrect
results, or by libc/gcc abort'ing with its stack canary
triggered.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2013-07-29 18:08:55 +01:00
Guannan Ren
e3f2686bdf caps: use -device for primary video when qemu >=1.6
https://bugzilla.redhat.com/show_bug.cgi?id=981094
The commit 0ad9025ef introduce qemu flag QEMU_CAPS_DEVICE_VIDEO_PRIMARY
for using -device VGA, -device cirrus-vga, -device vmware-svga and
-device qxl-vga. In use, for -device qxl-vga, mouse doesn't display
in guest window like the desciption in above bug.
This patch try to use -device for primary video when qemu >=1.6 which
contains the bug fix patch
2013-07-29 13:31:20 +08:00
Ján Tomko
99d3a60b1f Resolve Coverity complaint in storagevolxml2argvtest
Ignore NULL pool in testSetVolumeType to silence Coverity,
even though we only call it with NULL pool when vol is also NULL.

(13) Event var_deref_model:	Passing null pointer "inputpool" to
function "testSetVolumeType(virStorageVolDefPtr, virStoragePoolDefPtr)",
which dereferences it. [details]
Also see events: [assign_zero]

95    testSetVolumeType(inputvol, inputpool);
2013-07-26 14:17:02 +02:00
Guido Günther
6b79a47270 virdbustest: Don't pass number of arguments as long long
since sizeof(int) != sizeof(long long) on 32bit archs.

This unbreaks virdbustest which otherwise fails like:

 (gdb) bt
 #0  __strlen_sse2_bsf () at ../sysdeps/i386/i686/multiarch/strlen-sse2-bsf.S:50
 #1  0x405907d2 in ?? () from /lib/i386-linux-gnu/libdbus-1.so.3
 #2  0x4057c140 in ?? () from /lib/i386-linux-gnu/libdbus-1.so.3
 #3  0x4057e7ec in dbus_message_iter_append_basic () from /lib/i386-linux-gnu/libdbus-1.so.3
 #4  0x400742ec in virDBusMessageIterEncode (args=0xbfd4b8f0 "k\321\004\b.", types=0x804d260 "",
     rootiter=0xbfd4b844) at util/virdbus.c:560
 #5  virDBusMessageEncodeArgs (msg=msg@entry=0x893c278, types=types@entry=0x804d25c "sais",
     args=args@entry=0xbfd4b8d8 "r\320\004\b\003") at util/virdbus.c:921
 #6  0x40075917 in virDBusMessageEncode (msg=0x893c278, types=0x804d25c "sais") at util/virdbus.c:959
 #7  0x0804a4a1 in testMessageArray (args=0x0) at virdbustest.c:195
 #8  0x0804c404 in virtTestRun (title=title@entry=0x804cfcb "Test message array ",
     nloops=nloops@entry=1, body=body@entry=0x804a3f0 <testMessageArray>, data=data@entry=0x0)
     at testutils.c:168
 #9  0x08049346 in mymain () at virdbustest.c:384
 #10 0x0804cb2e in virtTestMain (argc=argc@entry=1, argv=argv@entry=0xbfd4bb24,
     func=func@entry=0x80492c0 <mymain>) at testutils.c:764
 #11 0x080491af in main (argc=1, argv=0xbfd4bb24) at virdbustest.c:393
2013-07-25 16:20:49 +02:00
Ján Tomko
601d465254 Add inputpool to storagevolxml2argvtest
This allows testing the command line for cloning file-based
volumes into logical volumes and vice versa.
2013-07-25 13:27:41 +02:00
Ján Tomko
3a75fca289 Move volume XMLs out of storagevolxml2argvdata
Reuse the XML files in storagevolxml2xmlin.

(This requires changing a few backing files to /dev/null,
since virStorageBackendCreateQemuImgCmd checks for its
presence)
2013-07-25 13:26:41 +02:00
Ján Tomko
823778829e Move pool XML out of storagevolxml2argvdata
Reuse the pool definition from storagepoolxml2xmlin.
2013-07-25 13:26:40 +02:00
Ján Tomko
7064eee95a Use separate macros for failure/success in vol-to-argv test
Reindent them to put the input volume on a separate line.
2013-07-25 13:26:37 +02:00
Ján Tomko
e4f0a55e79 tests: PCI controller checks
Check if PCI bridges with duplicate indexes are rejected.
PCI root controllers with non-zero indexes or addresses should
also be rejected.
2013-07-25 13:16:46 +02:00
Laine Stump
3ceb4c7df6 qemu: set/validate slot/connection type when assigning slots for PCI devices
Since PCI bridges, PCIe bridges, PCIe switches, and PCIe root ports
all share the same namespace, they are all defined as controllers of
type='pci' in libvirt (but with a differing model attribute). Each of
these controllers has a certain connection type upstream, allows
certain connection types downstream, and each can either allow a
single downstream connection at slot 0, or connections from slot 1 -
31.

Right now, we only support the pci-root and pci-bridge devices, both
of which only allow PCI devices to connect, and both which have usable
slots 1 - 31. In preparation for adding other types of controllers
that have different capabilities, this patch 1) adds info to the
qemuDomainPCIAddressBus object to indicate the capabilities, 2) sets
those capabilities appropriately for pci-root and pci-bridge devices,
and 3) validates that the controller being connected to is the proper
type when allocating slots or validating that a user-selected slot is
appropriate for a device..

Having this infrastructure in place will make it much easier to add
support for the other PCI controller types.

While it would be possible to do all the necessary checking by just
storing the controller model in the qemyuDomainPCIAddressBus, it
greatly simplifies all the validation code to also keep a "flags",
"minSlot" and "maxSlot" for each - that way we can just check those
attributes rather than requiring a nearly identical switch statement
everywhere we need to validate compatibility.

You may notice many places where the flags are seemingly hard-coded to

  QEMU_PCI_CONNECT_HOTPLUGGABLE | QEMU_PCI_CONNECT_TYPE_PCI

This is currently the correct value for all PCI devices, and in the
future will be the default, with small bits of code added to change to
the flags for the few devices which are the exceptions to this rule.

Finally, there are a few places with "FIXME" comments. Note that these
aren't indicating places that are broken according to the currently
supported devices, they are places that will need fixing when support
for new PCI controller models is added.

To assure that there was no regression in the auto-allocation of PCI
addresses or auto-creation of integrated pci-root, ide, and usb
controllers, a new test case (pci-bridge-many-disks) has been added to
both the qemuxml2argv and qemuxml2xml tests. This new test defines a
domain with several dozen virtio disks but no pci-root or
pci-bridges. The .args file of the new test case was created using
libvirt sources from before this patch, and the test still passes
after this patch has been applied.
2013-07-24 06:45:07 -04:00
Laine Stump
fcbfd58429 qemu: only check for PIIX3-specific device addrs on pc-* machinetypes
The implicit IDE, USB, and video controllers provided by the PIIX3
chipset in the pc-* machinetypes are not present on other
machinetypes, so we shouldn't be doing the special checking for
them. This patch places those validation checks into a separate
function that is only called for machine types that have a PIIX3 chip
(which happens to be the i440fx-based pc-* machine types).

One qemuxml2argv test data file had to be changed - the
pseries-usb-multi test had included a piix3-usb-uhci device, which was
being placed at a specific address, and also had slot 2 auto reserved
for a video device, but the pseries virtual machine doesn't actually
have a PIIX3 chip, so even if there was a piix3-usb-uhci driver for
it, the device wouldn't need to reside at slot 1 function 2. I just
changed the .argv file to have the generic slot info for the two
devices that results when the special PIIX3 code isn't executed.
2013-07-24 06:29:23 -04:00
John Ferlan
e91f14cb87 valgrind.supp: Add more valgrind suppression paths
Update based on recent run/failures seen
2013-07-23 19:04:48 -04:00
Daniel P. Berrange
d64e852b5a Remove obsolete cgroups creation apis
The virCgroupNewDomainDriver and virCgroupNewDriver methods
are obsolete now that we can auto-detect existing cgroup
placement. Delete them to reduce code bloat.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2013-07-23 22:46:31 +01:00
Daniel P. Berrange
666bff4faf Add logic for handling systemd-machined non-existance
If systemd machine does not exist, return -2 instead of -1,
so that applications don't need to repeat the tedious error
checking code

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2013-07-23 22:35:26 +01:00
John Ferlan
c00b2f0dd1 conf: Introduce new XML tag "mode" for disk source
There are two ways to use a iSCSI LUN as disk source for qemu.

 * The LUN's path as it shows up on host, e.g.
   /dev/disk/by-path/ip-$ip:3260-iscsi-$iqn-fc18:iscsi.iscsi0-lun-1

 * The libiscsi URI from the storage pool source element host attribute, e.g.
   iscsi://demo.org:6000/iqn.1992-01.com.example/1

For a "volume" type disk, if the specified "pool" is of iscsi
type, we should support to use the LUN in either of above 2 ways.
That's why to introduce a new XML tag "mode" for the disk source
(libvirt should support iscsi pool with libiscsi, but it's another
new feature, which should be done later).

The "mode" can be either of "host" or "direct". Use "host" to indicate
use of the LUN with the path as it shows up on host. Use "direct" to
indicate to use it with the source pool host URI (future patches may support
to use network type libvirt storage too, e.g. Ceph)
2013-07-22 14:01:04 -04:00
Jiri Denemark
c9150d3747 tests: Free test at the end of GetDeviceAliases JSON test
Commit 58b147ad07 added a test for
qemuMonitorGetDeviceAliases but forgot to free the test object at the
end which causes all sort of weird errors and failures when new tests
are added after the GetDeviceAliases.
2013-07-22 16:59:14 +02:00
Daniel P. Berrange
b64dabff27 Report full errors from virCgroupNew*
Instead of returning raw errno values, report full libvirt
errors in virCgroupNew* functions.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2013-07-22 13:09:58 +01:00
Daniel P. Berrange
dff93f8cab Add API for calling systemd-machined's DBus API
To register virtual machines and containers with systemd-machined,
and thus have cgroups auto-created, we need to talk over DBus.
This is somewhat tedious code, so introduce a dedicated function
to isolate the DBus call in one place.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2013-07-22 13:09:58 +01:00
Daniel P. Berrange
834c9c9459 Introduce virDBusCallMethod & virDBusMessageRead methods
Doing DBus method calls using libdbus.so is tedious in the
extreme. systemd developers came up with a nice high level
API for DBus method calls (sd_bus_call_method). While
systemd doesn't use libdbus.so, their API design can easily
be ported to libdbus.so.

This patch thus introduces methods virDBusCallMethod &
virDBusMessageRead, which are based on the code used for
sd_bus_call_method and sd_bus_message_read. This code in
systemd is under the LGPLv2+, so we're license compatible.

This code is probably pretty unintelligible unless you are
familiar with the DBus type system. So I added some API
docs trying to explain how to use them, as well as test
cases to validate that I didn't screw up the adaptation
from the original systemd code.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2013-07-22 13:09:58 +01:00
Jiri Denemark
67dfc772d1 cpu: Let explicit features override model features
Until now CPU features inherited from a specified CPU model could only
be overridden with 'disable' policy. With this patch, any explicitly
specified feature always overrides the same feature inherited from a CPU
model regardless on the specified policy.

The CPU in x86-exact-force-Haswell.xml would previously be incompatible
with x86-host-SandyBridge.xml CPU even though x86-host-SandyBridge.xml
provides all features required by x86-exact-force-Haswell.xml.
2013-07-22 13:57:53 +02:00
Jiri Denemark
1dfa174ad2 cpu: Store arch in virCPUData 2013-07-22 13:56:54 +02:00
Jiri Denemark
57d52b244b Replace union cpuData with virCPUData 2013-07-22 13:54:46 +02:00
Viktor Mihajlovski
1a82e01c97 qemu: Shorten SCSI hostdev alias to avoid QEMU failure
The alias for hostdevs of type SCSI can be too long for QEMU if
larger LUNs are encountered. Here's a real life example:

    <hostdev mode='subsystem' type='scsi' managed='no'>
      <source>
        <adapter name='scsi_host0'/>
        <address bus='0' target='19' unit='1088634913'/>
      </source>
      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
    </hostdev>

this results in a too long drive id, resulting in QEMU yelling

Property 'scsi-generic.drive' can't find value 'drive-hostdev-scsi_host0-0-19-1088634913'

This commit changes the alias back to the default hostdev$(index)
scheme.

Signed-off-by: Viktor Mihajlovski <mihajlov@linux.vnet.ibm.com>
2013-07-22 13:16:29 +02:00
Jiri Denemark
58b147ad07 qemu: Introduce qemuMonitorGetDeviceAliases
This API provides a NULL-terminated list of devices which are currently
attached to a QEMU domain.
2013-07-19 18:45:47 +02:00
Daniel P. Berrange
a81eb0b4e9 Change s/i/iv/ in test code to avoid syntax-check
The code parsing VIR_TEST_RANGE mistakenly used 'unsigned int i'
which violated syntax-check rules

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2013-07-19 13:08:30 +01:00
Daniel P. Berrange
ab92ae3338 Allow test cases to be run selectively
When debugging a failing test with many test cases, it is useful
to be able to skip most tests. Introducing a new environment
variable VIR_TEST_RANGE=N-M enables execution of only the test
cases numbered N-M inclusive, starting from 1.

For example, to skip all the cgroup tests except 2

$ VIR_TEST_RANGE=2-3 VIR_TEST_DEBUG=1 ./vircgrouptest
TEST: vircgrouptest
 2) New cgroup for driver                                             ... Unexpected found LXC cgroup: 1
libvirt: Cgroup error : Failed to create controller cpu for group: No such file or directory
FAILED
 3) New cgroup for domain driver                                      ... Cannot find LXC cgroup: 1
libvirt: Cgroup error : Failed to create controller cpu for group: No such file or directory
FAILED

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2013-07-19 13:00:41 +01:00
Eric Blake
d21d40bf0c maint: split long lines in Makefiles
Makefiles are another easy file to enforce line limits.

Mostly straightforward; interesting tricks worth noting:
src/Makefile.am: $(confdir) was already defined, use it in more places
tests/Makefile.am: path_add and VG required some interesting compression

* cfg.mk (sc_prohibit_long_lines): Add another test.
* Makefile.am: Fix offenders.
* daemon/Makefile.am: Likewise.
* docs/Makefile.am: Likewise.
* python/Makefile.am: Likewise.
* src/Makefile.am: Likewise.
* tests/Makefile.am: Likewise.

Signed-off-by: Eric Blake <eblake@redhat.com>
2013-07-19 05:25:35 -06:00
Eric Blake
684c90bfbc tests: split long lines
Long lines are harder to read and harder to diff; in fact, if lines get
too long (> 1000 bytes), it starts causing issues where git send-email
refuses to send patches for the file.  I've cleaned up the tests
directory in the past (see commits bd6c46f, 3b750d1), but new long
lines have been introduced in the meantime.

Why 90 instead of 80? Because there were too many tests on the fringe
edge, and I didn't want to edit that many files.

Add a syntax check to prevent future long lines.

* cfg.mk (sc_prohibit_long_lines): New rule.
* tests/qemuxml2argvdata/qemuxml2argv-*.args: Split lines of any
file with content longer than 90 columns.
* tests/storagevolxml2argvdata/*.argv: Likewise.

Signed-off-by: Eric Blake <eblake@redhat.com>
2013-07-18 10:08:04 -06:00
Jiri Denemark
984c01ba5c qemu: Emit VIR_DOMAIN_EVENT_ID_DEVICE_REMOVED events 2013-07-18 15:28:45 +02:00
Michal Privoznik
166db595c3 qemuhotplugtest: Resolve some memleaks
If testQemuHotplugAttach succeeds, the vm->def steals the dev pointer.
However, not the envelope, which needs to be freed. In addition,
driver.config is allocated, but never freed.
2013-07-18 14:16:53 +02:00
Ján Tomko
23e938ee63 virAsprintf: correctly check return value
When virAsprintf was changed from a function to a macro
reporting OOM error in dc6f2da, it was documented as returning
0 on success. This is incorrect, it returns the number of bytes
written as asprintf does.

Some of the functions were converted to use virAsprintf's return
value directly, changing the return value on success from 0 to >= 0.

For most of these, this is not a problem, but the change in
virPCIDriverDir breaks PCI passthrough.

The return value check in virhashtest pre-dates virAsprintf OOM
conversion.

vmwareMakePath seems to be unused.
2013-07-18 14:05:46 +02:00
Daniel P. Berrange
040d996342 Merge virCommandPreserveFD / virCommandTransferFD
Merge the virCommandPreserveFD / virCommandTransferFD methods
into a single virCommandPasFD method, and use a new
VIR_COMMAND_PASS_FD_CLOSE_PARENT to indicate their difference
in behaviour

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2013-07-18 12:18:24 +01:00
John Ferlan
9ed3a5ca34 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>'.
2013-07-16 08:44:52 -04:00
Martin Kletzander
efab27afbf 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
2013-07-16 12:16:37 +02:00
Michal Privoznik
9e45b3dfe3 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.
2013-07-16 11:47:39 +02:00
John Ferlan
eb0d79c64b 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
2013-07-15 12:41:12 -04:00
John Ferlan
50336d871a 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).
2013-07-15 12:26:16 -04:00
John Ferlan
bdce278984 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".
2013-07-15 12:26:16 -04:00
John Ferlan
d76a89780b 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.
2013-07-15 12:26:15 -04:00
Jincheng Miao
945b18eb7d Change domain controller index type to unsigned
Error out on negative index values.

https://bugzilla.redhat.com/show_bug.cgi?id=981261
2013-07-12 14:55:04 +02:00
Michal Privoznik
0f7a7ce5ff 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.
2013-07-12 11:00:04 +02:00
Michal Privoznik
4a51447abe 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.
2013-07-12 11:00:01 +02:00
John Ferlan
8283ef9ea2 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.
2013-07-11 14:18:11 -04:00
Daniel P. Berrange
7a1e691711 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>
2013-07-10 17:40:13 +01:00
Michal Privoznik
3ea84b9548 Adapt to VIR_ALLOC and virAsprintf in tests/* 2013-07-10 11:07:33 +02:00
Michal Privoznik
dc6f2dadac Introduce OOM reporting to virAsprintf
Actually, I'm turning this function into a macro as filename,
function name and line number needs to be passed. The new
function virAsprintfInternal is introduced with the extended set
of arguments.
2013-07-10 11:07:31 +02:00
Michal Privoznik
8290cbbc38 viralloc: Report OOM error on failure
Similarly to VIR_STRDUP, we want the OOM error to be reported in
VIR_ALLOC and friends.
2013-07-10 11:07:31 +02:00