Commit Graph

25235 Commits

Author SHA1 Message Date
John Ferlan
448e2d5e94 storage: Fix build due to recent storage backend code movement
Commit id '5f07c3c07' broke the freebsd build in the libvirt CI test
environment because the UMOUNT was not defined unless WITH_STORAGE_FS
is defined.

So remove the virStorageBackendUmountLocal from storage_util.c,h and
restore the code back in the storage_backend_fs.c and _vstorage.c
modules.
2017-01-26 11:43:30 -05:00
Olga Krishtal
a55ddc8774 storage: vstorage pool documentation and simple test
Signed-off-by: Olga Krishtal <okrishtal@virtuozzo.com>
2017-01-26 10:43:42 -05:00
Olga Krishtal
479a2f16f1 storage: Introduce Virtuozzo vstorage pool and volume APIs
Added create/define/etc pool operations for vstorage backend.

Used the common/local pool API's from storage_util for operations
that are not specific to vstorage. In particular Refresh and Delete
Pool operations as well as all the Volume operations.

Signed-off-by: Olga Krishtal <okrishtal@virtuozzo.com>
2017-01-26 10:43:42 -05:00
Olga Krishtal
e590d5301e storage: Introduce Virtuozzo vstorage backend
Added general definitions for vstorage pool backend including
the build options to add --with-storage-vstorage checking.
In order to use vstorage as a backend for a storage pool
vstorage tools (vstorage and vstorage-mount) need to be installed.

Signed-off-by: Olga Krishtal <okrishtal@virtuozzo.com>
2017-01-26 10:43:42 -05:00
John Ferlan
1452c85fb7 storage: Create common file/dir volume backend helpers
Move all the volume functions to storage_util to create local/common helpers
using the same naming syntax as the existing upload, download, and wipe
virStorageBackend*Local API's.

In the process of doing so, found more API's that can now become local
to storage_util. In order to distinguish between local/external - I
changed the names of the now local only ones from "virStorageBackend..."
to just "storageBackend..."

Signed-off-by: John Ferlan <jferlan@redhat.com>
2017-01-26 10:40:05 -05:00
John Ferlan
5f07c3c079 storage: Create common file/dir pool backend helpers
Move some pool functions to storage_util to create local/common helpers
using the same naming syntax as the existing upload, download, and wipe
virStorageBackend*Local API's.

In the process of doing so, found a few API's that can now become local
to storage_util. In order to distinguish between local/external - I
changed the names of the now local only ones from "virStorageBackend..."
to just "storageBackend..."

Signed-off-by: John Ferlan <jferlan@redhat.com>
2017-01-26 10:40:05 -05:00
John Ferlan
e26c21629e storage: Move the virStorageBackendFileSystem{Start|Stop} API's
Just moving code around with minor adjustment to have the Stop
code combine with the Unmount code since all the Stop code did
was call the Unmount code.
2017-01-26 10:40:05 -05:00
Michal Privoznik
572eda12ad qemu: Implement mtu on interface
Not only we should set the MTU on the host end of the device but
also let qemu know what MTU did we set.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
2017-01-26 10:00:01 +01:00
Michal Privoznik
b020cf73fe domain_conf: Introduce <mtu/> to <interface/>
So far we allow to set MTU for libvirt networks. However, not all
domain interfaces have to be plugged into a libvirt network and
even if they are, they might want to have a different MTU (e.g.
for testing purposes).

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
2017-01-26 09:59:56 +01:00
Michal Privoznik
eebec1697e virDomainNetDefParseXML: s/ret/rv/
We use @ret to hold the actual return value of the function we
are currently in. To hold a return value of a function called we
use different variables: @rv, @rc, etc. Honour this naming
scheme in virDomainNetDefParseXML too.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
2017-01-25 09:18:49 +01:00
Michal Privoznik
d737fa560f formatnetwork.html.in: Fix #elementsNICS anchor
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
2017-01-25 09:18:49 +01:00
Chen Hanxiao
f97a8a3284 THREADS.txt: fix typos
s/wakup/wakeup

