]> xenbits.xensource.com Git - libvirt.git/log
libvirt.git
10 years agolibxl: Receive migration data in a thread
Jim Fehlig [Wed, 12 Nov 2014 22:32:02 +0000 (15:32 -0700)]
libxl: Receive migration data in a thread

The libxl driver receives migration data within an IO callback invoked
by the event loop, effectively disabling the event loop while migration
occurs.

This patch moves receving of the migration data to a thread.  The
incoming connection is still accepted in the IO callback, but control
is immediately returned to the event loop after spawning the thread.

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
10 years agolibxl: Allow libxl to find pygrub binary.
Ian Campbell [Fri, 21 Nov 2014 14:32:53 +0000 (14:32 +0000)]
libxl: Allow libxl to find pygrub binary.

Specifying an explicit path to pygrub (e.g. BINDIR "/pygrub") only works if
Xen and libvirt happen to be installed to the same prefix. A more flexible
approach is to simply specify "pygrub" which will cause libxl to use the
correct path which it knows (since it is built with the same prefix as pygrub).

This is particular problematic in the Debian packaging, since the Debian Xen
package relocates pygrub into a libexec dir, however I think this change makes
sense upstream.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Jim Fehlig <jfehlig@suse.com>
10 years agostorage: rbd: Implement support for passing config file option
Peter Krempa [Tue, 11 Nov 2014 16:31:24 +0000 (17:31 +0100)]
storage: rbd: Implement support for passing config file option

To be able to express some use cases of the RBD backing with libvirt, we
need to be able to specify a config file for the RBD client to qemu as
that is one of the commonly used options.

10 years agostorage: rbd: qemu: Add support for specifying internal RBD snapshots
Peter Krempa [Tue, 11 Nov 2014 10:35:25 +0000 (11:35 +0100)]
storage: rbd: qemu: Add support for specifying internal RBD snapshots

Some storage systems have internal support for snapshots. Libvirt should
be able to select a correct snapshot when starting a VM.

This patch adds a XML element to select a storage source snapshot for
the RBD protocol which supports this feature.

10 years agostorage: Allow parsing of RBD backing strings when building backing chain
Peter Krempa [Tue, 4 Nov 2014 16:35:16 +0000 (17:35 +0100)]
storage: Allow parsing of RBD backing strings when building backing chain

As we now have a common function to parse backing store string for RBD
backing store we can reuse it in the backing store walker so that we
don't fail on files backed by RBD storage.

This patch also adds a few tests to verify that the parsing works as
expected.

10 years agoutil: storagefile: Split out parsing of NBD string into a separate func
Peter Krempa [Tue, 4 Nov 2014 13:07:53 +0000 (14:07 +0100)]
util: storagefile: Split out parsing of NBD string into a separate func

Split out the code so that the function looks homogenous after adding
more protocol specific parsers.

10 years agoutil: split out qemuParseRBDString into a common helper
Peter Krempa [Fri, 31 Oct 2014 16:49:56 +0000 (17:49 +0100)]
util: split out qemuParseRBDString into a common helper

To allow reuse this non-trivial parser code in the backing store parser
this part of the command line parser needs to be split out into a
separate funciton.

10 years agotests: Reflow the expected output from RBD disk test
Peter Krempa [Tue, 11 Nov 2014 09:37:27 +0000 (10:37 +0100)]
tests: Reflow the expected output from RBD disk test

Addition of tested cases to the test will be more obvious.

10 years agoqemu: Refactor qemuBuildNetworkDriveURI to take a virStorageSourcePtr
Peter Krempa [Mon, 10 Nov 2014 16:55:26 +0000 (17:55 +0100)]
qemu: Refactor qemuBuildNetworkDriveURI to take a virStorageSourcePtr

Instead of splitting out various fields, pass the complete structure and
let the function pick various things of it.

As one of the callers isn't using virStorageSourcePtr to store the data,
this patch adds glue code that fills the data into a dummy
virStorageSourcePtr before calling the func.

This change will help when adding new fields that need output processing
in the future.

10 years agoutil: storage: Copy hosts of a storage file only if they exist
Peter Krempa [Thu, 30 Oct 2014 10:52:17 +0000 (11:52 +0100)]
util: storage: Copy hosts of a storage file only if they exist

If there are no hosts for a storage source virStorageSourceCopy and
virStorageSourceNewFromBackingRelative would try to copy them anyways.
As the success of virStorageNetHostDefCopy is determined by returning
a pointer and malloc of 0 elements might return NULL according to the
implementation, the result of the copy function may vary.

Fix this by copying the hosts array only if there are hosts defined.

10 years agoutil: storage: Add notice for extension of struct virStorageSource
Peter Krempa [Thu, 30 Oct 2014 10:42:55 +0000 (11:42 +0100)]
util: storage: Add notice for extension of struct virStorageSource

As we now have a deep copy function for struct virStorageSource add a
notice that extensions of the structure require also appropriate changes
to the virStorageSourceCopy func.

10 years agoutil: buffer: Clarify scope of the escape operation in virBufferEscape
Peter Krempa [Tue, 11 Nov 2014 16:23:49 +0000 (17:23 +0100)]
util: buffer: Clarify scope of the escape operation in virBufferEscape

The escaping is applied only to the string, not the format argument.
State this fact in the docs.

10 years agotest: virstoragetest: Add testing of network disk details
Peter Krempa [Tue, 4 Nov 2014 13:26:45 +0000 (14:26 +0100)]
test: virstoragetest: Add testing of network disk details

To be able to fully test parsing of networked storage strings we need to
add a few fields for: hostname, protocol and auth string.

10 years agodocs: domain: Move docs for storage hosts under the <source> element
Peter Krempa [Wed, 12 Nov 2014 12:54:10 +0000 (13:54 +0100)]
docs: domain: Move docs for storage hosts under the <source> element

The docs describing the <host> element that are under the <source>
element in the XML document were incorrectly placed under the <disk>
element. Move them to the correct place.

10 years agovirsh: sync domdisplay help and manual
Martin Kletzander [Fri, 21 Nov 2014 10:10:21 +0000 (11:10 +0100)]
virsh: sync domdisplay help and manual

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
10 years agoqemu: Add handling for VSERPORT_CHANGE event
Peter Krempa [Thu, 13 Nov 2014 13:09:39 +0000 (14:09 +0100)]
qemu: Add handling for VSERPORT_CHANGE event

