Commit Graph

1376 Commits

Author SHA1 Message Date
John Ferlan
01757a46ee xencapstest: Resolve Coverity CHECKED_RETURN error
The return from virInitialize() needs to be checked.
2013-05-21 09:22:21 -04:00
Eric Blake
d7f53c7b97 maint: use LGPL correctly
Several files called out COPYING or COPYING.LIB instead of using
the normal boilerplate.  It's especially important that we don't
call out COPYING from an LGPL file, since COPYING is traditionally
used for the GPL.  A few files were lacking copyright altogether.

* src/rpc/gendispatch.pl: Add missing copyright.
* Makefile.nonreentrant: Likewise.
* src/check-symfile.pl: Likewise.
* src/check-symsorting.pl: Likewise.
* src/driver.h: Likewise.
* src/internal.h: Likewise.
* tools/libvirt-guests.sh.in: Likewise.
* tools/virt-pki-validate.in: Mention copyright in comment, not just code.
* tools/virt-sanlock-cleanup.in: Likewise.
* src/rpc/genprotocol.pl: Spell out license terms.
* src/xen/xend_internal.h: Likewise.
* src/xen/xend_internal.c: Likewise.
* Makefile.am: Likewise.
* daemon/Makefile.am: Likewise.
* docs/Makefile.am: Likewise.
* docs/schemas/Makefile.am: Likewise.
* examples/apparmor/Makefile.am: Likewise.
* examples/domain-events/events-c/Makefile.am: Likewise.
* examples/dominfo/Makefile.am: Likewise.
* examples/domsuspend/Makefile.am: Likewise.
* examples/hellolibvirt/Makefile.am: Likewise.
* examples/openauth/Makefile.am: Likewise.
* examples/python/Makefile.am: Likewise.
* examples/systemtap/Makefile.am: Likewise.
* examples/xml/nwfilter/Makefile.am: Likewise.
* gnulib/lib/Makefile.am: Likewise.
* gnulib/tests/Makefile.am: Likewise.
* include/Makefile.am: Likewise.
* include/libvirt/Makefile.am: Likewise.
* python/Makefile.am: Likewise.
* python/tests/Makefile.am: Likewise.
* src/Makefile.am: Likewise.
* tests/Makefile.am: Likewise.
* tools/Makefile.am: Likewise.
* configure.ac: Likewise.

Signed-off-by: Eric Blake <eblake@redhat.com>
2013-05-20 14:03:48 -06:00
Osier Yang
3a6204cbbd qemu: Add callback struct for qemuBuildCommandLine
Since 0d70656afd, it starts to access the sysfs files to build
the qemu command line (by virSCSIDeviceGetSgName, which is to find
out the scsi generic device name by adpater🚌target:unit), there
is no way to work around, qemu wants to see the scsi generic device
like "/dev/sg6" anyway.

And there might be other places which need to access sysfs files
when building qemu command line in future.

Instead of increasing the arguments of qemuBuildCommandLine, this
introduces a new callback for qemuBuildCommandLine, and thus tests
can register their own callbacks for sysfs test input files accessing.

* src/qemu/qemu_command.h: (New callback struct
                            qemuBuildCommandLineCallbacks;
                            extern buildCommandLineCallbacks)
* src/qemu/qemu_command.c: (wire up the callback struct)
* src/qemu/qemu_driver.c: (Use the new syntax of qemuBuildCommandLine)
* src/qemu/qemu_hotplug.c: Likewise
* src/qemu/qemu_process.c: Likewise
* tests/testutilsqemu.[ch]: (Helper testSCSIDeviceGetSgName;
                             callback struct testCallbacks;)
* tests/qemuxml2argvtest.c: (Use testCallbacks)
* src/tests/qemuxmlnstest.c: (Like above)
2013-05-20 20:14:19 +08:00
Viktor Mihajlovski
4fb50623a7 test: fix VPATH fchosttest failure
Running make check in a VPATH configured build directory fails
in fchosttest as the test data files are searched for relative to
the current working directory.