Signed-off-by: Chen Hanxiao <chenhanxiao@gmail.com>
2017-01-25 09:18:49 +01:00
Jim Fehlig
d397092591 tests: add xlconfig tests for <timer> configurations 2017-01-24 16:18:13 -07:00
Jim Fehlig
b4386fdac7 xenconfig: add support for more timers
Currently xenconfig only supports the hpet timer for HVM domains.
Include support for tsc timer for both PV and HVM domains.
2017-01-24 16:18:13 -07:00
Jim Fehlig
87df87e06b libxl: support emulate mode of tsc timer
While at it, use members of libxl_tsc_mode enum instead of literal
int values.
2017-01-24 16:18:13 -07:00
Jim Fehlig
6e4759d069 libxl: fix timer configuration
The current logic around configuring timers in libxl based on
virDomainDef object is a bit brain dead. Unsupported timers are
silently ignored and tsc is only recognized if it is the first
timer specified.

Change the logic to reject unsupported timers and honor the tsc
timer regardless of its order when multiple timers are specified.
2017-01-24 16:18:13 -07:00
Boris Fiuczynski
16dd2f030a configure: fix indentation in TLS priority result
Signed-off-by: Boris Fiuczynski <fiuczy@linux.vnet.ibm.com>
2017-01-24 17:24:14 +01:00
Shivaprasad G Bhat
bd12889616 util: Forbid resetting non-endpoint devices
It is destructive to attempt reset on a pci- or cardbus-bridge, the
host can crash.  The bridges won't contain any guest data and neither
they can be passed through using vfio/stub.  So, no point in allowing a
reset on them.

Signed-off-by: Shivaprasad G Bhat <sbhat@linux.vnet.ibm.com>
2017-01-23 17:23:12 +01:00
Shivaprasad G Bhat
bec9b9b01a util: Forbid assigning a pci-bridge to a guest
Non-endpoint devices like pci-bridges cannot be assigned to guests.
Prevent such attempts.

Signed-off-by: Shivaprasad G Bhat <sbhat@linux.vnet.ibm.com>
2017-01-23 17:23:03 +01:00
John Ferlan
5f580d82f3 util: Fix typo in previous commit
Should be Unlock not Lock... Bad fingers.
2017-01-21 12:46:09 -05:00
Wang King
a563451e2b util: unlock closeCallbacks if get callbacks for connect fail
Avoid return with the closeCallbacks locked when get callbacks list for connect fail.

Signed-off-by: Wang King <king.wang@huawei.com>
Signed-off-by: John Ferlan <jferlan@redhat.com>
2017-01-21 12:39:52 -05:00
Chen Hanxiao
980f2a35c7 qemu_domain: add timestamp in tainting of guests log
We lacked of timestamp in tainting of guests log,
which bring troubles for finding guest issues:
such as whether a guest powerdown caused by qemu-monitor-command
or others issues inside guests.
If we had timestamp in tainting of guests log,
it would be helpful when checking guest's /var/log/messages.

