]> xenbits.xensource.com Git - libvirt.git/log
libvirt.git
7 years agotests: utils: Allow NULL strings to be equal to empty file in virTestCompareToFile
Peter Krempa [Fri, 28 Jul 2017 10:37:48 +0000 (12:37 +0200)]
tests: utils: Allow NULL strings to be equal to empty file in virTestCompareToFile

Treat an NULL string equivalent to an empty string in
virTestCompareToFile so that callers don't need to add additional logic
in case when a test produces no output.

7 years agotests: Run virdrivermoduletest only when WITH_LIBVIRTD is defined
Peter Krempa [Fri, 28 Jul 2017 09:54:37 +0000 (11:54 +0200)]
tests: Run virdrivermoduletest only when WITH_LIBVIRTD is defined

The test makes sense only when building the daemon, thus run it only in
such case.

7 years agotests: Run virt-aa-helper-test only when the helper was compiled
Peter Krempa [Fri, 28 Jul 2017 09:49:38 +0000 (11:49 +0200)]
tests: Run virt-aa-helper-test only when the helper was compiled

'virt-aa-helper' is compiled when both WITH_LIBVIRTD and
WITH_SECDRIVER_APPARMOR are defined. The test was run only when
WITH_SECDRIVER_APPARMOR was defined thus causing a build failure when
building without the daemon.

7 years agodocs: Format comment timestamp in UTC
Martin Kletzander [Fri, 28 Jul 2017 08:45:26 +0000 (10:45 +0200)]
docs: Format comment timestamp in UTC

I just forgot '-u' in a54c9622860a.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
7 years agonodedev: Fix double unlock of the driver on udevEnumerateDevices failure
Erik Skultety [Wed, 26 Jul 2017 08:45:11 +0000 (10:45 +0200)]
nodedev: Fix double unlock of the driver on udevEnumerateDevices failure

Commit @4cb719b2dc moved the driver locks around since these have become
unnecessary at spots where the code handles now self-lockable object
list, but missed the possible double unlock if udevEnumerateDevices
fails, because at that point the driver lock had been already dropped.

Signed-off-by: Erik Skultety <eskultet@redhat.com>
7 years agoRevert "build: distribute tests/virfilecachedata"
Pavel Hrdina [Thu, 27 Jul 2017 10:08:13 +0000 (12:08 +0200)]
Revert "build: distribute tests/virfilecachedata"

This reverts commit d3d422e00c995d50c4b78066367bfbc4f872f586.

Already fixed by commit 5a30b817ec93543c7a6cc93b5a6091a6666e377e.

7 years agobuild: distribute tests/virfilecachedata
Pavel Hrdina [Thu, 27 Jul 2017 09:55:40 +0000 (11:55 +0200)]
build: distribute tests/virfilecachedata

Missed by 478f0c5b8575.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
7 years agosecurity: apparmor: load the storage driver dynamically
Peter Krempa [Wed, 26 Jul 2017 19:57:23 +0000 (21:57 +0200)]
security: apparmor: load the storage driver dynamically

In commit 5e515b542d I've attempted to fix the inability to access
storage from the apparmor helper program by linking with the storage
driver. By linking with the .so the linker complains that it's not
portable. Fix this by loading the module dynamically as we are supposed
to do.

Reviewed-by: Daniel P. Berrange <berrange@redhat.com>
7 years agomake: Drop building without driver modules
Peter Krempa [Wed, 26 Jul 2017 19:31:47 +0000 (21:31 +0200)]
make: Drop building without driver modules

Driver modules proved to be reliable for a long time. Since support for
not building modules complicates the code and makefiles drop it.

Reviewed-by: Daniel P. Berrange <berrange@redhat.com>
7 years agotests: add virfilecachedata to EXTRA_DIST
Daniel P. Berrange [Thu, 27 Jul 2017 09:56:20 +0000 (10:56 +0100)]
tests: add virfilecachedata to EXTRA_DIST

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
7 years agotests: add test case for new syntax of VNC unix path with '='
Pavel Hrdina [Fri, 21 Jul 2017 17:55:35 +0000 (19:55 +0200)]
tests: add test case for new syntax of VNC unix path with '='

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
7 years agoqemu: properly handle '=' in the VNC socket path
Pavel Hrdina [Fri, 21 Jul 2017 17:54:33 +0000 (19:54 +0200)]
qemu: properly handle '=' in the VNC socket path

If a domain name contains a '=' and the unix socket path is
auto-generated or socket path provided by user contains '=' QEMU
is unable to properly parse the command line.  In order to make it
work we need to use the new command line syntax for VNC if it's
available, otherwise we can use the old syntax.

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

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
7 years agoqemu: capabilities: introduce QEMU_CAPS_VNC_MULTI_SERVERS
Pavel Hrdina [Fri, 21 Jul 2017 16:44:14 +0000 (18:44 +0200)]
qemu: capabilities: introduce QEMU_CAPS_VNC_MULTI_SERVERS

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
7 years agotests: qemumonitorjson: Test extraction of iSCSI device node names
Peter Krempa [Wed, 3 May 2017 06:45:00 +0000 (08:45 +0200)]
tests: qemumonitorjson: Test extraction of iSCSI device node names

Test storage was created on a rhel/centos 7 node using targetcli.

Reviewed-by: Eric Blake <eblake@redhat.com>
7 years agotests: qemumonitorjson: Test extraction of LUKS node names
Peter Krempa [Thu, 27 Jul 2017 08:26:41 +0000 (10:26 +0200)]
tests: qemumonitorjson: Test extraction of LUKS node names

Test file created by:

qemu-img create -f luks /var/lib/libvirt/images/luks 10M \
        -o key-secret=asdf --object secret,id=asdf,format=raw,data=asdf

Used in libvirt as:
 <disk type='file' device='disk'>
   <driver name='qemu' type='raw'/>
   <source file='/var/lib/libvirt/images/luks'/>
   <target dev='vda' bus='virtio'/>
   <encryption format='luks'>
     <secret type='passphrase' uuid='9b2c831a-fdb9-4c09-873c-1959580589e1'/>
   </encryption>
 </disk>

