Commit Graph

3381 Commits

Author SHA1 Message Date
Michal Privoznik
2300c92fe0 conf: Introduce memoryBacking/discard
QEMU has possibility to call madvise(.., MADV_REMOVE) in some
cases. Expose this feature to users by new element/attribute
discard.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2018-05-14 09:42:20 +02:00
Michal Privoznik
0329075733 conf: Move virDomainMemtune formatting into a separate function
At the same time convert the code to use virXMLFormatElement.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2018-05-14 09:42:20 +02:00
Michal Privoznik
687730540e virstoragefile: Introduce virStoragePRDef
This is a definition that holds information on SCSI persistent
reservation settings. The XML part looks like this:

  <reservations enabled='yes' managed='no'>
    <source type='unix' path='/path/to/qemu-pr-helper.sock' mode='client'/>
  </reservations>

If @managed is set to 'yes' then the <source/> is not parsed.
This design was agreed on here:

https://www.redhat.com/archives/libvir-list/2017-November/msg01005.html

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
2018-05-11 09:02:56 +02:00
Peter Krempa
3817fa10c4 storage: Properly track that backing chain members are readonly
Everything besides the top of the chain is readonly. Track this when
parsing the XML and detecting the chain from the disk. Also fix the
state when taking snapshots.

All other cases where the top image is changed already preserve the
readonly state from the original image.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
2018-05-07 14:41:20 +02:00
John Ferlan
b04629b629 conf: Clean up object referencing for Add and Remove
When adding a new object to the domain object list, there should
have been 2 virObjectRef calls made one for each list into which
the object was placed to match the 2 virObjectUnref calls that
would occur during Remove as part of virHashRemoveEntry when
virObjectFreeHashData is called when the element is removed from
the hash table as set up in virDomainObjListNew.

Some drivers (libxl, lxc, qemu, and vz) handled this inconsistency
by calling virObjectRef upon successful return from virDomainObjListAdd
in order to use virDomainObjEndAPI when done with the returned @vm.
While others (bhyve, openvz, test, and vmware) handled this via only
calling virObjectUnlock upon successful return from virDomainObjListAdd.

This patch will "unify" the approach to use virDomainObjEndAPI
for any @vm successfully returned from virDomainObjListAdd.

Because list removal is so tightly coupled with list addition,
this patch fixes the list removal algorithm to return the object
as entered - "locked and reffed".  This way, the callers can then
decide how to uniformly handle add/remove success and failure.
This removes the onus on the caller to "specially handle" the
@vm during removal processing.

The Add/Remove logic allows for some logic simplification such
as in libxl where we can Remove the @vm directly rather than
needing to set a @remove_dom boolean and removing after the
libxlDomainObjEndJob completes as the @vm is locked/reffed.

Signed-off-by: John Ferlan <jferlan@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
2018-05-03 19:09:03 -04:00
John Ferlan
2d2ed7b6f6 conf: Move and use virDomainObjListRemoveLocked
Rather than open code within virDomainObjListRemove, just call
the *Locked function.

Additionally, add comments to virDomainObjListRemove to describe
the usage model.

Signed-off-by: John Ferlan <jferlan@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
2018-05-03 19:09:03 -04:00
John Ferlan
7ae289203a conf: Use virDomainObjListFindBy*Locked for virDomainObjListAdd
Use the FindBy{UUID|Name}Locked helpers which will return a locked
and ref counted object rather than the direct virHashLookup and
virObjectLock of the returned object. We'll need to temporarily
virObjectUnref when we assign a new domain @def, but that will
change shortly when virDomainObjListAddObjLocked returns the
correct reference counted object.

Use the virDomainObjEndAPI in the error path to Unref/Unlock for
the corresponding Unref/Unlock of either the FindBy* return or
the virDomainObjNew since both return a reffed/locked object.

Signed-off-by: John Ferlan <jferlan@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
2018-05-03 19:09:03 -04:00
John Ferlan
cf5184d1e1 conf: Split FindBy{UUID|Name} into locked helpers
Create helpers virDomainObjListFindByUUIDLocked and
virDomainObjListFindByNameLocked to avoid the need
to lock the domain object list leaving that task
for the caller.

