]> xenbits.xensource.com Git - libvirt.git/log
libvirt.git
7 years agogendispatch: Introduce @sparseflag for our calls
Michal Privoznik [Tue, 12 Apr 2016 13:17:30 +0000 (15:17 +0200)]
gendispatch: Introduce @sparseflag for our calls

Now, not all APIs are going to support sparse streams. To some it
makes no sense at all, e.g. virDomainOpenConsole() or
virDomainOpenChannel(). To others, we will need a special flag to
indicate that client wants to enable sparse streams. Instead of
having to write RPC dispatchers by hand we can just annotate in
our .x files that a certain flag to certain RPC call enables this
feature. For instance:

     /**
      * @generate: both
      * @readstream: 1
      * @sparseflag: VIR_SPARSE_STREAM
      * @acl: storage_vol:data_read
      */
     REMOTE_PROC_DOMAIN_SOME_API = XXX,

Therefore, whenever client calls virDomainSomeAPI(..,
VIR_SPARSE_STREAM); daemon will mark that down and send stream
skips when possible.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
7 years agofdstream: Implement sparse stream
Michal Privoznik [Wed, 27 Apr 2016 08:51:46 +0000 (10:51 +0200)]
fdstream: Implement sparse stream

Basically, what is needed here is to introduce new message type
for the messages passed between the event loop callbacks and the
worker thread that does all the I/O. The idea is that instead of
a queue of read buffers we will have a queue where "hole of size
X" messages appear. That way the event loop callbacks can just
check the head of the queue and see if the worker thread is in
data or a hole section and how long the section is.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
7 years agodaemonStreamHandleRead: Wire up seekable stream
Michal Privoznik [Mon, 11 Apr 2016 09:58:19 +0000 (11:58 +0200)]
daemonStreamHandleRead: Wire up seekable stream

Whenever client is able to receive some data from stream
daemonStreamHandleRead is called. But now the behaviour of this
function needs to be changed a bit. Previously it just read data
from underlying file (of chardev or whatever) and sent those
through the stream to client. This model will not work any longer
because it does not differentiate whether underlying file is in
data or hole section. Therefore, at the beginning of this
function add code that checks this situation and acts
accordingly.
So after the this, when wanting to send some data we always check
whether we are not in a hole and if so, skip it an inform client
about its size.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
7 years agoremote_driver: Implement VIR_STREAM_RECV_STOP_AT_HOLE
Michal Privoznik [Fri, 20 May 2016 14:44:22 +0000 (16:44 +0200)]
remote_driver: Implement VIR_STREAM_RECV_STOP_AT_HOLE

This is fairly trivial now that we have everything in place.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
7 years agovirNetClientStream: Wire up VIR_NET_STREAM_HOLE
Michal Privoznik [Fri, 20 May 2016 14:35:13 +0000 (16:35 +0200)]
virNetClientStream: Wire up VIR_NET_STREAM_HOLE

Whenever server sends a client stream packet (either regular with
actual data or stream skip one) it is queued on @st->rx. So the
list is a mixture of both types of stream packets. So now that we
have all the helpers needed we can wire their processing up. But
since virNetClientStreamRecvPacket doesn't support
VIR_STREAM_RECV_STOP_AT_HOLE flag yet, let's turn all received
skips into zeroes repeating requested times.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
7 years agoremote: Implement virStreamRecvHole
Michal Privoznik [Fri, 20 May 2016 13:28:42 +0000 (15:28 +0200)]
remote: Implement virStreamRecvHole

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
7 years agoIntroduce virNetClientStreamRecvHole
Michal Privoznik [Fri, 20 May 2016 13:28:29 +0000 (15:28 +0200)]
Introduce virNetClientStreamRecvHole

This function will fetch previously processed stream holes and
return their sum.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
7 years agovirNetClientStreamRecvPacket: Introduce @flags argument
Michal Privoznik [Fri, 20 May 2016 11:04:29 +0000 (13:04 +0200)]
virNetClientStreamRecvPacket: Introduce @flags argument

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
7 years agoremote_driver: Implement virStreamSendHole
Michal Privoznik [Sun, 10 Apr 2016 13:48:27 +0000 (15:48 +0200)]
remote_driver: Implement virStreamSendHole

Now that we have RPC wrappers over VIR_NET_STREAM_HOLE we can
start wiring them up. This commit wires up situation when a
client wants to send a hole to daemon.

To keep stream offsets synchronous, upon successful call on the
daemon skip the same hole in local part of the stream.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
7 years agovirnetclientstream: Introduce virNetClientStreamHandleHole
Michal Privoznik [Fri, 12 May 2017 09:27:53 +0000 (11:27 +0200)]
virnetclientstream: Introduce virNetClientStreamHandleHole

This is a function that handles an incoming STREAM_HOLE packet.
Even though it is not wired up yet, it will be soon. At the
beginning do couple of checks whether server plays nicely and
sent us a STREAM_HOLE packed only after we've enabled sparse
streams. Then decodes the message payload to see how big the hole
is and stores it in passed @length argument.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
7 years agodaemon: Implement VIR_NET_STREAM_HOLE handling
Michal Privoznik [Fri, 12 May 2017 09:26:33 +0000 (11:26 +0200)]
daemon: Implement VIR_NET_STREAM_HOLE handling

Basically, whenever the new type of stream packet arrives to the
daemon call this function that decodes it and calls
virStreamSendHole(). Otherwise a regular data stream packet has
arrived and therefore continue its processing.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
7 years agovirnetclientstream: Introduce virNetClientStreamSendHole
Michal Privoznik [Mon, 11 Apr 2016 15:23:17 +0000 (17:23 +0200)]
virnetclientstream: Introduce virNetClientStreamSendHole

While the previous commit implemented a helper for sending a
STREAM_HOLE packet for daemon, this is a client's counterpart.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
7 years agodaemon: Introduce virNetServerProgramSendStreamHole
Michal Privoznik [Mon, 11 Apr 2016 09:44:42 +0000 (11:44 +0200)]
daemon: Introduce virNetServerProgramSendStreamHole