Reviewed-by: Eric Blake <eblake@redhat.com>
7 years agotests: qemumonitorjson: Add test case for node name detection with blockjob
Peter Krempa [Wed, 26 Jul 2017 09:06:51 +0000 (11:06 +0200)]
tests: qemumonitorjson: Add test case for node name detection with blockjob

qemu 2.9 returns an extra layer in the backing data if a block job is
active. Add a test case to see whether our code properly detects and
ignores such layer.

The test data was prepared by creating a backing chain of qcow2 images
(with qemu-img and with libvirt's snapshot feature).

One of the layers was then merged back by doing a block-commit:

virsh blockcommit VM hda --top /var/lib/libvirt/images/b

and then a block-copy job was started and kept in synchronized phase:

virsh blockcopy VM hda /tmp/tgt.img --transient job

Reviewed-by: Eric Blake <eblake@redhat.com>
7 years agotests: qemumonitorjson: Fix 'gluster' node name detection test case
Peter Krempa [Wed, 26 Jul 2017 08:30:18 +0000 (10:30 +0200)]
tests: qemumonitorjson: Fix 'gluster' node name detection test case

Add the blockstats data and fix the expected output.

Reviewed-by: Eric Blake <eblake@redhat.com>
7 years agotests: qemumonitorjson: Fix 'relative' node name detection test case
Peter Krempa [Wed, 26 Jul 2017 08:30:18 +0000 (10:30 +0200)]
tests: qemumonitorjson: Fix 'relative' node name detection test case

Add the blockstats data and fix the expected output.

Test data was created as:

qemu-img create -f qcow2 img0 10M
qemu-img create -f qcow2 -o "backing_fmt=qcow2,backing_file=img0" img1
qemu-img create -f qcow2 -o "backing_fmt=qcow2,backing_file=img1" img2
...

Reviewed-by: Eric Blake <eblake@redhat.com>
7 years agotests: qemumonitorjson: Add data and fix 'same-backing' node detection case
Peter Krempa [Wed, 26 Jul 2017 08:27:57 +0000 (10:27 +0200)]
tests: qemumonitorjson: Add data and fix 'same-backing' node detection case

With the new approach we are actually able to correctly detect node
names for the two instances of the same backing file.

Test images were created as:
qemu-img create -f qcow2 /var/lib/libvirt/images/base.qcow2 10M
qemu-img create -f qcow2 \
   -o "backing_fmt=qcow2,backing_file=/var/lib/libvirt/images/base.qcow2 \
   /var/lib/libvirt/images/a.qcow2
qemu-img create -f qcow2 \
   -o "backing_fmt=qcow2,backing_file=/var/lib/libvirt/images/base.qcow2 \
   /var/lib/libvirt/images/b.qcow2

and then used for two separate disks.

Reviewed-by: Eric Blake <eblake@redhat.com>
7 years agoqemu: block: store and test driver names for detected storage nodes
Peter Krempa [Tue, 25 Jul 2017 17:10:27 +0000 (19:10 +0200)]
qemu: block: store and test driver names for detected storage nodes

Store the 'drv' field both for the storage node and for the format node
and format them in the test case.

Reviewed-by: Eric Blake <eblake@redhat.com>
7 years agotests: qemumonitorjson: Simplify node name detection test
Peter Krempa [Wed, 26 Jul 2017 07:42:11 +0000 (09:42 +0200)]
tests: qemumonitorjson: Simplify node name detection test

We can now iterate the hash table and print all detected backing chains.
This simplifies calling of the test cases.

Reviewed-by: Eric Blake <eblake@redhat.com>
7 years agotests: Extract mock library for making hash table deterministic
Peter Krempa [Wed, 26 Jul 2017 08:02:21 +0000 (10:02 +0200)]
tests: Extract mock library for making hash table deterministic

virHashNew calls virRandomBits to initialize seed for the hashing
function. If a test uses iteration through the hash table to produce
results they may/will be non-deterministic. Extract the mock library
which was used for mac address mapping to be universal.

Reviewed-by: Eric Blake <eblake@redhat.com>
7 years agoqemu: block: Refactor node name detection code
Peter Krempa [Wed, 26 Jul 2017 07:36:21 +0000 (09:36 +0200)]
qemu: block: Refactor node name detection code

Remove the complex and unreliable code which inferred the node name
hierarchy only from data returned by 'query-named-block-nodes'. It turns
out that query-blockstats contain the full hierarchy of nodes as
perceived by qemu so the inference code is not necessary.

In query blockstats, the 'parent' object corresponds to the storage
behind a storage volume and 'backing' corresponds to the lower level of
backing chain. Since all have node names this data can be really easily
used to detect node names.

In addition to the code refactoring the one remaining test case needed
to be fixed along.

Reviewed-by: Eric Blake <eblake@redhat.com>
7 years agoutil: storagefile: rename 'nodebacking' to 'nodestorage' in virStorageSource
Peter Krempa [Tue, 25 Jul 2017 16:11:58 +0000 (18:11 +0200)]
util: storagefile: rename 'nodebacking' to 'nodestorage' in virStorageSource

Make it less confusing by naming the field which refers to the storage
object as 'nodestorage'.

Reviewed-by: Eric Blake <eblake@redhat.com>
7 years agoqemu: block: Rename qemuBlockFillNodeData and move it to the top
Peter Krempa [Tue, 25 Jul 2017 15:32:38 +0000 (17:32 +0200)]
qemu: block: Rename qemuBlockFillNodeData and move it to the top

The same operation will become useful in other places so rename the
function to be more generic and move it to the top so that it can be
reused earlier in the file.

Reviewed-by: Eric Blake <eblake@redhat.com>
7 years agotests: qemumontitorjson: temporarily disable node name detection tests
Peter Krempa [Wed, 26 Jul 2017 07:33:32 +0000 (09:33 +0200)]
tests: qemumontitorjson: temporarily disable node name detection tests

To simplify the refactoring patches disable the tests. This will allow
adding test data later.

Reviewed-by: Eric Blake <eblake@redhat.com>
7 years agotests: qemumonitorjson: simplify path handling in testBlockNodeNameDetect
Peter Krempa [Tue, 25 Jul 2017 13:49:00 +0000 (15:49 +0200)]
tests: qemumonitorjson: simplify path handling in testBlockNodeNameDetect

Extract the test prefix path into a variable and reuse
virTestLoadFileJSON to load the sample json files rather than doing it
manually.

Reviewed-by: Eric Blake <eblake@redhat.com>
7 years agotests: utils: Add virTestLoadFileJSON helper
Peter Krempa [Tue, 25 Jul 2017 16:40:50 +0000 (18:40 +0200)]
tests: utils: Add virTestLoadFileJSON helper

This new helper loads, parses and returns a JSON file from 'abs_srcdir'
By using variable arguments for the function, it's not necessary to
format the path separately in the test cases.

Reviewed-by: Eric Blake <eblake@redhat.com>
7 years agotests: qemuhelp: convert to virTestLoadFilePath
Peter Krempa [Tue, 25 Jul 2017 13:13:33 +0000 (15:13 +0200)]
tests: qemuhelp: convert to virTestLoadFilePath

As a sample usage of the new helper convert the calls in qemuhelptest to
the new helper.

Reviewed-by: Eric Blake <eblake@redhat.com>
7 years agotests: utils: Add virTestLoadFilePath helper
Peter Krempa [Tue, 25 Jul 2017 13:11:31 +0000 (15:11 +0200)]
tests: utils: Add virTestLoadFilePath helper

This new helper loads and returns a file from 'abs_srcdir'. By using
variable arguments for the function, it's not necessary to format the
path separately in the test cases.

Reviewed-by: Eric Blake <eblake@redhat.com>
7 years agoutil: buffer: Add virBufferStrcatVArgs
Peter Krempa [Mon, 24 Jul 2017 16:54:15 +0000 (18:54 +0200)]
util: buffer: Add virBufferStrcatVArgs

Split out the worker loop into a separate function and export it.

Reviewed-by: Eric Blake <eblake@redhat.com>
7 years agotests: utils: Don't calculate file size in virTestLoadFile
Peter Krempa [Tue, 25 Jul 2017 12:28:48 +0000 (14:28 +0200)]
tests: utils: Don't calculate file size in virTestLoadFile

The callers don't use it so don't waste a strlen(). Also fix the comment
for the function.

Reviewed-by: Eric Blake <eblake@redhat.com>
7 years agotests: qemumonitorjson: Drop redundant data from testBlockNodeNameDetectFormat
Peter Krempa [Wed, 26 Jul 2017 07:32:10 +0000 (09:32 +0200)]
tests: qemumonitorjson: Drop redundant data from testBlockNodeNameDetectFormat

The node name and backing file name can be inferred from the hierarchy.
This will also help when converting to detect node names using
query-blockstats data.

Reviewed-by: Eric Blake <eblake@redhat.com>
7 years agotests: qemumonitor: Prepare for more test data in testBlockNodeNameDetect
Peter Krempa [Wed, 26 Jul 2017 07:30:18 +0000 (09:30 +0200)]
tests: qemumonitor: Prepare for more test data in testBlockNodeNameDetect

Rename 'json' and related variables to 'nodeNameJson'. Also rename the
test files along. This is a preparation for modifying how we detect node
names which will also require data from 'query-blockstats'.

Reviewed-by: Eric Blake <eblake@redhat.com>
7 years agotests: qemumonitorjson: Consolidate basic node name detection test cases
Peter Krempa [Wed, 26 Jul 2017 07:26:56 +0000 (09:26 +0200)]
tests: qemumonitorjson: Consolidate basic node name detection test cases

Test cases named '1' and '2' differed only in the length of the backing
chain, so remove test case '2' and rename test '1' to 'basic'.

Reviewed-by: Eric Blake <eblake@redhat.com>
7 years agoqemu: monitor: Extract call of 'query-blockstats' and add new API for it
Peter Krempa [Mon, 24 Jul 2017 10:51:10 +0000 (12:51 +0200)]
qemu: monitor: Extract call of 'query-blockstats' and add new API for it

Allow getting the raw data from query-blockstats, so that we can use it
to detect the backing chain later on.

Reviewed-by: Eric Blake <eblake@redhat.com>
7 years agostorage: Disallow usage of the HBA for a fc_host backing
John Ferlan [Thu, 20 Jul 2017 18:52:15 +0000 (14:52 -0400)]
storage: Disallow usage of the HBA for a fc_host backing

Disallow providing the wwnn/wwpn of the HBA in the adapter XML:

  <adapter type='fc_host' [parent='scsi_hostN'] wwnn='HBA_wwnn'
    wwpn='HBA_wwpn'/>

This should be considered a configuration error since a vHBA
would not be created. In order to use the HBA as the backing the
following XML should be used:

  <adapter type='scsi_host' name='scsi_hostN'/>

So add a check prior to the checkParent call to validate that
the provided wwnn/wwpn resolves to a vHBA and not an HBA.

Signed-off-by: John Ferlan <jferlan@redhat.com>
7 years agoqemu_cgroup: Remove unnecessary virQEMUDriverPtr arguments
Martin Kletzander [Tue, 25 Jul 2017 15:49:43 +0000 (17:49 +0200)]
qemu_cgroup: Remove unnecessary virQEMUDriverPtr arguments

Since commit 2e6ecba1bcac, the pointer to the qemu driver is saved in
domain object's private data and hence does not have to be passed as
yet another parameter if domain object is already one of them.

This is a first (example) patch of this kind of clean up, others will
hopefully follow.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
7 years agodocs: Add build timestamps to generated html/php pages
Martin Kletzander [Wed, 26 Jul 2017 15:04:37 +0000 (17:04 +0200)]
docs: Add build timestamps to generated html/php pages

In order not to make the build even less reproducible, honour
SOURCE_DATE_EPOCH environment variable as specified:

  https://reproducible-builds.org/specs/source-date-epoch/

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
7 years agobuild: Distribute tests/{qemucpumock.c,testutilshostcpus.h}
Martin Kletzander [Wed, 26 Jul 2017 15:34:03 +0000 (17:34 +0200)]
build: Distribute tests/{qemucpumock.c,testutilshostcpus.h}

Missed by 13554a9e7f4e.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
7 years agotests: Prepare for stricter NIC model validation
Andrea Bolognani [Tue, 25 Jul 2017 14:46:14 +0000 (16:46 +0200)]
tests: Prepare for stricter NIC model validation

While using "definitely-not-virtio" as a model name is very
cute, it will also cause the relevant test to fail once we
introduce stricter validation.

Use "e1000", which is definitely not virtio but also a valid
model name, instead.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
7 years agodocs: Fix typo in memory backing section
Nitesh Konkar [Wed, 26 Jul 2017 09:54:25 +0000 (15:24 +0530)]
docs: Fix typo in memory backing section

Signed-off-by: Nitesh Konkar <nitkon12@linux.vnet.ibm.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
7 years agotest: Use consistent variable names for network test driver APIs
John Ferlan [Fri, 12 May 2017 11:57:12 +0000 (07:57 -0400)]
test: Use consistent variable names for network test driver APIs

A virNetworkObjPtr will be an 'obj'.

A virNetworkPtr will be a 'net'.

Signed-off-by: John Ferlan <jferlan@redhat.com>
7 years agoqemu: privatize _virQEMUCapsCachePriv struct
Pavel Hrdina [Wed, 19 Jul 2017 15:02:40 +0000 (17:02 +0200)]
qemu: privatize _virQEMUCapsCachePriv struct

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
7 years agoqemu: switch QEMU capabilities to use virFileCache
Pavel Hrdina [Wed, 19 Jul 2017 15:01:56 +0000 (17:01 +0200)]
qemu: switch QEMU capabilities to use virFileCache

The switch contains considerable amount of changes:

  virQEMUCapsRememberCached() is removed because this is now handled
  by virFileCacheSave().

  virQEMUCapsInitCached() is removed because this is now handled by
  virFileCacheLoad().

  virQEMUCapsNewForBinary() is split into two functions,
  virQEMUCapsNewData() which creates new data if there is nothing
  cached and virQEMUCapsLoadFile() which loads the cached data.
  This is now handled by virFileCacheNewData().

  virQEMUCapsCacheValidate() is removed because this is now handled by
  virFileCacheValidate().

  virQEMUCapsCacheFree() is removed because it's no longer required.

  Add virCapsPtr into virQEMUCapsCachePriv because for each call of
  virFileCacheLookup*() we need to use current virCapsPtr.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
7 years agoqemu: pass only host arch instead of the whole virCaps
Pavel Hrdina [Fri, 21 Jul 2017 13:09:54 +0000 (15:09 +0200)]
qemu: pass only host arch instead of the whole virCaps

This is a preparation for following patches where we switch to
virFileCache for QEMU capabilities cache

The host arch will always remain the same but virCaps may change.  Now
the host arch is stored while creating new qemu capabilities cache.
It removes the need to pass virCaps into virQEMUCapsCache*() functions.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
7 years agotests: rewrite host CPU mocking
Pavel Hrdina [Fri, 21 Jul 2017 12:24:51 +0000 (14:24 +0200)]
tests: rewrite host CPU mocking

Move all the host CPU data into a separate file and rewrite qemucpumock
to not use passed @caps.  This is preparation for following patch which
will replace virCaps argument with virArch.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
7 years agoqemu: introduce struct _virQEMUCapsCachePriv
Pavel Hrdina [Tue, 20 Jun 2017 14:17:23 +0000 (16:17 +0200)]
qemu: introduce struct _virQEMUCapsCachePriv

This will store private data that will be used by following patches
when switching to virFileCache.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
7 years agotests: add virfilecachetest
Pavel Hrdina [Wed, 12 Apr 2017 13:58:29 +0000 (15:58 +0200)]
tests: add virfilecachetest

Implements 3 test cases that covers how the cache is used.

We have to mock unlink() function because the caching code unlinks
files that are no longer valid and we don't want to do it in our tests.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
7 years agoutil: introduce virFileCache
Pavel Hrdina [Fri, 7 Apr 2017 15:34:53 +0000 (17:34 +0200)]
util: introduce virFileCache

The new virFileCache will nicely handle the caching logic for any data
that we would like to cache.  For each type of data we will just need
to implement few handlers that will take care of creating, validating,
loading and saving the cached data.

The cached data must be an instance of virObject.

Currently we cache QEMU capabilities which will start using
virFileCache.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
7 years agoqemu: we prefer C89 comment styles over C99
Pavel Hrdina [Tue, 25 Jul 2017 21:10:00 +0000 (23:10 +0200)]
qemu: we prefer C89 comment styles over C99

Introduced by commit 'a7bc2c8cfd6f'.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
7 years agoGenerate unique socket file
Scott Garfinkle [Tue, 25 Jul 2017 14:33:50 +0000 (09:33 -0500)]
Generate unique socket file

It's possible to have more than one unnamed virtio-serial unix channel.
We need to generate a unique name for each channel. Currently, we use
".../unknown.sock" for all of them. Better practice would be to specify
an explicit target path name; however, in the absence of that, we need
uniqueness in the names we generate internally.

Before the changes we'd get /var/lib/libvirt/qemu/channel/target/unknown.sock
for each instance of
    <channel type='unix'>
        <source mode='bind'/>
        <target type='virtio'/>
    </channel>

Now, we get vioser-00-00-01.sock, vioser-00-00-02.sock, etc.

Signed-off-by: Scott Garfinkle <seg@us.ibm.com>
7 years agoMove machineName generation from virsystemd into domain_conf
Martin Kletzander [Fri, 21 Jul 2017 13:51:03 +0000 (15:51 +0200)]
Move machineName generation from virsystemd into domain_conf

It is more related to a domain as we might use it even when there is
no systemd and it does not use any dbus/systemd functions.  In order
not to use code from conf/ in util/ pass machineName in cgroups code
as a parameter.  That also fixes a leak of machineName in the lxc
driver and cleans up and de-duplicates some code.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
7 years agolxc: Make lxcProcessStop callable even without PID being available
Martin Kletzander [Fri, 21 Jul 2017 13:56:46 +0000 (15:56 +0200)]
lxc: Make lxcProcessStop callable even without PID being available

This way the function can work as a central point of clean-up code and
we don't have to duplicate code.  And it works similarly to the qemu
driver.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
7 years agoqemu: Save qemu driver in qemuDomainObjPrivateData
Martin Kletzander [Fri, 21 Jul 2017 13:46:56 +0000 (15:46 +0200)]
qemu: Save qemu driver in qemuDomainObjPrivateData

This way we can finally make it static and not use any externs anywhere.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
7 years agoconf: Pass config.priv to xmlopt->privateData.alloc
Martin Kletzander [Fri, 21 Jul 2017 13:29:00 +0000 (15:29 +0200)]
conf: Pass config.priv to xmlopt->privateData.alloc

This will help us to get to some data more easily.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
7 years agosecret: Handle object list removal and deletion properly
John Ferlan [Thu, 1 Jun 2017 16:43:06 +0000 (12:43 -0400)]
secret: Handle object list removal and deletion properly

Rather than rely on virSecretObjEndAPI to make the final virObjectUnref
after the call to virSecretObjListRemove, be more explicit by calling
virObjectUnref and setting @obj to NULL for secretUndefine and in
the error path of secretDefineXML. Calling EndAPI will end up calling
Unlock on an already unlocked object which has indeteriminate results
(usually an ignored error).

The virSecretObjEndAPI will both Unref and Unlock the object; however,
the virSecretObjListRemove would have already Unlock'd the object so
calling Unlock again is incorrect. Once the virSecretObjListRemove
is called all that's left is to Unref our interest since that's the
corrollary to the virSecretObjListAdd which returned our ref interest
plus references for each hash table in which the object resides. In math
terms, after an Add there's 2 refs on the object (1 for the object and
1 for the list). After calling Remove there's just 1 ref on the object.
For the Add callers, calling EndAPI removes the ref for the object and
unlocks it, but since it's in a list the other 1 remains.

