]> xenbits.xensource.com Git - libvirt.git/log
libvirt.git
10 years agolibxl: Implement basic video device selection
Stefan Bader [Tue, 1 Jul 2014 07:58:18 +0000 (09:58 +0200)]
libxl: Implement basic video device selection

This started as an investigation into an issue where libvirt (using the
libxl driver) and the Xen host, like an old couple, could not agree on
who is responsible for selecting the VNC port to use.

Things usually (and a bit surprisingly) did work because, just like that
old couple, they had the same idea on what to do by default. However it
was possible that this ended up in a big argument.

The problem is that display information exists in two different places:
in the vfbs list and in the build info. And for launching the device model,
only the latter is used. But that never gets initialized from libvirt. So
Xen allows the device model to select a default port while libvirt thinks
it has told Xen that this is done by libvirt (though the vfbs config).

While fixing that, I made a stab at actually evaluating the configuration
of the video device. So that it is now possible to at least decide between
a Cirrus or standard VGA emulation and to modify the VRAM within certain
limits using libvirt.

Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
Signed-off-by: Jim Fehlig <jfehlig@suse.com>
10 years agolibxl: Add function to determine device model type
Jim Fehlig [Fri, 19 Sep 2014 16:32:43 +0000 (10:32 -0600)]
libxl: Add function to determine device model type

This patch introduces a function to detect whether the specified
emulator is QEMU_XEN or QEMU_XEN_TRADITIONAL.  Detection is based on the
string "Options specific to the Xen version:" in '$qemu -help' output.
AFAIK, the only qemu containing that string in help output is the
old Xen fork (aka qemu-dm).

Note:
QEMU_XEN means a qemu that contains support for Xen.

QEMU_XEN_TRADITIONAL means Xen's old forked qemu 0.10.2

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
10 years agoXen: Defer setting default vram value to Xen drivers
Jim Fehlig [Fri, 19 Sep 2014 16:13:40 +0000 (10:13 -0600)]
Xen: Defer setting default vram value to Xen drivers

Allow the Xen drivers to determine default vram values.  Sane
default vaules depend on the device model being used, so the
drivers are in the best position to determine the defaults.

For the legacy xen driver, it is best to maintain the existing
logic for setting default vram values to ensure there are no
regressions.  The libxl driver currently does not support
configuring a video device.  Support will be added in a
subsequent patch, where the benefit of this change will be
reaped.

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
10 years agolibxl: Copy user-specified keymap to libxl build info struct
Jim Fehlig [Fri, 19 Sep 2014 16:38:37 +0000 (10:38 -0600)]
libxl: Copy user-specified keymap to libxl build info struct

Commit 4dfc34c3 missed copying the user-specified keymap to
libxl_domain_build_info struct when creating a VFB device.

Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
Signed-off-by: Jim Fehlig <jfehlig@suse.com>
10 years agoqemu: save domain status after set domain's numa parameters
Shanzhi Yu [Mon, 6 Oct 2014 15:00:00 +0000 (17:00 +0200)]
qemu: save domain status after set domain's numa parameters

After set domain's numa parameters for running domain, save the change,
save the change into live xml is needed to survive restarting the libvirtd,
same story with bug 1146511; meanwihle add call
qemuDomainObjBeginJob/qemuDomainObjEndJob in qemuDomainSetNumaParameters

Signed-off-by: Shanzhi Yu <shyu@redhat.com>
10 years agoqemu: call qemuDomainObjBeginJob/qemuDomainObjEndJob in qemuDomainSetInterfaceParameters
Shanzhi Yu [Mon, 6 Oct 2014 15:00:00 +0000 (17:00 +0200)]
qemu: call qemuDomainObjBeginJob/qemuDomainObjEndJob in qemuDomainSetInterfaceParameters

add call qemuDomainObjBeginJob/qemuDomainObjEndJob in
qemuDomainSetInterfaceParameters

Signed-off-by: Shanzhi Yu <shyu@redhat.com>
10 years agoqemu: save domain status after set the blkio parameters
Shanzhi Yu [Mon, 6 Oct 2014 15:00:00 +0000 (17:00 +0200)]
qemu: save domain status after set the blkio parameters

After set the blkio parameters for running domain, save the change into
live xml is needed to survive restarting the libvirtd, same story with
bug 1146511, meanwhile add call qemuDomainObjBeginJob/qemuDomainObjEndJob
in qemuDomainSetBlkioParameters

Signed-off-by: Shanzhi Yu <shyu@redhat.com>
10 years agoFix build-time pkg-config files in VPATH
Jiri Denemark [Tue, 7 Oct 2014 13:22:52 +0000 (15:22 +0200)]
Fix build-time pkg-config files in VPATH

The pkg-config files in src/ make it pretty easy to build language
bindings against an uninstalled libvirt, however, they don't work with
VPATH builds. The reason is that all *-api.xml files are generated in
source rather than build directory.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
10 years agosecurity_selinux: Don't relabel /dev/net/tun
Michal Privoznik [Tue, 7 Oct 2014 14:22:17 +0000 (16:22 +0200)]
security_selinux: Don't relabel /dev/net/tun

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

The code for relabelling the TAP FD is there due to a race. When
libvirt creates a /dev/tapN device it's labeled as
'system_u:object_r:device_t:s0' by default. Later, when
udev/systemd reacts to this device, it's relabelled to the
expected label 'system_u:object_r:tun_tap_device_t:s0'. Hence, we
have a code that relabels the device, to cut the race down. For
more info see ae368ebfcc4.

But the problem is, the relabel function is called on all TUN/TAP
devices. Yes, on /dev/net/tun too. This is however a special kind
of device - other processes uses it too. We shouldn't touch it's
label then.

Ideally, there would an API in SELinux that would label just the
passed FD and not the underlying path. That way, we wouldn't need
to care as we would be not labeling /dev/net/tun but the FD
passed to the domain. Unfortunately, there's no such API so we
have to workaround until then.

Tested-by: Richard W.M. Jones <rjones@redhat.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
10 years agoFix build with older libcurl
Ján Tomko [Wed, 8 Oct 2014 07:13:40 +0000 (09:13 +0200)]
Fix build with older libcurl

Add ATTRIBUTE_UNUSED marker to the unused timeout_ms option
in esxVI_MultiCURL_TimerCallback.

Introduced by commit 125007d.

