Commit Graph

1494 Commits

Author SHA1 Message Date
Eric Blake
15168f9874 tests: test negative number through dbus
Commit f1088c8 weakened a test, by not passing a value larger
than INT_MAX through an int slot.  Make the fix in a different
way, using an explicit negative value.  Suggested by Dan Berrange.

* tests/virdbustest.c (testMessageArray): Adjust previous fix.
(testMessageStruct): Use a negative number.

Signed-off-by: Eric Blake <eblake@redhat.com>
2013-08-09 08:57:01 -06:00
Eric Blake
f1088c8177 tests: avoid too-large constants
Compiling with gcc 4.1.2 (RHEL 5) on a 32-bit platform complains:

virdbustest.c: In function 'testMessageSimple':
virdbustest.c:61: warning: integer constant is too large for 'long' type
virdbustest.c:62: warning: integer constant is too large for 'long' type
virdbustest.c: In function 'testMessageArray':
virdbustest.c:183: warning: this decimal constant is unsigned only in ISO C90
virdbustest.c: In function 'testMessageStruct':
virdbustest.c:239: warning: integer constant is too large for 'long' type
virdbustest.c:240: warning: integer constant is too large for 'long' type

* tests/virdbustest.c (testMessageSiple, testMessageArray)
(testMessageStruct): Don't violate C89 constant constraints.

Signed-off-by: Eric Blake <eblake@redhat.com>
2013-08-09 07:46:18 -06:00
Daniel P. Berrange
eaa99a17db Fix parallel runs of TLS test suites
Use a separate keyfile name for the two TLS test suites so that
they don't clash when running tests in parallel

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2013-08-09 11:54:41 +01:00
Eric Blake
edfae3dccf tests: work with older dbus
On RHEL 5, with dbus 1.1.2, compilation failed with:

virsystemdmock.c: In function 'dbus_connection_send_with_reply_and_block':
virsystemdmock.c:68: warning: implicit declaration of function 'dbus_message_set_serial'

Fix this by instead bypassing all attempts to use a dbus serial.

* tests/virsystemdmock.c (dbus_message_set_reply_serial): Add new
override.
(dbus_connection_send_with_reply_and_block): No longer bother with
the serial.

Signed-off-by: Eric Blake <eblake@redhat.com>
2013-08-08 16:33:55 -06:00
Daniel P. Berrange
31d41d9268 Fix validation of CA certificate chains
The code added to validate CA certificates did not take into
account the possibility that the cacert.pem file can contain
multiple (concatenated) cert data blocks. Extend the code for
loading CA certs to use the gnutls APIs for loading cert lists.
Add test cases to check that multi-level trees of certs will
validate correctly.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2013-08-08 10:44:28 +01:00
Daniel P. Berrange
b93bd78ed3 Change data passed into TLS test cases
Currently a 'struct testTLSCertReq' instance is passed into
the TLS test cases. This is not flexible enough to cope with
certificate chains, where one file now corresponds to multiple
certificates. Change the test cases so that we pass in filenames
instead.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2013-08-08 10:02:12 +01:00
Daniel P. Berrange
90811c5987 Avoid re-generating certs every time
Currently every test case in the TLS test suite generates the
certs fresh. This is a waste of time, since its parameters
don't change across test cases. Create certs once in main
method.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2013-08-08 10:00:42 +01:00
Daniel P. Berrange
236da82dae Split TLS test into two separate tests
The virnettlscontexttest.c tests both virNetTLSContext
and virNetTLSSession functionality. Split into two
separate tests, to make the code size more manageable

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2013-08-08 10:00:42 +01:00
Laine Stump
83718cfe23 qemu: enable using implicit sata controller in q35 machines
q35 machines have an implicit ahci (sata) controller at 00:1F.2 which
has no "id" associated with it. For this reason, we can't refer to it
as "ahci0". Instead, we don't give an id on the commandline, which
qemu interprets as "use the first ahci controller". We then need to
specify the unit with "unit=%d" rather than adding it onto the bus
arg.
2013-08-06 13:37:36 -04:00
Laine Stump
01b8812765 qemu: properly set/use device alias for pci controllers
We had been setting the device alias in the devinceinfo for pci
controllers to "pci%u", but then hardcoding "pci.%u" when creating the
device address for other devices using that pci bus. This all worked
just fine until we encountered the built-in "pcie.0" bus (the PCIe
root complex) in Q35 machines.