Signed-off-by: Viktor Mihajlovski <mihajlov@linux.vnet.ibm.com>
2013-05-17 12:09:52 +02:00
Ján Tomko
25b98d31ec schema: make source optional in volume XML
We don't parse it anyway.

https://bugzilla.redhat.com/show_bug.cgi?id=893273
2013-05-17 08:35:08 +02:00
Ján Tomko
a07b88ee03 schema: require target path in storage pool xml
Make target path mandatory for pool types that require target,
since we refuse to parse a target without a path.

https://bugzilla.redhat.com/show_bug.cgi?id=893273
2013-05-17 08:33:22 +02:00
Osier Yang
9049d6a8c7 qemu: Change values of disk discard
QEMU might support more values for "-drive discard", so using Bi-state
values (on/off) for it doesn't make sense.

"on" maps to "unmap", "off" maps to "ignore":

<...>
@var{discard} is one of "ignore" (or "off") or "unmap" (or "on") and
controls whether @dfn{discard} (also known as @dfn{trim} or @dfn{unmap})
requests are ignored or passed to the filesystem.  Some machine types
may not support discard requests.
</...>
2013-05-17 13:03:25 +08:00
Jiri Denemark
fd74f74fe6 qemu: Implement support for locking domain's memory pages 2013-05-16 23:21:58 +02:00
Osier Yang
6765316093 conf: Introduce sgio for hostdev
"sgio" is only valid for scsi host device.
2013-05-17 00:46:44 +08:00
Osier Yang
f2c1d9a804 conf: Introduce <shareable> for hostdev
Unlike disk device, the scsi-generic always writethrough the data,
so no need to introduce a "cache" tag, and set "cache=off".
2013-05-16 23:41:25 +08:00
Osier Yang
e3b40bec42 conf: Fix the bug of disk->copy_on_read formating
The reason for it's not exposed for such long time is that the
enums for VirtioEventIdx and CopyOnReadType have same enum values
and Correspondingstrings. This fixes the bug and adds test.
2013-05-16 23:07:51 +08:00
Eric Blake
504b4a8dae string: test VIR_STRDUP
The surest way to avoid regressions is to test documented behavior :)

* tests/virstringtest.c (testStrdup): New test case.

Signed-off-by: Eric Blake <eblake@redhat.com>
2013-05-15 19:28:00 -06:00
John Ferlan
a2c37618d3 Adjust improperly formatted <sysinfo> uuid
If the <sysinfo> system table 'uuid' field is improperly formatted,
then qemu will fail to start the guest with the error:

virsh start dom
error: Failed to start domain dom
error: internal error process exited while connecting to monitor: Invalid SMBIOS UUID string

This was because the parsing rules were lax with respect to allowing extraneous
spaces and dashes in the provided UUID.  As long as there were 32 hexavalues
that matched the UUID for the domain the string was accepted. However startup
failed because the string format wasn't correct. This patch will adjust the
string format so that when it's presented to the driver it's in the expected
format.

Added a test for uuid comparison within sysinfo.
2013-05-15 12:05:22 -04:00
John Ferlan
21540f5ee3 Validate the bios_date format for <sysinfo>
Add incorrectly formatted bios_date validation test
2013-05-15 12:05:22 -04:00
Osier Yang
a7c4202cdd qemu: Support discard for disk
QEMU introduced "discard" option for drive since commit a9384aff53,

<...>
@var{discard} is one of "ignore" (or "off") or "unmap" (or "on") and
controls whether @dfn{discard} (also known as @dfn{trim} or @dfn{unmap})
requests are ignored or passed to the filesystem.  Some machine types
may not support discard requests.
</...>

This patch exposes the support in libvirt.

QEMU supported "discard" for "-drive" since v1.5.0-rc0:

% git tag --contains a9384aff53
contains
v1.5.0-rc0
v1.5.0-rc1

So this only detects the capability bit using virQEMUCapsProbeQMPCommandLine.
2013-05-15 19:01:00 +08:00
Martin Kletzander
85ec7ff6fd qemu: Add VNC WebSocket support
Adding a VNC WebSocket support for QEMU driver.  This functionality is
in upstream qemu from commit described as v1.3.0-982-g7536ee4, so the
capability is being recognized based on QEMU version for now.
2013-05-15 09:48:05 +02:00
Osier Yang
5606c7a867 tests: Sort the EXTRA_DIST list
Commit 1cc8259bfe fixes the build failure, but forgot to keep the
list alphanumeric sorted.
2013-05-15 11:34:27 +08:00
Osier Yang
77b54b9661 qemu: New XML to disable memory merge at guest startup
QEMU introduced command line "-mem-merge=on|off" (defaults to on) to
enable/disable the memory merge (KSM) at guest startup. This exposes
it by new XML:
  <memoryBacking>
    <nosharepages/>
  </memoryBacking>

The XML tag is same with what we used internally for old RHEL.
2013-05-15 11:25:45 +08:00
Daniel P. Berrange
8639bc5db4 Rename rbd-invalid.xml to rbd-no-colon.xml
Files ending in -invalid.xml are expected to violate the
XML schema check. The RBD file does not so must have a
different filename.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2013-05-14 20:09:48 +01:00
Osier Yang
1cc8259bfe tests: Add fchostdata in EXTRA_DIST
Pushed under build-breaker rule.
2013-05-15 01:18:26 +08:00
Daniel P. Berrange
2a2bc1517a Forbid use of ':' in RBD pool names
The QEMU command line syntax for RBD disks is

   file=rbd:pool/image:opt1=val1:opt2=val2...

There is no way to escape the ':' if it appears in the
pool or image name. Thus it must be explicitly forbidden
if it occurs in the libvirt XML. People are known to
be abusing the lack of escaping in current libvirt to
pass arbitrary args to QEMU.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2013-05-14 15:02:42 +01:00
Daniel P. Berrange
78cff68ca3 Workaround issue with clang and inline functions with static vars
Clang does not like it when you pass a static variable to an
inline function

 vircgroupmock.c:462:22: error: static variable 'fakesysfsdir' is
  used in an inline function with external linkage [-Werror,-Wstatic-in-inline]

Just make the var non-static to avoid this

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2013-05-14 15:00:22 +01:00
Eric Blake
bd56d0d813 qemu: query command line options in QMP
Ever since the conversion to using only QMP for probing features
of qemu 1.2 and newer, we have been unable to detect features
that are added only by additional command line options.  For
example, we'd like to know if '-machine mem-merge=on' (added
in qemu 1.5) is present.  To do this, we will take advantage
of qemu 1.5's query-command-line-parameters QMP call [1].

This patch wires up the framework for probing the command results;
if the QMP command is missing, or if a particular command line
option does not output any parameters (for example, -net uses
a polymorphic parser, which showed up as no parameters as of qemu
1.5), we silently treat that command as having no results.

[1] https://lists.gnu.org/archive/html/qemu-devel/2013-04/msg05180.html

* src/qemu/qemu_monitor.h (qemuMonitorGetOptions)
(qemuMonitorSetOptions)
(qemuMonitorGetCommandLineOptionParameters): New functions.
* src/qemu/qemu_monitor_json.h
(qemuMonitorJSONGetCommandLineOptionParameters): Likewise.
* src/qemu/qemu_monitor.c (_qemuMonitor): Add cache field.
(qemuMonitorDispose): Clean it.
(qemuMonitorGetCommandLineOptionParameters): Implement new function.
* src/qemu/qemu_monitor_json.c
(qemuMonitorJSONGetCommandLineOptionParameters): Likewise.
(testQemuMonitorJSONGetCommandLineParameters): Test it.