This is just a helper function that takes in a length value,
encodes it into XDR and sends to client.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
7 years agoTeach wireshark plugin about VIR_NET_STREAM_HOLE
Michal Privoznik [Wed, 13 Apr 2016 14:38:09 +0000 (16:38 +0200)]
Teach wireshark plugin about VIR_NET_STREAM_HOLE

Ideally, this would be generated, but to achieve that
corresponding XDR definitions needed to go into a different .x
file. But they belong just to the one that they are right now.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
7 years agoIntroduce VIR_NET_STREAM_HOLE message type
Michal Privoznik [Mon, 4 Apr 2016 12:54:46 +0000 (14:54 +0200)]
Introduce VIR_NET_STREAM_HOLE message type

This is a special type of stream packet, that is bidirectional
and contains information regarding how many bytes each side will
be skipping in the stream.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
7 years agoRPC: Introduce virNetStreamHole
Michal Privoznik [Mon, 11 Apr 2016 14:58:15 +0000 (16:58 +0200)]
RPC: Introduce virNetStreamHole

This is going to be RPC representation for virStreamSendHole.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
7 years agoAdd new flag to daemonCreateClientStream and virNetClientStreamNew
Michal Privoznik [Mon, 11 Apr 2016 14:50:04 +0000 (16:50 +0200)]
Add new flag to daemonCreateClientStream and virNetClientStreamNew

Add a new argument to daemonCreateClientStream in order to allow for
future expansion to mark that a specific stream can be used to skip
data, such as the case with sparsely populated files. The new flag will
be the eventual decision point between client/server to decide whether
both ends can support and want to use sparse streams.

A new bool 'allowSkip' is added to both _virNetClientStream and
daemonClientStream in order to perform the tracking.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
7 years agovirNetClientStreamNew: Track origin stream
Michal Privoznik [Tue, 12 Apr 2016 09:38:12 +0000 (11:38 +0200)]
virNetClientStreamNew: Track origin stream

Add a virStreamPtr pointer to the _virNetClientStream
in order to reverse track the parent stream.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
7 years agoIntroduce virStreamInData
Michal Privoznik [Sat, 21 May 2016 12:25:14 +0000 (14:25 +0200)]
Introduce virStreamInData

This is just an internal API, that calls corresponding function
in stream driver. This function will set @data = 1 if the
underlying file is in data section, or @data = 0 if it is in a
hole. At any rate, @length is set to number of bytes remaining in
the section the file currently is.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
7 years agoIntroduce virStreamSparseSendAll
Michal Privoznik [Sat, 21 May 2016 13:47:39 +0000 (15:47 +0200)]
Introduce virStreamSparseSendAll

This is just a wrapper over new function that have been just
introduced: virStreamSendHole() . It's very similar to
virStreamSendAll() except it handles sparse streams well.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
7 years agoIntroduce virStreamSparseRecvAll
Michal Privoznik [Sat, 21 May 2016 13:17:51 +0000 (15:17 +0200)]
Introduce virStreamSparseRecvAll

This is just a wrapper over new functions that have been just
introduced: virStreamRecvFlags(), virStreamRecvHole(). It's very
similar to virStreamRecvAll() except it handles sparse streams
well.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
7 years agoIntroduce VIR_STREAM_RECV_STOP_AT_HOLE flag
Michal Privoznik [Fri, 20 May 2016 13:12:59 +0000 (15:12 +0200)]
Introduce VIR_STREAM_RECV_STOP_AT_HOLE flag

Add a new flag to virStreamRecvFlags in order to handle being able to
stop reading from the stream so that the consumer can generate a "hole"
in stream target. Generation of a hole replaces the need to receive and
handle a sequence of zero bytes for sparse stream targets.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
7 years agoIntroduce virStreamRecvHole
Michal Privoznik [Fri, 20 May 2016 13:03:11 +0000 (15:03 +0200)]
Introduce virStreamRecvHole

This function is basically a counterpart for virStreamSendHole().
If one side of a stream called virStreamSendHole() the other
should call virStreamRecvHole() to get the size of the hole.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
7 years agoIntroduce virStreamSendHole
Michal Privoznik [Sun, 10 Apr 2016 10:01:20 +0000 (12:01 +0200)]
Introduce virStreamSendHole

This API is used to tell the other side of the stream to skip
some bytes in the stream. This can be used to create a sparse
file on the receiving side of a stream.

It takes @length argument, which says how big the hole is. This
skipping is done from the current point of stream. Since our
streams are not rewindable like regular files, we don't need
@whence argument like seek(2) has.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
7 years agoImplement virStreamRecvFlags to some drivers
Michal Privoznik [Thu, 19 May 2016 15:34:23 +0000 (17:34 +0200)]
Implement virStreamRecvFlags to some drivers

There are three virStreamDriver's currently supported:

 * virFDStream
 * remote driver
 * ESX driver

For now, backend virStreamRecvFlags support for only remote driver and
ESX driver is sufficient. Future patches will update virFDStream.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
7 years agoIntroduce virStreamRecvFlags
Michal Privoznik [Thu, 19 May 2016 14:53:35 +0000 (16:53 +0200)]
Introduce virStreamRecvFlags

This patch is adding the virStreamRecvFlags as a variant to the
virStreamRecv function in order to allow for future expansion of
functionality for processing sparse streams using a @flags
argument.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
7 years agoutil: Introduce virFileInData
Michal Privoznik [Thu, 16 Jun 2016 08:42:47 +0000 (10:42 +0200)]
util: Introduce virFileInData

This function takes a FD and determines whether the current
position is in data section or in a hole. In addition to that,
it also determines how much bytes are there remaining till the
current section ends.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
7 years agovirfdstream: Use messages instead of pipe
Michal Privoznik [Thu, 13 Apr 2017 09:49:30 +0000 (11:49 +0200)]
virfdstream: Use messages instead of pipe