In order to create the correct commandline for this one case, this
patch:

1) sets the alias for PCI controllers correctly, to "pci.%u" (or
"pcie.%u" for the pcie-root controller)

2) eliminates the hardcoded "pci.%u" for pci controllers when
generatuing device address strings, and instead uses the controller's
alias.

3) plumbs a pointer to the virDomainDef all the way down to
qemuBuildDeviceAddressStr. This was necessary in order to make the
aliase of the controller *used by a device* available (previously
qemuBuildDeviceAddressStr only had the deviceinfo of the device
itself, *not* of the controller it was connecting to). This made for a
larger than desired diff, but at least in the future we won't have to
do it again, since all the information we could possibly ever need for
future enhancements is in the virDomainDef. (right?)

This should be done for *all* controllers, but for now we just do it
in the case of PCI controllers, to reduce the likelyhood of
regression.
2013-08-05 16:08:37 -04:00
Laine Stump
c27b0bb171 qemu: fix handling of default/implicit devices for q35
This patch adds in special handling for a few devices that need to be
treated differently for q35 domains:

usb - there is no implicit/default usb controller for the q35
machinetype. This is done because normally the default usb controller
is added to a domain by just adding "-usb" to the qemu commandline,
and it's assumed that this will add a single piix3 usb1 controller at
slot 1 function 2. That's not what happens when the machinetype is
q35, though. Instead, adding -usb to the commandline adds 3 usb
(version 2) controllers to the domain at slot 0x1D.{1,2,7}. Rather
than having

  <controller type='usb' index='0'/>

translate into 3 separate devices on the PCI bus, it's cleaner to not
automatically add a default usb device; one can always be added
explicitly if desired. Or we may decide that on q35 machines, 3 usb
controllers will be automatically added when none is given. But for
this initial commit, at least we aren't locking ourselves into
something we later won't want.

video - qemu always initializes the primary video device immediately
after any integrated devices for the machinetype. Unless instructed
otherwise (by using "-device vga..." instead of "-vga" which libvirt
uses in many cases to work around deficiencies and bugs in various
qemu versions) qemu will always pick the first unused slot. In the
case of the "pc" machinetype and its derivatives, this is always slot
2, but on q35 machinetypes, the first free slot is slot 1 (since the
q35's integrated peripheral devices are placed in other slots,
e.g. slot 0x1f). In order to make the PCI address of the video device
predictable, that slot (1 or 2, depending on machinetype) is reserved
even when no video device has been specified.

sata - a q35 machine always has a sata controller implicitly added at
slot 0x1F, function 2. There is no way to avoid this controller, so we
always add it. Note that the xml2xml tests for the pcie-root and q35
cases were changed to use DO_TEST_DIFFERENT() so that we can check for
the sata controller being automatically added. This is especially
important because we can't check for it in the xml2argv output (it has
no effect on that output since it's an implicit device).

ide - q35 has no ide controllers.

isa and smbus controllers - these two are always present in a q35 (at
slot 0x1F functions 0 and 3) but we have no way of modelling them in
our config. We do need to reserve those functions so that the user
doesn't attempt to put anything else there though. (note that the "pc"
machine type also has an ISA controller, which we also ignore).
2013-08-05 15:47:49 -04:00
Laine Stump
62ac6b4354 qemu: add dmi-to-pci-bridge controller
This PCI controller, named "dmi-to-pci-bridge" in the libvirt config,
and implemented with qemu's "i82801b11-bridge" device, connects to a
PCI Express slot (e.g. one of the slots provided by the pcie-root
controller, aka "pcie.0" on the qemu commandline), and provides 31
*non-hot-pluggable* PCI (*not* PCIe) slots, numbered 1-31.