10 years agoesx: Implement virDomainScreenshot using libcurl stream driver
Matthias Bolte [Sun, 30 Mar 2014 18:45:07 +0000 (20:45 +0200)]
esx: Implement virDomainScreenshot using libcurl stream driver

This implementation uses the https://esx-server/screen?id=<id> way to get
a screenshot of a running domain. Compared to the CreateScreenshot_Task
way this works since ESX 2.5 while CreateScreenshot_Task was added in
version 4.0.

The newly added libcurl stream driver is used to directly provide the
downloaded data without saving it to a temporary file first.

10 years agoesx: Add libcurl based stream driver
Matthias Bolte [Sun, 30 Mar 2014 18:37:00 +0000 (20:37 +0200)]
esx: Add libcurl based stream driver

This allows to implement libvirt functions that use streams, such as
virDoaminScreenshot, without the need to store the downloaded data in
a temporary file first. The stream driver directly interacts with
libcurl to send and receive data.

The driver uses the libcurl multi interface that allows to do a transfer
in multiple curl_multi_perform() calls. The easy interface would do the
whole transfer in a single curl_easy_perform() call. This doesn't work
with the libvirt stream API that is driven by multiple calls to the
virStreamSend() and virStreamRecv() functions.

The curl_multi_wait() function is used to do blocking operations. But it
was added in libcurl 7.28.0. For older versions it is emulated using the
socket callback of the multi interface.

The current driver only supports blocking operations. There is already
some code in place for non-blocking mode but it is not complete.

10 years agoqemu: change macvtap device MAC address in response to NIC_RX_FILTER_CHANGED
Laine Stump [Wed, 24 Sep 2014 08:30:04 +0000 (04:30 -0400)]
qemu: change macvtap device MAC address in response to NIC_RX_FILTER_CHANGED

This patch fills in the functionality of
processNicRxFilterChangedEvent().  It now checks if it is appropriate
to respond to the NIC_RX_FILTER_CHANGED event (based on device type
and configuration) and takes appropriate action. Currently it checks
if the guest interface has been configured with
trustGuestRxFilters='yes', and if the host side device is macvtap. If
so, and the MAC address on the guest has changed, the MAC address of
the macvtap device is changed to match.

The result of this is that networking from the guest will continue to
work if the mac address of a macvtap-connected network device is
changed from within the guest, as long as trustGuestRxFilters='yes'
(previously changing the MAC address in the guest would break
networking).

10 years agoqemu: setup infrastructure to handle NIC_RX_FILTER_CHANGED event
Laine Stump [Wed, 17 Sep 2014 17:07:50 +0000 (13:07 -0400)]
qemu: setup infrastructure to handle NIC_RX_FILTER_CHANGED event

NIC_RX_FILTER_CHANGED is sent by qemu any time a NIC driver in the
guest modified the NIC's RX Filter (for example, if the MAC address of
the NIC is changed by the guest).

This patch doesn't do anything useful with that event; it just sets up
all the plumbing to get news of the event into a worker thread with
all proper locking/reference counting, and provide an easy place to
add in desired functionality.

See src/qemu/EVENTHANDLERS.txt for information/instructions on adding
a libvirt-internal handler for a qemu event (using
NIC_RX_FILTER_CHANGED as an example).

10 years agoqemu: add short document on qemu event handlers
Laine Stump [Thu, 2 Oct 2014 15:46:30 +0000 (11:46 -0400)]
qemu: add short document on qemu event handlers

This text was in the commit log for the patch that added the event
handler for NIC_RX_FILTER_CHANGED, and John Ferlan expressed a desire
that the information not be "lost", so I've put it into a file in the
qemu directory, hoping that it might catch the attention of future
writers of handlers for qemu events.

10 years agoqemu: qemuMonitorQueryRxFilter - retrieve guest netdev rx-filter
Laine Stump [Mon, 22 Sep 2014 16:19:41 +0000 (12:19 -0400)]
qemu: qemuMonitorQueryRxFilter - retrieve guest netdev rx-filter

This function can be called at any time to get the current status of a
guest's network device rx-filter. In particular it is useful to call
after libvirt recieves a NIC_RX_FILTER_CHANGED event - this event only
tells you that something has changed in the rx-filter, the details are
retrieved with the query-rx-filter monitor command (only available in
the json monitor). The command sent to the qemu monitor looks like this:

  {"execute":"query-rx-filter", "arguments": {"name":"net2"} }'

and the results will look something like this:

{
    "return": [
        {
            "promiscuous": false,
            "name": "net2",
            "main-mac": "52:54:00:98:2d:e3",
            "unicast": "normal",
            "vlan": "normal",
            "vlan-table": [
                42,
                0
            ],
            "unicast-table": [

            ],
            "multicast": "normal",
            "multicast-overflow": false,
            "unicast-overflow": false,
            "multicast-table": [
                "33:33:ff:98:2d:e3",
                "01:80:c2:00:00:21",
                "01:00:5e:00:00:fb",
                "33:33:ff:98:2d:e2",
                "01:00:5e:00:00:01",
                "33:33:00:00:00:01"
            ],
            "broadcast-allowed": false
        }
    ],
    "id": "libvirt-14"
}

This is all parsed from JSON into a virNetDevRxFilter object for
easier consumption. (unicast-table is usually empty, but is also an
array of mac addresses similar to multicast-table).