Signed-off-by: Eric Blake <eblake@redhat.com>
2013-05-13 15:15:54 -06:00
Eric Blake
764bb5e5aa qemu: use bool in monitor struct
Follows on the heels of other bool cleanups, such as commit 93002b98.

* src/qemu/qemu_monitor.h (qemuMonitorOpen, qemuMonitorOpenFD):
Update json parameter type.
* src/qemu/qemu_monitor.c (qemuMonitorOpen, qemuMonitorOpenFD):
Likewise.
(_qemuMonitor): Adjust field type.
* src/qemu/qemu_domain.h (_qemuDomainObjPrivate): Likewise.
* src/qemu/qemu_domain.c (qemuDomainObjPrivateXMLParse): Adjust
client.
* src/qemu/qemu_process.c (qemuProcessStart): Likewise.
* tests/qemumonitortestutils.c (qemuMonitorTestNew): Likewise.

Signed-off-by: Eric Blake <eblake@redhat.com>
2013-05-13 15:15:54 -06:00
Eric Blake
547a7c778a json: support removing a value from an object
In an upcoming patch, I need the way to safely transfer a nested
virJSON object out of its parent container for independent use,
even after the parent is freed.

* src/util/virjson.h (virJSONValueObjectRemoveKey): New function.
(_virJSONObject, _virJSONArray): Use correct type.
* src/util/virjson.c (virJSONValueObjectRemoveKey): Implement it.
* src/libvirt_private.syms (virjson.h): Export it.
* tests/jsontest.c (mymain): Test it.

Signed-off-by: Eric Blake <eblake@redhat.com>
2013-05-13 15:15:54 -06:00
Gene Czarcinski
ccff335f83 Support for static routes on a virtual bridge
network: static route support for <network>

This patch adds the <route> subelement of <network> to define a static
route.  the address and prefix (or netmask) attribute identify the
destination network, and the gateway attribute specifies the next hop
address (which must be directly reachable from the containing
<network>) which is to receive the packets destined for
"address/(prefix|netmask)".

These attributes are translated into an "ip route add" command that is
executed when the network is started. The command used is of the
following form:

  ip route add <address>/<prefix> via <gateway> \
               dev <virbr-bridge> proto static metric <metric>

Tests are done to validate that the input data are correct.  For
example, for a static route ip definition, the address must be a
network address and not a host address.  Additional checks are added
to ensure that the specified gateway is directly reachable via this
network (i.e. that the gateway IP address is in the same subnet as one
of the IP's defined for the network).

prefix='0' is supported for both family='ipv4' address='0.0.0.0'
netmask='0.0.0.0' or prefix='0', and for family='ipv6' address='::',
prefix=0', although care should be taken to not override a desired
system default route.

Anytime an attempt is made to define a static route which *exactly*
duplicates an existing static route (for example, address=::,
prefix=0, metric=1), the following error message will be sent to
syslog:

    RTNETLINK answers: File exists

This can be overridden by decreasing the metric value for the route
that should be preferred, or increasing the metric for the route that
shouldn't be preferred (and is thus in place only in anticipation that
the preferred route may be removed in the future).  Caution should be
used when manipulating route metrics, especially for a default route.

Note: The use of the command-line interface should be replaced by
direct use of libnl so that error conditions can be handled better.  But,
that is being left as an exercise for another day.

Signed-off-by: Gene Czarcinski <gene@czarc.net>
Signed-off-by: Laine Stump <laine@laine.org>
2013-05-13 16:14:40 -04:00
Eric Blake
84f3777a79 build: avoid shadowed variable in fdstreamtest
On RHEL 6.4 (gcc 4.4.7), I got:

fdstreamtest.c: In function 'testFDStreamReadCommon':
fdstreamtest.c:44: error: declaration of 'tmpfile' shadows a global declaration [-Wshadow]

