]> xenbits.xensource.com Git - libvirt.git/log
libvirt.git
7 years agoutil: bitmap: Note that shrinking the bitmap requires clearing of unused bits
Peter Krempa [Mon, 5 Feb 2018 13:05:05 +0000 (14:05 +0100)]
util: bitmap: Note that shrinking the bitmap requires clearing of unused bits

Note the fact that the unused portion of the last element in the bitmap
needs to be cleared, since we use functions which process only full-size
elements and don't really deal with individual bits.

7 years agoutil: bitmap: Use VIR_SHRINK_N in virBitmapShrink
Peter Krempa [Mon, 5 Feb 2018 12:50:44 +0000 (13:50 +0100)]
util: bitmap: Use VIR_SHRINK_N in virBitmapShrink

The function only reduces the size of the bitmap thus we can use the
appropriate shrinking function which also does not have any return
value.

Since virBitmapShrink now does not return any value callers need to be
fixed as well.

7 years agoutil: bitmap: Fix value of 'map_alloc' when shrinking bitmap
Peter Krempa [Mon, 5 Feb 2018 12:36:57 +0000 (13:36 +0100)]
util: bitmap: Fix value of 'map_alloc' when shrinking bitmap

The virBitmap code uses VIR_RESIZE_N to do quadratic scaling, which
means that along with the number of requested map elements we also need
to keep the number of actually allocated elements for the scaling
algorithm to work properly.

The shrinking code did not fix 'map_alloc' thus virResizeN might
actually not expand the bitmap properly after called on a previously
shrunk bitmap.

7 years agoutil: bitmap: Add comments for functions which don't have them
Peter Krempa [Mon, 5 Feb 2018 12:32:05 +0000 (13:32 +0100)]
util: bitmap: Add comments for functions which don't have them

virBitmap code is thoroughly documented. Add docs for the few functions
missing them.

7 years agoutil: bitmap: Fix function formatting and spacing
Peter Krempa [Mon, 5 Feb 2018 12:17:49 +0000 (13:17 +0100)]
util: bitmap: Fix function formatting and spacing

7 years agoutil: bitmap: Rename 'max_bit' to 'nbits'
Peter Krempa [Mon, 5 Feb 2018 10:24:05 +0000 (11:24 +0100)]
util: bitmap: Rename 'max_bit' to 'nbits'

'max_bit' is misleading as the value is set to the first invalid bit
as it's used as the number of bits in the bitmap. Rename it to a more
descriptive name.

7 years agoqemu: Refresh capabilities when creating resctrl allocation
Martin Kletzander [Fri, 2 Feb 2018 07:35:30 +0000 (08:35 +0100)]
qemu: Refresh capabilities when creating resctrl allocation

Since one of the things in capabilities (info from resctrl updated with data
about caches) can be change on the system by remounting the /sys/fs/resctrl with
different options, the capabilities need to be refreshed.  There is a better fix
in the works, but it's going to be way bigger than this (hence the XXX note
there), so for the time being let's workaround this.  And in order not to slow
down the domain starting, only get the capabilities if there are any cachetunes.

Relates-to: https://bugzilla.redhat.com/show_bug.cgi?id=1540780
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
7 years agoutil: Check if kernel-provided info is consistent with itself
Martin Kletzander [Fri, 2 Feb 2018 14:05:22 +0000 (15:05 +0100)]
util: Check if kernel-provided info is consistent with itself

Just in case someone re-mounted /sys/fs/resctrl with different mount
options (cdp), add a check here.

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

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
7 years agoqemu: Add and use qemuProcessEventFree for freeing qemuProcessEvents
Marc Hartmayer [Fri, 2 Feb 2018 12:13:46 +0000 (13:13 +0100)]
qemu: Add and use qemuProcessEventFree for freeing qemuProcessEvents

Add and use qemuProcessEventFree for freeing qemuProcessEvents. This
is less error-prone as the compiler can help us make sure that for
every new enumeration value of qemuProcessEventType the
qemuProcessEventFree function has to be adapted.

All process*Event functions are *only* called by
qemuProcessHandleEvent and this function does the freeing by itself
with qemuProcessEventFree. This means that an explicit freeing of
processEvent->data is no longer required in each process*Event
handler.

The effectiveness of this change is also demonstrated by the fact that
it fixes a memory leak of the panic info data in
qemuProcessHandleGuestPanic.

Reported-by: Wang Dong <dongdwdw@linux.vnet.ibm.com>
Signed-off-by: Bjoern Walk <bwalk@linux.vnet.ibm.com>
Signed-off-by: Marc Hartmayer <mhartmay@linux.vnet.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.vnet.ibm.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
7 years agoqemu: Use the return value of virObjectRef directly
Marc Hartmayer [Fri, 2 Feb 2018 12:13:45 +0000 (13:13 +0100)]
qemu: Use the return value of virObjectRef directly

Use the return value of virObjectRef directly. This way, it's easier
for another reader to identify the reason why the additional reference
is required.

Signed-off-by: Marc Hartmayer <mhartmay@linux.vnet.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.vnet.ibm.com>
Reviewed-by: Bjoern Walk <bwalk@linux.vnet.ibm.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
7 years agonetserver: Remove ServiceToggle during ServerDispose
John Ferlan [Thu, 21 Dec 2017 15:02:00 +0000 (10:02 -0500)]
netserver: Remove ServiceToggle during ServerDispose

No sense in calling ServiceToggle for all nservices during
ServiceDispose since ServerClose calls ServiceClose which
removes the IOCallback that's being toggled via ServiceToggle.

Signed-off-by: John Ferlan <jferlan@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
7 years agoqemu: Add dump completed event to the capabilities
John Ferlan [Fri, 17 Nov 2017 13:46:27 +0000 (08:46 -0500)]
qemu: Add dump completed event to the capabilities