Signed-off-by: John Ferlan <jferlan@redhat.com>
7 years agosecret: Fix memory leak in virSecretLoad
John Ferlan [Tue, 25 Jul 2017 13:02:09 +0000 (09:02 -0400)]
secret: Fix memory leak in virSecretLoad

If the virSecretLoadValue fails, the code jumped to cleanup without
setting @ret = obj, thus calling virSecretObjListRemove which only
accounts for the object reference related to adding the object to
the list during virSecretObjListAdd, but does not account for the
reference to the object itself as the return of @ret would be NULL
so the caller wouldn't call virSecretObjEndAPI on the object recently
added thus reducing the refcnt to zero.

This patch will perform the ObjListRemove in the failure path of
virSecretLoadValue and Unref @obj in order to perform clean up
and return @obj as NULL. The @def will be freed as part of the
virObjectUnref.

7 years agosecret: Properly handle @def after virSecretObjAdd in driver
John Ferlan [Thu, 1 Jun 2017 12:17:52 +0000 (08:17 -0400)]
secret: Properly handle @def after virSecretObjAdd in driver

Since the virSecretObjListAdd technically consumes @def on success,
the secretDefineXML should set @def = NULL immediately and process
the remaining calls using a new @objDef variable. We can use use
VIR_STEAL_PTR since we know the Add function just stores @def in
obj->def.