* tests/fdstreamtest.c (testFDStreamReadCommon)
(testFDStreamWriteCommon): Rename 'tmpfile' variable.

Signed-off-by: Eric Blake <eblake@redhat.com>
2013-05-13 13:38:18 -06:00
Daniel P. Berrange
13579d4544 Add 'nbd' as a valid filesystem driver type
The <filesystem> element can now accept a <driver type='nbd'/>
as an alternative to 'loop'. The benefit of NBD is support
for non-raw disk image formats.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2013-05-13 13:15:19 +01:00
Daniel P. Berrange
ada14b86cc Add support for storage format in FS <driver>
Extend the <driver> element in filesystem devices to
allow a storage format to be set. The new attribute
uses 'format' to reflect the storage format. This is
different from the <driver> element in disk devices
which use 'type' to reflect the storage format. This
is because the 'type' attribute on filesystem devices
is already used for the driver backend, for which the
disk devices use the 'name' attribute. Arggggh.

Anyway for disks we have

   <driver name="qemu" type="raw"/>

And for filesystems this change means we now have

   <driver type="loop" format="raw"/>

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2013-05-13 13:15:19 +01:00
Osier Yang
bab6ee6b30 qemu: Support bootindex for scsi host device 2013-05-13 19:08:32 +08:00
Osier Yang
f4bb7b4807 Introduce <readonly> for hostdev
Since it's generic enough to be used by other types in future, I
put it in <hostdev> as sub-element, though now it's only used by
scsi host device.
2013-05-13 19:02:40 +08:00
Han Cheng
0d70656afd qemu: Build qemu command line for scsi host device
Except the scsi host device's controller is "lsilogic", mapping
between the libvirt attributes and scsi-generic properties is:

  libvirt     qemu
-----------------------------------------
  controller  bus ($libvirt_controller.0)
  bus         channel
  target      scsi-id
  unit        lun

For scsi host device with "lsilogic" controller, the mapping is:
('target (libvirt)' must be 0, as it's not used; 'unit (libvirt)
must <= 7).

  libvirt            qemu
----------------------------------------------------------
  controller && bus  bus ($libvirt_controller.$libvirt_bus)
  unit               scsi-id

It's not good to hardcode/hard-check limits of these attributes,
and even worse, these limits are not documented, one has to find
out by either testing or reading the qemu code, I'm looking forward
to qemu expose limits like these one day). For example, exposing
"max_target", "max_lun" for megasas:

static const struct SCSIBusInfo megasas_scsi_info = {
    .tcq = true,
    .max_target = MFI_MAX_LD,
    .max_lun = 255,

    .transfer_data = megasas_xfer_complete,
    .get_sg_list = megasas_get_sg_list,
    .complete = megasas_command_complete,
    .cancel = megasas_command_cancel,
};

Example of the qemu command line (lsilogic controller):

  -drive file=/dev/sg2,if=none,id=drive-hostdev-scsi_host7-0-0-0 \
  -device scsi-generic,bus=scsi0.0,scsi-id=8,\
  drive=drive-hostdev-scsi_host7-0-0-0,id=hostdev-scsi_host7-0-0-0

Example of the qemu command line (virtio-scsi controller):

  -drive file=/dev/sg2,if=none,id=drive-hostdev-scsi_host7-0-0-0 \
  -device scsi-generic,bus=scsi0.0,channel=0,scsi-id=128,lun=128,\
  drive=drive-hostdev-scsi_host7-0-0-0,id=hostdev-scsi_host7-0-0-0

Signed-off-by: Han Cheng <hanc.fnst@cn.fujitsu.com>
Signed-off-by: Osier Yang <jyang@redhat.com>
2013-05-13 18:50:16 +08:00
Han Cheng
b238c0bec1 qemu: New cap flags for scsi-generic
Adding two cap flags for scsi-generic:
  QEMU_CAPS_SCSI_GENERIC
  QEMU_CAPS_SCSI_GENERIC_BOOTINDEX