Add the DUMP_COMPLETED check to the capabilities. This is the
mechanism used to determine whether the dump-guest-memory command
can support the "-detach" option and thus be able to wait on the
event and allow for a query of the progress of the dump.

Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
7 years agoqemu: Introduce qemuDomainGetJobInfoMigrationStats
John Ferlan [Mon, 20 Nov 2017 18:00:43 +0000 (13:00 -0500)]
qemu: Introduce qemuDomainGetJobInfoMigrationStats

Extract out the parts of qemuDomainGetJobStatsInternal that get
the migration stats. We're about to add the ability to get just
dump information.

Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
7 years agovbox: fix SEGV during dumpxml of a serial port
Laine Stump [Sun, 21 Jan 2018 02:11:05 +0000 (21:11 -0500)]
vbox: fix SEGV during dumpxml of a serial port

commit 77a12987a48 changed the "virDomainChrSourceDef source" inside
virDomainChrDef to "virDomainChrSourceDefPtr source", and started
allocating source inside virDomainChrDefNew(), but vboxDumpSerial()
was allocating a virDomainChrDef with a simple VIR_ALLOC() (i.e. never
calling virDomainChrDefNew()), so source was never initialized,
leading to a SEGV any time a serial port was present. The same problem
was created in vboxDumpParallel().

This patch changes vboxDumpSerial() and vboxDumpParallel() to use
virDomainChrDefNew() instead of VIR_ALLOC(), and changes both of those
functions to return an error if virDomainChrDef() (or any other
allocation) fails.

This resolves: https://bugzilla.redhat.com/1536649

7 years agonwfilter: Remove unnecessary UUID comparison bypass
John Ferlan [Sun, 16 Jul 2017 14:09:10 +0000 (10:09 -0400)]
nwfilter: Remove unnecessary UUID comparison bypass

Remove the unnecessary check as since commit id '46a811db07' it is
not possible to add or alter a filter using the same name, but with
a different UUID.

NB: It's not required to provide a UUID for a filter by name, but
if one is provided, then it must match the existing. If not provided,
then one is generated during ParseXML processing.

Reviewed-by: Laine Stump <laine@laine.org>
Reviewed-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
Signed-off-by: John Ferlan <jferlan@redhat.com>
7 years agoutil: Remove unnecessary initialization
John Ferlan [Fri, 12 Jan 2018 15:32:41 +0000 (10:32 -0500)]
util: Remove unnecessary initialization

VIR_ALLOC will already initialize, so no need to do it again.

7 years agoqemu: Use switch statement for address types in qemuBuildControllerDevStr
Marc Hartmayer [Thu, 4 Jan 2018 11:41:29 +0000 (12:41 +0100)]
qemu: Use switch statement for address types in qemuBuildControllerDevStr

Use a switch statement instead of if-else-if statements. Move the
command line building of the iothread attribute into the common path
as the SCSI controller attributes are already validated.

Signed-off-by: Marc Hartmayer <mhartmay@linux.vnet.ibm.com>
7 years agoqemu: Introduce qemuDomainDeviceDefValidateControllerSATA
John Ferlan [Wed, 29 Nov 2017 13:34:28 +0000 (08:34 -0500)]
qemu: Introduce qemuDomainDeviceDefValidateControllerSATA

Move the SATA controller check from command line building to
controller def validation. This includes copying the SATA
skip check found in qemuBuildSkipController.

7 years agoqemu: Complete PCI command checks to controller def validate
John Ferlan [Tue, 28 Nov 2017 21:00:52 +0000 (16:00 -0500)]
qemu: Complete PCI command checks to controller def validate

Move the qemuCaps checks over to qemuDomainControllerDefValidatePCI.

This requires two test updates in order to set the correct capability
bit for an xml2xml test as well as setting up the similar capability
for the pseries memlocktest.

7 years agoqemu: Move more PCI command checks to controller def validate
John Ferlan [Mon, 27 Nov 2017 21:24:04 +0000 (16:24 -0500)]
qemu: Move more PCI command checks to controller def validate

Excluding the qemuCaps checks, move the remainder of the checks
that validate whether the PCI definition is valid or not into
qemuDomainControllerDefValidatePCI.

7 years agoqemu: Move PCI command modelName TypeToString to controller def validate
John Ferlan [Mon, 27 Nov 2017 20:05:49 +0000 (15:05 -0500)]
qemu: Move PCI command modelName TypeToString to controller def validate