Because we steal @def into @objDef, if we jump to restore_backup:
and @backup is set, then we need to ensure the @def would be
free'd properly, so we'll steal it back from @objDef. For the other
condition this fixes a double free of @def if the code had jumped to
@backup == NULL thus calling virSecretObjListRemove without setting
@def = NULL. In this case, the subsequent call to DefFree would
succeed and free @def; however, the call to EndAPI would also
call DefFree because the Unref done would be the last one for
the @obj meaning the obj->def would be used to call DefFree,
but it's already been free'd because @def wasn't managed right
within this error path.

Signed-off-by: John Ferlan <jferlan@redhat.com>
7 years agosecret: Remove need for local configFile and base64File in ObjectAdd
John Ferlan [Wed, 31 May 2017 19:11:28 +0000 (15:11 -0400)]
secret: Remove need for local configFile and base64File in ObjectAdd

Rather than assign to a local variable, let's just assign directly to the
object using the error path for cleanup.

Signed-off-by: John Ferlan <jferlan@redhat.com>
7 years agoRevert "virthread: Introduce virRWLockInitPreferWriter"
Michal Privoznik [Tue, 25 Jul 2017 08:31:54 +0000 (10:31 +0200)]
Revert "virthread: Introduce virRWLockInitPreferWriter"