Signed-off-by: Han Cheng <hanc.fnst@cn.fujitsu.com>
Signed-off-by: Osier Yang <jyang@redhat.com>
2013-05-13 18:30:26 +08:00
Han Cheng
5c811dcec5 conf: Generic XMLs for scsi hostdev
An example of the scsi hostdev XML:

    <hostdev mode='subsystem' type='scsi'>
      <source>
        <adapter name='scsi_host0'/>
        <address bus='0' target='0' unit='0'/>
      </source>
      <address type='drive' controller='0' bus='0' target='4' unit='8'/>
    </hostdev>

Controller is implicitly added for scsi hostdev, though the scsi
controller's model defaults to "lsilogic", which might be not what
the user wants (same problem exists for virtio-scsi disk). It's
the existing problem, will be addressed later.

The device address must be specified manually. Later patch will let
libvirt generate it automatically.

This only introduces the generic XMLs for scsi hostdev, later patches
will add other elements, e.g. <readonly>, <shareable>.

Signed-off-by: Han Cheng <hanc.fnst@cn.fujitsu.com>
Signed-off-by: Osier Yang <jyang@redhat.com>
2013-05-13 18:23:50 +08:00
Osier Yang
9706d85fe9 tests: Add tests for fc_host
Since the NPIV machine is not easy to get, it's very likely to
introduce regressions when doing changes on the existing code.
This patch dumps part of the sysfs files (the necessary ones)
of fc_host as test input data, to test the related util functions.
It could be extended for more fc_host related testing in future.
2013-05-13 17:24:18 +08:00
Daniel P. Berrange
31989e66c6 Add a test case for the fdstream file read/write code
Add a test case which exercises the virFDStreamOpenFile
and virFDStreamCreateFile methods. Ensure that both the
synchronous and non-blocking iohelper code paths work.
This validates the regression recently fixed which
broke reading in non-blocking mode

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2013-05-10 19:57:18 +01:00
Laine Stump
bfe7721d50 util: move virFile* functions from virutil.c to virfile.c
These all existed before virfile.c was created, and for some reason
weren't moved.

This is mostly straightfoward, although the syntax rule prohibiting
write() had to be changed to have an exception for virfile.c instead
of virutil.c.