Similar to the checking the modelName vs. NAME_NONE, let's make the
ModelNameTypeToString check more generic too within the checking done
in controller validation (with the same ignore certain models.

NB: We need to keep the ModelNameTypeToString fetch in command line
validation since we use it, but at least we can assume it returns
something valid now.

7 years agoqemu: Move PCI command modelName check to controller def validate
John Ferlan [Mon, 27 Nov 2017 19:36:22 +0000 (14:36 -0500)]
qemu: Move PCI command modelName check to controller def validate

Move the various modelName == NAME_NONE from the command line
generation into domain controller validation.  Also rather than
have multiple cases with the same check, let's make the code
more generic, but also note that it was the modelName option
that caused the failure. We also have to be sure not to check
the PCI models that we don't care about.

For the remaining checks in command line building, we can use
the field name in the error message to be more specific about
what causes the failure.

7 years agoqemu: Use virDomainPCIControllerOpts in qemuBuildControllerDevStr
John Ferlan [Mon, 27 Nov 2017 19:45:54 +0000 (14:45 -0500)]
qemu: Use virDomainPCIControllerOpts in qemuBuildControllerDevStr

Shorten up a few characters and reference the pciopts pointer

7 years agoqemu: Add missing checks for pcie-root-port options
Andrea Bolognani [Wed, 6 Dec 2017 10:15:29 +0000 (11:15 +0100)]
qemu: Add missing checks for pcie-root-port options

We format the 'chassis' and 'port' properties on the QEMU command
line later on, so we should make sure they've been set.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
7 years agoqemu: Introduce qemuDomainDeviceDefValidateControllerPCI
John Ferlan [Mon, 27 Nov 2017 18:21:44 +0000 (13:21 -0500)]
qemu: Introduce qemuDomainDeviceDefValidateControllerPCI

Move PCI validation checks out of qemu_command into the proper
qemu_domain validation helper.

Since there's a lot to move, we'll start slow by replicating the
pcie-root and pci-root avoidance from qemuBuildSkipController and
the first switch found in qemuBuildControllerDevStr.

7 years agoqemu: Introduce qemuDomainDeviceDefValidateControllerSCSI
John Ferlan [Mon, 27 Nov 2017 16:16:17 +0000 (11:16 -0500)]
qemu: Introduce qemuDomainDeviceDefValidateControllerSCSI

Move SCSI validation from qemu_command into qemu_domain.

Rename/reorder the args in qemuCheckSCSIControllerIOThreads
to match the caller as well as fixing up the comments to
remove the previously removed qemuCaps arg.

7 years agoqemu: Add check for iothread attribute in validate controller
John Ferlan [Fri, 8 Dec 2017 19:03:54 +0000 (14:03 -0500)]
qemu: Add check for iothread attribute in validate controller

Let's make sure that non SCSI virtio-scsi isn't used for any type
other than a virtio-scsi controller.

7 years agoqemu: Adjust SCSI controller switch in qemuBuildControllerDevStr
John Ferlan [Fri, 8 Dec 2017 18:34:53 +0000 (13:34 -0500)]
qemu: Adjust SCSI controller switch in qemuBuildControllerDevStr

Modify the SCSI controller switch during command line building
to account for all virDomainControllerModelSCSI types rather
than using the default label.

7 years agoqemu: Move and rename qemuBuildCheckSCSIControllerModel
John Ferlan [Fri, 5 Jan 2018 23:16:36 +0000 (18:16 -0500)]
qemu: Move and rename qemuBuildCheckSCSIControllerModel

Move to qemu_domain during the validation of controller options and
rename qemuDomainCheckSCSIControllerModel.

7 years agoqemu: Introduce qemuDomainDeviceDefValidateControllerAttributes
John Ferlan [Fri, 8 Dec 2017 18:21:05 +0000 (13:21 -0500)]
qemu: Introduce qemuDomainDeviceDefValidateControllerAttributes

Move the checks that various attributes are not set on any controller
other than SCSI controller using virtio-scsi model into the common
controller validate checks.

7 years agotests: Add test for properly removing cachetune entries
Martin Kletzander [Thu, 1 Feb 2018 13:36:09 +0000 (14:36 +0100)]
tests: Add test for properly removing cachetune entries

Cachetune for unavailable vCPUs should be cleared the same way vcpupin and other
things do, so let's add tests for it.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
7 years agoutil: Clear unused part of the map in virBitmapShrink
Martin Kletzander [Thu, 1 Feb 2018 13:33:02 +0000 (14:33 +0100)]
util: Clear unused part of the map in virBitmapShrink

Some of the other functions depend on the fact that unused bits and longs are
always zero and it's less error-prone to clear it than fix the other functions.
It's enough to zero out one piece of the map since we're calling realloc() to
get rid of the rest (and updating map_len).

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

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
7 years agoutil: Fix possible leak in virResctrlAllocMasksAssign
Martin Kletzander [Thu, 1 Feb 2018 13:19:42 +0000 (14:19 +0100)]
util: Fix possible leak in virResctrlAllocMasksAssign

Found by coverity.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
7 years agorpc: fix non-NULL annotations when GNUTLS is disabled
Daniel P. Berrangé [Thu, 1 Feb 2018 15:34:39 +0000 (15:34 +0000)]
rpc: fix non-NULL annotations when GNUTLS is disabled

The position of various parameters changes depending on the WITH_GNUTLS
macro.

Reviewed-by: John Ferlan <jferlan@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
7 years agorpc: assume private data callbacks are always non-NULL
Daniel P. Berrangé [Thu, 1 Feb 2018 15:34:06 +0000 (15:34 +0000)]
rpc: assume private data callbacks are always non-NULL

Since we annotate the APIs are having non-NULL parameters, we can remove
the checks for NULL in the code too.

Reviewed-by: John Ferlan <jferlan@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
7 years agotests: validate private data / pre / post exec hooks for RPC APIs
Daniel P. Berrangé [Thu, 1 Feb 2018 15:32:49 +0000 (15:32 +0000)]
tests: validate private data / pre / post exec hooks for RPC APIs

Validate that the virNetServer(Client) RPC APIs are processing the
private data callbacks correctly by passing in non-NULL pointers.

Reviewed-by: John Ferlan <jferlan@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
7 years agoqemuDomainRemoveMemoryDevice: unlink() memory backing file
Michal Privoznik [Thu, 11 Jan 2018 12:02:52 +0000 (13:02 +0100)]
qemuDomainRemoveMemoryDevice: unlink() memory backing file

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

Since fec8f9c49af we try to use predictable file names for
'memory-backend-file' objects. But that made us provide full path
to qemu when hot plugging the object while previously we provided
merely a directory. But this makes qemu behave differently. If
qemu sees a path terminated with a directory it calls mkstemp()
and unlinks the file immediately. But if it sees full path it
just calls open(path, O_CREAT ..); and never unlinks the file.
Therefore it's up to libvirt to unlink the file and not leave it
behind.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
7 years agoqemu: migration: Refresh device information after transferring state
Peter Krempa [Thu, 1 Feb 2018 14:02:17 +0000 (15:02 +0100)]
qemu: migration: Refresh device information after transferring state

In my first approach in 4b480d10768c I overlooked the comment in
qemuMigrationRunIncoming stating that during actual migration the
qemuMigrationRunIncoming does not wait until the migration is complete
but rather offloads that to the Finish phase of migration.

This means that during actual migration qemuProcessRefreshState was
called prior to qemu actually transferring the full state and thus the
queries did not get the correct information. The approach worked only
for restore, where we wait for the migration to finish during qemu
startup.

Fix the issue by calling qemuProcessRefreshState both from
qemuProcessStart if there's no incomming migration and from
qemuMigrationFinish so that the code actually works as expected.

7 years agoqemu: Expose rx/tx_queue_size in qemu.conf too
Michal Privoznik [Fri, 19 Jan 2018 10:34:54 +0000 (11:34 +0100)]
qemu: Expose rx/tx_queue_size in qemu.conf too

In 2074ef6cd4a2 and c56cdf259 (and friends) we've added two
attributes to virtio NICs: rx_queue_size and tx_queue_size.
However, sysadmins might want to set these on per-host basis but
don't necessarily have an access to domain XML (e.g. because they
are generated by some other app). So let's expose them under
qemu.conf (the settings from domain XML still take precedence as
they are more specific ones).

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
7 years agoblockjob: Fix a error checking of blockjob status in some case
Jie Wang [Fri, 19 Jan 2018 14:03:05 +0000 (22:03 +0800)]
blockjob: Fix a error checking of blockjob status in some case