Signed-off-by: John Ferlan <jferlan@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
2018-05-03 19:09:03 -04:00
Cole Robinson
33455bc4ce domain_capabilities: Report <vmcoreinfo> support
Report <features><vmcoreinfo supported='yes'/> if the guest config
accepts <features><vmcoreinfo state='on'/>

Reviewed-by: John Ferlan <jferlan@redhat.com>
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2018-05-03 16:37:41 -04:00
Cole Robinson
217d2656a5 conf: Add a comment warning about boolean feature XML
This is the old style and we really shouldn't be adding any more
examples like this. Add a comment to warn devs away

Reviewed-by: John Ferlan <jferlan@redhat.com>
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2018-05-03 16:37:41 -04:00
Cole Robinson
c84be08156 conf: format/parse <vmcoreinfo> as tristate
<features><vmcoreinfo/> is a bare boolean XML property. We don't really
use this format anymore and instead prefer tristate <X state=on|off/>
since it's required for modeling on/off/default. If for example future
qemu started enabling vmcoreinfo by default we wouldn't have any way
for the user to turn this off.

Convert it to tristate. For writing XML this is semanticly the same,
<vmcoreinfo/> is processed as <vmcoreinfo state='on'/>.

For apps reading guest XML this is technically an API change,
as they might misinterpret <vmcoreinfo state='off'/>, however this
has only been present in libvirt since 3.10.0 and I don't think any
apps are dependent on this yet

Reviewed-by: John Ferlan <jferlan@redhat.com>
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2018-05-03 16:37:41 -04:00
Martin Kletzander
8525b9694e qemu: Add I/O thread support info into domain capabilities
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
2018-05-03 22:31:37 +02:00
Daniel P. Berrangé
23ed8eb21d nwfilter: pass vm name in when instantiating filters
The vm name is not needed for any functional requirement, but it will be
useful when debugging problems to identify which VM is associated with a
filter, since UUID is not human friendly.

Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2018-05-03 17:00:57 +01:00
Daniel P. Berrangé
593ba43f1f nwfilter: introduce virNWFilterBinding to decouple from virDomainNet
The virDomainNet struct contains everything related to configuring a
guest network device. Out of all of this info, only 5 fields are
relevant to configuring network filters. It will be more convenient for
future changes to the nwfilter driver if the relevant fields are kept in
a dedicated struct. Thus the virNWFilterBinding struct is created to
track this information.

Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2018-05-03 17:00:57 +01:00
Daniel P. Berrangé
94d31e7c0e nwfilter: remove obsolete code related to firewalld
There is a bunch of left over code in the nwfilter driver related to
monitoring firewalld over dbus, that is no longer used since the
conversion to use virFirewall APIs.

Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2018-05-03 17:00:57 +01:00
Daniel P. Berrangé
d60896321b nwfilter: remove virNWFilterHashTable typedefs entirely
All the code now just uses the virHashTablePtr type directly.

Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2018-05-03 17:00:57 +01:00
Daniel P. Berrangé
1cf16d755e nwfilter: remove methods that are trivial wrappers for virHash APIs
This removes the virNWFilterHashTableFree, virNWFilterHashTablePut
and virNWFilterHashTableRemove methods, in favour of just calling
the virHash APIs directly.

The virNWFilterHashTablePut method was unreasonably complex because
the virHashUpdateEntry already knows how to create the entry if it
does not currently exist.

Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2018-05-03 17:00:57 +01:00
Daniel P. Berrangé
77646d9478 nwfilter: remove pointless virNWFilterHashTable struct
The virNWFilterHashTable struct only contains a single virHashTable
member since

  commit 293d4fe2f1
  Author: Daniel P. Berrange <berrange@redhat.com>
  Date:   Mon Mar 24 16:35:23 2014 +0000

    Remove pointless storage of var names in virNWFilterHashTable

Thus, this struct wrapper adds no real value over just using the
virHashTable directly, but brings the complexity of needing to derefence
the hashtable to call virHash* APIs, and adds extra memory allocation
step.

To minimize code churn this just turns virNWFilterHashTable into a
typedef aliases virHashTable.

Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2018-05-03 17:00:57 +01:00
Stefan Berger
fead27f4b3 conf: Enable TPM CRB interface in the domain XML
Enable the TPM CRB to be specified in the domain XML. This
now allows to describe the TPM device like this:

  <tpm model='tpm-crb'>
    <backend type='passthrough'>
      <device path='/dev/tpm0'/>
    </backend>
  </tpm>