Signed-off-by: Chen Hanxiao <chenhanxiao@gmail.com>
2017-01-21 12:34:19 -05:00
Michal Privoznik
0cacdc6f24 virDomainHostdevSubsysSCSIVHostDefParseXML: Don't leak @protocol
==24748== 12 bytes in 2 blocks are definitely lost in loss record 25 of 84
==24748==    at 0x4C2BF80: malloc (vg_replace_malloc.c:296)
==24748==    by 0x1A1E1E78: xmlStrndup (in /usr/lib64/libxml2.so.2.9.4)
==24748==    by 0x18D0495F: virXMLPropString (virxml.c:506)
==24748==    by 0x18D1FB3E: virDomainHostdevSubsysSCSIVHostDefParseXML (domain_conf.c:6280)
==24748==    by 0x18D20350: virDomainHostdevDefParseXMLSubsys (domain_conf.c:6450)
==24748==    by 0x18D34E7D: virDomainHostdevDefParseXML (domain_conf.c:13218)
==24748==    by 0x18D42598: virDomainDefParseXML (domain_conf.c:17745)
==24748==    by 0x18D440A9: virDomainDefParseNode (domain_conf.c:18236)
==24748==    by 0x18D43EFA: virDomainDefParse (domain_conf.c:18180)
==24748==    by 0x18D43FA0: virDomainDefParseFile (domain_conf.c:18206)
==24748==    by 0x44EDA1: testCompareDomXML2XMLFiles (testutils.c:1140)
==24748==    by 0x4365F8: testXML2XMLActive (qemuxml2xmltest.c:59)

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
2017-01-20 16:31:05 +01:00
Jiri Denemark
6cb204b7ac qemu: Reset hostModelInfo in virQEMUCapsReset
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2017-01-20 15:52:56 +01:00
Michal Privoznik
57b5e27d3d qemu: set default vhost-user ifname
Based on work of Mehdi Abaakouk <sileht@sileht.net>.

When parsing vhost-user interface XML and no ifname is found we
can try to fill it in in post parse callback. The way this works
is we try to make up interface name from given socket path and
then ask openvswitch whether it knows the interface.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
2017-01-20 15:42:12 +01:00
Peter Krempa
1d4fd2dd0f qemu: hotplug: Properly emit "DEVICE_DELETED" event when unplugging memory
The event needs to be emitted after the last monitor call, so that it's
not possible to find the device in the XML accidentally while the vm
object is unlocked.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1414393
2017-01-20 14:24:35 +01:00
Roman Bogorodskiy
6a9c7468de bhyve: fix interface type handling for argv2xml
When generating a domain XML from native command (i.e. via
the connectDomainXMLFromNative call), we should use
interface type 'bridge' rather than 'ethernet' because we only
support bridges at this point.

As we don't have bridge name explicitly specified on the command line,
just use 'virbr0' as a default.
2017-01-19 20:19:44 +04:00
Andrea Bolognani
5fff7b99db nss: Remove RES_USE_INET6 usage
The recent deprecation in glibc (commit b76e065991ec) means the
module will fail to build entirely:

  nss/libvirt_nss.c: In function '_nss_libvirt_gethostbyname_r':
  nss/libvirt_nss.c:363:13: error: RES_USE_INET6 is deprecated [-Werror]
     int af = ((_res.options & RES_USE_INET6) ? AF_INET6 : AF_INET);
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~

This resolver option was removed shortly after being introduced,
and application using it are already broken anyway.
2017-01-19 13:46:20 +01:00
Daniel P. Berrange
2e045a4f9b storage: avoid use of undefined GLUSTER_CLI variable
Previous commit tried to change configure logic such that the
GLUSTER_CLI parameter would always be set:

  commit 9e97c8c0f0
  Author: Peter Krempa <pkrempa@redhat.com>
  Date:   Mon Jan 9 15:56:12 2017 +0100

    storage: gluster: Remove build-time dependency on the 'gluster' cli tool

This missed the fact that the AC_PATH_PROG call was itself inside an 'if'
conditional that would not be called in with_storage_gluster was false. As
a result, GLUSTER_CLI was still conditionally defined.

Just kill the GLUSTER_CLI parameter and AC_PATH_PROG call entirely and pass a
bare "gluster" string to virFindFileInPath instead.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2017-01-19 10:56:54 +00:00
Daniel P. Berrange
b9cc6316c0 qemu: catch failure of drive_add
Previously when QEMU failed "drive_add" due to an error opening
a file it would report

  "could not open disk image"

These days though, QEMU reports

  "Could not open '/tmp/virtd-test_e3hnhh5/disk1.qcow2': Permission denied"