Commit id 'bc444666f' added a check if the returned data
buffer had an error, but failed to adjust the event from
VIR_DOMAIN_BLOCK_JOB_COMPLETED to VIR_DOMAIN_BLOCK_JOB_FAILED
in order to propagate an error such as "File descriptor in bad
state" that may be returned from QEMU when both @offset and
@len are set to 0 such as is the case when performing an async
block job read on a read only filesystem.

Signed-off-by: Jie Wang <wangjie88@huawei.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
7 years agonews: Add VIR_ERR_DEVICE_MISSING change as improvements
Chen Hanxiao [Tue, 23 Jan 2018 04:24:46 +0000 (12:24 +0800)]
news: Add VIR_ERR_DEVICE_MISSING change as improvements

Signed-off-by: Chen Hanxiao <chenhanxiao@gmail.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
7 years agoqemu: Use VIR_ERR_DEVICE_MISSING for various coldplug messages
Chen Hanxiao [Tue, 23 Jan 2018 04:24:45 +0000 (12:24 +0800)]
qemu: Use VIR_ERR_DEVICE_MISSING for various coldplug messages

Use the DEVICE_MISSING error code when helpers fail to find
the requested device. This makes it easier for consumers to
key off the error code rather than the error message.

Signed-off-by: Chen Hanxiao <chenhanxiao@gmail.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
7 years agoqemu: Use VIR_ERR_DEVICE_MISSING for various hotplug messages
Chen Hanxiao [Tue, 23 Jan 2018 04:24:44 +0000 (12:24 +0800)]
qemu: Use VIR_ERR_DEVICE_MISSING for various hotplug messages

Modify OPERATION_FAILED and INTERNAL_ERROR error codes to
use DEVICE_MISSING instead for failures associated with the
inability to find the device. This makes it easier for consumers
to key off the error code rather than the error message.

Signed-off-by: Chen Hanxiao <chenhanxiao@gmail.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
7 years agoqemu: Introduce VIR_ERR_DEVICE_MISSING
Chen Hanxiao [Tue, 23 Jan 2018 04:24:43 +0000 (12:24 +0800)]
qemu: Introduce VIR_ERR_DEVICE_MISSING

Add new error code to be able to allow consumers (such as Nova) to be
able to key of a specific error code rather than needing to search the
error message."

Signed-off-by: Chen Hanxiao <chenhanxiao@gmail.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
7 years agoqemu: Add some more details for hotplug errors when device not found
Chen Hanxiao [Tue, 23 Jan 2018 04:24:42 +0000 (12:24 +0800)]
qemu: Add some more details for hotplug errors when device not found

More proper/detail error messages updated.

Signed-off-by: Chen Hanxiao <chenhanxiao@gmail.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
7 years agoconf: Small indentation and coding style fixes
Andrea Bolognani [Thu, 1 Feb 2018 09:34:41 +0000 (10:34 +0100)]
conf: Small indentation and coding style fixes

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
7 years agoadmin: set XDR_CFLAGS when building admin server
Daniel P. Berrangé [Wed, 31 Jan 2018 19:05:32 +0000 (19:05 +0000)]
admin: set XDR_CFLAGS when building admin server

The XDR_CFLAGS variable is needed when the XDR headers are not
part of the stock glibc install

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
7 years agostorage: remove virConnectPtr from all backend functions
Daniel P. Berrangé [Fri, 26 Jan 2018 13:31:58 +0000 (13:31 +0000)]
storage: remove virConnectPtr from all backend functions

Now that we can open connections to the secondary drivers on demand,
there is no need to pass a virConnectPtr into all the backend
functions.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
7 years agostorage: open nodedev driver connection at time of use
Daniel P. Berrangé [Wed, 31 Jan 2018 16:31:57 +0000 (16:31 +0000)]
storage: open nodedev driver connection at time of use

Instead of passing around a virConnectPtr object, just open a connection
to the nodedev driver at time of use. Opening connections on demand will
be beneficial when the nodedev driver is in a separate daemon. It also
solves the problem that a number of callers just pass in a NULL
connection today which prevents nodedev lookup working at all.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
7 years agostorage: open secret driver connection at time of use
Daniel P. Berrangé [Fri, 26 Jan 2018 13:15:33 +0000 (13:15 +0000)]
storage: open secret driver connection at time of use