Extend the XML schema to also allow tpm-crb.
Extend the documentation.
Add a test case for testing the XML parser and formatter.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
2018-05-03 11:28:42 -04:00
Ján Tomko
bf70a48e22 conf: remove unused VIR_DOMAIN_FS_RAM_DEFAULT_USAGE
Unused since its introduction in commit <76b644c>.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
2018-05-02 16:03:00 +02:00
John Ferlan
da613819e9 Check return status for virUUIDGenerate
Although legal, a few paths were not checking a return value < 0
for failure instead they checked a non zero failure.

Clean them all up to be consistent.

Signed-off-by: John Ferlan <jferlan@redhat.com>
2018-04-24 08:52:59 -04:00
Michal Privoznik
31daccf5a5 virNumaGetHugePageInfo: Return page_avail and page_free as ULL
https://bugzilla.redhat.com/show_bug.cgi?id=1569678

On some large systems (with ~400GB of RAM) it is possible for
unsigned int to overflow in which case we report invalid number
of 4K pages pool size. Switch to unsigned long long.

We hit overflow in virNumaGetPages when doing:

    huge_page_sum += 1024 * page_size * page_avail;

because although 'huge_page_sum' is an unsigned long long, the
page_size and page_avail are both unsigned int, so the promotion
to unsigned long long doesn't happen until the sum has been
calculated, by which time we've already overflowed.

Turning page_avail into a unsigned long long is not strictly
needed until we need ability to represent more than 2^32
4k pages, which equates to 16 TB of RAM. That's not
outside the realm of possibility, so makes sense that we
change it to unsigned long long to avoid future problems.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2018-04-24 11:02:28 +02:00
Andrea Bolognani
c4466179f4 conf: Add rom.enabled attribute for PCI devices
The attribute can be used to disable ROM loading completely
for a device.

This might be needed because, even when the guest is configured
such that the PCI ROM will not be loaded in the PCI BAR, some
hypervisors (eg. QEMU) might still make it available to the
guest in a form (eg. fw_cfg) that some firmwares (eg. SeaBIOS)
will consume, thus not achieving the desired result.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
2018-04-23 15:20:54 +02:00
John Ferlan
868136624f conf: Rework/rename virDomainObjListFindByIDRef
Rework the code such that virDomainObjListFindByID will always
return a locked/ref counted object so that the callers can
always do the same cleanup logic to call virDomainObjEndAPI.
Makes accessing the objects much more consistent.

NB:
There were 2 callers (lxcDomainLookupByID and qemuDomainLookupByID)
that were already using the ByID name, but not virDomainObjEndAPI -
these were changed as well in this update/patch.

Signed-off-by: John Ferlan <jferlan@redhat.com>
Reviewed-by: Jim Fehlig <jfehlig@suse.com>
2018-04-23 06:41:45 -04:00
John Ferlan
fd9ef3b31e conf: Rework/rename virDomainObjListFindByUUIDRef
Now that every caller is using virDomainObjListFindByUUIDRef,
let's just remove it and keep the name as virDomainObjListFindByUUID.

Signed-off-by: John Ferlan <jferlan@redhat.com>
Reviewed-by: Jim Fehlig <jfehlig@suse.com>
2018-04-23 06:41:45 -04:00
John Ferlan
c028c71930 conf: Add error checking to virDomainSnapshotDiskDefFormat
Commit id '43f2ccdc' called virDomainDiskSourceDefFormatInternal
rather than formatting the the disk source inline. However, it
did not handle the case where the helper failed. Over time the
helper has been renamed to virDomainDiskSourceFormat. Similar to
other consumers, if virDomainDiskSourceFormat fails, then the
formatting could be off, so it's better to fail than to continue
on with some possibly bad data. Alter the function and the caller
to check status and jump to error in that case.

Found by Coverity