New qemu added a new event that is emitted when a virtio serial channel
is opened in the guest OS. This allows us to update the state of the
port in the output-only XML element.

This patch implements the monitor callbacks and necessary handlers to
update the state in the definition.

10 years agoconf: Add channel state for virtio channels to the XML
Peter Krempa [Wed, 29 Oct 2014 15:03:53 +0000 (16:03 +0100)]
conf: Add channel state for virtio channels to the XML

To track state of virtio channels this patch adds a new output-only
attribute called 'state' to the <target> element of virtio channels.

This will be later populated with the guest state of the channel.

10 years agoqemu: monitor: Rename and improve qemuMonitorGetPtyPaths
Peter Krempa [Thu, 13 Nov 2014 15:17:21 +0000 (16:17 +0100)]
qemu: monitor: Rename and improve qemuMonitorGetPtyPaths

To unify future additions that require information from "query-chardev"
rename qemuMonitorGetPtyPaths and friends to qemuMonitorGetChardevInfo
and move the allocation of the returned hash into the top level
function.

10 years agotest: xml2xml: Print full filenames if xml2xml test fails
Peter Krempa [Wed, 29 Oct 2014 14:53:36 +0000 (15:53 +0100)]
test: xml2xml: Print full filenames if xml2xml test fails

To simplify looking for a problem instrument the XML comparator function
with possibility to print the filename of the failed/expected XML
output.

This is necessary as the VIR_TEST_DIFFERENT macro possibly tests two XML
files for the inactive/active state and the resulting error may not be
obvious.

10 years agoconf: Annotate source enums for character device struct members
Peter Krempa [Wed, 29 Oct 2014 12:03:57 +0000 (13:03 +0100)]
conf: Annotate source enums for character device struct members

Add a comment to track which values may be present in certain members of
a struct _virDomainChrDef.

10 years agoqemu: process: report useful error if alias formatting fails
Peter Krempa [Thu, 13 Nov 2014 19:10:51 +0000 (20:10 +0100)]
qemu: process: report useful error if alias formatting fails

When retrieving the paths for PTY devices the alias gets formatted into
a static string. If it doesn't fit we wouldn't report an error.

10 years agodocs: fix a typo in formatdomain.html
Chen Fan [Fri, 21 Nov 2014 05:39:48 +0000 (13:39 +0800)]
docs: fix a typo in formatdomain.html

Signed-off-by: Chen Fan <chen.fan.fnst@cn.fujitsu.com>
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
10 years agostorage: qemu: Fix security labelling of new image chain elements
Peter Krempa [Wed, 19 Nov 2014 17:54:43 +0000 (18:54 +0100)]
storage: qemu: Fix security labelling of new image chain elements