This reverts commit 328bd24443d2a345a5832ee48ebba0208f8036ea.

As it turns out, this is not portable and very Linux & glibc
specific. Worse, this may lead to not starving writers on Linux
but everywhere else. Revert this and if the starvation occurs
resolve it.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel P. Berrange <berrange@redhat.com>
7 years agoconf: Rename virDomainControllerIsPCIHostBridge() to IsPSeriesPHB()
Andrea Bolognani [Mon, 24 Jul 2017 11:26:57 +0000 (13:26 +0200)]
conf: Rename virDomainControllerIsPCIHostBridge() to IsPSeriesPHB()

The original name didn't hint at the fact that PHBs are
a pSeries-specific concept.

Suggested-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
7 years agoconf: Fix backwards migration of pSeries guests
Andrea Bolognani [Wed, 19 Jul 2017 08:37:04 +0000 (10:37 +0200)]
conf: Fix backwards migration of pSeries guests

Recent commits made it so that pci-root controllers for
pSeries guests are automatically assigned the
spapr-pci-host-bridge model name; however, that prevents
guests to migrate to older versions of libvirt which don't
know about that model name at all, which at the moment is
all of them :)

To avoid the issue, just strip the model name from PHBs
when formatting the migratable XML; guests that use more
than one PHB are not going to be migratable anyway.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
7 years agostorage: Check if provided parent is vHBA capable
John Ferlan [Thu, 20 Jul 2017 15:14:46 +0000 (11:14 -0400)]
storage: Check if provided parent is vHBA capable

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