Instead of passing around a virConnectPtr object, just open a connection
to the secret driver at time of use. Opening connections on demand will
be beneficial when the secret driver is in a separate daemon. It also
solves the problem that a number of callers just pass in a NULL
connection today which prevents secret lookup working at all.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
7 years agodriver: add some helpers for opening secondary driver connections
Daniel P. Berrangé [Wed, 31 Jan 2018 18:21:52 +0000 (18:21 +0000)]
driver: add some helpers for opening secondary driver connections

Various parts of libvirt will want to open connections to secondary
drivers. The right URI to use will depend on the context, so rather than
duplicating that logic in various places, use some helper APIs. This
will also make it easier for us to later pre-open/cache connections to
avoid repeated opening & closing the same connectiong during autostart.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
7 years agosecret: allow opening with secret:///system and secret:///session URIs
Daniel P. Berrangé [Fri, 26 Jan 2018 11:16:00 +0000 (11:16 +0000)]
secret: allow opening with secret:///system and secret:///session URIs

Allow the possibility of opening a connection to only the secret
driver, by defining secret:///system and secret:///session URIs
and registering a fake hypervisor driver that supports them.

The hypervisor drivers can now directly open a secret driver
connection at time of need, instead of having to pass around a
virConnectPtr through many functions. This will facilitate the later
change to support separate daemons for each driver.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
7 years agonodedev: allow opening with nodedev:///system and nodedev:///session URIs
Daniel P. Berrangé [Fri, 26 Jan 2018 11:16:00 +0000 (11:16 +0000)]
nodedev: allow opening with nodedev:///system and nodedev:///session URIs

Allow the possibility of opening a connection to only the nodedev
driver, by defining nodedev:///system and nodedev:///session URIs
and registering a fake hypervisor driver that supports them.

The hypervisor drivers can now directly open a nodedev driver
connection at time of need, instead of having to pass around a
virConnectPtr through many functions. This will facilitate the later
change to support separate daemons for each driver.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
7 years agointerface: allow opening with interface:///system and interface:///session URIs
Daniel P. Berrangé [Fri, 26 Jan 2018 11:16:00 +0000 (11:16 +0000)]
interface: allow opening with interface:///system and interface:///session URIs

Allow the possibility of opening a connection to only the interface
driver, by defining interface:///system and interface:///session URIs
and registering a fake hypervisor driver that supports them.

The hypervisor drivers can now directly open a interface driver
connection at time of need, instead of having to pass around a
virConnectPtr through many functions. This will facilitate the later
change to support separate daemons for each driver.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
7 years agonwfilter: allow opening with nwfilter:///system URI
Daniel P. Berrangé [Fri, 26 Jan 2018 11:16:00 +0000 (11:16 +0000)]
nwfilter: allow opening with nwfilter:///system URI

Allow the possibility of opening a connection to only the storage
driver, by defining a nwfilter:///system URI and registering a fake
hypervisor driver that supports it.

The hypervisor drivers can now directly open a nwfilter driver
connection at time of need, instead of having to pass around a
virConnectPtr through many functions. This will facilitate the later
change to support separate daemons for each driver.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
7 years agonetwork: allow opening with network:///system and network:///session URIs
Daniel P. Berrangé [Fri, 26 Jan 2018 11:16:00 +0000 (11:16 +0000)]
network: allow opening with network:///system and network:///session URIs

Allow the possibility of opening a connection to only the network
driver, by defining network:///system and network:///session URIs
and registering a fake hypervisor driver that supports them.

The hypervisor drivers can now directly open a network driver
connection at time of need, instead of having to pass around a
virConnectPtr through many functions. This will facilitate the later
change to support separate daemons for each driver.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
7 years agonetwork: move driver registration back to end of the file
Daniel P. Berrangé [Fri, 26 Jan 2018 11:21:09 +0000 (11:21 +0000)]
network: move driver registration back to end of the file

By convention the last thing in the driver.c files should be the driver
callback table and function to register it.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
7 years agostorage: allow opening with storage:///system and storage:///session URIs
Daniel P. Berrangé [Fri, 26 Jan 2018 11:16:00 +0000 (11:16 +0000)]
storage: allow opening with storage:///system and storage:///session URIs

Allow the possibility of opening a connection to only the storage
driver, by defining storage:///system and storage:///session URIs
and registering a fake hypervisor driver that supports them.

The hypervisor drivers can now directly open a storage driver
connection at time of need, instead of having to pass around a
virConnectPtr through many functions. This will facilitate the later
change to support separate daemons for each driver.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
7 years agostorage: move driver registration back to end of the file
Daniel P. Berrangé [Fri, 26 Jan 2018 11:21:09 +0000 (11:21 +0000)]
storage: move driver registration back to end of the file

By convention the last thing in the driver.c files should be the driver
callback table and function to register it.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
7 years agoutil: use union for sockaddr structs to avoid aliasing
Daniel P. Berrange [Wed, 31 Jan 2018 17:27:11 +0000 (17:27 +0000)]
util: use union for sockaddr structs to avoid aliasing

Some platforms/toolchains will complain about casting
sockaddr_storage to sockaddr_un because it breaks strict
aliasing rule

../../src/util/virutil.c: In function 'virGetUNIXSocketPath':
../../src/util/virutil.c:2005: error: dereferencing pointer 'un' does break strict-aliasing rules [-Wstrict-aliasing]

Change the code to use a union, in the same way that the
virsocketaddr.h header does.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
7 years agotools: unlink bash completion files before symlinking
Daniel P. Berrangé [Wed, 31 Jan 2018 17:30:55 +0000 (17:30 +0000)]
tools: unlink bash completion files before symlinking

"ln" will not replace an existing symlink, so if you run 'make install'
twice, the second time will get an error:

  ln: failed to create symbolic link 'virsh': File exists