Signed-off-by: John Ferlan <jferlan@redhat.com>
2018-04-19 14:23:39 -04:00
Peter Krempa
18ba54c015 conf: Disk 'shared' state is not guest ABI
Drop the checking of 'shared' from the ABI stability check. This
property controls whether the hypervisor allows concurrent access to the
same file, but this fact does not influence guest ABI.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
2018-04-18 16:19:37 +02:00
Peter Krempa
4fdcf67a63 conf: Move 'driverName' back to disk definition structure
Currently it is not used in backing chains and does not seem that we
will need to use it so return it back to the disk definition. Thankfully
most accesses are done via the accessors.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
2018-04-18 16:19:12 +02:00
Peter Krempa
b2e54a3377 conf, qemu: Replace access to disk driver name with accessors
Replace direct usage of disk->src->driverName with the existing
accessors. The parser code where we assign the driver from XML is
intentionally not fixed to save an allocation.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
2018-04-18 16:16:48 +02:00
Peter Krempa
97a467b3c4 conf: Make argument of virDomainDiskGetDriver const
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
2018-04-18 16:10:39 +02:00
Jiri Denemark
71872d8224 conf: Reindent virDomainObjCheckActive
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2018-04-18 11:40:37 +02:00
Clementine Hayat
749282d400 Add function that raises error if domain is not active
Add a function named virDomainObjCheckIsActive in src/conf/domain_conf.c.
It calls virDomainObjIsActive, raises error if necessary and returns.

There is a lot of occurence of this pattern and it will save 3 lines on
each call.

Signed-off-by: Clementine Hayat <clem@lse.epita.fr>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
2018-04-18 10:22:07 +02:00
Michal Privoznik
10f94828ea virobject: Introduce VIR_CLASS_NEW() macro
So far we are repeating the following lines over and over:

  if (!(virSomeObjectClass = virClassNew(virClassForObject(),
                             "virSomeObject",
                             sizeof(virSomeObject),
                             virSomeObjectDispose)))
      return -1;

While this works, it is impossible to do some checking. Firstly,
the class name (the 2nd argument) doesn't match the name in the
code in all cases (the 3rd argument). Secondly, the current style
is needlessly verbose. This commit turns example into following:

  if (!(VIR_CLASS_NEW(virSomeObject,
                      virClassForObject)))
      return -1;

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2018-04-18 10:04:55 +02:00
Michal Privoznik
cbbbe7b448 datatypes: Rename @parent to @parentName in virNodeDevice
In next patches this name will be needed for a different memeber.
Also, it makes sense to rename the variable because it does not
contain reference to parent device, just its name.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2018-04-18 10:04:55 +02:00
Michal Privoznik
9ce3c20bb1 src: Unify dispose function names
If a function is disposing virSomething it should be called
virSomethingDispose(). There are two offenders:
virCapabilitiesDispose(virCapsPtr) and
virDomainXMLOptionClassDispose(virDomainXMLOptionPtr).

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
2018-04-17 09:13:19 +02:00
Michal Privoznik
bdefded54b domain_event: s/MetadataCange/MetadataChange/g
There's a typo in struct name.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
2018-04-17 09:13:19 +02:00
Michal Privoznik
f574e2e521 conf: Actually make virDomainChrSourceDef an object
In 2ada9ef146 we've tried to turn virDomainChrSourceDef into
virObject. Well, this requires 'virObject' member to be stored on
the first position of the struct. This adjustment is missing in
the original commit leading to all sorts of funny memleaks and
data corruptions.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
Reviewed-by: Marc Hartmayer <mhartmay@linux.vnet.ibm.com>
2018-04-12 12:44:36 +02:00
John Ferlan
2ada9ef146 conf: Convert virDomainChrSourceDefNew to return object
Let's use object referencing to handle the ChrSourceDef. A subsequent
patch then can allow the monConfig to take an extra reference before
dropping the domain lock to then ensure nothing free's the memory that
needs to be used.

Signed-off-by: John Ferlan <jferlan@redhat.com>
Reviewed-by: Marc Hartmayer <mhartmay@linux.vnet.ibm.com>
2018-04-10 08:11:09 -04:00
John Ferlan
9e792d1aaa qemu: Use virDomainChrSourceDefNew for monConfig
Rather than VIR_ALLOC, use the New function for allocation. We
already use the Free function anyway.

Signed-off-by: John Ferlan <jferlan@redhat.com>
Reviewed-by: Laine Stump <laine@laine.org>
Reviewed-by: Marc Hartmayer <mhartmay@linux.vnet.ibm.com>
2018-04-10 08:11:09 -04:00
John Ferlan
d6d8d7bb9a conf: Use virDomainChrSourceDefNew for vhostuser
Rather than using VIR_ALLOC, use the New API since we already
use the virDomainChrSourceDefFree function when done.