If the parent provided for the storage pool adapter is not vHBA
capable, then issue a configuration error even though the provided
wwnn/wwpn were found.

It is a configuration error to provide a mismatched parent to
the wwnn/wwpn. The @parent is optional and is used as a means to
perform duplicate pool source checks.

7 years agostorage: Remove @conn from virNodeDeviceCreateVport
John Ferlan [Tue, 18 Jul 2017 13:51:08 +0000 (09:51 -0400)]
storage: Remove @conn from virNodeDeviceCreateVport

It's no longer needed since the checkParent code moved back to
storage_backend_scsi.c

Signed-off-by: John Ferlan <jferlan@redhat.com>
7 years agostorage: Fix existing parent check for vHBA creation
John Ferlan [Tue, 18 Jul 2017 13:21:30 +0000 (09:21 -0400)]
storage: Fix existing parent check for vHBA creation

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

Commit id '106930aaa' altered the order of checking for an existing
vHBA (e.g something created via nodedev-create functionality outside
of the storage pool logic) which inadvertantly broke the code to
decide whether to alter/force the fchost->managed field to be 'yes'
because the storage pool will be managing the created vHBA in order
to ensure when the storage pool is destroyed that the vHBA is also
destroyed.

This patch moves the check (and checkParent helper) for an existing
vHBA back into the createVport in storage_backend_scsi. It also
adjusts the checkParent logic to more closely follow the intentions
prior to commit id '79ab0935'. The changes made by commit id '08c0ea16f'
are only necessary to run the virStoragePoolFCRefreshThread when
a vHBA was really created because there's a timing lag such that
the refreshPool call made after a startPool from storagePoolCreate*
wouldn't necessarily find LUNs, but the thread would. For an already
existing vHBA, using the thread is unnecessary since the vHBA already
exists and the lag to configure the LUNs wouldn't exist.

Signed-off-by: John Ferlan <jferlan@redhat.com>
7 years agonodedev: Remove driver locks around object list mgmt code
John Ferlan [Thu, 29 Jun 2017 20:51:54 +0000 (16:51 -0400)]
nodedev: Remove driver locks around object list mgmt code

Since virnodedeviceobj now has a self-lockable hash table, there's no
need to lock the table from the driver for processing. Thus remove the
locks from the driver for NodeDeviceObjList mgmt.

This includes the test driver as well.

7 years agonodedev: Convert virNodeDeviceObjListPtr to use hash tables
John Ferlan [Thu, 29 Jun 2017 19:50:06 +0000 (15:50 -0400)]
nodedev: Convert virNodeDeviceObjListPtr to use hash tables

Rather than use a forward linked list of elements, it'll be much more
efficient to use a hash table to reference the elements by unique name
and to perform hash searches.

This patch does all the heavy lifting of converting the list object to
use a self locking list that contains the hash table. Each of the FindBy
functions that do not involve finding the object by it's key (name) is
converted to use virHashSearch in order to find the specific object.
When searching for the key (name), it's possible to use virHashLookup.
For any of the list perusal functions that are required to evaluate
each object, the virHashForEach function is used.

7 years agonodedev: Remove @create from virNodeDeviceObjListGetParentHost
John Ferlan [Thu, 20 Jul 2017 13:17:22 +0000 (09:17 -0400)]
nodedev: Remove @create from virNodeDeviceObjListGetParentHost

The only callers to this function are from CreateXML paths now, so
let's just remove the unnecessary parameter.

7 years agonodedev: Alter node device deletion logic
John Ferlan [Thu, 20 Jul 2017 13:07:52 +0000 (09:07 -0400)]
nodedev: Alter node device deletion logic

Alter the node device deletion logic to make use of the parent field
from the obj->def rather than call virNodeDeviceObjListGetParentHost.
As it turns out the saved @def won't have parent_wwnn/wwpn or
parent_fabric_wwn, so the only logical path would be to call
virNodeDeviceObjListGetParentHostByParent which we can accomplish
directly via virNodeDeviceObjListFindByName.

7 years agovirdomainobjlist: Use virObjectRWLockable
Michal Privoznik [Wed, 19 Jul 2017 10:11:05 +0000 (12:11 +0200)]
virdomainobjlist: Use virObjectRWLockable

There is no reason why two threads trying to look up two domains
should mutually exclude each other. Utilize new
virObjectRWLockable that was just introduced.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
7 years agovirobject: Introduce virObjectRWLockable
Michal Privoznik [Wed, 19 Jul 2017 07:31:50 +0000 (09:31 +0200)]
virobject: Introduce virObjectRWLockable

Up until now we only had virObjectLockable which uses mutexes for
mutually excluding each other in critical section. Well, this is
not enough. Future work will require RW locks so we might as well
have virObjectRWLockable which is introduced here.

Moreover, polymorphism is introduced to our code for the first
time. Yay! More specifically, virObjectLock will grab a write
lock, virObjectLockRead will grab a read lock then (what a
surprise right?). This has great advantage that an object can be
made derived from virObjectRWLockable in a single line and still
continue functioning properly (mutexes can be viewed as grabbing
write locks only). Then just those critical sections that can
grab a read lock need fixing. Therefore the resulting change is
going to be way smaller.

In order to avoid writer starvation, the object initializes RW
lock that prefers writers.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
7 years agovirthread: Introduce virRWLockInitPreferWriter
Michal Privoznik [Wed, 19 Jul 2017 10:54:23 +0000 (12:54 +0200)]
virthread: Introduce virRWLockInitPreferWriter