(NB: LIBNL_CFLAGS was added to tests/Makefile.am because virnetdev.h
now includes util/virnetlink.h, which includes netlink/msg.h when
appropriate. Without LIBNL_CFLAGS, gcc can't find that file (if
libnl/netlink isn't available, LIBNL_CFLAGS will be empty and
virnetlink.h won't try to include netlink/msg.h anyway).)

10 years agoutil: define virNetDevRxFilter and basic utility functions
Laine Stump [Sat, 20 Sep 2014 18:39:44 +0000 (14:39 -0400)]
util: define virNetDevRxFilter and basic utility functions

This same structure will be used to retrieve RX filter info for
interfaces on the host via netlink messages, and RX filter info for
interfaces on the guest via the qemu "query-rx-filter" command.

10 years agonetwork: set interface actual trustGuestRxFilters from network/portgroup
Laine Stump [Tue, 23 Sep 2014 18:54:16 +0000 (14:54 -0400)]
network: set interface actual trustGuestRxFilters from network/portgroup

As is done with other items such as vlan, virtualport, and bandwidth,
set the actual trustGuestRxFilters value to be used by a domain
interface according to a merge of the same attribute in the interface,
portgroup, and network in use. the interface setting always takes
precedence (if specified), followed by portgroup, and finally the
setting in the network is used if it's not specified in the interface
or portgroup.

10 years agoconf: add trustGuestRxFilters attribute to network and domain interface
Laine Stump [Tue, 23 Sep 2014 18:19:08 +0000 (14:19 -0400)]
conf: add trustGuestRxFilters attribute to network and domain interface

This new attribute will control whether or not libvirt will pay
attention to guest notifications about changes to network device mac
addresses and receive filters. The default for this is 'no' (for
security reasons). If it is set to 'yes' *and* the specified device
model and connection support it (currently only macvtap+virtio) then
libvirt will watch for NIC_RX_FILTER_CHANGED events, and when it
receives one, it will issue a query-rx-filter command, retrieve the
result, and modify the host-side macvtap interface's mac address and
unicast/multicast filters accordingly.

The functionality behind this attribute will be in a later patch. This
patch merely adds the attribute to the top-level of a domain's
<interface> as well as to <network> and <portgroup>, and adds
documentation and schema/xml2xml tests. Rather than adding even more
test files, I've just added the net attribute in various applicable
places of existing test files.

10 years agoqemu: Remove possible NULL deref in debug output
John Ferlan [Wed, 24 Sep 2014 12:30:09 +0000 (08:30 -0400)]
qemu: Remove possible NULL deref in debug output

Check for !dev->info.alias was done after a VIR_DEBUG() statement
that already tried to print - just flip sequence

10 years agoqemu: Remove need for virConnectPtr in hotunplug detach host, net
John Ferlan [Wed, 24 Sep 2014 12:31:32 +0000 (08:31 -0400)]
qemu: Remove need for virConnectPtr in hotunplug detach host, net

Prior patch removed the need for the virConnectPtr in the unplug
detach host path which caused ripple effect to remove in multiple
callers.  The previous patch just left things as ATTRIBUTE_UNUSED -
this patch will remove the variable.

10 years agoqemu: Fix hot unplug of SCSI_HOST device
John Ferlan [Tue, 23 Sep 2014 22:53:25 +0000 (18:53 -0400)]
qemu: Fix hot unplug of SCSI_HOST device

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

Introduced by commit id '8f76ad99' the logic to detach a scsi_host
device (SCSI or iSCSI) fails when attempting to remove the 'drive'
because as I found in my investigation - the DelDevice takes care of
that for us.

The investigation turned up commits to adjust the logic for the
qemuMonitorDelDevice and qemuMonitorDriveDel processing for interfaces
(commit id '81f76598'), disk bus=VIRTIO,SCSI,USB (commit id '0635785b'),
and chr devices (commit id '55b21f9b'), but nothing with the host devices.

This commit uses the model for the previous set of changes and applies
it to the hostdev path. The call to qemuDomainDetachHostSCSIDevice will
return to qemuDomainDetachThisHostDevice handling either the audit of
the failure or the wait for the removal and then call into
qemuDomainRemoveHostDevice for the event, removal from the domain hostdev
list, and audit of the removal similar to other paths.

NOTE: For now the 'conn' param to +qemuDomainDetachHostSCSIDevice is left
as ATTRIBUTE_UNUSED.  Removing requires a cascade of other changes to be
left for a future patch.

10 years agomaint: update .mailmap
Eric Blake [Mon, 6 Oct 2014 14:23:47 +0000 (08:23 -0600)]
maint: update .mailmap

Consolidate several commits made by James:
https://www.redhat.com/archives/libvir-list/2014-September/msg01156.html

Signed-off-by: Eric Blake <eblake@redhat.com>
10 years agoInclude .libs in libdir in source tree pkg-config files
Ján Tomko [Wed, 1 Oct 2014 12:46:54 +0000 (14:46 +0200)]
Include .libs in libdir in source tree pkg-config files

This lets me build against an uninstalled source tree without
libtool.

10 years agodocs: fix a typo in drvlxc
Chen Hanxiao [Mon, 6 Oct 2014 09:28:40 +0000 (17:28 +0800)]
docs: fix a typo in drvlxc

s/the/The

Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com>
10 years agominor shmem clean-ups
Martin Kletzander [Sat, 4 Oct 2014 08:46:22 +0000 (10:46 +0200)]
minor shmem clean-ups

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
10 years agoutil: Prepare URI formatting for libxml2 >= 2.9.2
Martin Kletzander [Fri, 3 Oct 2014 16:27:01 +0000 (18:27 +0200)]
util: Prepare URI formatting for libxml2 >= 2.9.2

Since commit 8eb55d782a2b9afacc7938694891cc6fad7b42a5 libxml2 removes
two slashes from the URI when there is no server part.  This is fixed
with beb7281055dbf0ed4d041022a67c6c5cfd126f25, but only if the calling
application calls xmlSaveUri() on URI that xmlURIParse() parsed.  And
that is not the case in virURIFormat().  virURIFormat() accepts
virURIPtr that can be created without parsing it and we do that when we
format network storage paths for gluster for example.  Even though
virStorageSourceParseBackingURI() uses virURIParse(), it throws that data
structure right away.

Since we want to format URIs as URIs and not absolute URIs or opaque
URIs (see RFC 3986), we can specify that with a special hack thanks to
commit beb7281055dbf0ed4d041022a67c6c5cfd126f25, by setting port to -1.

This fixes qemuxml2argvtest test where the disk-drive-network-gluster
case was failing.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
10 years agovbox: remove unused code that causes build failures
Martin Kletzander [Fri, 3 Oct 2014 17:06:33 +0000 (19:06 +0200)]
vbox: remove unused code that causes build failures

Since 87dea4fcffb2d1b120e7841adc0e3d8ea97ed777 vboxGetDrivers() is not
used for getting the vbox network driver.  The only call the code does
is using NULL as the @networkDriver_ret param , but the code still used
vbox[0-9][0-9]NetworkDriver that didn't exist anymore.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
10 years agoqemu: Build command line for ivshmem device
Martin Kletzander [Thu, 25 Sep 2014 07:00:47 +0000 (09:00 +0200)]
qemu: Build command line for ivshmem device

This patch implements support for the ivshmem device in QEMU.

Signed-off-by: Maxime Leroy <maxime.leroy@6wind.com>
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
10 years agoqemu: add capability probing for ivshmem device
Maxime Leroy [Fri, 22 Aug 2014 10:47:02 +0000 (12:47 +0200)]
qemu: add capability probing for ivshmem device

Ivshmem is supported by QEMU since 0.13 release.

Signed-off-by: Maxime Leroy <maxime.leroy@6wind.com>
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
10 years agodocs, conf, schema: add support for shmem device
Martin Kletzander [Mon, 22 Sep 2014 08:49:39 +0000 (10:49 +0200)]
docs, conf, schema: add support for shmem device

This patch adds parsing/formatting code as well as documentation for
shared memory devices.  This will currently be only accessible in QEMU
using it's ivshmem device, but is designed as generic as possible to
allow future expansion for other hypervisors.

In the devices section in the domain XML users may specify:

- For shmem device using a server:

 <shmem name='shmem0'>
   <server path='/tmp/socket-ivshmem0'/>
   <size unit='M'>32</size>
   <msi vectors='32' ioeventfd='on'/>
 </shmem>

- For ivshmem device not using an ivshmem server:

 <shmem name='shmem1'>
   <size unit='M'>32</size>
 </shmem>

Most of the configuration is made optional so it also allows
specifications like:

 <shmem name='shmem1/>
 <shmem name='shmem2'>
   <server/>
 </shmem>

Signed-off-by: Maxime Leroy <maxime.leroy@6wind.com>
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
10 years agoqemu: support nospace reason in io error event
Eric Blake [Fri, 3 Oct 2014 14:46:25 +0000 (08:46 -0600)]
qemu: support nospace reason in io error event

Aeons ago (commit 34dcbbb4, v0.8.2), we added a new libvirt event
(VIR_DOMAIN_EVENT_ID_IO_ERROR_REASON) in order to tell the user WHY
the guest halted.  This is because at least VDSM wants to react
differently to ENOSPC events (resize the lvm partition to be larger,
and resume the guest as if nothing had happened) from all other events
(I/O is hosed, throw up our hands and flag things as broken).  At the
time this was done, downstream RHEL qemu added a vendor extension
'__com.redhat_reason', which would be exactly one of these strings:
"enospc", "eperm", "eio", and "eother".  In our stupidity, we exposed
those exact strings to clients, rather than an enum, and we also
return "" if we did not have access to a reason (which was the case
for upstream qemu).

Fast forward to now: upstream qemu commit c7c2ff0c (will be qemu 2.2)
FINALLY adds a 'nospace' boolean, after discussion with multiple
projects determined that VDSM really doesn't care about distinction
between any other error types.  So this patch converts 'nospace' into
the string "enospc" for compatibility with RHEL clients that were
already used to the downstream extension, while leaving the reason
blank for all other cases (no change from the status quo).

See also https://bugzilla.redhat.com/show_bug.cgi?id=1119784

* src/qemu/qemu_monitor_json.c (qewmuMonitorJSONHandleIOError):
Parse reason field from modern qemu.
* include/libvirt/libvirt.h.in
(virConnectDomainEventIOErrorReasonCallback): Document it.

Signed-off-by: Eric Blake <eblake@redhat.com>
10 years agoqemu: Don't compare CPU against host for TCG
Cole Robinson [Tue, 23 Sep 2014 17:07:09 +0000 (13:07 -0400)]
qemu: Don't compare CPU against host for TCG

Right now when building the qemu command line, we try to do various
unconditional validations of the guest CPU against the host CPU. However
this checks are overly applied. The only time we should use the checks
are:

- The user requests host-model/host-passthrough, or

- When KVM is requsted. CPU features requested in TCG mode are always
  emulated by qemu and are independent of the host CPU, so no host CPU
  checks should be performed.

Right now if trying to specify a CPU for arm on an x86 host, it attempts
to do non-sensical validation and falls over.

Switch all the test cases that were intending to test CPU validation to
use KVM, so they continue to test the intended code.

Amend some aarch64 XML tests with a CPU model, to ensure things work
correctly.

10 years agoqemu_command: Split qemuBuildCpuArgStr
Cole Robinson [Tue, 23 Sep 2014 15:35:57 +0000 (11:35 -0400)]
qemu_command: Split qemuBuildCpuArgStr

Move the CPU mode/model handling to its own function. This is just
code movement and re-indentation.

10 years agoconfigure: improve misleading libnl3-devel missing error message
Shanzhi Yu [Fri, 26 Sep 2014 05:50:13 +0000 (13:50 +0800)]
configure: improve misleading libnl3-devel missing error message

When building libvirt from source with netcf-devel installed, the
configure script reports error "libnl-devel >=3.0 is required for
macvtap support", while actually libnl3-devel is required.

Signed-off-by: Shanzhi Yu <shyu@redhat.com>
10 years agoqemu: Improve domainSetTime error info report
Shanzhi Yu [Tue, 30 Sep 2014 13:36:23 +0000 (21:36 +0800)]
qemu: Improve domainSetTime error info report

check domain's status before call virQEMUCapsGet to report a accurate
error when domain is shut off

Resolve: https://bugzilla.redhat.com/show_bug.cgi?id=1147847
Signed-off-by: Shanzhi Yu <shyu@redhat.com>
10 years agoMakefile: Fix build without driver modules
Michal Privoznik [Fri, 3 Oct 2014 11:59:12 +0000 (13:59 +0200)]
Makefile: Fix build without driver modules

After 87dea4fcf one can observe a build failure:

./autogen.sh --system --without-driver-modules && make

  CCLD     libvirtd
../src/.libs/libvirt_driver_vbox.a(libvirt_driver_vbox_impl_la-vbox_driver.o):
In function `vboxNetworkRegister':
/home/jtomko/work/libvirt/libvirt.git/src/vbox/vbox_driver.c:168: undefined
reference to `vboxGetNetworkDriver'
collect2: error: ld returned 1 exit status
make[3]: *** [libvirtd] Error 1

The problem is that when building without driver modules the VBOX
network driver is not linked into the the VBOX driver.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
10 years agovbox: New network driver
Taowei [Thu, 2 Oct 2014 03:30:38 +0000 (11:30 +0800)]
vbox: New network driver

This patch seperate the domain driver and the network driver.

libvirt_driver_vbox_impl.la has been linked in the network driver.
So that the version specified codes in vbox_V*.c would only be
compiled once.

The vboxGetNetworkDriver provides a simple interface to get vbox
network driver.

10 years agovbox: Rewrite vboxNetworkGetXMLDesc
Taowei [Thu, 2 Oct 2014 03:30:37 +0000 (11:30 +0800)]
vbox: Rewrite vboxNetworkGetXMLDesc

10 years agovbox: Rewrite vboxNetworkCreate
Taowei [Thu, 2 Oct 2014 03:30:36 +0000 (11:30 +0800)]
vbox: Rewrite vboxNetworkCreate

10 years agovbox: Rewrite vboxNetworkUndefineDestroy
Taowei [Thu, 2 Oct 2014 03:30:35 +0000 (11:30 +0800)]
vbox: Rewrite vboxNetworkUndefineDestroy

This patch rewrites two public APIs. They are vboxNetworkUndefine
and vboxNetworkDestroy. They use the same core function
vboxNetworkUndefineDestroy. I merged it in one patch.

10 years agovbox: Rewrite vboxNetworkDefineCreateXML
Taowei [Thu, 2 Oct 2014 03:30:34 +0000 (11:30 +0800)]
vbox: Rewrite vboxNetworkDefineCreateXML

This patch actually contains two public API, virNetworkDefineXML
and virNetworkCreateXML. They use the same core function
vboxNetworkDefineCreateXML. So I merged it together.

10 years agovbox: Rewrite vboxNetworkLookupByName
Taowei [Thu, 2 Oct 2014 03:30:33 +0000 (11:30 +0800)]
vbox: Rewrite vboxNetworkLookupByName

10 years agovbox: Rewrite vboxNetworkLookupByUUID
Taowei [Thu, 2 Oct 2014 03:30:32 +0000 (11:30 +0800)]
vbox: Rewrite vboxNetworkLookupByUUID

10 years agovbox: Rewrite vboxConnectListDefinedNetworks
Taowei [Thu, 2 Oct 2014 03:30:31 +0000 (11:30 +0800)]
vbox: Rewrite vboxConnectListDefinedNetworks

10 years agovbox: Rewrite vboxConnectNumOfDefinedNetworks
Taowei [Thu, 2 Oct 2014 03:30:30 +0000 (11:30 +0800)]
vbox: Rewrite vboxConnectNumOfDefinedNetworks

10 years agovbox: Rewrite vboxConnectListNetworks
Taowei [Thu, 2 Oct 2014 03:30:29 +0000 (11:30 +0800)]
vbox: Rewrite vboxConnectListNetworks

10 years agovbox: Rewrite vboxConnectNumOfNetworks
Taowei [Thu, 2 Oct 2014 03:30:28 +0000 (11:30 +0800)]
vbox: Rewrite vboxConnectNumOfNetworks

10 years agovbox: Rewrite vboxNetworkClose
Taowei [Thu, 2 Oct 2014 03:30:27 +0000 (11:30 +0800)]
vbox: Rewrite vboxNetworkClose

10 years agovbox: Rewrite vboxNetworkOpen
Taowei [Thu, 2 Oct 2014 03:30:26 +0000 (11:30 +0800)]
vbox: Rewrite vboxNetworkOpen

10 years agovbox: Interfaces for register per parties
Taowei [Thu, 2 Oct 2014 03:30:25 +0000 (11:30 +0800)]
vbox: Interfaces for register per parties

The patch dbb4cbf532fa by Michal has splited the vbox driver into
three parties. This modification brings a more suitable interface
to the previous patch.

The new function vboxGetDriver is introduced to get the
corresponding vbox domain driver directly thought the vbox version.

Functions like vboxGetNetworkDriver and vboxGetStorageDriver
will be introduced after rewriting it's drivers.

This patch, by the way, fixed the align problem for vbox in
Makefile.am

10 years agoqemu: Fix updating balloon period in live XML
Erik Skultety [Thu, 2 Oct 2014 12:48:02 +0000 (14:48 +0200)]
qemu: Fix updating balloon period in live XML

Up until now, we set memballoon period in monitor successfully, however
we did not update domain definition structure, thus dumpxml was omitting
period attribute in memballoon element

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

10 years agoqemu: Fix updating bandwidth limits in live XML
Erik Skultety [Thu, 2 Oct 2014 12:48:01 +0000 (14:48 +0200)]
qemu: Fix updating bandwidth limits in live XML

When trying to update bandwidth limits on a running domain, limits get
updated in our internal structures, however XML parser reads
bandwidth limits from network 'actual' definition. Committing this patch
it is now available to update bandwidth 'actual' definition as well,
thus updating domain runtime XML.

10 years agoAdd virCgroupTerminateMachine stub
Ján Tomko [Thu, 2 Oct 2014 09:05:50 +0000 (11:05 +0200)]
Add virCgroupTerminateMachine stub

Fix the build on FreeBSD, broken by commit 4882618.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
10 years agobuild: fix build on non-Linux
Eric Blake [Thu, 2 Oct 2014 03:18:52 +0000 (21:18 -0600)]
build: fix build on non-Linux

A cygwin build of 1.2.9 fails with:

util/virprocess.c:87:27: fatal error: sys/syscall.h: No such file or directory
 #  include <sys/syscall.h>

But in reality, the ONLY user of setns() is lxc, which is Linux-only.
It's easiest to just limit the setns workarounds to Linux.

* src/util/virprocess.c (setns): Limit definition to Linux.

Signed-off-by: Eric Blake <eblake@redhat.com>
10 years agoMake editor used for 'virsh edit' configurable
Guido Günther [Sun, 28 Sep 2014 08:34:03 +0000 (10:34 +0200)]
Make editor used for 'virsh edit' configurable

Debian wants to use 'sensible-editor' instead of vi other distros might
want to use other defaults. This avoids distro specific patches.

10 years agoqemu: use systemd's TerminateMachine to kill all processes
Guido Günther [Thu, 25 Sep 2014 11:32:58 +0000 (13:32 +0200)]
qemu: use systemd's TerminateMachine to kill all processes

If we don't properly clean up all processes in the
machine-<vmname>.scope systemd won't remove the cgroup and subsequent vm
starts fail with

  'CreateMachine: File exists'

Additional processes can e.g. be added via

  echo $PID > /sys/fs/cgroup/systemd/machine.slice/machine-${VMNAME}.scope/tasks

but there are other cases like

  http://bugs.debian.org/761521

Invoke TerminateMachine to be on the safe side since systemd tracks the
cgroup anyway. This is a noop if all processes have terminated already.

10 years agomaint: Prohibit "devname" by a syntax check rules
Peter Krempa [Wed, 1 Oct 2014 14:07:46 +0000 (16:07 +0200)]
maint: Prohibit "devname" by a syntax check rules

and tweak the code to avoid using it.

10 years agoqemu: monitor: Avoid shadowing variable "devname" on FreeBSD. Again.
Peter Krempa [Wed, 1 Oct 2014 12:39:23 +0000 (14:39 +0200)]
qemu: monitor: Avoid shadowing variable "devname" on FreeBSD. Again.

FreeBSD's compiler complains that we shadow the symbol. Sigh.

s/devname/dev_name/

10 years agoqemu: json: Fix missing break in error reporting function
Peter Krempa [Wed, 1 Oct 2014 12:33:09 +0000 (14:33 +0200)]
qemu: json: Fix missing break in error reporting function

Otherwise we'd report a different error.

Reported by John Ferlan's coverity run.

10 years agoqemu: bulk stats: add block allocation information
Francesco Romani [Mon, 15 Sep 2014 15:42:52 +0000 (17:42 +0200)]
qemu: bulk stats: add block allocation information

Management software wants to be able to allocate disk space on demand.
To support this they need keep track of the space occupation of the
block device.  This information is reported by qemu as part of block
stats.

This patch extend the block information in the bulk stats with the
allocation information.

To keep the same behaviour a helper is extracted from
qemuMonitorJSONGetBlockExtent in order to get per-device allocation
information.

Signed-off-by: Francesco Romani <fromani@redhat.com>
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
10 years agoqemu: monitor: Add helper function to fill physical/virtual image size
Peter Krempa [Thu, 25 Sep 2014 10:03:26 +0000 (12:03 +0200)]
qemu: monitor: Add helper function to fill physical/virtual image size

While our code gathers block stats via "query-blockstats" some
information need to be gathered via "query-block". Add a helper function
that will update the blockstats structure if requested.

10 years agoBump version to 1.2.10 for new dev cycle
Peter Krempa [Wed, 1 Oct 2014 08:47:14 +0000 (10:47 +0200)]
Bump version to 1.2.10 for new dev cycle

10 years agoRelease of libvirt-1.2.9
Daniel Veillard [Wed, 1 Oct 2014 08:45:32 +0000 (16:45 +0800)]
Release of libvirt-1.2.9

* docs/news.html.in libvirt.spec.in: update for release
* po/*.po*: updated localizations and regenerated

10 years agodomain_conf: fix domain deadlock
Pavel Hrdina [Mon, 22 Sep 2014 16:19:07 +0000 (18:19 +0200)]
domain_conf: fix domain deadlock

If you use public api virConnectListAllDomains() with second parameter
set to NULL to get only the number of domains you will lock out all
other operations with domains.

Introduced by commit 2c680804.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
10 years agoAllow setting migration max downtime any time
Chris St. Pierre [Mon, 29 Sep 2014 13:45:28 +0000 (13:45 +0000)]
Allow setting migration max downtime any time

This removes the artificial and unnecessary restriction that
virDomainSetMaxDowntime() only be called while a migration is in
progress.

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

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
10 years agoqemu: monitor: Avoid shadowing variable "devname" on FreeBSD
Peter Krempa [Tue, 30 Sep 2014 09:41:43 +0000 (11:41 +0200)]
qemu: monitor: Avoid shadowing variable "devname" on FreeBSD

FreeBSD's compiler complains that we shadow the symbol. Sigh.

s/devname/dev_name/

10 years agoqemu: monitor: return block stats data as a hash to avoid disk mixup
Peter Krempa [Thu, 25 Sep 2014 08:12:15 +0000 (10:12 +0200)]
qemu: monitor: return block stats data as a hash to avoid disk mixup

The current block stats code matched up the disk name with the actual
stats by the order in the data returned from qemu. This unfortunately
isn't right as qemu may return the disks in any order. Fix this by
returning a hash of stats and index them by the disk alias.

10 years agoAlso filter out non-migratable features out of host-passthrough
Ján Tomko [Mon, 29 Sep 2014 10:44:43 +0000 (12:44 +0200)]
Also filter out non-migratable features out of host-passthrough

Commit de0aeaf filtered them out from the host-model features,
to allow host-model to be migratable by default.

Even though they are not passed to QEMU for host-passthrough,
(and not enabled by default) filter them out too
so the user does not think the domain has them.

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

10 years agoDon't verify CPU features with host-passthrough
Ján Tomko [Mon, 29 Sep 2014 13:58:38 +0000 (15:58 +0200)]
Don't verify CPU features with host-passthrough

Commit fba6bc4 introduced the non-migratable invtsc feature,
breaking save/migration with host-model and host-passthrough.

On hosts with this feature present it was automatically included
in the CPU definition, regardless of QEMU support.

Commit de0aeaf stopped including it by default for host-model,
but failed to fix host-passthrough.

This commit ignores checking of CPU features with host-passthrough,
since we don't pass them to QEMU (only -cpu host is passed),
allowing domains using host-passthrough that were saved with
the broken version of libvirtd to be restored.

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

10 years agoFix crash cpu_shares change event crash on domain startup
Ján Tomko [Mon, 29 Sep 2014 11:47:44 +0000 (13:47 +0200)]
Fix crash cpu_shares change event crash on domain startup

Introduced by commit 0dce260.

qemuDomainEventQueue was called with qemuDomainObjPrivatePtr instead
of virQEMUDriverPtr.

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

10 years agostorage: Fix logical pool fmt type
Erik Skultety [Thu, 25 Sep 2014 14:26:18 +0000 (16:26 +0200)]
storage: Fix logical pool fmt type

According to our documentation logical pool supports formats 'auto' and
'lvm2'. However, in storage_conf.c we previously defined storage pool
formats: unknown, lvm2. Due to backward compatibility reasons
we must continue refer to pool format type 'unknown' instead of 'auto'.

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

10 years agovirsh: Fix help message of allocpages
Tomoki Sekiyama [Fri, 26 Sep 2014 22:57:22 +0000 (18:57 -0400)]
virsh: Fix help message of allocpages

Fix info in the command definition of allocpages, which is currently
pointing info for 'capabilities'.

Signed-off-by: Tomoki Sekiyama <tomoki.sekiyama@hds.com>
10 years agoqemu: remove capabilities.monitor.sock when done
Guido Günther [Thu, 25 Sep 2014 08:30:58 +0000 (10:30 +0200)]
qemu: remove capabilities.monitor.sock when done

Prompted by

   http://bugs.debian.org/761131

10 years agoconf: report error in virCPUDefParseXML
Jincheng Miao [Thu, 25 Sep 2014 11:28:33 +0000 (19:28 +0800)]
conf: report error in virCPUDefParseXML

When detected invalid 'memAccess', virCPUDefParseXML should report error.

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

Signed-off-by: Jincheng Miao <jmiao@redhat.com>
10 years agoCheck for NULL in qemu monitor event filter
Ján Tomko [Mon, 22 Sep 2014 11:54:52 +0000 (13:54 +0200)]
Check for NULL in qemu monitor event filter

When virConnectDomainQemuMonitorEventRegister is called with the
VIR_CONNECT_DOMAIN_QEMU_MONITOR_EVENT_REGISTER_REGEX flag,
ignore the flag instead of crashing.

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

10 years agoFix typo s/EMULATORIN/EMULATORPIN/
Daniel P. Berrange [Fri, 26 Sep 2014 10:20:56 +0000 (11:20 +0100)]
Fix typo s/EMULATORIN/EMULATORPIN/

Fix the typo in VIR_DOMAIN_TUNABLE_CPU_EMULATORIN

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
10 years agoRename tunable event constants
Daniel P. Berrange [Thu, 25 Sep 2014 16:48:01 +0000 (17:48 +0100)]
Rename tunable event constants

For the new VIR_DOMAIN_EVENT_ID_TUNABLE event we have a bunch of
constants added

   VIR_DOMAIN_EVENT_CPUTUNE_<blah>
   VIR_DOMAIN_EVENT_BLKDEVIOTUNE_<blah>

This naming convention is bad for two reasons

  - There is no common prefix unique for the events to both
    relate them, and distinguish them from other event
    constants

  - The values associated with the constants were chosen
    to match the names used with virConnectGetAllDomainStats
    so having EVENT in the constant name is not applicable in
    that respect

This patch proposes renaming the constants to

    VIR_DOMAIN_TUNABLE_CPU_<blah>
    VIR_DOMAIN_TUNABLE_BLKDEV_<blah>

ie, given them a common VIR_DOMAIN_TUNABLE prefix.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
10 years agolxc_monitor_protocol: Redefine xdr_uint64_t if needed
Michal Privoznik [Tue, 23 Sep 2014 08:44:42 +0000 (10:44 +0200)]
lxc_monitor_protocol: Redefine xdr_uint64_t if needed

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

On some systems (using libtirpc instead of glibc's
implementation), xdr_uint64_t exists rather under different name:
xdr_u_int64_t. This makes compilation fail then:

libvirt_lxc-lxc_monitor_protocol.o: In function `xdr_virLXCMonitorInitEventMsg':
/usr/local/src/libvirt/libvirt-1.1.1/src/./lxc/lxc_monitor_protocol.c:31: undefined reference to `xdr_uint64_t'

Therefore we rather mirror the d707c866 commit and redefine
xdr_uint64_t if needed.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
10 years agoqemuPrepareNVRAM: Save domain after NVRAM path generation
Michal Privoznik [Thu, 25 Sep 2014 12:39:19 +0000 (14:39 +0200)]
qemuPrepareNVRAM: Save domain after NVRAM path generation

On a domain startup, the variable store path is generated if needed.
The path is intended to be generated only once. However, the updated
domain definition is not saved into config dir rather than state XML
only. So later, whenever the domain is destroyed and the daemon is
restarted, the generated path is forgotten and the file may be left
behind on virDomainUndefine() call.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
10 years agoremoteNodeGetFreePages: Don't alloc args.pages.pages_val
Michal Privoznik [Thu, 25 Sep 2014 09:18:50 +0000 (11:18 +0200)]
remoteNodeGetFreePages: Don't alloc args.pages.pages_val

There's no one to free() it anyway. Instead, we can just pass the
provided array pointer directly.

==20039== 48 bytes in 4 blocks are definitely lost in loss record 658 of 787
==20039==    at 0x4C2A700: calloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==20039==    by 0x4EA661F: virAllocN (viralloc.c:191)
==20039==    by 0x50386EF: remoteNodeGetFreePages (remote_driver.c:7625)
==20039==    by 0x5003504: virNodeGetFreePages (libvirt.c:21379)
==20039==    by 0x154625: cmdFreepages (virsh-host.c:374)
==20039==    by 0x12F718: vshCommandRun (virsh.c:1935)
==20039==    by 0x1339FB: main (virsh.c:3747)

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
10 years agonodeinfo: fix version of nodeAllocPages
Tomoki Sekiyama [Thu, 25 Sep 2014 20:02:21 +0000 (16:02 -0400)]
nodeinfo: fix version of nodeAllocPages

Fix comments about the version in which '.nodeAllocPages' are added.

Signed-off-by: Tomoki Sekiyama <tomoki.sekiyama@hds.com>
10 years agoqemu: Always re-detect backing chain
Peter Krempa [Thu, 25 Sep 2014 15:30:28 +0000 (17:30 +0200)]
qemu: Always re-detect backing chain

Since 363e9a68 we track backing chain metadata when creating snapshots
the right way even for the inactive configuration. As we did not yet
update other code paths that modify the backing chain (blockpull) the
newDef backing chain gets out of sync.

After stopping of a VM the new definition gets copied to the next start
one. The new VM then has incorrect backing chain info. This patch
switches the backing chain detector to always purge the existing backing
chain and forces re-detection to avoid this issue until we'll have full
backing chain tracking support.

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

10 years agoevent_example: cleanup example code for tunable event
Pavel Hrdina [Thu, 25 Sep 2014 13:03:46 +0000 (15:03 +0200)]
event_example: cleanup example code for tunable event

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
10 years agovirNodeAllocPages: Disallow RO connection
Michal Privoznik [Thu, 25 Sep 2014 15:12:46 +0000 (17:12 +0200)]
virNodeAllocPages: Disallow RO connection

Due to a missing check the API can be successfully called even if
the connection is ReadOnly. Fortunately, the API hasn't been
released yet, so there's no need for a CVE.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
10 years agoparallels: login to parallels SDK
Dmitry Guryanov [Thu, 11 Sep 2014 16:24:03 +0000 (20:24 +0400)]
parallels: login to parallels SDK

Add files parallels_sdk.c and parallels_sdk.h for code
which works with SDK, so libvirt's code will not mix with
dealing with parallels SDK.

To use Parallels SDK you must first call PrlApi_InitEx function,
and then you will be able to connect to a server with
PrlSrv_LoginLocalEx function. When you've done you must call
PrlApi_Deinit. So let's call PrlApi_InitEx on first .connectOpen,
count number of connections and deinitialize, when this counter
becomes zero.

Signed-off-by: Dmitry Guryanov <dguryanov@parallels.com>
10 years agoparallels: build with parallels SDK
Dmitry Guryanov [Thu, 11 Sep 2014 16:24:02 +0000 (20:24 +0400)]
parallels: build with parallels SDK

Executing prlctl command is not an optimal way to interact with
Parallels Cloud Server (PCS), it's better to use parallels SDK,
which is a remote API to paralles dispatcher service.

We prepared opensource version of this SDK and published it on
github, it's distributed under LGPL license. Here is a git repo:
https://github.com/Parallels/parallels-sdk.

To build with parallels SDK user should get compiler and linker
options from pkg-config 'parallels-sdk' file. So fix checks in
configure script and build with parallels SDK, if that pkg-config
file exists and add gcc options to makefile.

Signed-off-by: Dmitry Guryanov <dguryanov@parallels.com>
10 years agovirnetserver: Raise log level of max_clients related messages
Michal Privoznik [Thu, 25 Sep 2014 09:50:04 +0000 (11:50 +0200)]
virnetserver: Raise log level of max_clients related messages

We have these configuration knobs, like max_clients and
max_anonymous_clients. They limit the number of clients
connected.  Whenever the limit is reached, the daemon stops
accepting new ones and resumes if one of the connected clients
disconnects. If that's the case, a debug message is printed into
the logs. And when the daemon starts over to accept new clients
too. However, the problem is the messages have debug priority.
This may be unfortunate, because if the daemon stops accepting
new clients all of a sudden, and users don't have debug logs
enabled they have no idea what's going on. Raise the messages
level to INFO at least.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
10 years agopolkit_driver: fix possible segfault
Pavel Hrdina [Thu, 25 Sep 2014 09:13:29 +0000 (11:13 +0200)]
polkit_driver: fix possible segfault

The changes in commit c7542573 introduced possible segfault. Looking
deeper into the code and the original code before the patch series were
applied I think that we should report error for each function failure
and also we shouldn't call some of the function twice.

Found by coverity.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
10 years agoblkdeviotune: trigger tunable event for blkdeviotune updates
Pavel Hrdina [Thu, 25 Sep 2014 09:30:57 +0000 (11:30 +0200)]
blkdeviotune: trigger tunable event for blkdeviotune updates

Use the universal tunable event to report changes to user. All
blkdeviotune values are prefixed with "blkdeviotune".

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
10 years agoblkdeviotune: fix bug with saving values into live XML
Pavel Hrdina [Thu, 25 Sep 2014 09:28:25 +0000 (11:28 +0200)]
blkdeviotune: fix bug with saving values into live XML

When you updated some blkdeviotune values for running domain the values
were stored only internally, but not saved into the live XML so they
won't survive restarting the libvirtd.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
10 years agoFix build without polkit
Pavel Hrdina [Thu, 25 Sep 2014 08:57:24 +0000 (10:57 +0200)]
Fix build without polkit

The commit 1b854c76 introduced a new function 'virPolkitCheckAuth' and
in the #else section when you don't have polkit all attributes should be
follwed by ATTRIBUTE_UNUSED.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
10 years agotunable_event: extend debug message and tweak limit for remote message
Pavel Hrdina [Wed, 24 Sep 2014 07:43:31 +0000 (09:43 +0200)]
tunable_event: extend debug message and tweak limit for remote message

It would be nice to also print a params pointer and number of params in
the debug message and the previous limit for number of params in the rpc
message was too large. The 2048 params will be enough for future events.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
10 years agovirsh: Expose virNodeAllocPages
Michal Privoznik [Wed, 17 Sep 2014 13:53:42 +0000 (15:53 +0200)]
virsh: Expose virNodeAllocPages

The new virsh command is named 'allocpages'.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
10 years agonodeinfo: Implement nodeAllocPages
Michal Privoznik [Thu, 18 Sep 2014 07:47:07 +0000 (09:47 +0200)]
nodeinfo: Implement nodeAllocPages

And add stubs to other drivers like: lxc, qemu, uml and vbox.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
10 years agovirnuma: Introduce virNumaSetPagePoolSize
Michal Privoznik [Thu, 18 Sep 2014 07:24:16 +0000 (09:24 +0200)]
virnuma: Introduce virNumaSetPagePoolSize

This internal API can be used to allocate or free some pages in
the huge pages pool.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
10 years agoIntroduce virNodeAllocPages
Michal Privoznik [Tue, 16 Sep 2014 16:17:22 +0000 (18:17 +0200)]
Introduce virNodeAllocPages

A long time ago in a galaxy far, far away it has been decided
that libvirt will manage not only domains but host as well. And
with my latest work on qemu driver supporting huge pages, we miss
the cherry on top: an API to allocate huge pages on the run.
Currently users are forced to log into the host and adjust the
huge pages pool themselves.  However, with this API the problem
is gone - they can both size up and size down the pool.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
10 years agonodeGetFreePages: Push forgotten change
Michal Privoznik [Wed, 24 Sep 2014 13:10:18 +0000 (15:10 +0200)]
nodeGetFreePages: Push forgotten change

In the previous patch I've changed the for loop bounds but forgot
to 'git add' changes that adapt the rest of the code.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
10 years agosecurity: Fix labelling host devices (bz 1145968)
Cole Robinson [Wed, 24 Sep 2014 15:47:46 +0000 (11:47 -0400)]
security: Fix labelling host devices (bz 1145968)

The check for ISCSI devices was missing a check of subsys type, which
meant we could skip labelling of other host devices as well. This fixes
USB hotplug on F21

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

10 years agoFix MinGW build
Pavel Hrdina [Wed, 24 Sep 2014 09:07:08 +0000 (11:07 +0200)]
Fix MinGW build

When building on mingw the format string for long long/unsigned long
long have to be I64d/I64u instead of lld/llu.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>