One big downside of using the pipe to transfer the data is that
we can really transfer just bare data. No metadata can be carried
through unless some formatted messages are introduced. That would
be quite painful to achieve so let's use a message queue. It's
fairly easy to exchange info between threads now that iohelper is
no longer used.

The reason why we cannot use the FD for plain files directly is
that despite us setting noblock flag on the FD, any
read()/write() blocks regardless (which is a show stopper since
those parts of the code are run from the event loop) and poll()
reports such FD as always readable/writable - even though the
subsequent operation might block.

The pipe is still not gone though. It is used to signal the event
loop that an event occurred (e.g. data is available for reading
in the queue, or vice versa).

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
7 years agovirsh: add --io when attaching disks to guests
Gordon Messmer [Fri, 12 May 2017 21:27:27 +0000 (14:27 -0700)]
virsh: add --io when attaching disks to guests

virt-install and virt-manager both default to explicitly setting
"io='native'" in the disk "driver" tag. virsh, however, does not and also
does not provide an option to specify that setting at all.  As a result,
disks use a different IO mechanism (the default, "threads") when attached
post-setup using virsh.  Adding this option allows users to keep disk
performance consistent for disks attached at install, and those attached
afterward.

7 years agoqemu: driver: Allow passing disk target as top image with block commit
Peter Krempa [Wed, 17 May 2017 15:16:15 +0000 (17:16 +0200)]
qemu: driver: Allow passing disk target as top image with block commit

Since we allow active layer block commit the users are allowed to commit
the top of the chain (e.g. vda) into the backing image. The API would
not accept that parameter, as it tried to look up the image in the
backing chain.

Add the ability to use the top level image target name explicitly as the
top image of the block commit operation.

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

7 years agonews: Update for GIC version on TCG changes
Andrea Bolognani [Fri, 12 May 2017 13:40:51 +0000 (15:40 +0200)]
news: Update for GIC version on TCG changes

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
7 years agogic: Remove VIR_GIC_VERSION_DEFAULT
Andrea Bolognani [Fri, 12 May 2017 12:38:08 +0000 (14:38 +0200)]
gic: Remove VIR_GIC_VERSION_DEFAULT

The QEMU default is GICv2, and some of the code in libvirt
relies on the exact value. Stop pretending that's not the
case and use GICv2 explicitly where needed.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
7 years agoqemu: Use GICv2 for aarch64/virt TCG guests
Andrea Bolognani [Fri, 12 May 2017 11:29:57 +0000 (13:29 +0200)]
qemu: Use GICv2 for aarch64/virt TCG guests

There are currently some limitations in the emulated GICv3
that make it unsuitable as a default. Use GICv2 instead.

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

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
7 years agotests: Check default GIC version for aarch64/virt TCG guests
Andrea Bolognani [Fri, 12 May 2017 12:05:55 +0000 (14:05 +0200)]
tests: Check default GIC version for aarch64/virt TCG guests

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
7 years agoqemu: Use qemuDomainMachineIsVirt() more
Andrea Bolognani [Fri, 12 May 2017 09:03:19 +0000 (11:03 +0200)]
qemu: Use qemuDomainMachineIsVirt() more

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
7 years agoqemu: improve detection of UNIX path generated by libvirt
Pavel Hrdina [Thu, 11 May 2017 12:09:35 +0000 (14:09 +0200)]
qemu: improve detection of UNIX path generated by libvirt

Currently we consider all UNIX paths with specific prefix as generated
by libvirt, but that's a wrong assumption.  Let's make the detection
better by actually checking whether the whole path matches one of the
paths that we generate or generated in the past.

The UNIX path isn't stored in config XML since libvirt-1.3.1.

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

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
7 years agoremove hack for debian etch limits.h
Daniel P. Berrange [Mon, 15 May 2017 16:00:09 +0000 (17:00 +0100)]
remove hack for debian etch limits.h

The debian etch distro was end-of-life a long time ago so we no
longer need the ULLONG_MAX hack. In any case gnulib now provides
an equivalent fix by default, and so our definition now triggers
syntax-check rule failure

src/internal.h:#    define ULLONG_MAX   ULONG_LONG_MAX
maint.mk: define the above via some gnulib .h file
maint.mk:843: recipe for target 'sc_prohibit_always-defined_macros' failed

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
7 years agomaint: update to latest gnulib
Daniel P. Berrange [Thu, 11 May 2017 14:40:25 +0000 (15:40 +0100)]
maint: update to latest gnulib

This pulls in the fixes for poll() on Win32 which finally
makes the remote driver work again.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
7 years agoconf: add ABI stability checks for IOMMU options
Ján Tomko [Fri, 12 May 2017 14:59:45 +0000 (16:59 +0200)]
conf: add ABI stability checks for IOMMU options

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

7 years agoconf: split out virDomainIOMMUDefCheckABIStability
Ján Tomko [Fri, 12 May 2017 14:59:09 +0000 (16:59 +0200)]
conf: split out virDomainIOMMUDefCheckABIStability

7 years agoqemu: format caching-mode on iommu command line
Ján Tomko [Fri, 17 Mar 2017 07:28:04 +0000 (08:28 +0100)]
qemu: format caching-mode on iommu command line

Format the caching-mode option for the intel-iommu device,
based on its <driver caching> attribute value.

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

7 years agoconf: add caching_mode attribute to iommu device
Ján Tomko [Fri, 17 Mar 2017 07:27:49 +0000 (08:27 +0100)]
conf: add caching_mode attribute to iommu device

Add a new attribute to control the caching mode.

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

7 years agoqemu: format intel-iommu,intremap on the command line
Ján Tomko [Wed, 3 May 2017 13:23:12 +0000 (15:23 +0200)]
qemu: format intel-iommu,intremap on the command line

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

7 years agoconf: add <driver intremap> to <iommu>
Ján Tomko [Fri, 17 Mar 2017 07:35:22 +0000 (08:35 +0100)]
conf: add <driver intremap> to <iommu>

Add a new attribute to control interrupt remapping.

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