Any time a machine is defined which has a pcie-root controller
(i.e. any q35-based machinetype), libvirt will automatically add a
dmi-to-pci-bridge controller if one doesn't exist, and also add a
pci-bridge controller. The reasoning here is that any useful domain
will have either an immediate (startup time) or eventual (subsequent
hot-plug) need for a standard PCI slot; since the pcie-root controller
only provides PCIe slots, we need to connect a dmi-to-pci-bridge
controller to it in order to get a non-hot-plug PCI slot that we can
then use to connect a pci-bridge - the slots provided by the
pci-bridge will be both standard PCI and hot-pluggable.

Since pci-bridge devices themselves can not be hot-plugged into a
running system (although you can hot-plug other devices into a
pci-bridge's slots), any new pci-bridge controller that is added can
(and will) be plugged into the dmi-to-pci-bridge as long as it has
empty slots available.

This patch is also changing the qemuxml2xml-pcie test from a "DO_TEST"
to a "DO_DIFFERENT_TEST". This is so that the "before" xml can omit
the automatically added dmi-to-pci-bridge and pci-bridge devices, and
the "after" xml can include it - this way we are testing if libvirt is
properly adding these devices.
2013-08-05 15:40:49 -04:00
Laine Stump
48a3f48ac5 qemu: add pcie-root controller
This controller is implicit on q35 machinetypes. It provides 31 PCIe
(*not* PCI) slots as controller 0.

Currently there are no devices that can connect to pcie-root, and no
implicit pci controller on a q35 machine, so q35 is still
unusable. For a usable q35 system, we need to add a
"dmi-to-pci-bridge" pci controller, which can connect to pcie-root,
and provides standard pci slots that can be used to connect other
devices.
2013-08-05 15:13:56 -04:00
Peter Krempa
8f95d5d84c qemumonitortestutils: Don't skip va_end() on error path
When allocation of memory failed the error path didn't call va_end()
causing a coverity failure.

Reported by John Ferlan.
2013-08-02 12:28:58 +02:00
Peter Krempa
ae9ef97b9b qemuagenttest: Check invalid response in shutdown test
The shutdown test utilizes waiting for condition to exit the test. This
addition will return an error for the shutdown command to see if the
condition waiting code will not hang.
2013-08-02 12:28:58 +02:00
Peter Krempa
baebb34120 qemuagenttest: Fix checking of shutdown mode
Coverity complained about unused variable that contains the shutdown
mode. The original intention was to check it against the requested mode.

Also the fixed check revealed a mistake in the expected shutdown mode.

Reported by John Ferlan.
2013-08-02 12:28:50 +02:00
John Ferlan
6e69166ef1 valgrind: Adjust filter for _dl_allocate_tls
More tests are now using the path - adjust the filter to include any
path from a test through pthread_create to _dl_allocate_tls
2013-08-01 17:04:28 -04:00
John Ferlan
3b4b121423 tests: Coverity found new NULL_RETURNS
Coverity reported the existing missing check of the return value and
subsequent use from a call to virJSONValueFromString() in testJSONAddRemove().
2013-08-01 17:04:28 -04:00
Jincheng Miao
a320730a88 build: fix qemuagenttest build with -O0 in fedora 19.
When building libvirt with -O0 flag in fedora 19, it will fail to
generate qemuagenttest, a link error occurs like:

./.libs/libqemumonitortestutils.a(qemumonitortestutils.o): In function `qemuMonitorTestFree':
libvirt/tests/qemumonitortestutils.c:346: undefined reference to `qemuMonitorClose'
./.libs/libqemumonitortestutils.a(qemumonitortestutils.o): In function `qemuMonitorTestNew':
libvirt/tests/qemumonitortestutils.c:870: undefined reference to `qemuMonitorOpen'
collect2: error: ld returned 1 exit status

Fix it by listing libraries in the correct order to avoid lazy linkage.

Signed-off-by: Eric Blake <eblake@redhat.com>
2013-08-01 14:07:03 -06:00
Daniel P. Berrange
aedd46e7e3 Add support for systemd cgroup mount
Systemd uses a named cgroup mount for tracking processes. Add
it as another type of controller, albeit one which we have to
special case in a number of places. In particular we must
never create/delete directories there, nor add tasks. Essentially
the systemd mount is to be considered read-only for libvirt.

With this change both the virCgroupDetectPlacement and
virCgroupCopyPlacement methods must be invoked. The copy
placement method will copy setup for resource controllers
only. The detect placement method will probe for any
named controllers, or resource controllers not already
setup.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2013-07-31 19:27:19 +01:00
Daniel P. Berrange
4574b475df Add APIs for formatting systemd slice/scope names
There are some interesting escaping rules to consider when dealing
with systemd slice/scope names. Thus it is helpful to have APIs
for formatting names

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2013-07-31 19:24:53 +01:00
Peter Krempa
2d95e8b100 qemuagenttest: Add tests for CPU plug functions and helpers 2013-07-31 14:45:46 +02:00
Peter Krempa
fea2590a02 qemuagenttest: Introduce testing of shutdown commands
This patch exports a few utility functions and adds testing of shutdown
commands of the guest agent.
2013-07-31 14:25:43 +02:00
Peter Krempa
f3a9391bec qemuagenttest: Add testing of agent suspend modes 2013-07-31 14:25:43 +02:00
Peter Krempa
725ee3b1d5 qemuagenttest: Test the filesystem trimming 2013-07-31 14:25:43 +02:00
Peter Krempa
5c94dfdd76 tests: Add qemuagenttest
Add a basic test framework with two simple tests to test guest agent
interaction.
2013-07-31 14:25:43 +02:00
Peter Krempa
e32f6e778b qemumonitortestutils: Add the ability to check arguments of commands
This patch adds helpers that allow to check for argument values in
commands sent to the monitor.
2013-07-31 14:25:43 +02:00
Peter Krempa
69441df4d0 qemumonitortestutils: Improve error reporting from mock qemu monitor
Use the JSON error messages to report errors back to the caller in
addition to erroring out. The error reported from the event loop from
the mock function of the monitor was later overwritten by the call to
the monitor/agent interaction API. This will also allow testing of error
reporting.
2013-07-31 14:25:43 +02:00
Peter Krempa
659fe6d2db qemumonitortestutils: Add instrumentation for guest agent testing
Add helper functions to open guest agent connections and a handler for
replying to the "guest-sync" command.
2013-07-31 14:25:43 +02:00
Peter Krempa
f6bb917e6a qemumonitortestutils: Split lines on \n instead of \r\n
The normal monitor uses windows line endings, where the agent monitor
uses only newlines. Change this to tolerate both approaches and allow to
use the utilities for guest agent tests.
2013-07-31 14:25:43 +02:00
Peter Krempa
5467cbef4b qemumonitortestutils: Refactor the test helpers to allow reuse
Refactor the test helpers to allow adding callbacks to verify the
monitor responses instead of simple command name checking and clean up
various parts to prepare for adding guest agent tests.
2013-07-31 14:25:43 +02:00
Peter Krempa
3383480430 qemumonitortestutils: Split up creation of the test to allow reuse
The instrumentation for the monitor test can be hacked for qemu agent
testing. Split out the monitor specific stuff to allow using the code in
guest agent tests in the future.
2013-07-31 14:25:43 +02:00
Peter Krempa
a63a7a5af9 qemumonitortestutils: Don't crash on non fully initialized test
The qemumonitorjsontest crashed when one of the initialization steps
done before starting the worker thread failed. This patch fixes this by
trying to pthread_join() the thread only after it was created.
2013-07-31 14:25:43 +02:00
Peter Krempa
5bf61f3818 qemumonitortestutils: remove multiline function calls 2013-07-31 14:25:43 +02:00
Peter Krempa
65f3f9dd78 qemumonitortestutils: Use VIR_DELETE_ELEMENT and VIR_APPEND_ELEMENT
Simplify the code using the existing helpers instead of open coding the
same functionality.
2013-07-31 14:25:43 +02:00
Peter Krempa
d24dbdd0a2 qemumonitortestutils: Use consistent header style and line spacing 2013-07-31 14:25:43 +02:00
Jiri Denemark
df166a611b tests: Put a mock library at the start of LD_PRELOAD
This fixes vircgrouptest when run in a sandbox which already overrides
open() and others.
2013-07-30 17:05:43 +02:00
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