When creating a disk image snapshot the libvirt code would blindly copy
the parents label to the newly created image. This runs into problems
when you start a VM from an image hosted on NFS (or other storage system
that doesn't support selinux labels) and the snapshot destination is on
a storage system that does support selinux labels. Libvirt's code in
that case generates a different security label for the image hosted on
NFS. This label is valid only for NFS images and doesn't allow access in
case of a locally stored image.

To fix this issue libvirt needs to refrain from copying security
information in cases where the default domain seclabel is a better
choice.

This patch repurposes the now unused @force argument of
virStorageSourceInitChainElement to denote whether a copy of the
security labelling stuff should be attempted or not. This allows to
fine-control the copy operation for cases where we need to keep the
label of the old disk vs. the cases where we need to keep the label
unset to use the default domain imagelabel.

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

10 years agobuild: fix build when not using dbus
Eric Blake [Thu, 20 Nov 2014 15:48:19 +0000 (08:48 -0700)]
build: fix build when not using dbus

Commit c0e7022 breaks on a machine that lacks dbus headers:

In file included from util/virdbus.c:24:0:
util/virdbuspriv.h:31:3: error: unknown type name 'dbus_int16_t'

* src/util/virdbuspriv.h (DBusBasicValue): Only provide fallback
when dbus is compiled.

Signed-off-by: Eric Blake <eblake@redhat.com>
10 years agobuild: avoid 32-bit failure on older gcc
Eric Blake [Thu, 20 Nov 2014 15:29:23 +0000 (08:29 -0700)]
build: avoid 32-bit failure on older gcc

On 32-bit platforms with old gcc (hello RHEL 5 gcc 4.1.2), the
build fails with:
virsh-domain.c: In function 'cmdBlockCopy':
virsh-domain.c:2172: warning: comparison is always false due to limited range of data type

Adjust the code to silence the warning.

* tools/virsh-domain.c (cmdBlockCopy): Pacify RHEL 5 gcc.

Signed-off-by: Eric Blake <eblake@redhat.com>
10 years agostorage: Add thread to refresh for createVport
John Ferlan [Tue, 18 Nov 2014 19:51:01 +0000 (14:51 -0500)]
storage: Add thread to refresh for createVport

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

When libvirt create's the vport (VPORT_CREATE) for the vHBA, there isn't
enough "time" between the creation and the running of the following
backend->refreshPool after a backend->startPool in order to find the LU's.
Population of LU's happens asynchronously when udevEventHandleCallback
discovers the "new" vHBA port.  Creation of the infrastructure by udev
is an iterative process creating and discovering actual storage devices and
adjusting the environment.

Because of the time it takes to discover and set things up, the backend
refreshPool call done after the startPool call will generally fail to
find any devices. This leaves the newly started pool appear empty when
querying via 'vol-list' after startup. The "workaround" has always been
to run pool-refresh after startup (or any time thereafter) in order to
find the LU's. Depending on how quickly run after startup, this too may
not find any LUs in the pool. Eventually though given enough time and
retries it will find something if LU's exist for the vHBA.

This patch adds a thread to be executed after the VPORT_CREATE which will
attempt to find the LU's without requiring the external run of refresh-pool.
It does this by waiting for 5 seconds and searching for the LU's. If any
are found, then the thread completes; otherwise, it will retry once more
in another 5 seconds.  If none are found in that second pass, the thread
gives up.

Things learned while investigating this... No need to try and fill the
pool too quickly or too many times. Over the course of creation, the udev
code may 'add', 'change', and 'delete' the same device. So if the refresh
code runs and finds something, it may display it only to have a subsequent
refresh appear to "lose" the device. The udev processing doesn't seem to
have a way to indicate that it's all done with the creation processing of a
newly found vHBA. Only the Lone Ranger has silver bullets to fix everything.

10 years agostorage: Fix issue finding LU's when block doesn't exist
John Ferlan [Wed, 19 Nov 2014 15:06:22 +0000 (10:06 -0500)]
storage: Fix issue finding LU's when block doesn't exist

Fix a problem in the getBlockDevice and processLU where retval initialized
to zero causing some failures to erroneously continue through to the
virStorageBackendSCSINewLun with an attempt to find a path for "/dev/(null)".
This would fail approximately 10 seconds later with debug message:

virStorageBackendSCSINewLun:203 :
     No stable path found for '/dev/(null)' in '/dev/disk/by-path'

The root cause of the issue is for many /sys/bus/scsi/devices/<lun path>
there is no "block*" device found for the vHBA's, where "<lun path>" are
the various paths created for the vHBA, such as "17:0:0:0", "17:0:1:0",
"17:0:2:0", "17:0:3:0", etc.  If the block device isn't found, then the
directory should just be ignored rather than attempting to process it.

The bug was that in getBlockDevice the assumption was "block" would exist
and either getNewStyleBlockDevice or getOldStyleBlockDevice would fill in
@block_device. However, if 'block*' doesn't exist, then the code returned
NULL for block_device *and* a good (zero) retval value.  This caused the
processLU code to attempt the virStorageBackendSCSINewLun which failed
"at some point in time" in the future.

After this change - on test system the refresh-pool didn't have a noticable
pause of about 20 seconds - it completed within a second since no longer
was there an attempt/need to find "/dev/(null)".

Additionally, the virStorageBackendSCSIFindLU's shouldn't be declaring
found unless the processLU actually returns success. This will be
important in the followup patch which relies on whether a LU was found.

10 years agodocs: Remove references to unused libvirt-libvirt.html
Nehal J Wani [Thu, 20 Nov 2014 15:13:11 +0000 (15:13 +0000)]
docs: Remove references to unused libvirt-libvirt.html

The libvirt-libvirt.html file is no longer generated so
should not be referenced by the Makefile.am

10 years agobuild: fix build with older dbus headers
Eric Blake [Wed, 19 Nov 2014 21:57:30 +0000 (14:57 -0700)]
build: fix build with older dbus headers

Compilation on a RHEL 5 host failed, due to the older dbus headers
present on that machine, and triggered by commit 2aa167ca:

util/virdbus.c: In function 'virDBusMessageIterDecode':
util/virdbus.c:952: error: 'DBusBasicValue' undeclared (first use in this function)

* m4/virt-dbus.m4 (LIBVIRT_CHECK_DBUS): Check for DBusBasicValue.
* src/util/virdbuspriv.h (DBusBasicValue): Provide fallback.

Signed-off-by: Eric Blake <eblake@redhat.com>
10 years agorpc: do not fail if the pid of the connecting process is not set
Giuseppe Scrivano [Wed, 19 Nov 2014 14:54:14 +0000 (15:54 +0100)]
rpc: do not fail if the pid of the connecting process is not set

getsockopt(sock->fd, SOL_SOCKET, SO_PEERCRED, ...) sets the pid to 0
when the process that opens the connection is in another container.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
10 years agoutil: don't log failure when older iptables lacks -w
Eric Blake [Wed, 19 Nov 2014 23:18:55 +0000 (16:18 -0700)]
util: don't log failure when older iptables lacks -w

Commit dc33e6e4 caused older platforms like Fedora 20 to emit
scary log messages at startup:

2014-11-19 23:12:58.800+0000: 28906: error : virCommandWait:2532 : internal error: Child process (/usr/sbin/iptables -w -L -n) unexpected exit status 2: iptables v1.4.19.1: unknown option "-w"
Try `iptables -h' or 'iptables --help' for more information.

Since we are probing and expect to handle the case where -w is not
supported, we should not let virCommand log it as an error.

* src/util/virfirewall.c (virFirewallCheckUpdateLock): Handle
non-zero status ourselves.

Signed-off-by: Eric Blake <eblake@redhat.com>
10 years agoqemu: Really fix crash in tunnelled migration
Jiri Denemark [Thu, 20 Nov 2014 12:44:18 +0000 (13:44 +0100)]
qemu: Really fix crash in tunnelled migration

Oops, I forgot to squash one more instance of the same check in the
previous commit (v1.2.10-144-g52691f9).

https://bugzilla.redhat.com/show_bug.cgi?id=1147331
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
10 years agovirsh: Fix msg: blockjob is aborted from another client
Erik Skultety [Thu, 20 Nov 2014 11:52:57 +0000 (12:52 +0100)]
virsh: Fix msg: blockjob is aborted from another client

When a block{pull, copy, commit} is aborted via keyboard interrupt,
the job is properly canceled followed by proper error message.
However, when the job receives an abort from another client connected
to the same domain, the error message incorrectly indicates that
a blockjob has been finished successfully, though the abort request
took effect. This patch introduces a new blockjob abort handler, which
is registered when the client calls block{copy,commit,pull} routine,
providing its caller the status of the finished blockjob.

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

10 years agoqemu: Fix crash in tunnelled migration
Jiri Denemark [Thu, 20 Nov 2014 12:09:16 +0000 (13:09 +0100)]
qemu: Fix crash in tunnelled migration

Any attempt to start a tunnelled migration with libvirtd that supports
RDMA migration (specifically commit v1.2.8-226-ged22a47) crashes
libvirtd on the destination host.

The crash is inevitable because qemuMigrationPrepareAny is always called
with NULL protocol in case of tunnelled migration.

https://bugzilla.redhat.com/show_bug.cgi?id=1147331
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
10 years agomaint: use portable shell
Eric Blake [Wed, 19 Nov 2014 19:13:14 +0000 (12:13 -0700)]
maint: use portable shell

Reported in https://bugzilla.redhat.com/show_bug.cgi?id=1165827;
dash complains:

checking for pkcheck... /usr/bin/pkcheck
checking whether pkcheck supports uid value... yes
./configure: 63906: test: xno: unexpected operator
checking for dtrace... no

* configure.ac: Use '=' not '==' in test.

Signed-off-by: Eric Blake <eblake@redhat.com>
10 years agoqemu: Drop OVMF whitelist
Michal Privoznik [Wed, 19 Nov 2014 17:16:12 +0000 (18:16 +0100)]
qemu: Drop OVMF whitelist

As discussed on the upstream list, it's better not to make this
kind of predictions in libvirt. It may happen that qemu learns
how to enable OVMF on other architectures too and we shouldn't
try to chase that.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
10 years agoqemu: Support OVMF on armv7l aarch64 guests
Michal Privoznik [Wed, 19 Nov 2014 15:25:56 +0000 (16:25 +0100)]
qemu: Support OVMF on armv7l aarch64 guests

Currently, we are whitelisting architectures, that we know how to run
OVMF on. So far, only x86_64 was enabled. However, looking at qemu
code, the same commandline can be used to enable OVMF for armv7l and
aarch64.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
10 years agomaint: forbid 'int foo = true'
Eric Blake [Mon, 17 Nov 2014 23:39:48 +0000 (16:39 -0700)]
maint: forbid 'int foo = true'

I noticed this while working on qemuDomainGetBlockInfo.  Assigning
a bool value to an int variable compiles fine, but raises red flags
on the maintenance front as it becomes too easy to assign -1 or 2
or any other non-bool value to the same variable.

* cfg.mk (sc_prohibit_int_assign_bool): New rule.
* src/conf/snapshot_conf.c (virDomainSnapshotRedefinePrep): Fix
offenders.
* src/qemu/qemu_driver.c (qemuDomainGetBlockInfo)
(qemuDomainSnapshotCreateXML): Likewise.
* src/test/test_driver.c (testDomainSnapshotAlignDisks):
Likewise.
* src/util/vircgroup.c (virCgroupSupportsCpuBW): Likewise.
* src/util/virpci.c (virPCIDeviceBindToStub): Likewise.
* src/util/virutil.c (virIsCapableVport): Likewise.
* tools/virsh-domain-monitor.c (cmdDomMemStat): Likewise.
* tools/virsh-domain.c (cmdBlockResize, cmdScreenshot)
(cmdInjectNMI, cmdSendKey, cmdSendProcessSignal)
(cmdDetachInterface): Likewise.

Signed-off-by: Eric Blake <eblake@redhat.com>
10 years agovirdbus: don't force users to pass int for bool values
Eric Blake [Tue, 18 Nov 2014 00:18:58 +0000 (17:18 -0700)]
virdbus: don't force users to pass int for bool values

Use of an 'int' to represent a 'bool' value is confusing.  Just
because dbus made the mistake of cementing their 4-byte wire
format of dbus_bool_t into their API doesn't mean we have to
repeat the mistake.  With a little bit of finesse, we can
guarantee that we provide a large-enough value to the DBus
code, while still copying only the relevant one-byte bool
to the client code, and isolate the rest of our code base from
the DBus stupidity.

* src/util/virdbus.c (GET_NEXT_VAL): Add parameter.
(virDBusMessageIterDecode): Adjust all clients.
* src/util/virpolkit.c (virPolkitCheckAuth): Use nicer type.
* tests/virdbustest.c (testMessageSimple, testMessageStruct):
Test new behavior.

Signed-off-by: Eric Blake <eblake@redhat.com>
10 years agostorage: wrap storage_driver.c to 80 columns
Chen Hanxiao [Wed, 19 Nov 2014 08:48:09 +0000 (16:48 +0800)]
storage: wrap storage_driver.c to 80 columns

Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com>
10 years agovbox: fix a bug in _machineStateInactive
Yohan BELLEGUIC [Wed, 19 Nov 2014 08:53:15 +0000 (09:53 +0100)]
vbox: fix a bug in _machineStateInactive

This function returned non-inactive domains instead of active
domains.  This broke virConnectNumOfDefinedDomains() and
virConnectListDefinedDomains() functions.

10 years agonetwork: Add network bandwidth support to ethernet interfaces
Anirban Chakraborty [Tue, 18 Nov 2014 23:55:48 +0000 (15:55 -0800)]
network: Add network bandwidth support to ethernet interfaces

Ethernet interfaces in libvirt currently do not support bandwidth setting.
For example, following xml file for an interface will not apply these
settings to corresponding qdiscs.

    <interface type="ethernet">
      <mac address="02:36:1d:18:2a:e4"/>
      <model type="virtio"/>
      <script path=""/>
      <target dev="tap361d182a-e4"/>
      <bandwidth>
        <inbound average="984" peak="1024" burst="64"/>
        <outbound average="2000" peak="2048" burst="128"/>
      </bandwidth>
    </interface>

Signed-off-by: Anirban Chakraborty <abchak@juniper.net>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
10 years agodocs: Document NVRAM behavior on transient domains
Michal Privoznik [Tue, 18 Nov 2014 15:58:54 +0000 (16:58 +0100)]
docs: Document NVRAM behavior on transient domains

Since 1.2.8 it's possible to use OVMF on domains. Moreover, it's
possible to have libvirt create NVRAM file per domain. Later,
when domain is undefined, the file is removed too. However,
things are a bit complicated when domain's transient. There's no
undefine to transient domains. There are two options: 1) leave
the file behind and let mgmt app remove it. 2) remove it
automatically as domain dies.
But, in some scenarios mgmt app may want to preserve the file,
copy it somewhere safe, and then copy it back when the domain is
starting again. And this wouldn't be possible with case 2). So,
even though case 1) leaves some files behind (possibly undeleted
for a long time), the files themselves are small (128K each). And
data loss is worse than full disk, isn't it?

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
10 years agoRemove left over debug in hvsupport.pl script
Daniel P. Berrange [Tue, 18 Nov 2014 17:53:51 +0000 (17:53 +0000)]
Remove left over debug in hvsupport.pl script

10 years agoqemu: Resolve Coverity UNINIT
John Ferlan [Sat, 15 Nov 2014 13:09:53 +0000 (08:09 -0500)]
qemu: Resolve Coverity UNINIT

For some reason, commit id '72b4151f' triggered a Coverity uninitialized
'reply' variable check when referenced within the for loop.

It seems Coverity doesn't know that flags will have to be either AFFECT_LIVE
or AFFECT_CONFIG after the virDomainLiveConfigHelperMethod call.

By adding a "sa_assert()" to confirm that fact, Coverity is happy again.

10 years agoqemu: Fix get blkiodevtune for a disk that has been hot unplugged
Luyao Huang [Fri, 14 Nov 2014 03:21:10 +0000 (11:21 +0800)]
qemu: Fix get blkiodevtune for a disk that has been hot unplugged

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

After a disk is hotunplugged a subsequent call to qemuDomainGetBlockIoTune
to get the --config settings of that disk will fail because the disk is no
longer found by qemuDiskPathToAlias causing an unexpected failure.

Since only the --live flag needs to have the disk device pointer, move the
fetch inside the (flags & VIR_DOMAIN_AFFECT_LIVE) condition. This will also
affect the results if no flags are provided or the --current flag is provided.

Signed-off-by: Luyao Huang <lhuang@redhat.com>
10 years agoqemu: Add tests for new blkdeviotune arguments
John Ferlan [Wed, 12 Nov 2014 15:16:52 +0000 (10:16 -0500)]
qemu: Add tests for new blkdeviotune arguments

The recent commit to add support for block_set_io_throttle parameters
from version 1.7 of qemu did not add any tests - this adds the tests

Signed-off-by: John Ferlan <jferlan@redhat.com>
10 years agoqemu: Add checks for blkdeviotune 'size_iops_sec' and adjust error
John Ferlan [Wed, 12 Nov 2014 15:16:51 +0000 (10:16 -0500)]
qemu: Add checks for blkdeviotune 'size_iops_sec' and adjust error

Seems the 'size_iops_sec' was a late add and the checks for whether
the field was defined, but unsupported and the maximum size of the
field were not being made.

Also, adjust blkdeviotune support error message for grammar, spelling
(paramater), and remove the "(need QEMU 1.7 or superior)".  None of
our other similar error messages list which QEMU version is required.

Signed-off-by: John Ferlan <jferlan@redhat.com>
10 years agobracket-spacing: Add syntax-check for unnecessary curly brackets
Martin Kletzander [Wed, 12 Nov 2014 16:22:27 +0000 (17:22 +0100)]
bracket-spacing: Add syntax-check for unnecessary curly brackets

We're looking for three consecutive lines, first one is a if/for/while
with a condition and start of body, second one is a body with one and
only semicolon and third is end of the body by itself.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
10 years agobracket-spacing-check: Print out more specific error message
Martin Kletzander [Fri, 14 Nov 2014 14:55:54 +0000 (15:55 +0100)]
bracket-spacing-check: Print out more specific error message

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
10 years agobracket-spacing: Remove pointless cycles
Martin Kletzander [Thu, 13 Nov 2014 14:09:35 +0000 (15:09 +0100)]
bracket-spacing: Remove pointless cycles

Change while () { smth; last; } to if () { smth; } as 'last' in perl is
analogous to 'break' in C.  These are probably copy-paste leftovers from
creating new syntax-check rules.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
10 years agobracket-spacing: Don't modify current line
Martin Kletzander [Thu, 13 Nov 2014 14:04:52 +0000 (15:04 +0100)]
bracket-spacing: Don't modify current line

In bracket-spacing.pl, the current $line is being modified in $data.
That, however, spoils that $data for another check.  Introduce new
$tmpdata variable that can be used for temporary modifications.  The
difference between $data and $line is that $data are as much cleaned as
possible from non-code blocks and these changes must be kept.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
10 years agodocs: Adjust contributor guidelines about curly brackets
Martin Kletzander [Thu, 13 Nov 2014 13:56:53 +0000 (14:56 +0100)]
docs: Adjust contributor guidelines about curly brackets

After recent discussion it looks like curly brackets around one-line
bodies are preferred if the preceding condition is, itself, multiline.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
10 years agoRemove unnecessary curly brackets in tests/
Martin Kletzander [Thu, 13 Nov 2014 14:20:43 +0000 (15:20 +0100)]
Remove unnecessary curly brackets in tests/

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
10 years agoRemove unnecessary curly brackets in tools/
Martin Kletzander [Thu, 13 Nov 2014 14:20:51 +0000 (15:20 +0100)]
Remove unnecessary curly brackets in tools/

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
10 years agoRemove unnecessary curly brackets in rest of src/
Martin Kletzander [Thu, 13 Nov 2014 14:29:45 +0000 (15:29 +0100)]
Remove unnecessary curly brackets in rest of src/

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
10 years agoRemove unnecessary curly brackets in rest of src/[o-u]*/
Martin Kletzander [Thu, 13 Nov 2014 14:29:21 +0000 (15:29 +0100)]
Remove unnecessary curly brackets in rest of src/[o-u]*/

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
10 years agoRemove unnecessary curly brackets in rest of src/[a-n]*/
Martin Kletzander [Thu, 13 Nov 2014 14:27:11 +0000 (15:27 +0100)]
Remove unnecessary curly brackets in rest of src/[a-n]*/

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
10 years agoRemove unnecessary curly brackets in src/vbox/
Martin Kletzander [Thu, 13 Nov 2014 14:21:37 +0000 (15:21 +0100)]
Remove unnecessary curly brackets in src/vbox/

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
10 years agoRemove unnecessary curly brackets in src/util/
Martin Kletzander [Thu, 13 Nov 2014 14:28:18 +0000 (15:28 +0100)]
Remove unnecessary curly brackets in src/util/

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
10 years agoRemove unnecessary curly brackets in src/test/test_driver.c
Martin Kletzander [Thu, 13 Nov 2014 14:24:39 +0000 (15:24 +0100)]
Remove unnecessary curly brackets in src/test/test_driver.c

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
10 years agoRemove unnecessary curly brackets in src/storage/
Martin Kletzander [Thu, 13 Nov 2014 14:25:27 +0000 (15:25 +0100)]
Remove unnecessary curly brackets in src/storage/

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
10 years agoRemove unnecessary curly brackets in src/qemu/
Martin Kletzander [Thu, 13 Nov 2014 14:25:30 +0000 (15:25 +0100)]
Remove unnecessary curly brackets in src/qemu/

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
10 years agoRemove unnecessary curly brackets in src/node_device/
Martin Kletzander [Thu, 13 Nov 2014 14:24:17 +0000 (15:24 +0100)]
Remove unnecessary curly brackets in src/node_device/

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
10 years agoRemove unnecessary curly brackets in src/hyperv/
Martin Kletzander [Thu, 13 Nov 2014 14:23:51 +0000 (15:23 +0100)]
Remove unnecessary curly brackets in src/hyperv/

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
10 years agoRemove unnecessary curly brackets in src/conf/
Martin Kletzander [Thu, 13 Nov 2014 14:23:27 +0000 (15:23 +0100)]
Remove unnecessary curly brackets in src/conf/

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
10 years agoRemove unnecessary curly brackets in src/vmx/vmx.c
Martin Kletzander [Thu, 13 Nov 2014 14:21:21 +0000 (15:21 +0100)]
Remove unnecessary curly brackets in src/vmx/vmx.c

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
10 years agoRemove unnecessary curly brackets in rest of src/esx/
Martin Kletzander [Thu, 13 Nov 2014 14:22:20 +0000 (15:22 +0100)]
Remove unnecessary curly brackets in rest of src/esx/

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
10 years agoRemove unnecessary curly brackets in src/esx/esx_driver.c
Martin Kletzander [Thu, 13 Nov 2014 14:22:05 +0000 (15:22 +0100)]
Remove unnecessary curly brackets in src/esx/esx_driver.c

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
10 years agoRemove unnecessary curly brackets in daemon/ and examples/
Martin Kletzander [Thu, 13 Nov 2014 14:20:27 +0000 (15:20 +0100)]
Remove unnecessary curly brackets in daemon/ and examples/

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
10 years agovirsh: Convert EDIT_NOT_CHANGED macro to do-while block.
Martin Kletzander [Fri, 14 Nov 2014 14:57:17 +0000 (15:57 +0100)]
virsh: Convert EDIT_NOT_CHANGED macro to do-while block.

This macro is being used as an inline body after an if and might get
pretty confusing.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
10 years agovirt-aa-helper: Trick invalid syntax-check
Martin Kletzander [Wed, 12 Nov 2014 16:41:38 +0000 (17:41 +0100)]
virt-aa-helper: Trick invalid syntax-check

Rule sc_prohibit_newline_at_end_of_diagnostic for syntax-check does
check for passing strings ending with '\n' two lines after known
functions.  This is, of course subject to false positives, so for the
sake of future changes, trick that syntax-check by adding one more line
with a comment.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
10 years agoRe-add use of locking with iptables/ip6tables/ebtables
Daniel P. Berrange [Tue, 11 Nov 2014 12:34:57 +0000 (12:34 +0000)]
Re-add use of locking with iptables/ip6tables/ebtables

A previous commit introduced use of locking with invocation
of iptables in the viriptables.c module

  commit ba95426d6f39aec1da6e069dd7222f7a8c6a5862
  Author: Serge Hallyn <serge.hallyn@ubuntu.com>
  Date:   Fri Nov 1 12:36:59 2013 -0500

    util: use -w flag when calling iptables

This only ever had effect with the virtual network driver,
as it was not wired up into the nwfilter driver. Unfortunately
in the firewall refactoring the use of the -w flag was
accidentally lost.

This patch introduces it to the virfirewall.c module so that
both the virtual network and nwfilter drivers will be using
it. It also ensures that the equivalent --concurrent flag
to ebtables is used.

10 years agoqemu: Don't try to parse -help for new QEMU
Jiri Denemark [Wed, 12 Nov 2014 15:49:59 +0000 (16:49 +0100)]
qemu: Don't try to parse -help for new QEMU

Since QEMU 1.2.0, we switched to QMP probing instead of parsing -help
(and other commands, such as -cpu ?) output. However, if QMP probing
failed, we still tried starting QEMU with various options and parsing
the output, which was guaranteed to fail because the output changed.
Let's just refuse parsing -help for QEMU >= 1.2.0.

https://bugzilla.redhat.com/show_bug.cgi?id=1160318
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
10 years agoqemu: Always set migration capabilities
Jiri Denemark [Mon, 10 Nov 2014 13:46:26 +0000 (14:46 +0100)]
qemu: Always set migration capabilities

We used to set migration capabilities only when a user asked for them in
flags. This is fine when migration succeeds since the QEMU process is
killed in the end but in case migration fails or if it's cancelled, some
capabilities may remain turned on with no way to turn them off. To fix
that, migration capabilities have to be turned on if requested but
explicitly turned off in case they were not requested but QEMU supports
them.

https://bugzilla.redhat.com/show_bug.cgi?id=1163953
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
10 years agovirsh: Error out if VSH_OT_STRING option has VSH_OFLAG_REQ flag
Martin Kletzander [Tue, 11 Nov 2014 11:03:11 +0000 (12:03 +0100)]
virsh: Error out if VSH_OT_STRING option has VSH_OFLAG_REQ flag

Recent commit 12bd207e217f3c5dc2272a5ea943b81067bd8034 fixed few
VSH_OT_STRING options that should've been VSH_OT_DATA.  That lead me to
this commit that enforces people to check that newly added options have
proper type.  Thanks to virsh erroring out with error message, this will
immediately show up in 'make check' thanks to our virsh-synopsis test.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
10 years agovirsh: Enforce proper ordering of options
Martin Kletzander [Tue, 11 Nov 2014 10:01:05 +0000 (11:01 +0100)]
virsh: Enforce proper ordering of options

Even though vshCmddefOptParse() tried returning -1 if there was an
optional option specification that preceded a required one, it failed to
check that for boolean type options and options with VSH_OFLAG_REQ_OPT
flag set.  On the other hand, it makes sense that VSH_OT_ARGV is
specified at the end of the option list.

Returning -1 enforces the proper ordering thanks to virsh-synopsis test
in 'make check'.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
10 years agovirsh: Reorder some options
Martin Kletzander [Tue, 11 Nov 2014 09:45:24 +0000 (10:45 +0100)]
virsh: Reorder some options

According to comments in parsing functions, optional options should be
specified *after* required ones.  It makes sense and help output looks
cleaner.  The only exceptions are options with type == VSH_OT_ARGV.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
10 years agodrvbhyve: Use boot-order for grub-bhyve boot device
Conrad Meyer [Wed, 12 Nov 2014 22:31:53 +0000 (17:31 -0500)]
drvbhyve: Use boot-order for grub-bhyve boot device

Rather than just picking the first CD (or failing that, HDD) we come
across, if the user has picked a boot device ordering with <boot
order=''>, respect that (and just try to boot the lowest-index device).

Adds two sets of tests to bhyve2xmlargv; 'grub-bootorder' shows that we
pick a user-specified device over the first device in the domain;
'grub-bootorder2' shows that we pick the first (lowest index) device.

10 years agolxc: fix setmem effect on a running LXC machine
Erik Skultety [Fri, 24 Oct 2014 09:17:20 +0000 (11:17 +0200)]
lxc: fix setmem effect on a running LXC machine

When user calls setmem on a running LXC machine, we do update its cgroup
entry, however we neither update domain's runtime XML nor
we update our internal structures and this patch fixes it.

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

10 years agodrvbhyve: Clean-up some used ATTRIBUTE_UNUSEDs.
Conrad Meyer [Wed, 12 Nov 2014 21:11:33 +0000 (16:11 -0500)]
drvbhyve: Clean-up some used ATTRIBUTE_UNUSEDs.

10 years agoFix API docs for header file re-organization
Daniel P. Berrange [Tue, 11 Nov 2014 16:28:26 +0000 (16:28 +0000)]
Fix API docs for header file re-organization

The API docs generators were broken by the header file
re-organization. Specifically

 * html/libvirt-libvirt.html was empty (and should be deleted)
 * Makefile.am didn't install html/libvirt-libvirt-*.html
 * hvsupport.html was mostly empty
 * sitemap.html.in didn't list the new html/*.html files

10 years agonwfilter: fix deadlock caused updating network device and nwfilter
Pavel Hrdina [Wed, 5 Nov 2014 13:28:57 +0000 (14:28 +0100)]
nwfilter: fix deadlock caused updating network device and nwfilter

Commit 6e5c79a1 tried to fix deadlock between nwfilter{Define,Undefine}
and starting of guest, but this same deadlock exists for
updating/attaching network device to domain.

The deadlock was introduced by removing global QEMU driver lock because
nwfilter was counting on this lock and ensure that all driver locks are
locked inside of nwfilter{Define,Undefine}.

This patch extends usage of virNWFilterReadLockFilterUpdates to prevent
the deadlock for all possible paths in QEMU driver. LXC and UML drivers
still have global lock.

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

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
10 years agoqemuPrepareNVRAM: Save domain conf only if domain's persistent
Michal Privoznik [Wed, 12 Nov 2014 17:09:46 +0000 (18:09 +0100)]
qemuPrepareNVRAM: Save domain conf only if domain's persistent

In one of my previous patches (3a3c3780b) I've tried to fix the
problem of nvram path disappearing on a domain that's been
started and shut down again. I fixed this by explicitly saving
domain's config file.  However, I did a bit of clumsy without
realizing we have a transient domains for which we don't save the
config file. Hence, any domain using UEFI became persistent.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
10 years agoqemuxml2argvtest: Run some test only on Linux
Michal Privoznik [Wed, 12 Nov 2014 09:26:43 +0000 (10:26 +0100)]
qemuxml2argvtest: Run some test only on Linux

As I was reviewing bhyve commits, I've noticed qemuxml2argvtest
failing for some test cases. This is not bug in qemu driver code
rather than being unable to load qemuxml2argvmock on non-Linux
platforms. For instance:

318) QEMU XML-2-ARGV numatune-memnode
... libvirt:  error : internal error: NUMA node 0 is unavailable
FAILED

Rather than disabling qemuxml2argvtest on BSD (we do compile qemu
driver there) disable only those test cases which require mocking.
To achieve that goal new DO_TEST_LINUX() macro is introduced which
invokes the test case on Linux only and consume arguments on other
systems.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
10 years agostorage: Introduce 'managed' for the fchost parent
John Ferlan [Mon, 10 Nov 2014 16:19:51 +0000 (11:19 -0500)]
storage: Introduce 'managed' for the fchost parent

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

Introduce a 'managed' attribute to allow libvirt to decide whether to
delete a vHBA vport created via external means such as nodedev-create.
The code currently decides whether to delete the vHBA based solely on
whether the parent was provided at creation time. However, that may not
be the desired action, so rather than delete and force someone to create
another vHBA via an additional nodedev-create allow the configuration of
the storage pool to decide the desired action.

During createVport when libvirt does the VPORT_CREATE, set the managed
value to YES if not already set to indicate to the deleteVport code that
it should delete the vHBA when the pool is destroyed.

If libvirtd is restarted all the memory only state was lost, so for a
persistent storage pool, use the virStoragePoolSaveConfig in order to
write out the managed value.

Because we're now saving the current configuration, we need to be sure
to not save the parent in the output XML if it was undefined at start.
Saving the name would cause future starts to always use the same parent
which is not the expected result when not providing a parent. By not
providing a parent, libvirt is expected to find the best available
vHBA port for each subsequent (re)start.

At deleteVport, use the new managed value to decide whether to execute
the VPORT_DELETE.  Since we no longer save the parent in memory or in
XML when provided, if it was not provided, then we have to look it up.

10 years agostorage: Introduce virStoragePoolSaveConfig
John Ferlan [Mon, 10 Nov 2014 17:23:46 +0000 (12:23 -0500)]
storage: Introduce virStoragePoolSaveConfig

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

Introduce the ability to save a configuration of a persistent configuration
that may be changed by storage pool backend activity, such as start or stop

10 years agostorage: Don't use a stack copy of the adapter
John Ferlan [Mon, 10 Nov 2014 16:34:57 +0000 (11:34 -0500)]
storage: Don't use a stack copy of the adapter

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

Passing a copy of the storage pool adapter to a function just changes the
copy of the fields in the particular function and then when returning to
the caller those changes are discarded.  While not yet biting us in the
storage clean-up case, it did cause an issue for the fchost storage pool
startup case, createVport.  The issue was at startup, if no parent is found
in the XML, the code will search for the 'best available' parent and then
store that in the in memory copy of the adapter.  Of course, in this case
it was a copy, so when returning to the virStorageBackendSCSIStartPool that
change was discarded (or lost) from the pool->def->source.adapter which
meant at shutdown (deleteVport), the code assumed no adapter was passed
and skipped the deletion, leaving the vHBA created by libvirt still defined
requiring an additional stop of a nodedev-destroy to remove.

Adjusted the createVport to take virStoragePoolDefPtr instead of the
adapter copy. Then use the virStoragePoolSourceAdapterPtr when processing.
A future patch will need the 'def' anyway, so this just sets up for that.

10 years agostorage: Ensure fc_host parent matches wwnn/wwpn
John Ferlan [Thu, 6 Nov 2014 17:22:58 +0000 (12:22 -0500)]
storage: Ensure fc_host parent matches wwnn/wwpn

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

The existing code assumed that the configuration of a 'parent' attribute
was correct for the createVport path. As it turns out, that may not be
the case which leads errors during the deleteVport path because the
wwnn/wwpn isn't associated with the parent.

With this change the following is reported:

error: Failed to start pool fc_pool_host3
error: XML error: Parent attribute 'scsi_host4' does not match parent 'scsi_host3' determined for the 'scsi_host16' wwnn/wwpn lookup.

for XML as follows:

  <pool type='scsi'>
    <name>fc_pool</name>
    <source>
      <adapter type='fc_host' parent='scsi_host4' wwnn='5001a4aaf3ca174b' wwpn='5001a4a77192b864'/>
    </source>

Where 'nodedev-dumpxml scsi_host16' provides:

  <device>
    <name>scsi_host16</name>
    <path>/sys/devices/pci0000:00/0000:00:04.0/0000:10:00.0/host3/vport-3:0-11/host16</path>
    <parent>scsi_host3</parent>
    <capability type='scsi_host'>
      <host>16</host>
      <unique_id>13</unique_id>
      <capability type='fc_host'>
        <wwnn>5001a4aaf3ca174b</wwnn>
        <wwpn>5001a4a77192b864</wwpn>
...

The patch also adjusts the description of the storage pool to describe the
restrictions.

Signed-off-by: John Ferlan <jferlan@redhat.com>
10 years agostorage: Check for valid fc_host parent at startup
John Ferlan [Thu, 6 Nov 2014 17:32:46 +0000 (12:32 -0500)]
storage: Check for valid fc_host parent at startup

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

If a 'parent' attribute is provided for the fchost, then at startup
time check to ensure it is a vport capable scsi_host. If the parent
is not vport capable, then disallow the startup. The following is the
expected results:

error: Failed to start pool fc_pool
error: XML error: parent 'scsi_host2' specified for vHBA is not vport capable

where the XML for the fc_pool is:

    <pool type='scsi'>
      <name>fc_pool</name>
      <source>
        <adapter type='fc_host' parent='scsi_host2' wwnn='5001a4aaf3ca174b' wwpn='5001a4a77192b864'/>
      </source>
...

and 'scsi_host2' is not vport capable.

Providing an incorrect parent and a correct wwnn/wwpn could lead to
failures at shutdown (deleteVport) where the assumption is the parent
is for the fchost.

NOTE: If the provided wwnn/wwpn doesn't resolve to an existing scsi_host,
      then we will be creating one with code (virManageVport) which
      assumes the parent is vport capable.

Signed-off-by: John Ferlan <jferlan@redhat.com>
10 years agoqemu: Resolve Coverity DEADCODE.
Matthias Gatto [Wed, 12 Nov 2014 15:53:01 +0000 (16:53 +0100)]
qemu: Resolve Coverity DEADCODE.

reported here: http://www.redhat.com/archives/libvir-list/2014-November/msg00327.html

I could have just remove bool supportMaxOptions variable, but
if I had do this, we could not check anymore if the nparams variable is
superior to QEMU_NB_BLOCK_IO_TUNE_PARAM_MAX.

v2: change following this proposal:
http://www.redhat.com/archives/libvir-list/2014-November/msg00379.html

10 years agoqemu: Fix copy_paste_error in qemuBuildDriveStr.
Matthias Gatto [Wed, 12 Nov 2014 13:04:15 +0000 (14:04 +0100)]
qemu: Fix copy_paste_error in qemuBuildDriveStr.

Fix for this: http://www.redhat.com/archives/libvir-list/2014-November/msg00324.html

Signed-off-by: Matthias Gatto <matthias.gatto@outscale.com>
10 years agobhyvexml2argv: Add test for grub console support
Conrad Meyer [Sat, 8 Nov 2014 16:48:36 +0000 (11:48 -0500)]
bhyvexml2argv: Add test for grub console support

10 years agobhyve: Add console support for grub-bhyve bootloader
Conrad Meyer [Sat, 8 Nov 2014 16:48:35 +0000 (11:48 -0500)]
bhyve: Add console support for grub-bhyve bootloader

This enables booting interactive GRUB menus (e.g. install CDs) with
libvirt-bhyve.

Caveat: A terminal other than the '--console' option to 'virsh start'
(e.g. 'cu -l /dev/nmdm0B -s 115200') must be used to connect to
grub-bhyve because the bhyve loader path is synchronous and must occur
before the VM actually starts.

Changing the bhyveProcessStart logic around to accommodate '--console'
for interactive loader use seems like a significant project and probably
not worth it, if UEFI/BIOS support for bhyve is "coming soon."

10 years agobhyve: Probe grub-bhyve for --cons-dev capability
Conrad Meyer [Tue, 11 Nov 2014 15:35:06 +0000 (10:35 -0500)]
bhyve: Probe grub-bhyve for --cons-dev capability

10 years agobhyvexml2argv: Add tests for domain-configured bootloader, args
Conrad Meyer [Sat, 8 Nov 2014 16:48:33 +0000 (11:48 -0500)]
bhyvexml2argv: Add tests for domain-configured bootloader, args

10 years agodomaincommon.rng: Add 'bootloader' to os=hvm schema for Bhyve
Conrad Meyer [Sat, 8 Nov 2014 16:48:32 +0000 (11:48 -0500)]
domaincommon.rng: Add 'bootloader' to os=hvm schema for Bhyve

Additionally, make the <bootloader> tag optional (for bhyveload with
custom arguments) (also, matches the actual parser).

10 years agobhyvexml2argv: Add loader argv tests.
Conrad Meyer [Sat, 8 Nov 2014 16:48:31 +0000 (11:48 -0500)]
bhyvexml2argv: Add loader argv tests.

10 years agobhyve: Support /domain/bootloader configuration for non-FreeBSD guests.
Conrad Meyer [Sat, 8 Nov 2014 16:48:30 +0000 (11:48 -0500)]
bhyve: Support /domain/bootloader configuration for non-FreeBSD guests.

We still default to bhyveloader(1) if no explicit bootloader
configuration is supplied in the domain.

If the /domain/bootloader looks like grub-bhyve and the user doesn't
supply /domain/bootloader_args, we make an intelligent guess and try
chainloading the first partition on the disk (or a CD if one exists,
under the assumption that for a VM a CD is likely an install source).

Caveat: Assumes the HDD boots from the msdos1 partition. I think this is
a pretty reasonable assumption for a VM. (DrvBhyve with Bhyveload
already assumes that the first disk should be booted.)

I've tested both HDD and CD boot and they seem to work.

10 years agoDo not crash on gluster snapshots with no host name
Ján Tomko [Wed, 12 Nov 2014 08:34:28 +0000 (09:34 +0100)]
Do not crash on gluster snapshots with no host name

virStorageFileBackendGlusterInit did not check nhosts.

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