7 years agoqemu: format kernel_irqchip on the command line
Ján Tomko [Fri, 17 Mar 2017 07:26:49 +0000 (08:26 +0100)]
qemu: format kernel_irqchip on the command line

Add kernel_irqchip=split/on to the QEMU command line
and a capability that looks for it in query-command-line-options
output. For the 'split' option, use a version check
since it cannot be reasonably probed.

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

7 years agoconf: add <ioapic driver> to <features>
Ján Tomko [Fri, 17 Mar 2017 07:26:35 +0000 (08:26 +0100)]
conf: add <ioapic driver> to <features>

Add a new <ioapic> element with a driver attribute.

Possible values are qemu and kvm. With 'qemu', the I/O
APIC can be put in the userspace even for KVM domains.

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

8 years agoutil: conf: Don't log when adding commented out lines
Peter Krempa [Fri, 12 May 2017 14:29:15 +0000 (16:29 +0200)]
util: conf: Don't log when adding commented out lines

virConfAddEntry spams debug logs even for fully commented out lines.
Skip such messages to avoid:

2017-05-12 12:35:38.867+0000: 10820: debug : virConfAddEntry:241 : Add entry (null) (nil)
2017-05-12 12:35:38.867+0000: 10820: debug : virConfAddEntry:241 : Add entry (null) (nil)
2017-05-12 12:35:38.867+0000: 10820: debug : virConfAddEntry:241 : Add entry (null) (nil)
2017-05-12 12:35:38.867+0000: 10820: debug : virConfAddEntry:241 : Add entry (null) (nil)
2017-05-12 12:35:38.867+0000: 10820: debug : virConfAddEntry:241 : Add entry (null) (nil)
...

This also fixes NULL passed to printf.

8 years agostorage: use 0711 as the default perms for dirs
Serge Hallyn [Mon, 15 May 2017 11:05:31 +0000 (13:05 +0200)]
storage: use 0711 as the default perms for dirs

There should be no need to make dir based pools world/group readable.
So use 0711, not 0755, as the default perms for storage dirs.

Updates in v2:
 - adapt commit wording to mention dropping group readable as well

Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
8 years agoDetect VMDK version 3 files
Daniel P. Berrange [Mon, 8 May 2017 09:05:09 +0000 (10:05 +0100)]
Detect VMDK version 3 files

The metadata libvirt cares about is identical for version 3
as for previous versions, so we merely need list the new
version number.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
8 years agoqemu: monitor: do not report error on shutdown
Christian Ehrhardt [Thu, 9 Mar 2017 09:54:32 +0000 (10:54 +0100)]
qemu: monitor: do not report error on shutdown

If a shutdown is expected because it was triggered via libvirt we can
also expect the monitor to close. In those cases do not report an
internal error like:
  "internal error: End of file from qemu monitor"

Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
8 years agotest-wrap-argv.pl: Accept short parameter -i for --in-place
Martin Kletzander [Fri, 12 May 2017 13:08:51 +0000 (15:08 +0200)]
test-wrap-argv.pl: Accept short parameter -i for --in-place

I like to use it that way and every time I try running it I just
instinctively use '-i' (like with sed, etc.) and it makes sense, IMHO.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
8 years agoutil: introduce virBufferEscapeRegex
Pavel Hrdina [Fri, 12 May 2017 12:26:09 +0000 (14:26 +0200)]
util: introduce virBufferEscapeRegex

Add a helper to escape all possible meta-characters used for
POSIX extended regular expressions.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
8 years agoutil: introduce virStringMatch
Pavel Hrdina [Thu, 11 May 2017 15:16:13 +0000 (17:16 +0200)]
util: introduce virStringMatch

Simply tries to match the provided regex on a string and returns
the result.  Useful if caller don't care about the matched substring
and want to just test if some pattern patches a string.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
8 years agodocs: install html fonts and related
Nikolay Shirokovskiy [Thu, 11 May 2017 09:01:27 +0000 (12:01 +0300)]
docs: install html fonts and related

8 years agovirsh: Add --tls description for the virsh man page
John Ferlan [Wed, 10 May 2017 14:07:31 +0000 (10:07 -0400)]
virsh: Add --tls description for the virsh man page

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

Commit id '6a8d898d' neglected to update the man page.

8 years agoconf: Fix resource leak in virCapabilitiesInitCaches
John Ferlan [Fri, 12 May 2017 10:46:20 +0000 (06:46 -0400)]
conf: Fix resource leak in virCapabilitiesInitCaches

The @type from virFileReadValueString needs to be VIR_FREE each time
through the loop since it's not saved and since cleanup can be reached
prior to decoding it for @kernel_type amd bank->type, the cleanup code
needs to also have a VIR_FREE

Found by Coverity

8 years agospec: Use HTTPS instead of HTTP
Andrea Bolognani [Thu, 11 May 2017 16:31:08 +0000 (18:31 +0200)]
spec: Use HTTPS instead of HTTP

libvirt.org supports HTTPS, so might as well use it.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
8 years agospec: Support maintenance releases on mingw
Andrea Bolognani [Thu, 11 May 2017 16:28:00 +0000 (18:28 +0200)]
spec: Support maintenance releases on mingw

The regular spec file contains code to deal with the fact
that maintenance releases are uploaded to their own
directory: copy it over to the mingw spec file so that it's
possible to build maintenance releases there as well.

This also switches the source URL from FTP to HTTP for
consistency with the main spec file.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
8 years agoqemu: Provide a much clearer message on device hot-plug
Erik Skultety [Thu, 11 May 2017 13:26:47 +0000 (15:26 +0200)]
qemu: Provide a much clearer message on device hot-plug

Adjust the current message to make it clear, that it is the hotplug
operation that is unsupported with the given host device type.

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

Signed-off-by: Erik Skultety <eskultet@redhat.com>
8 years agotests: stub out virfilewrapper.c on Win32
Daniel P. Berrange [Thu, 11 May 2017 10:42:14 +0000 (11:42 +0100)]
tests: stub out virfilewrapper.c on Win32