This movement pointed out that there is a function called
virBuildPath(), and another almost identical function called
virFileBuildPath(). They really should be a single function, which
I'll take care of as soon as I figure out what the arglist should look
like.
2013-05-10 13:09:30 -04:00
John Ferlan
7ca784c4a5 Build breaker - requires VIR_FROM_THIS 2013-05-10 08:52:43 -04:00
Michal Privoznik
e60b9783e1 Adapt to VIR_STRDUP and VIR_STRNDUP in tests/* 2013-05-10 11:54:29 +02:00
Eric Blake
1d21b884a3 tests: use portable shell code
'make check' fails since commit 470d5c46 on any system with dash
as /bin/sh, because '<<<' is a bash extension.  For example:

nwfilterschematest: 23: /home/eblake/libvirt/tests/schematestutils.sh: Syntax error: redirection unexpected

Also, there is no need to spawn a grep process when shell globbing
can do the same.

* tests/schematestutils.sh: Replace bashism and subprocess with a
faster and portable construct.

Signed-off-by: Eric Blake <eblake@redhat.com>
2013-05-09 11:46:45 -06:00
Daniel P. Berrange
7c5752dd57 Disable some URI tests on older libxml2
Older versions of libxml2 could not correctly parse certain
URIs. This causes test failures. There's nothing libvirt can
do about this, so disable the problem tests on old libxml2
versions

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2013-05-09 17:02:18 +01:00
Ján Tomko
1d96440a06 conf: don't crash on a tpm device with no backends
Print an error instead of crashing when a TPM device without
a backend is specified.

Add a test for tpm device with no backend, which should fail
with a parse error.

https://bugzilla.redhat.com/show_bug.cgi?id=961252
2013-05-09 14:25:11 +02:00
Ján Tomko
470d5c4654 tests: files named '.*-invalid.xml' should fail validation
Currently, using an invalid XML in tests fails, because
the schema test expects all of them to be valid.

Treat files with -invalid.xml suffix as invalid and expect
them to fail validation.
2013-05-09 14:25:11 +02:00
Daniel Hansel
e914dcfdaa rpc: message related sizes enlarged
We have seen an issue on s390x platform where domain XMLs larger than 1MB
were used. The define command was finished successfully. The dumpxml command
was not successful (i.e. could not encode message payload).

Enlarged message related sizes (e.g. maximum string size, message size, etc.)
to handle larger system configurations used on s390x platform.

To improve handling of the RPC message size the allocation during encode process
is changed to a dynamic one (i.e. starting with 64kB initial size and increasing
that size in steps up to 16MB if the payload data is larger).

Signed-off-by: Daniel Hansel <daniel.hansel@linux.vnet.ibm.com>
Signed-off-by: Viktor Mihajlovski <mihajlov@linux.vnet.ibm.com>
2013-05-07 13:29:58 +02:00
Eric Blake
c21c38d71b build: clean up stray files found by 'make distcheck'
'make distcheck' complained:

ERROR: files left in build directory after distclean:
./python/libvirt.pyc
./tests/commandhelper.log

Problems introduced in commits f015495 and 25ea8e4 (both v1.0.3).

* tests/commandtest.c (test21): Check (and clean) log file.
* tests/commanddata/test21.log: New file.
* python/Makefile.am (CLEANFILES): Clean up compiled python files.

Signed-off-by: Eric Blake <eblake@redhat.com>
2013-05-06 14:01:08 -06:00
Laine Stump
cc8f9e677c util: fix compile errors caused by moving string functions
commit 7c9a2d8 missed adding in a few #include "virstring.h"s, causing
builds to fail.
2013-05-02 13:27:19 -04:00
Michal Privoznik
7c9a2d88cd virutil: Move string related functions to virstring.c
The source code base needs to be adapted as well. Some files
include virutil.h just for the string related functions (here,
the include is substituted to match the new file), some include
virutil.h without any need (here, the include is removed), and
some require both.
2013-05-02 16:56:55 +02:00
Viktor Mihajlovski
3a82f628a9 S390: Do not generate a default USB controller
For s390 we don't want to have a default USB device generated even
if QEMU is silently tolerating -usb on the command line. This may change
in the future.
Another reason to avoid the USB controller is that it implies a PCI
bus which might cause a regression at some later point in time.
The following change will set the USB controller model to 'none'
unless a model or address has been specified, which can be the case
if a legacy definition is loaded or the XML writer knows what
she/he's doing.
Requiring the user to explicitly disable USB on systems not supporting
it seems cumbersome.

Signed-off-by: Viktor Mihajlovski <mihajlov@linux.vnet.ibm.com>
2013-04-30 19:18:43 -06:00
Ján Tomko
dfb4834940 qemu: honor allowDiskFormatProbing when parsing command line
My commit 024e9af broke this.
2013-04-29 15:52:02 +02:00
Ján Tomko
877bc08947 qemu: don't always reserve PCI addresses for implicit controllers
In the past we automatically added a USB controller and assigned
it a PCI address (0:0:1.2) even on machines without a PCI bus.
This didn't break machines with no PCI bus  because the command
line for it is just '-usb', with no mention of the PCI bus.

The implicit IDE controller (reserved address 0:0:1.1) has
no command line at all.

Commit b33eb0dc removed the ability to reserve PCI addresses
on machines without a PCI bus. This made them stop working,
since there would always be the implicit USB controller.

Skip the reservation of addresses for these controllers when
there is no PCI bus, instead of failing.
2013-04-27 12:55:46 +02:00