which we were not detecting as an error condition.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2017-01-19 10:56:53 +00:00
Peter Krempa
01d9c3497c storage: sheepdog: Split out functions required for tests
Separate the headers so that functions only required for testing of the
sheepdog backend are separated into their own file.
2017-01-19 09:25:51 +01:00
Peter Krempa
ebc8564c1a storage: scsi: Remove private constants from header
They are used only in the SCSI backend driver so there's no need to
pollute the headers.
2017-01-19 09:25:51 +01:00
Peter Krempa
0de123c84e storage: scsi: Fix build if SCSI backend is disabled but iSCSI is enabled
The iSCSI backend driver was using stuff from the SCSI driver without
making sure that it's compiled in. Move the common code into the
storage_util.c since it does not contain any specific code.
2017-01-19 09:25:51 +01:00
Peter Krempa
d66dda6504 storage: fs: Compile file backends even if filesystem support is disabled
The file backend code was mistakenly put into #if WITH_STORAGE_FS. This
is not necessary since all the backends just access files on disk, and
thus the code for WITH_STORAGE_DIR is sufficient to compile everything.
2017-01-19 09:25:51 +01:00
Peter Krempa
46e8049c15 storage: Split utility functions from storage_backend.(ch)
The file became a garbage dump for all kinds of utility functions over
time. Move them to a separate file so that the files can become a clean
interface for the storage backends.
2017-01-19 09:25:51 +01:00
Peter Krempa
4417481d8a storage: Remove common code from specific driver backend
The storage driver helper functions that deal with parted were put into
the disk backend code but are used commonly across.
2017-01-19 09:25:51 +01:00
Jim Fehlig
b018ada330 tests: fix compilation of shunloadtest
While local builds succeed fine, a build worker building in a
chroot environment is encountering the following error with
libvirt 3.0.0 release candidates