We must always remove the symlink target first.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
7 years agoFixed virGetUNIXSocketPath stub on Win32
Daniel P. Berrangé [Wed, 31 Jan 2018 17:10:04 +0000 (17:10 +0000)]
Fixed virGetUNIXSocketPath stub on Win32

The _() macro was not terminated and an argument needs to be marked as
unused.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
7 years agoqemu: Update qemuDomainFindSCSIControllerModel return
John Ferlan [Tue, 30 Jan 2018 22:11:54 +0000 (17:11 -0500)]
qemu: Update qemuDomainFindSCSIControllerModel return

Now that the controller model is updated during post parse callback,
this code no longer needs to fetch the model based on the capabilities
and can just return the model directly if the controller is found.

Removal of @qemuCaps cascades through various callers which are now
updated to not pass the capabilities.

7 years agoqemu: Reduce need to call qemuDomainGetSCSIControllerModel
John Ferlan [Tue, 30 Jan 2018 21:12:31 +0000 (16:12 -0500)]
qemu: Reduce need to call qemuDomainGetSCSIControllerModel

Now that post parse processing handles setting the SCSI controller
model, there's no need to call qemuDomainGetSCSIControllerModel to
get the "default controller" when building the command line controller
string or when assigning the spaprvio address since the controller
model value will already be filled in.

7 years agoconf: Allow configuration of implicit controller model
John Ferlan [Tue, 30 Jan 2018 21:09:30 +0000 (16:09 -0500)]
conf: Allow configuration of implicit controller model

When an implicit controller is added, the model is defined as -1
(IOW: undefined). So, if an implicit SCSI controller was added,
can set the model to the default value if the underlying hypervisor
supports it.

7 years agoqemu: Introduce qemuDomainSetSCSIControllerModel
John Ferlan [Tue, 30 Jan 2018 19:19:47 +0000 (14:19 -0500)]
qemu: Introduce qemuDomainSetSCSIControllerModel

During post parse processing, let's force setting the controller
model to default value if not already set for defined controllers
(e.g. the non implicit ones).

7 years agoqemu: Fetch/save the default SCSI controller model during hotplug
John Ferlan [Tue, 30 Jan 2018 22:29:48 +0000 (17:29 -0500)]
qemu: Fetch/save the default SCSI controller model during hotplug

If we're going to add a controller to the domain, let's set the
default SCSI model value if we cannot find another SCSI controller
already present.

NB: Requires updating the live output test data since the model
will now be formatted.

7 years agoqemu: Introduce qemuDomainGetSCSIControllerModel
John Ferlan [Tue, 30 Jan 2018 17:06:36 +0000 (12:06 -0500)]
qemu: Introduce qemuDomainGetSCSIControllerModel

Rename and rework qemuDomainSetSCSIControllerModel since we're
really not setting the SCSI controller model. Instead the code
is either returning the existing SCSI controller model value, the
default value based on the capabilities, or -1 with the error set.

7 years agoqemu: Introduce qemuDomainFindSCSIControllerModel
John Ferlan [Tue, 30 Jan 2018 15:45:43 +0000 (10:45 -0500)]
qemu: Introduce qemuDomainFindSCSIControllerModel

Rather than repeat multiple steps in order to find the SCSI
controller model, let's combine them into one helper that will
return either the model from the definition or the default
model based on the capabilities.

This patch adds an extra check/error that the controller
that's being found actually exists. This just clarifies that
the error was because the controller doesn't exist rather
than the more generic error that we were unable to determine
the model from qemuDomainSetSCSIControllerModel when a -1
was passed in and the capabilities were unable to find one.

7 years agoconf: Rework and rename virDomainDeviceFindControllerModel
John Ferlan [Tue, 30 Jan 2018 15:04:03 +0000 (10:04 -0500)]
conf: Rework and rename virDomainDeviceFindControllerModel

As it turns out virDomainDeviceFindControllerModel was only ever
called for SCSI controllers using VIR_DOMAIN_CONTROLLER_TYPE_SCSI
as a parameter.

So rename to virDomainDeviceFindSCSIController and rather than
return a model, let's return a virDomainControllerDefPtr to let
the caller reference whatever it wants.

7 years agoqemu: Split qemuDomainSetSCSIControllerModel
John Ferlan [Fri, 5 Jan 2018 22:32:28 +0000 (17:32 -0500)]
qemu: Split qemuDomainSetSCSIControllerModel

Rather than one function serving two purposes, let's split out the
else condition which is checking whether the model can be used
during command line building based on the capabilities.

Signed-off-by: John Ferlan <jferlan@redhat.com>
7 years agovirUSBDeviceNew: Construct vroot path properly
Michal Privoznik [Wed, 24 Jan 2018 09:26:07 +0000 (10:26 +0100)]
virUSBDeviceNew: Construct vroot path properly

When starting an LXC container, the /dev entries are created
under temp root (/var/run/libvirt/lxc/$name.dev), relabelled and
then the root is pivoted. However, when it comes to USB devices
which keep path to the device in the structure we need a way to
override the default /dev/usb/... path because we want to work
with the one under temp root. That's what @vroot argument is for
in virUSBDeviceNew. However, what is being passed there is:

  vroot = /var/run/libvirt/lxc/lxc_0.dev/bus/usb

Therefore, constructed path is wrong:

  dev->path = //var/run/libvirt/lxc/lxc_0.dev/bus/usb//dev/bus/usb/002/002

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
7 years agoCheck for tabs in augeas files
Daniel P. Berrangé [Wed, 31 Jan 2018 14:53:03 +0000 (14:53 +0000)]
Check for tabs in augeas files

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
7 years agolockd: add support for admin protocol in virtlockd
Daniel P. Berrange [Fri, 19 Jan 2018 14:54:00 +0000 (14:54 +0000)]
lockd: add support for admin protocol in virtlockd