We already have virRWLockInit. But this uses pthread defaults
which prefer reader to initialize the RW lock. This may lead to
writer starvation. Therefore we need to have the counterpart that
prefers writers. Now, according to the
pthread_rwlockattr_setkind_np() man page setting
PTHREAD_RWLOCK_PREFER_WRITER_NP attribute is no-op. Therefore we
need to use PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP
attribute. So much for good enum value names.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
7 years agotestutils: Remove unneeded variable
Martin Kletzander [Fri, 21 Jul 2017 06:11:56 +0000 (08:11 +0200)]
testutils: Remove unneeded variable

virDomainXMLOptionNew() gladly accepts NULL and it is used in some
drivers.  There is no need for additional variable with no members set

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
7 years agoqemu_capabilities: Fix the formatting with a space
Shivaprasad G Bhat [Mon, 24 Jul 2017 05:55:16 +0000 (11:25 +0530)]
qemu_capabilities: Fix the formatting with a space

It was observed while adding new property that there should be a space
before closing a curly brace in intel-iommu object property definition.
Fixing it as a separate patch.

Signed-off-by: Shivaprasad G Bhat <sbhat@linux.vnet.ibm.com>
7 years agodocs: Span cells if there's not doc text for enum val
Michal Privoznik [Sat, 22 Jul 2017 07:12:36 +0000 (09:12 +0200)]
docs: Span cells if there's not doc text for enum val

When generating HTML documentation we put enum values into a
table so that we can display the value's name, numerical value
and description (if it has one). Now the last part is problem. If
the value doesn't have description the table row has just two
cells and if it has one the row counts three cells. This makes
HTML engines render the description into very little space - for
instance see:

  html/libvirt-libvirt-domain.html#virDomainMemoryStatTags

We can avoid this problem if we let the cell that corresponds to
numerical value span over two cells if there's no description.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
7 years agoapibuild.py: Handle enum comments properly
Michal Privoznik [Sat, 22 Jul 2017 06:05:12 +0000 (08:05 +0200)]
apibuild.py: Handle enum comments properly

After f4cb85c6aff7c1d90 we only have two options for placing enum
values descriptions. It's either:

    typedef enum {
        /* Some long description. Therefore it's placed before
         * the value. */
        VIR_ENUM_A_VAL = 1,
    } virEnumA;

or:

    typedef enum {
        VIR_ENUM_B_VAL = 1, /* Some short description */
    } virEnumB;

However, our apibuild.py script is not able to deal with the
former one. It messes up comments. To fix this couple of things
needs to be done:

a) DO NOT reset self.comment in parseEnumBlock(). This is a
result from our tokenizer. Upon calling token() if it finds a
comment block it stores it in self.comment and returns the next
token (which is not comment). Therefore, if we reset self.comment
we might lose the first comment in the enum block.

b) we need a variable to track if the current enum block uses
value descriptions before or after values. That is if it's type
virEnumA or virEnumB. Depending on that, it we're dealing with
virEnumA type and the current token is a comma ',' we can add the
value into the list as we already have everything needed:
comment, name and value.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
7 years agovirStorageNetHostDef: Turn @port into integer
Peter Krempa [Thu, 20 Jul 2017 10:45:42 +0000 (12:45 +0200)]
virStorageNetHostDef: Turn @port into integer

Currently, @port is type of string. Well, that's overkill and
waste of memory. Port is always an integer. Use it as such.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
7 years agoconf: domain: Split up virDomainStorageHostParse and rename it
Peter Krempa [Thu, 20 Jul 2017 11:26:29 +0000 (13:26 +0200)]
conf: domain: Split up virDomainStorageHostParse and rename it

Split out parsing of one host into a separate function and add a new
function to loop through all the host XML nodes.

This change removes multiple levels of nesting due to the old XML
parsing approach used.

7 years agoutil: storage: fill in default ports when parsing backing chain
Peter Krempa [Thu, 20 Jul 2017 12:18:04 +0000 (14:18 +0200)]
util: storage: fill in default ports when parsing backing chain

Similarly to when parsing XML we need to fill in default ports for the
backing chain. This was missed in commit 5bda835466a8050625dd8bb10566e

7 years agoqemu: command: Remove condition to use default sheepdog port
Peter Krempa [Thu, 20 Jul 2017 10:50:18 +0000 (12:50 +0200)]
qemu: command: Remove condition to use default sheepdog port

Since we now set the default ports when parsing disks, it's not
necessary to have default port numbers encoded in the command line
generator.

7 years agoutil: uri: Convert port number to unsigned integer
Peter Krempa [Thu, 20 Jul 2017 10:42:53 +0000 (12:42 +0200)]
util: uri: Convert port number to unsigned integer

Negative ports don't make sense so use a unsigned integer.

7 years agoqemu: command: Rename and move qemuNetworkDriveGetPort
Peter Krempa [Thu, 13 Jul 2017 13:31:50 +0000 (15:31 +0200)]
qemu: command: Rename and move qemuNetworkDriveGetPort

Move it to virstring.c and improve it to parse and validate ports. New
name is virStringParsePort.

7 years agostorage: Fix editing mistake in storagePoolSetAutostart
John Ferlan [Sat, 22 Jul 2017 11:05:55 +0000 (07:05 -0400)]
storage: Fix editing mistake in storagePoolSetAutostart

Commit id '905f1024b' had a rogue editing mistake that inadvertently
dropped a goto cleanup in storagePoolSetAutostart, but Coverity noted it.

7 years agoqemu_capabilities: Honour caps values formatting
Michal Privoznik [Sat, 22 Jul 2017 08:30:19 +0000 (10:30 +0200)]
qemu_capabilities: Honour caps values formatting

So the way we format this huge virQEMUCaps enum is we group the
values in groups of five. And then at the beginning of each group
we have a small comment that says what's the number of the first
item in the group. Well, the last commit of 11b2ebf3e152 does not
follow this formatting.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
7 years agostorage: Alter volume num, name, and export API's to just take obj
John Ferlan [Tue, 9 May 2017 11:00:41 +0000 (07:00 -0400)]
storage: Alter volume num, name, and export API's to just take obj