The Win32 platform can not do link time overrides in the same way
that we can on POSIX / ELF based platforms, so we cannot build
the virfilewrapper.c code reliably. Just stub it out on Win32
so it is a no-op. Tests that use this file are already written
to skip on Win32.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
8 years agolibxl: report numa sibling distances on host capabilities
Wim ten Have [Tue, 9 May 2017 18:06:29 +0000 (20:06 +0200)]
libxl: report numa sibling distances on host capabilities

When running on a NUMA machine, populate the sibling node
and distance information using data supplied by Xen.

With locality distances information, under Xen, new host
capabilities would like:

    <topology>
      <cells num='4'>
        <cell id='0'>
          <memory unit='KiB'>263902380</memory>
          <distances>
            <sibling id='0' value='10'/>
            <sibling id='1' value='21'/>
          </distances>
          ...
        </cell>
        ...
      </cells>
      ...
    </topology>

Signed-off-by: Wim ten Have <wim.ten.have@oracle.com>
Reviewed-by: Joao Martins <joao.m.martins@oracle.com>
Reviewed-by: Jim Fehlig <jfehlig@suse.com>
8 years agoAdd missing deps on virfilewrapper.h
Daniel P. Berrange [Wed, 10 May 2017 15:15:05 +0000 (16:15 +0100)]
Add missing deps on virfilewrapper.h

The test programs depend on virfilewrapper.h as well as the
virfilewrapper.c. Adding the dep ensures that virfilewrapper.h
gets included in the dist tarball.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
8 years agoqemu: driver: Fix usage of qemuOpenFile
Peter Krempa [Wed, 10 May 2017 10:33:19 +0000 (12:33 +0200)]
qemu: driver: Fix usage of qemuOpenFile

The function returns -errno on failure, not only -1.

8 years agoqemu: driver: Document qemuOpenFile
Peter Krempa [Wed, 10 May 2017 10:28:38 +0000 (12:28 +0200)]
qemu: driver: Document qemuOpenFile

The function is nontrivial to follow and has non-standard return values.
Recent usage was buggy.

8 years agoconf: Check CPU cache for ABI stability
Jiri Denemark [Tue, 9 May 2017 14:03:19 +0000 (16:03 +0200)]
conf: Check CPU cache for ABI stability

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Daniel P. Berrange <berrange@redhat.com>
8 years agoDon't inline virStringTrimOptionalNewline
Daniel P. Berrange [Wed, 10 May 2017 08:16:11 +0000 (09:16 +0100)]
Don't inline virStringTrimOptionalNewline

GCC complains that inlining virStringTrimOptionalNewline is not
likely on some platforms:

  cc1: warnings being treated as errors
  ../../src/util/virfile.c: In function 'virFileReadValueBitmap':
  ../../src/util/virstring.h:292: error: inlining failed in call to 'virStringTrimOptionalNewline': call is unlikely and code size would grow [-Winline]
  ../../src/util/virfile.c:3987: error: called from here [-Winline]

Inlining this function is not going to be a measurable performance
benefit either, since the time required to execute it is going to
be dominated by running of strlen() over the string, not by the
function call overhead.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
8 years agospec: Update version check for maint Source URL
Cole Robinson [Fri, 5 May 2017 00:08:55 +0000 (20:08 -0400)]
spec: Update version check for maint Source URL

New maint release version numbers of just A.B.C format, not the old
A.B.C.D format. Adjust the check that dynamically changes the Source
URL for maint releases

Signed-off-by: Cole Robinson <crobinso@redhat.com>
Acked-by: Andrea Bolognani <abologna@redhat.com>
8 years agoAdding POWER9 cpu model to cpu_map.xml
Kothapally Madhu Pavan [Tue, 9 May 2017 09:04:10 +0000 (05:04 -0400)]
Adding POWER9 cpu model to cpu_map.xml

As POWER9 model is not available in cpu_map.xml virsh capabilities
donot display the cpu model and vendor details. This patch
provides those details

8 years agotests: fix virfilewrapper
Roman Bogorodskiy [Tue, 9 May 2017 13:02:26 +0000 (17:02 +0400)]
tests: fix virfilewrapper

If __lxstat() and __xstat() functions are not available, build fails with:

  CC       virfilewrapper.o
virfilewrapper.c:180:5: error: no previous prototype for function '__lxstat' [-Werror,-Wmissing-prototypes]
int __lxstat(int ver, const char *path, struct stat *sb)
    ^
virfilewrapper.c:208:5: error: no previous prototype for function '__xstat' [-Werror,-Wmissing-prototypes]
int __xstat(int ver, const char *path, struct stat *sb)

Luckily, we already check presence of these functions in configure
using AC_CHECK_FUNCS, so just don't wrap these if they're not available.

Signed-off-by: Roman Bogorodskiy <bogorodskiy@gmail.com>
8 years agoutil: Define SYSFS_SYSTEM_PATH unconditionally in virhostcpu
Martin Kletzander [Tue, 9 May 2017 12:17:38 +0000 (14:17 +0200)]
util: Define SYSFS_SYSTEM_PATH unconditionally in virhostcpu

The code is already prepared to handle the non-existence of it.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
8 years agotests: Add resctrl test for vircaps2xmltest
Martin Kletzander [Fri, 31 Mar 2017 12:36:58 +0000 (14:36 +0200)]
tests: Add resctrl test for vircaps2xmltest

Add info from yet another machine, this time with resctrl data so that
we can extend tests easily in a test-driven way.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
8 years agotests: Add support for more complicated hierarchies in vircaps2xmltest
Martin Kletzander [Fri, 31 Mar 2017 12:33:57 +0000 (14:33 +0200)]
tests: Add support for more complicated hierarchies in vircaps2xmltest

More directories will need to be mocked, so let's prepare for that.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
8 years agoInit host cache info in drivers
Martin Kletzander [Wed, 29 Mar 2017 13:52:31 +0000 (15:52 +0200)]
Init host cache info in drivers