Add a virtlockd-admin-sock can serves the admin protocol for the virtlockd
daemon and define a virtlockd:///{system,session}  URI scheme for
connecting to it.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
7 years agologd: add support for admin protocol in virtlogd
Daniel P. Berrange [Fri, 19 Jan 2018 14:54:00 +0000 (14:54 +0000)]
logd: add support for admin protocol in virtlogd

Add a virtlogd-admin-sock can serves the admin protocol for the virtlogd
daemon and define a virtlogd:///{system,session}  URI scheme for
connecting to it.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
7 years agorpc: refactor virNetServer setup for post-exec restarts
Daniel P. Berrange [Mon, 22 Jan 2018 17:38:55 +0000 (17:38 +0000)]
rpc: refactor virNetServer setup for post-exec restarts

With the current code it is neccessary to call

  virNetDaemonNewPostExecRestart()

and then for each server that needs restarting you are supposed
to call

  virNetDaemonAddSeverPostExecRestart()

This is fine if there's only ever one server, but as soon as you
have two servers it is impossible to use this design. The code
has no idea which servers were recorded in the JSON state doc,
nor in which order the hash table serialized its keys.

So this patch changes things so that we only call

  virNetDaemonNewPostExecRestart()

passing in a callback, which is invoked once for each server
found int he JSON state doc.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
7 years agorpc: add method for checking if a named server exists
Daniel P. Berrange [Mon, 22 Jan 2018 17:42:08 +0000 (17:42 +0000)]
rpc: add method for checking if a named server exists

It is not possible to blindly call virNetDaemonGetServer()
because in a post-exec restart scenario, some servers may
not exist and this method will pollute the error logs.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
7 years agorpc: annotate various parameters as being required to be non-NULL
Daniel P. Berrange [Tue, 23 Jan 2018 13:02:06 +0000 (13:02 +0000)]
rpc: annotate various parameters as being required to be non-NULL

The server name and client data callbacks need to be non-NULL or the
system will crash at various times. This is particularly bad when some
of the crashes only occur post-exec restart.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
7 years agorpc: pass virNetServer to post-exec restart callback in typesafe manner
Daniel P. Berrange [Fri, 19 Jan 2018 17:41:13 +0000 (17:41 +0000)]
rpc: pass virNetServer to post-exec restart callback in typesafe manner

The virNetServer class is passing a pointer to itself to the
virNetServerClient as a 'void *' pointer. This is presumably due to fact
that the virnetserverclient.h file doesn't see the virNetServerPtr
typedef. The typedef is easily movable though, which lets us get
typesafe parameter passing, removing the confusion of passing two
distinct 'void *' pointers to one method.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
7 years agorpc: clarify "void *" values passed to client callbacks
Daniel P. Berrange [Fri, 19 Jan 2018 17:24:03 +0000 (17:24 +0000)]
rpc: clarify "void *" values passed to client callbacks

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
7 years agoutil: add virGetUNIXSocketPath helper
Daniel P. Berrange [Fri, 19 Jan 2018 13:48:10 +0000 (13:48 +0000)]
util: add virGetUNIXSocketPath helper

When receiving multiple socket FDs from systemd, it is critical to know
what socket address each corresponds to so we can setup the right
protocols on each.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
7 years agoadmin: add support for post-exec restart callbacks
Daniel P. Berrange [Tue, 23 Jan 2018 13:20:19 +0000 (13:20 +0000)]
admin: add support for post-exec restart callbacks

We don't have any per-client private data we need to persist, but the
RPC infrastructure requires that we provide the callbacks and serialize
an empty JSON object. This makes us future proof going forwards.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
7 years agolibvirtd: rename virNetServerClient callback impls to match type names
Daniel P. Berrange [Mon, 22 Jan 2018 18:29:55 +0000 (18:29 +0000)]
libvirtd: rename virNetServerClient callback impls to match type names

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
7 years agoadmin: move admins server impl/dispatch into src/admin directory
Daniel P. Berrange [Fri, 19 Jan 2018 11:30:31 +0000 (11:30 +0000)]
admin: move admins server impl/dispatch into src/admin directory

The admin server functionality is a generic concept that should be wired
up into all libvirt daemons, but is currently integrated with the
libvirtd code. Move it all into the src/admin directory to prepare for
broader reuse.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
7 years agotools: Make symlinks to vsh bash-completion script
Michal Privoznik [Wed, 24 Jan 2018 15:42:00 +0000 (16:42 +0100)]
tools: Make symlinks to vsh bash-completion script

The bash-completion project documents that only those scripts
from $BASH_COMPLETIONS_DIR that share name with the current
command for which <TAB> was hit are loaded [1]. This means, that
vsh script we have there is not loaded. We have to create
symlinks for virsh and virt-admin.

At the same time, we have to create new RPM package because
virt-admin and client packages are independent. That means we
cannot place the vsh script in either of them. What we can do is
to have a different package that contains the completion script
and then virt-admin and client packages contain only the symlink
and require the bash-completion package.

1: https://github.com/scop/bash-completion#faq

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
7 years agovirsh: Offer only persistent domains for autostart
Michal Privoznik [Thu, 25 Jan 2018 13:50:32 +0000 (14:50 +0100)]
virsh: Offer only persistent domains for autostart

The 'autostart' command accepts only persistent domains. Make the
completer return only those.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
7 years agovirshDomainNameCompleter: Prune accepted flags
Michal Privoznik [Thu, 25 Jan 2018 13:47:56 +0000 (14:47 +0100)]
virshDomainNameCompleter: Prune accepted flags