Alter the virStoragePoolObjNumOfVolumes, virStoragePoolObjVolumeGetNames,
and virStoragePoolObjVolumeListExport APIs to take a virStoragePoolObjPtr
instead of the &obj->volumes and obj->def.

Signed-off-by: John Ferlan <jferlan@redhat.com>
7 years agostorage: Use consistent variable names for driver
John Ferlan [Mon, 8 May 2017 15:05:12 +0000 (11:05 -0400)]
storage: Use consistent variable names for driver

A virStoragePoolObjPtr will be an 'obj'.

A virStoragePoolPtr will be a 'pool'.

A virStorageVolPtr will be a 'vol'.

A virStorageVolDefPtr will be a 'voldef'.

Signed-off-by: John Ferlan <jferlan@redhat.com>
7 years agostorage: Use consistent variable names in virstorageobj
John Ferlan [Fri, 5 May 2017 19:12:59 +0000 (15:12 -0400)]
storage: Use consistent variable names in virstorageobj

A virStoragePoolObjPtr will be an 'obj'.

Also modify the @matchpool to @matchobj.

Signed-off-by: John Ferlan <jferlan@redhat.com>
7 years agostorage: Fix return value checks for virAsprintf
John Ferlan [Mon, 8 May 2017 11:30:19 +0000 (07:30 -0400)]
storage: Fix return value checks for virAsprintf

Use the < 0 rather than == -1 (consistently) for virAsprintf errors.

Signed-off-by: John Ferlan <jferlan@redhat.com>
7 years agotest: Add testStorageVolDefFindByName for storage volume tests
John Ferlan [Fri, 5 May 2017 21:21:50 +0000 (17:21 -0400)]
test: Add testStorageVolDefFindByName for storage volume tests

Remove repetitive code, replace with common function.

Signed-off-by: John Ferlan <jferlan@redhat.com>
7 years agotest: Add helpers to fetch active/inactive storage pool by name
John Ferlan [Fri, 5 May 2017 21:02:01 +0000 (17:02 -0400)]
test: Add helpers to fetch active/inactive storage pool by name

Rather than have repetitive code - create/use a couple of helpers:

    testStoragePoolObjFindActiveByName
    testStoragePoolObjFindInactiveByName

This will also allow for the reduction of some cleanup path logic.

Signed-off-by: John Ferlan <jferlan@redhat.com>
7 years agotest: Cleanup exit/failure paths of some storage pool APIs
John Ferlan [Fri, 5 May 2017 21:31:36 +0000 (17:31 -0400)]
test: Cleanup exit/failure paths of some storage pool APIs

Rework some of the test driver API's to remove the need to return
failure when testStoragePoolObjFindByName returns NULL rather than
going to cleanup. This removes the need for check for "if (obj)" and in
some instances the need to for a cleanup label and a local ret variable.

Signed-off-by: John Ferlan <jferlan@redhat.com>
7 years agotest: Use consistent variable names for storage test driver APIs
John Ferlan [Fri, 5 May 2017 19:31:40 +0000 (15:31 -0400)]
test: Use consistent variable names for storage test driver APIs

A virStoragePoolObjPtr will be an 'obj'.

A virStoragePoolPtr will be a 'pool'.

Signed-off-by: John Ferlan <jferlan@redhat.com>
7 years agotest: Fix up formatting in storage test API's
John Ferlan [Fri, 5 May 2017 19:57:37 +0000 (15:57 -0400)]
test: Fix up formatting in storage test API's

Fix some spacing/formatting in the storage pool/vol test driver code.

Signed-off-by: John Ferlan <jferlan@redhat.com>
7 years agovirt-aa-helper-test: Add test for aarch32 UEFI image path
dann frazier [Thu, 20 Jul 2017 19:56:56 +0000 (13:56 -0600)]
virt-aa-helper-test: Add test for aarch32 UEFI image path

Signed-off-by: dann frazier <dann.frazier@canonical.com>
7 years agoqemu: Add AAVMF32 to the list of known UEFIs
dann frazier [Thu, 20 Jul 2017 19:56:55 +0000 (13:56 -0600)]
qemu: Add AAVMF32 to the list of known UEFIs

Add a path for UEFI VMs for AArch32 VMs, based on the path Debian is using.
libvirt is the de facto canonical location for defining where distros
should place these firmware images, so let's define this path here to try
and minimize distro fragmentation.

7 years agoqemu: Remove duplicated code in qemuBuildSerialChrDeviceStr()
Andrea Bolognani [Thu, 22 Jun 2017 10:08:46 +0000 (18:08 +0800)]
qemu: Remove duplicated code in qemuBuildSerialChrDeviceStr()

The call to qemuBuildDeviceAddressStr() happens no matter
what, so we can move it to the outer possible scope inside
the function.

We can also move the call to virBufferAsprintf() after all
the checks have been performed, where it makes more sense.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
7 years agoconf: Move some virDomainDeviceInfo functions
Andrea Bolognani [Tue, 27 Jun 2017 06:30:58 +0000 (08:30 +0200)]
conf: Move some virDomainDeviceInfo functions

The virDomainDeviceInfo struct is defined in device_conf,
so generic functions that operate on it should also be
defined there rather than in domain_conf.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
7 years agoconf: Clean up virDomainHostdevDefNew()
Andrea Bolognani [Tue, 27 Jun 2017 08:28:22 +0000 (10:28 +0200)]
conf: Clean up virDomainHostdevDefNew()

Follow the same style as other similar functions.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
7 years agoconf: Rename virDomainHostdevDefAlloc() to virDomainHostdevDefNew()
Andrea Bolognani [Sun, 25 Jun 2017 12:11:12 +0000 (14:11 +0200)]
conf: Rename virDomainHostdevDefAlloc() to virDomainHostdevDefNew()

All other virDomain*Def follow this naming convention for
their allocation function.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>