Added only in drivers that were already calling
virCapabilitiesInitNUMA().  Instead of refactoring all the callers to
behave the same way in case of error, just follow what the callers are
doing for all the functions.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
8 years agoAdd host cache information in capabilities
Martin Kletzander [Thu, 30 Mar 2017 13:01:27 +0000 (15:01 +0200)]
Add host cache information in capabilities

We're only adding only info about L3 caches, we can add more
later (just by changing one line), but for now that's more than enough
without overwhelming anyone.

XML snippet of how this should look like (also seen as part of the commit):

  <cache>
    <bank id='0' level='3' type='both' size='8192' unit='KiB' cpus='0-7'/>
  </cache>

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
8 years agotests: Add missing cache data for vircaps2xmltest
Martin Kletzander [Mon, 27 Mar 2017 06:27:38 +0000 (08:27 +0200)]
tests: Add missing cache data for vircaps2xmltest

Commit a0fdd2f6f9a0cc77ae285c289e2c16d314b6a907 added some data from
the system but forgot 3 files for each cache.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
8 years agotests: Test vircaps2xmldata XMLs in virschematest
Martin Kletzander [Thu, 30 Mar 2017 12:55:12 +0000 (14:55 +0200)]
tests: Test vircaps2xmldata XMLs in virschematest

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
8 years agoutil: Remove virsysfs and instead enhance virFileReadValue* functions
Martin Kletzander [Wed, 5 Apr 2017 14:13:52 +0000 (16:13 +0200)]
util: Remove virsysfs and instead enhance virFileReadValue* functions

It is no longer needed thanks to the great virfilewrapper.c.  And this
way we don't have to add a new set of functions for each prefixed
path.

While on that, add two functions that weren't there before, string and
scaled integer reading ones.  Also increase the length of the string
being read by one to accompany for the optional newline at the
end (i.e. change INT_STRLEN_BOUND to INT_BUFSIZE_BOUND).

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
8 years agotests: Add virfilewrapper -- the new super "mock"
Martin Kletzander [Mon, 3 Apr 2017 12:29:45 +0000 (14:29 +0200)]
tests: Add virfilewrapper -- the new super "mock"

This mock (which is actually not mock at all, see later) can redirect
all accesses to a path into another path.  There is no need to
create mocks for particular directories, you just create a directory
with all the data a redirect the test there.

In the future, this should also be able to register callbacks for
calls/paths, e.g. when the test is going to write into anything under
"/sys/devices", call function fce();  Then in the open() call we would
add information about the fd into some structure and in write() we
would call fce() with parameters like @path to write to, @data to
be written and pointer to optional return value, so that fce() itself
could stop the call from happening or change its behaviour.  But
that's an idea for a latter day.

This is not a mock because it will not be preloaded, but compiled in
the test itself.  See future patches for usage.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
8 years agomdev: Cleanup code after commits @daf5081b and @2739a983
Erik Skultety [Thu, 4 May 2017 13:36:37 +0000 (15:36 +0200)]
mdev: Cleanup code after commits @daf5081b and @2739a983

So, because mingw is somehow OK with dereferencing a pointer within a
VIR_DEBUG macro, compared to outside of it to which it complained with a
"potential NULL pointer dereference" error (still a false positive), we
can make the code a tiny bit cleaner.

Sighed-by: Erik Skultety <eskultet@redhat.com>
Signed-off-by: Erik Skultety <eskultet@redhat.com>
8 years agoDon't use ceph-devel on Fedora
Daniel P. Berrange [Mon, 8 May 2017 09:54:08 +0000 (10:54 +0100)]
Don't use ceph-devel on Fedora

A previous commit changed the spec to use librbd1-devel on
RHEL-7, since this replaces ceph-devel from RHEL-6:

  commit 6cfc8834c858849cc74c3082078dc91fb1cbae38
  Author: Peter Krempa <pkrempa@redhat.com>
  Date:   Thu Mar 5 11:40:54 2015 +0100

    spec: Enable RBD storage driver in RHEL-7

    Use correct package names too as they differ.

RHEL-7 inherited this rename from Fedora though, so it should
have also made Fedora use the new names.

This was missed, because Fedora still provides a (deprecated)
back-compat RPM for ceph-devel that just pulls in librbd1-devel
(and others).

Fixing this stops libvirt pulling Java into the build root in
Fedora.

Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
8 years agoHACKING: Document developer tooling
Andrea Bolognani [Fri, 28 Apr 2017 16:30:07 +0000 (18:30 +0200)]
HACKING: Document developer tooling

Advertise some of the useful developer tooling libvirt
integrates with out of the box.

8 years agoAdd YouCompleteMe support
Andrea Bolognani [Fri, 21 Apr 2017 14:47:02 +0000 (16:47 +0200)]
Add YouCompleteMe support

YouCompleteMe[1] is a vim plugin that implements semantic
code completion using libclang.

For non-trivial projects such as libvirt, the plugin needs
some help figuring out where to find the various header
files: generate its configuration file at configure time
so that the plugin works out of the box.

[1] http://valloric.github.io/YouCompleteMe/

8 years agoAdd color_coded support
Andrea Bolognani [Fri, 21 Apr 2017 14:05:19 +0000 (16:05 +0200)]
Add color_coded support

color_coded[1] is a vim plugin that implements semantic
syntax highlighting using libclang.

For non-trivial projects such as libvirt, the plugin needs
some help figuring out where to find the various header
files: generate its configuration file at configure time
so that the plugin works out of the box.

[1] https://github.com/jeaye/color_coded

8 years agoPost-release version bump to 3.4.0
Erik Skultety [Tue, 9 May 2017 07:17:54 +0000 (09:17 +0200)]
Post-release version bump to 3.4.0

Signed-off-by: Erik Skultety <eskultet@redhat.com>
8 years agoconfigure: enforce presence of python for build
Daniel P. Berrange [Mon, 8 May 2017 10:35:17 +0000 (11:35 +0100)]
configure: enforce presence of python for build