Only a small subset of VIR_CONNECT_LIST_DOMAINS_* flags are
actually used for this completer. Remove the unused ones. Note
that this is unrelated to other commands using
VIR_CONNECT_LIST_DOMAINS_* (i.e. cmdList) as this commit targets
the completer only and nothing else.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
7 years agoqemu: Restore resctrl alloc data after restart
Martin Kletzander [Tue, 30 Jan 2018 22:57:52 +0000 (23:57 +0100)]
qemu: Restore resctrl alloc data after restart

During reconnect we need to reconstruct the paths of all cachetunes so that they
get cleaned up when the domain is stopped.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
7 years agoutil: Extract path formatting into virResctrlAllocDeterminePath
Martin Kletzander [Tue, 30 Jan 2018 22:57:42 +0000 (23:57 +0100)]
util: Extract path formatting into virResctrlAllocDeterminePath

We can use this from more places later, so just a future code de-duplication.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
7 years agoqemu: Restore machinename even without cgroups
Martin Kletzander [Tue, 30 Jan 2018 22:57:24 +0000 (23:57 +0100)]
qemu: Restore machinename even without cgroups

The virresctrl will use this as well and we need to have that info after restart
to properly clean up /sys/fs/resctrl.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
7 years agoutil: Don't overwrite mask in virResctrlAllocFindUnused
Martin Kletzander [Tue, 30 Jan 2018 14:06:53 +0000 (15:06 +0100)]
util: Don't overwrite mask in virResctrlAllocFindUnused

Due to confusing naming the pointer to the mask got copied which must not
happen, so use UpdateMask instead of SetMask.  That also means we can get
completely rid of SetMask.

Also don't clear the free bits since it is not used again (leftover from
previous versions).

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
7 years agoutil: Use default group's mask for unspecified resctrl allocations
Martin Kletzander [Fri, 26 Jan 2018 17:14:49 +0000 (18:14 +0100)]
util: Use default group's mask for unspecified resctrl allocations

Introduce virResctrlAllocCopyMasks() and use that to initially copy the default
group schemata to the allocation before reserving any parts of the cache.  The
reason for this is that when new group is created the schemata will have unknown
data in it.  If there was previously group with the same CLoS ID, it will have
the previous valies, if not it will have all bits set.  And we need to set all
unspecified (in the XML) allocations to the same one as the default group.

Some non-Linux functions now need to be made public due to this change.

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

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
7 years agoutil: Add helpers for getting resctrl group allocs
Martin Kletzander [Thu, 25 Jan 2018 16:03:43 +0000 (17:03 +0100)]
util: Add helpers for getting resctrl group allocs

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
7 years agoutil: storage: Parse 'lun' for iSCSI protocol from JSON as string or number
Peter Krempa [Wed, 31 Jan 2018 11:00:42 +0000 (12:00 +0100)]
util: storage: Parse 'lun' for iSCSI protocol from JSON as string or number

While the QEMU QAPI schema describes 'lun' as a number, the code dealing
with JSON strings does not strictly adhere to this schema and thus
formats the number back as a string. Use the new helper to retrieve both
possibilities.

Note that the formatting code is okay and qemu will accept it as an int.

Tweak also one of the test strings to verify that both formats work
with libvirt.

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

7 years agoutil: json: Add helper to return string or number properties as string
Peter Krempa [Wed, 31 Jan 2018 10:54:31 +0000 (11:54 +0100)]
util: json: Add helper to return string or number properties as string

The helper is useful in cases when the JSON we have to parse may contain
one of the two due to historical reasons and the number value itself
would be stored as a string.

7 years agoconf: Use correct attribute name in error message
Andrea Bolognani [Tue, 30 Jan 2018 14:11:10 +0000 (15:11 +0100)]
conf: Use correct attribute name in error message

The <capabilities> feature has an attribute named 'policy', but the
error message mentioned the non-existing 'state' attribute instead.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
7 years agostorage: util: Properly ignore errors when backing volume is inaccessible
Peter Krempa [Tue, 30 Jan 2018 10:41:59 +0000 (11:41 +0100)]
storage: util: Properly ignore errors when backing volume is inaccessible

Commit 000e9504559 tried to fix improper bracketing when refreshing disk
volume stats for a backing volume. Unfortunately the condition is still
wrong as in cases as the backing store being inaccessible
storageBackendUpdateVolTargetInfo returns -2 if instructed to ignore
errors. The condition does not take this into account.

Dumping XML of a volume which has inacessible backing store would then
result into:

 # virsh vol-dumpxml http.img --pool default
 error: An error occurred, but the cause is unknown

Properly ignore -2 for backing volumes.

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

7 years agoutil: Don't check if entries under /sys/fs/resctrl/(info/) are directories
Martin Kletzander [Mon, 29 Jan 2018 13:46:45 +0000 (14:46 +0100)]
util: Don't check if entries under /sys/fs/resctrl/(info/) are directories

We are skipping non-directories under /sys/fs/resctrl/(info/) since those are not
interesting for us.  However in tests it can sometimes happen that ent->d_type
is 0 instead of 4 (DT_DIR) for directories.

I've seen it fail on two machines.  Different machines, different systems, I
cannot reproduce it even using the same setup.  So one of the ways how to work
around this is call stat() on it.  The other one is not checking if it is a
directory since we'll find out eventually when we want to read some files
underneath it.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
7 years agoutil: Remove unused variable in virResctrlGetInfo
Martin Kletzander [Mon, 29 Jan 2018 13:46:12 +0000 (14:46 +0100)]
util: Remove unused variable in virResctrlGetInfo

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
7 years agoutil: Make it possible for virResctrlAllocSetMask to replace existing mask
Martin Kletzander [Fri, 26 Jan 2018 13:47:19 +0000 (14:47 +0100)]
util: Make it possible for virResctrlAllocSetMask to replace existing mask

This wil be used in the future, but it makes sense for now as well.  It makes
sure there is no mask leftover that would leak.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>