[  162s] shunloadtest.o: In function `main':
[  162s] /home/abuild/rpmbuild/BUILD/libvirt-3.0.0/tests/shunloadtest.c:110: undefined reference to `dlopen'
[  162s] /home/abuild/rpmbuild/BUILD/libvirt-3.0.0/tests/shunloadtest.c:114: undefined reference to `dlsym'
[  162s] /home/abuild/rpmbuild/BUILD/libvirt-3.0.0/tests/shunloadtest.c:133: undefined reference to `dlclose'
[  162s] /home/abuild/rpmbuild/BUILD/libvirt-3.0.0/tests/shunloadtest.c:111: undefined reference to `dlerror'
[  162s] /home/abuild/rpmbuild/BUILD/libvirt-3.0.0/tests/shunloadtest.c:115: undefined reference to `dlerror'
[  162s] /home/abuild/rpmbuild/BUILD/libvirt-3.0.0/tests/shunloadtest.c:116: undefined reference to `dlclose'

Fix by appending DLOPEN_LIBS to shunloadtest_LDADD.
2017-01-18 15:59:00 -07:00
John Ferlan
748acc54e3 docs: Add news.xml entry for pool --uuid and --name adjustments 2017-01-18 09:16:35 -05:00
Chen Hanxiao
b5817855c0 virsh: pool-list: allow both --uuid and --name in one cmd
This patch will allow --uuid and --name in one cmd.
The pool's UUID and name will be printed side by side.

Signed-off-by: Chen Hanxiao <chenhanxiao@gmail.com>
2017-01-18 09:12:31 -05:00
Chen Hanxiao
0d9bcd6ffa virsh: pool-list: introduce --name for printing pool's name only
This patch will introduce option --name.
If specified, only name of pools will be printed out.

Signed-off-by: Chen Hanxiao <chenhanxiao@gmail.com>
2017-01-18 08:46:14 -05:00
Chen Hanxiao
3fe791f8c9 virsh: pool-list: introduce --uuid for printing pool's UUID only
This patch will introduce option --uuid.
If specified, only UUID of pools will be printed out.

Signed-off-by: Chen Hanxiao <chenhanxiao@gmail.com>
2017-01-18 08:46:14 -05:00
Boris Fiuczynski
666bee3973 nodedev: Fabric name must not be required for fc_host capability
fabric_name is one of many fc_host attributes in Linux that is optional
and left to the low-level driver to decide if it is implemented.
The zfcp device driver does not provide a fabric name for an fcp host.

This patch removes the requirement for a fabric name by making it optional.

Signed-off-by: Boris Fiuczynski <fiuczy@linux.vnet.ibm.com>
2017-01-18 06:31:54 -05:00
Boris Fiuczynski
d59226926e util: add file exists check in virReadFCHost
File open errors are prevented by a file exists check before
virFileReadAll is called since all callers of the virReadFCHost
method handle errors themselves based on the NULL return anyway.
Also included is a minor spelling correction in a comment.

Signed-off-by: Boris Fiuczynski <fiuczy@linux.vnet.ibm.com>
2017-01-18 06:25:55 -05:00
John Ferlan
0d157b3fed disk: Fixup error handling path for devmapper when part_separator='yes'
https://bugzilla.redhat.com/show_bug.cgi?id=1346566

If libvirt_parthelper is erroneously told to append the partition
separator 'p' onto the generated output for a disk pool using device
mapper that has 'user_friendly_names' set to true, then the error
recovery path will fail to find volume resulting in the pool being
in an unusable state.

So, augment the documentation to provide the better hint that the
part_separator='yes' should be set when user_friendly_names are not
being used. Additionally, once we're in the error path where the
returned name doesn't match the expected partition name try to see
if the reason is because the 'p' was erroneosly added. If so alter
the about to be removed vol->target.path so that the DiskDeleteVol
code can find the partition that was created and remove it.
2017-01-18 06:17:36 -05:00
John Ferlan
9508682ba0 storage: Allow probe of volume capacity for BLOCK type
If the voldef type is VIR_STORAGE_VOL_BLOCK, then as long as the
format is known, let's allow the probe to happen - gets a truer value
and the same probe/update would be allowed for the same volume defined
in a domain.
2017-01-18 06:09:38 -05:00
John Ferlan
d04bb05fb7 storage: Fix virStorageBackendUpdateVolTargetInfo type check
For volume processing in virStorageBackendUpdateVolTargetInfo to get
the capacity commit id 'a760ba3a7' added the ability to probe a volume
that didn't list a target format. Unfortunately, the code used the
virStorageSource  (e.g. target->type - virStorageType) rather than
virStorageVolDef (e.g. vol->type - virStorageVolType) in order to
make the comparison. As it turns out target->type for a volume is
not filled in at all for a voldef as the code relies on vol->type.
Ironically the result is that only VIR_STORAGE_VOL_BLOCK's would get
their capacity updated.

This patch will adjust the code to check the "vol->type" field instead
as an argument. This way for a voldef, the correct comparison is made.

Additionally for a backingStore, the 'type' field is never filled in;
however, since we know that the provided path is a location at which
the backing store can be accessed on the local filesystem thus just
pass VIR_STORAGE_VOL_FILE in order to satisfy the adjusted voltype
check. Whether it's a FILE or a BLOCK only matters if we're trying to
get more data based on the target->format.
2017-01-18 06:09:38 -05:00
Michal Privoznik
77831d212e Post-release version bump to 3.1.0
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
2017-01-18 11:57:54 +01:00
Michal Privoznik
1cbcbd3746 tests: Distribute qemuhotplugtestcpus
Starting from a245abce43 another set of tests for
qemuhotplugtest has been introduced. This time for vcpu hotplug.
However, the test data (which live in qemuhotplugtestcpus dir)
are not being distributed properly.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
2017-01-18 11:49:02 +01:00
Peter Krempa
dd335d03e8 spec: Depend on the gluster command line tool
The gluster command line tool that is used to lookup storage pool
sources moved from the gluster-client package to gluster-cli.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1349441
2017-01-18 11:05:26 +01:00
Peter Krempa
9e97c8c0f0 storage: gluster: Remove build-time dependency on the 'gluster' cli tool
The tool is used for pool discovery. Since we call an external binary we
don't really need to compile out the code that uses it. We can check
whether it exists at runtime.
2017-01-18 10:45:15 +01:00