The API docs extractor, ESX code generator and keycodemapdb tools
rely on python. Historically every platform that this present, but
with switch to Python3 by default, we're increasingly seeing
installs without a /usr/bin/python.

This tightens up the check during configure, so it exits immediately
if python is missing, rather than leaving an empty $(PYTHON) make
variable which leads to more obscure errors later.

Also add it as a build dep for Mingw, since Fedora build roots no
longer get python2 by default. This was not previously a major
problem, since both ESX & API generated files were included in
EXTRA_DIST, but the keycodemapdb generated files are not, so we
require python all the time now.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
8 years agoRelease of libvirt-3.3.0
Daniel Veillard [Fri, 5 May 2017 19:38:00 +0000 (21:38 +0200)]
Release of libvirt-3.3.0

* docs/news.xml: updated for release
* po/*.po*: regenerated

8 years agovirNWFilterObjListFree: Don't leak nwfilters->objs
Michal Privoznik [Thu, 4 May 2017 15:25:09 +0000 (17:25 +0200)]
virNWFilterObjListFree: Don't leak nwfilters->objs

When adding a nwfilter onto the list in
virNWFilterObjListAssignDef() this array is re-allocated to match
demand for new size. However, it is never freed leading to a
leak:

==26535== 136 bytes in 1 blocks are definitely lost in loss record 1,079 of 1,250
==26535==    at 0x4C2E2BE: realloc (vg_replace_malloc.c:785)
==26535==    by 0x54BA28E: virReallocN (viralloc.c:245)
==26535==    by 0x54BA384: virExpandN (viralloc.c:294)
==26535==    by 0x54BA657: virInsertElementsN (viralloc.c:436)
==26535==    by 0x55DB011: virNWFilterObjListAssignDef (virnwfilterobj.c:362)
==26535==    by 0x55DB530: virNWFilterObjListLoadConfig (virnwfilterobj.c:503)
==26535==    by 0x55DB635: virNWFilterObjListLoadAllConfigs (virnwfilterobj.c:539)
==26535==    by 0x2AC5A28B: nwfilterStateInitialize (nwfilter_driver.c:250)
==26535==    by 0x5621C64: virStateInitialize (libvirt.c:770)
==26535==    by 0x124379: daemonRunStateInit (libvirtd.c:881)
==26535==    by 0x554AC78: virThreadHelper (virthread.c:206)
==26535==    by 0x8F5F493: start_thread (in /lib64/libpthread-2.23.so)

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
8 years agovirPerfEventIsEnabled: Accept NULL @perf
Michal Privoznik [Thu, 4 May 2017 14:27:45 +0000 (16:27 +0200)]
virPerfEventIsEnabled: Accept NULL @perf

After bdcf6e481 there is a crasher in libvirt. The commit assumes
that priv->perf is always set. That is not true. For inactive
domains, the priv->perf is not allocated as it is set in
qemuProcessLaunch(). Now, usually we differentiate between
accesses to inactive and active definition and it works just
fine. Except for 'domstats'. There priv->perf is accessed without
prior check for domain inactivity. While we could check for that,
more robust solution is to make virPerfEventIsEnabled() accept
NULL.

How to reproduce:
1) ensure you have at least one inactive domain
2) virsh domstats

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel P. Berrange <berrange@redhat.com>
8 years agomdev: Fix mingw build by adding a check for non-NULL pointer
Erik Skultety [Thu, 4 May 2017 09:26:10 +0000 (11:26 +0200)]
mdev: Fix mingw build by adding a check for non-NULL pointer

This patch fixes the following MinGW error (although actually being a
false positive):

../../src/util/virmdev.c: In function 'virMediatedDeviceListMarkDevices':
../../src/util/virmdev.c:453:21: error: potential null pointer
dereference [-Werror=null-dereference]
          const char *mdev_path = mdev->path;
                      ^~~~~~~~~

Signed-off-by: Erik Skultety <eskultet@redhat.com>
8 years agonews: Fix typo
Andrea Bolognani [Thu, 4 May 2017 11:16:37 +0000 (13:16 +0200)]
news: Fix typo

Pointed-out-during-review-by: Ján Tomko <jtomko@redhat.com>
Not-fixed-before-pushing-by: Andrea Bolognani <abologna@redhat.com>
8 years agonews: Add even more v3.3.0 entries
Andrea Bolognani [Wed, 3 May 2017 16:01:58 +0000 (18:01 +0200)]
news: Add even more v3.3.0 entries

8 years agomdev: Fix daemon crash on domain shutdown after reconnect
Erik Skultety [Fri, 28 Apr 2017 07:24:31 +0000 (09:24 +0200)]
mdev: Fix daemon crash on domain shutdown after reconnect

The problem resides in virHostdevUpdateActiveMediatedDevices which gets
called during qemuProcessReconnect. The issue here is that
virMediatedDeviceListAdd takes a pointer to the item to be added to the
list to which VIR_APPEND_ELEMENT is used, which also clears the pointer.
However, in this case only the local copy of the pointer got cleared,
leaving the original pointing to valid memory. To sum it up, during
cleanup phase, the original pointer is freed and the daemon crashes
basically any time it would access it.

Backtrace:
0x00007ffff3ccdeba in __strcmp_sse2_unaligned
0x00007ffff72a444a in virMediatedDeviceListFindIndex
0x00007ffff7241446 in virHostdevReAttachMediatedDevices
0x00007fffc60215d9 in qemuHostdevReAttachMediatedDevices
0x00007fffc60216dc in qemuHostdevReAttachDomainDevices
0x00007fffc6046e6f in qemuProcessStop
0x00007fffc6091596 in processMonitorEOFEvent
0x00007fffc6091793 in qemuProcessEventHandler
0x00007ffff7294bf5 in virThreadPoolWorker
0x00007ffff7294184 in virThreadHelper
0x00007ffff3fdc3c4 in start_thread () from /lib64/libpthread.so.0
0x00007ffff3d269cf in clone () from /lib64/libc.so.6

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

Signed-off-by: Erik Skultety <eskultet@redhat.com>
Reviewed-by: Laine Stump <laine@laine.org>
8 years agoutil: mdev: Use a local variable instead of a direct pointer access
Erik Skultety [Fri, 28 Apr 2017 05:52:52 +0000 (07:52 +0200)]
util: mdev: Use a local variable instead of a direct pointer access

Use a local variable to hold data, rather than accessing the pointer
after calling virMediatedDeviceListAdd (therefore VIR_APPEND_ELEMENT).
Although not causing an issue at the moment, this change is a necessary
prerequisite for tweaking virMediatedDeviceListAdd in a separate patch,
which will take a reference for the source pointer (instead of pointer
value) and will clear it along the way.

Signed-off-by: Erik Skultety <eskultet@redhat.com>
Reviewed-by: Laine Stump <laine@laine.org>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
8 years agoqemuDomainDetachDeviceUnlink: Don't unlink files we haven't created
Michal Privoznik [Fri, 28 Apr 2017 11:17:04 +0000 (13:17 +0200)]
qemuDomainDetachDeviceUnlink: Don't unlink files we haven't created

Even though there are several checks before calling this function
and for some scenarios we don't call it at all (e.g. on disk hot
unplug), it may be possible to sneak in some weird files (e.g. if
domain would have RNG with /dev/shm/some_file as its backend). No
matter how improbable, we shouldn't unlink it as we would be
unlinking a file from the host which we haven't created in the
first place.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Cedric Bosdonnat <cbosdonnat@suse.com>
8 years agoqemuDomainAttachDeviceMknodRecursive: Don't try to create devices under preserved...
Michal Privoznik [Fri, 28 Apr 2017 09:28:53 +0000 (11:28 +0200)]
qemuDomainAttachDeviceMknodRecursive: Don't try to create devices under preserved mount points

Just like in previous commit, this fixes the same issue for
hotplug.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Cedric Bosdonnat <cbosdonnat@suse.com>
8 years agoqemuDomainCreateDeviceRecursive: Don't try to create devices under preserved mount...
Michal Privoznik [Fri, 28 Apr 2017 08:45:45 +0000 (10:45 +0200)]
qemuDomainCreateDeviceRecursive: Don't try to create devices under preserved mount points

While the code allows devices to already be there (by some
miracle), we shouldn't try to create devices that don't belong to
us. For instance, we shouldn't try to create /dev/shm/file
because /dev/shm is a mount point that is preserved. Therefore if
a file is created there from an outside (e.g. by mgmt application
or some other daemon running on the system like vhostmd), it
exists in the qemu namespace too as the mount point is the same.
It's only /dev and /dev only that is different. The same
reasoning applies to all other preserved mount points.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Cedric Bosdonnat <cbosdonnat@suse.com>
8 years agoqemuDomainCreateDeviceRecursive: pass a structure instead of bare path
Michal Privoznik [Fri, 28 Apr 2017 07:30:23 +0000 (09:30 +0200)]
qemuDomainCreateDeviceRecursive: pass a structure instead of bare path

Currently, all we need to do in qemuDomainCreateDeviceRecursive() is to
take given @device, get all kinds of info on it (major & minor numbers,
owner, seclabels) and create its copy at a temporary location @path
(usually /var/run/libvirt/qemu/$domName.dev), if @device live under
/dev. This is, however, very loose condition, as it also means
/dev/shm/* is created too. Therefor, we will need to pass more arguments
into the function for better decision making (e.g. list of mount points
under /dev). Instead of adding more arguments to all the functions (not
easily reachable because some functions are callback with strictly
defined type), lets just turn this one 'const char *' into a 'struct *'.
New "arguments" can be then added at no cost.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Cedric Bosdonnat <cbosdonnat@suse.com>
8 years agoqemuDomainBuildNamespace: Move /dev/* mountpoints later
Michal Privoznik [Thu, 27 Apr 2017 14:29:21 +0000 (16:29 +0200)]
qemuDomainBuildNamespace: Move /dev/* mountpoints later

When setting up mount namespace for a qemu domain the following
steps are executed:

1) get list of mountpoints under /dev/
2) move them to /var/run/libvirt/qemu/$domName.ext
3) start constructing new device tree under /var/run/libvirt/qemu/$domName.dev
4) move the mountpoint of the new device tree to /dev
5) restore original mountpoints from step 2)

Note the problem with this approach is that if some device in step
3) requires access to a mountpoint from step 2) it will fail as
the mountpoint is not there anymore. For instance consider the
following domain disk configuration:

    <disk type='file' device='disk'>
      <driver name='qemu' type='raw'/>
      <source file='/dev/shm/vhostmd0'/>
      <target dev='vdb' bus='virtio'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x0a' function='0x0'/>
    </disk>

In this case operation fails as we are unable to create vhostmd0
in the new device tree because after step 2) there is no /dev/shm
anymore. Leave aside fact that we shouldn't try to create devices
living in other mountpoints. That's a separate bug that will be
addressed later.

Currently, the order described above is rearranged to:

1) get list of mountpoints under /dev/
2) start constructing new device tree under /var/run/libvirt/qemu/$domName.dev
3) move them to /var/run/libvirt/qemu/$domName.ext
4) move the mountpoint of the new device tree to /dev
5) restore original mountpoints from step 3)

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Cedric Bosdonnat <cbosdonnat@suse.com>
8 years agonews: Add more v3.3.0 entries
Andrea Bolognani [Tue, 2 May 2017 15:20:16 +0000 (17:20 +0200)]
news: Add more v3.3.0 entries

These entries cover a number of features, improvements and
bug fixes that had not been documented during the development
cycle.

8 years agonews: Tweak existing v3.3.0 entries
Andrea Bolognani [Tue, 2 May 2017 13:52:02 +0000 (15:52 +0200)]
news: Tweak existing v3.3.0 entries

Some of the content was not following the (loosely established)
style, and some of the XML was not aligned properly.