Signed-off-by: John Ferlan <jferlan@redhat.com>
Reviewed-by: Laine Stump <laine@laine.org>
Reviewed-by: Marc Hartmayer <mhartmay@linux.vnet.ibm.com>
2018-04-10 08:11:09 -04:00
Andrea Bolognani
96b1ea4032 conf: Remove dubious code from virDomainPCIAddressSetGrow()
I haven't been able to come up with a single scenario in which
the code in question would be executed; even if there was one,
it would be due to the user specifying a *partial* PCI topology
in the guest XML, which is of course entirely unsupportable and
thus providing even the slightest hint that doing so is in any
way a good idea is actively harmful.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
2018-04-09 09:12:21 +02:00
John Ferlan
c534d10ffe conf: Introduce virDomainObjListAddObjLocked
Create a common helper to add an object to the locked domain
objlist hash tables and use it.

Signed-off-by: John Ferlan <jferlan@redhat.com>
2018-04-06 14:14:37 -04:00
John Ferlan
e0f7707cd5 conf: Fix error path logic in virDomainObjListLoadStatus
If the virHashAddEntry fails, then we need to "careful" about
how we free the @obj. When virDomainObjParseFile returns there
is one reference and the object is locked, so use virDomainObjEndAPI
when done.

Add a virObjectRef in the error path for the second virHashAddEntry
call since it doesn't call virObjectRef, but virHashRemoveEntry
will call virObjectUnref because virObjectFreeHashData is called
when the element is removed from the hash table as set up in
virDomainObjListNew.

Signed-off-by: John Ferlan <jferlan@redhat.com>
2018-04-06 14:14:37 -04:00
John Ferlan
2689a922aa conf: Fix error path logic in virDomainObjListAddLocked
If the virHashAddEntry fails, then we need to "careful" about
how we free the @vm. When virDomainObjNew returns there is one
reference and the object is locked, so use virDomainObjEndAPI
when done.

Add a virObjectRef in the error path for the second virHashAddEntry
call since it doesn't call virObjectRef, but virHashRemoveEntry
will call virObjectUnref because virObjectFreeHashData is called
when the element is removed from the hash table as set up in
virDomainObjListNew.

Eventually these paths should goto error and error should be changed
to use EndAPI as well, but that requires more adjustments to other
paths in the code to have a locked and ref counted @vm.

Signed-off-by: John Ferlan <jferlan@redhat.com>
2018-04-06 14:14:31 -04:00
Andrea Bolognani
898edc9617 conf: Prefer pcie-to-pci-bridge to dmi-to-pci-bridge
Both pcie-to-pci-bridge and dmi-to-pci-bridge can be used to
create a traditional PCI topology in a pure PCIe guest such as
those using the x86_64/q35 or aarch64/virt machine type;
however, the former should be preferred, as it doesn't need to
obey limitation of real hardware and is completely
architecture-agnostic.

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

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
2018-04-06 14:12:21 +02:00
Andrea Bolognani
9985bb468a conf: Add virDomainPCIAddressSet.isPCIeToPCIBridgeSupported
Just like the existing areMultipleRootsSupported, this will
allow us to change the results of the driver-agnostic PCI
address allocation logic based on whether the QEMU binary
supports certain features.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
2018-04-06 14:12:19 +02:00
Andrea Bolognani
542f05e775 qemu: Implement pcie-to-pci-bridge controller
The new controller will not yet be used automatically by
libvirt, but at this point it's already possible to configure
a guest to use it.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
2018-04-06 14:12:17 +02:00
Andrea Bolognani
33b2df2795 conf: Rename virDomainPCIAddressSet.areMultipleRootsSupported
We're going to add a similarly-named attribute later, and we'd
like to be consistent.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
2018-04-06 14:12:14 +02:00
Peter Krempa
8fc5e5bfdc conf: Extract logic for updating 'detect_zeroes' mode
For some reason we've decided to silently translate the disk
detect_zeroes mode if it would be invalid. Extract the
logic so that it does not need to be copypasta'd across the code base.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
2018-04-03 15:48:37 +02:00
Peter Krempa
1cb7f41568 conf: Don't require 'def' in virDomainDiskDefParse
In some use cases (mostly in tests) it is not required to check the
seclabel definition validity. Add possibility to call
virDomainDiskDefParse without the domain definition.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
2018-04-03 15:48:37 +02:00