[libvirt] [PATCH] util: fix build on non-Linux

2017-03-22 Thread Roman Bogorodskiy
Decorate unused arguments of the virNetDevGetMaster() stub with ATTRIBUTE_UNUSED to fix build on systems where this stub is used. --- Pushed as a build-breaker. src/util/virnetdev.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/util/virnetdev.c b/src/util/virnetdev.c

Re: [libvirt] [PATCH v3 7/7] qemu: Set up the migration TLS objects for source

2017-03-22 Thread John Ferlan
On 03/22/2017 12:26 PM, Jiri Denemark wrote: > On Fri, Mar 17, 2017 at 14:39:01 -0400, John Ferlan wrote: >> https://bugzilla.redhat.com/show_bug.cgi?id=1300769 >> >> If the migration flags indicate this migration will be using TLS, >> then while we have connection in the Begin phase check and

Re: [libvirt] [PATCH v3 6/7] qemu: Set up the migrate TLS objects for target

2017-03-22 Thread John Ferlan
On 03/22/2017 12:26 PM, Jiri Denemark wrote: > On Fri, Mar 17, 2017 at 14:39:00 -0400, John Ferlan wrote: >> If the migration flags indicate this migration will be using TLS, >> then set up the destination during the prepare phase once the target >> domain has been started to add the TLS objects

Re: [libvirt] [PATCH 06/23] qemu: monitor: Add support for BLOCK_WRITE_THRESHOLD event

2017-03-22 Thread Eric Blake
On 03/22/2017 08:08 PM, Eric Blake wrote: > On 03/15/2017 11:37 AM, Peter Krempa wrote: >> The event is fired when a given block backend node (identified by the >> node name) experiences a write beyond the bound set via >> block-set-write-threshold QMP command. This wires up the monitor code to >>

Re: [libvirt] [PATCH 09/23] qemu: process: Wire up firing of the VIR_DOMAIN_EVENT_ID_BLOCK_THRESHOLD event

2017-03-22 Thread Eric Blake
On 03/15/2017 11:37 AM, Peter Krempa wrote: > Bind it to qemus BLOCK_WRITE_THRESHOLD event. Look up the disk by s/qemus/qemu's/ > nodename and construct the string to return. > --- > src/qemu/qemu_process.c | 40 > 1 file changed, 40 insertions(+) > >

Re: [libvirt] [PATCH 08/23] qemu: domain: Add helper to generate indexed backing store names

2017-03-22 Thread Eric Blake
On 03/15/2017 11:37 AM, Peter Krempa wrote: > The code is currently simple, but if we later add node names, it will be > necessary to generate the names based on the node name. Add a helper so > that there's a central point to fix once we add self-generated node > names. We'll get there soon

Re: [libvirt] [PATCH 07/23] qemu: domain: Add helper to lookup disk by node name

2017-03-22 Thread Eric Blake
On 03/15/2017 11:37 AM, Peter Krempa wrote: > Looks up a disk and it's corresponding backing chain element by node s/it's/its/ (remember, "it's" is only appropriate if "it is" or "it has" can be used in its place) > name. > --- > src/qemu/qemu_domain.c | 43

Re: [libvirt] [PATCH 06/23] qemu: monitor: Add support for BLOCK_WRITE_THRESHOLD event

2017-03-22 Thread Eric Blake
On 03/15/2017 11:37 AM, Peter Krempa wrote: > The event is fired when a given block backend node (identified by the > node name) experiences a write beyond the bound set via > block-set-write-threshold QMP command. This wires up the monitor code to > extract the data and allow us receiving the

Re: [libvirt] [PATCH 05/23] lib: Introduce event for tracking disk backing file write threshold

2017-03-22 Thread Eric Blake
On 03/15/2017 11:37 AM, Peter Krempa wrote: > When using thin provisioning, management tools need to resize the disk > in certain cases. To avoid having them to poll disk usage introduce an > event which will be fired when a given offset of the storage is written > by the hypervisor. Together with

Re: [libvirt] [PATCH 04/23] util: storage: Add variables for node names into virStorageSource

2017-03-22 Thread Eric Blake
On 03/15/2017 11:37 AM, Peter Krempa wrote: > 'nodeformat' should be used for strings which describe the storage > format object, and 'nodebacking' for the actual storage object itself. > --- > src/libvirt_private.syms | 1 + > src/util/virstoragefile.c | 40

Re: [libvirt] [PATCH v3 4/7] qemu: Add TLS params to _qemuMonitorMigrationParams

2017-03-22 Thread John Ferlan
On 03/22/2017 12:26 PM, Jiri Denemark wrote: > On Fri, Mar 17, 2017 at 14:38:58 -0400, John Ferlan wrote: >> Add the fields to support setting tls-creds and tls-hostname during >> a migration (either source or target). Modify the query migration >> function to check for the presence and set the

Re: [libvirt] [PATCH 03/23] util: storage: Split out useful bits of virStorageFileParseChainIndex

2017-03-22 Thread Eric Blake
On 03/15/2017 11:37 AM, Peter Krempa wrote: > The function has very specific semantics. Split out the part that parses > the backing store specification string into a separate helper so that it > can be reused later while keeping the wrapper with existing semantics. > > Note that

Re: [libvirt] [PATCH 02/23] util: buffer: Add API to set indentation level to a given value

2017-03-22 Thread Eric Blake
On 03/15/2017 11:37 AM, Peter Krempa wrote: > It will be useful to set indentation level to 0 after formatting a > nested structure rather than having to track the depth. > --- > src/libvirt_private.syms | 1 + > src/util/virbuffer.c | 19 +++ > src/util/virbuffer.h | 2

Re: [libvirt] [PATCH 01/23] qemu: driver: Don't call qemuDomainDetermineDiskChain on block jobs

2017-03-22 Thread Eric Blake
On 03/15/2017 11:37 AM, Peter Krempa wrote: > Our code calls it when starting or re-starting the domain or when > hotplugging the disk so there's nothing to be detected. > --- > src/qemu/qemu_driver.c | 5 - > 1 file changed, 5 deletions(-) > I think I added it here because block jobs have

Re: [libvirt] [PATCH v3 2/7] conf: Introduce migrate_tls_x509_cert_dir

2017-03-22 Thread John Ferlan
On 03/22/2017 12:26 PM, Jiri Denemark wrote: > On Fri, Mar 17, 2017 at 14:38:56 -0400, John Ferlan wrote: >> Add a new TLS X.509 certificate type - "migrate". This will handle the >> creation of a TLS certificate capability (and possibly repository) to >> be used for migrations. Similar to

Re: [libvirt] [PATCH v3 7/7] qemu: Set up the migration TLS objects for source

2017-03-22 Thread Jiri Denemark
On Fri, Mar 17, 2017 at 14:39:01 -0400, John Ferlan wrote: > https://bugzilla.redhat.com/show_bug.cgi?id=1300769 > > If the migration flags indicate this migration will be using TLS, > then while we have connection in the Begin phase check and setup the > TLS environment that will be used by

Re: [libvirt] [PATCH v3 8/7] docs: Add news entry for Migration using TLS

2017-03-22 Thread Jiri Denemark
On Sat, Mar 18, 2017 at 09:47:04 -0400, John Ferlan wrote: > Signed-off-by: John Ferlan > --- > docs/news.xml | 10 ++ > 1 file changed, 10 insertions(+) > > diff --git a/docs/news.xml b/docs/news.xml > index 3501f89..25d920c 100644 > --- a/docs/news.xml > +++

Re: [libvirt] [PATCH v3 6/7] qemu: Set up the migrate TLS objects for target

2017-03-22 Thread Jiri Denemark
On Fri, Mar 17, 2017 at 14:39:00 -0400, John Ferlan wrote: > If the migration flags indicate this migration will be using TLS, > then set up the destination during the prepare phase once the target > domain has been started to add the TLS objects to perform the migration. > > This will create at

Re: [libvirt] [PATCH v3 3/7] Add new migration flag VIR_MIGRATE_TLS

2017-03-22 Thread Jiri Denemark
On Fri, Mar 17, 2017 at 14:38:57 -0400, John Ferlan wrote: > Signed-off-by: John Ferlan > --- > include/libvirt/libvirt-domain.h | 8 > src/qemu/qemu_migration.h| 3 ++- > tools/virsh-domain.c | 7 +++ > 3 files changed, 17 insertions(+), 1

Re: [libvirt] [PATCH v3 2/7] conf: Introduce migrate_tls_x509_cert_dir

2017-03-22 Thread Jiri Denemark
On Fri, Mar 17, 2017 at 14:38:56 -0400, John Ferlan wrote: > Add a new TLS X.509 certificate type - "migrate". This will handle the > creation of a TLS certificate capability (and possibly repository) to > be used for migrations. Similar to chardev's, credentials will be handled > via a libvirt

Re: [libvirt] [PATCH v3 4/7] qemu: Add TLS params to _qemuMonitorMigrationParams

2017-03-22 Thread Jiri Denemark
On Fri, Mar 17, 2017 at 14:38:58 -0400, John Ferlan wrote: > Add the fields to support setting tls-creds and tls-hostname during > a migration (either source or target). Modify the query migration > function to check for the presence and set the field for future > consumers to determine which of 3

Re: [libvirt] [PATCH v3 5/7] qemu: Add job for qemuDomain{Add|Del}TLSObjects

2017-03-22 Thread Jiri Denemark
On Fri, Mar 17, 2017 at 14:38:59 -0400, John Ferlan wrote: > Add an asyncJob argument for add/delete TLS Objects. A future patch will > add/delete TLS objects from a migration which may hae a job to join. s/hae/have/ I guess. > > Signed-off-by: John Ferlan > --- >

Re: [libvirt] [PATCH v3 1/7] qemu: Create #define for TLS configuration setup.

2017-03-22 Thread Jiri Denemark
On Fri, Mar 17, 2017 at 14:38:55 -0400, John Ferlan wrote: > Create GET_CONFIG_TLS_CERT to set up the TLS for 'chardev' TLS setting. > Soon to be reused. > > Signed-off-by: John Ferlan > --- > src/qemu/qemu_conf.c | 39 +-- > 1 file

Re: [libvirt] [PATCH 1/1] qemu: snapshot: Forbid internal snapshots with OVMF firmware

2017-03-22 Thread Laszlo Ersek
On 03/22/17 16:38, Laszlo Ersek wrote: > On 03/22/17 16:28, Peter Krempa wrote: >> QEMU does not snapshot the pflash drive when doing a 'savevm' thus >> internal snapshots with OVMF would be incomplete. > > Can you please explain it in a bit more detail: > > - the above statement is true as long

Re: [libvirt] [PATCH 1/1] qemu: snapshot: Forbid internal snapshots with OVMF firmware

2017-03-22 Thread Laszlo Ersek
On 03/22/17 16:28, Peter Krempa wrote: > QEMU does not snapshot the pflash drive when doing a 'savevm' thus > internal snapshots with OVMF would be incomplete. Can you please explain it in a bit more detail: - the above statement is true as long as we use "raw" for the varstore. - it would not

Re: [libvirt] [PATCH 0/3] allow fixing tap-bridge connections when network is restarted

2017-03-22 Thread Michal Privoznik
On 03/21/2017 04:03 PM, Laine Stump wrote: It's been a long-standing problem that when you stop and restart a libvirt network, the guest tap devices are no longer connected to the network. Until now the only way to recover from this was to either shutdown and restart all the affected guests, or

[libvirt] [PATCH v4 14/14] docs: Document the new hostdev and address type 'mdev'

2017-03-22 Thread Erik Skultety
Signed-off-by: Erik Skultety --- docs/formatdomain.html.in | 46 -- 1 file changed, 40 insertions(+), 6 deletions(-) diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index 4a3123e989..1eb6c44b6f 100644 ---

[libvirt] [PATCH v4 01/14] conf: hostdev: Enforce enum-in-switch compile-time checks

2017-03-22 Thread Erik Skultety
Enforce virDomainHostdevSubsysType checking during compilation. Again, one of a few spots in our code where we should enforce the typecast to the enum type, thus not forgetting to update *all* switch occurrences dealing with the give enum. Signed-off-by: Erik Skultety ---

[libvirt] [PATCH v4 04/14] util: Introduce new module virmdev

2017-03-22 Thread Erik Skultety
Beside creation, disposal, getter, and setter methods the module exports methods to work with lists of mediated devices. Signed-off-by: Erik Skultety --- po/POTFILES.in | 1 + src/Makefile.am | 1 + src/libvirt_private.syms | 22 +++

[libvirt] [PATCH v4 12/14] qemu: Format mdevs on qemu command line

2017-03-22 Thread Erik Skultety
Format the mediated devices on the qemu command line as -device vfio-pci,sysfsdev='/path/to/device/in/syfs'. Signed-off-by: Erik Skultety --- src/qemu/qemu_command.c | 45 + src/qemu/qemu_command.h | 5 + 2 files changed, 50

[libvirt] [PATCH 1/1] qemu: snapshot: Forbid internal snapshots with OVMF firmware

2017-03-22 Thread Peter Krempa
QEMU does not snapshot the pflash drive when doing a 'savevm' thus internal snapshots with OVMF would be incomplete. Forbid such snapshot so that we can avoid problems. --- CC: ler...@redhat.com There might be slight regression potential. While this did not work as expected I did not encounter

[libvirt] [PATCH v4 03/14] conf: Introduce virDomainHostdevDefPostParse

2017-03-22 Thread Erik Skultety
Just to make the code a bit cleaner, move hostdev specific post parse code to its own function just in case it grows in the future. Signed-off-by: Erik Skultety --- src/conf/domain_conf.c | 75 +++--- 1 file changed, 47

[libvirt] [PATCH v4 11/14] qemu: Bump the memory locking limit for mdevs as well

2017-03-22 Thread Erik Skultety
Since mdevs are just another type of VFIO devices, we should increase the memory locking limit the same way we do for VFIO PCI devices. Signed-off-by: Erik Skultety --- src/qemu/qemu_domain.c | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git

[libvirt] [PATCH v4 13/14] test: Add some test cases for our test suite regarding the mdevs

2017-03-22 Thread Erik Skultety
For now, these only cover the unmanaged, i.e. user pre-created devices. Signed-off-by: Erik Skultety --- ...ml2argv-hostdev-mdev-invalid-target-address.xml | 33 ++ ...muxml2argv-hostdev-mdev-src-address-invalid.xml | 35 +++

[libvirt] [PATCH v4 05/14] conf: Introduce new hostdev device type mdev

2017-03-22 Thread Erik Skultety
A mediated device will be identified by a UUID (with 'model' now being a mandatory attribute to represent the mediated device API) of the user pre-created mediated device. The data necessary to identify a mediated device can be easily extended in the future, e.g. when auto-creation of mediated

[libvirt] [PATCH v4 07/14] conf: Enable cold-plug of a mediated device

2017-03-22 Thread Erik Skultety
This merely introduces virDomainHostdevMatchSubsysMediatedDev method that is supposed to check whether device being cold-plugged does not already exist in the domain configuration. Signed-off-by: Erik Skultety --- src/conf/domain_conf.c | 14 ++ 1 file changed,

[libvirt] [PATCH v4 06/14] security: Enable labeling of vfio mediated devices

2017-03-22 Thread Erik Skultety
Label the VFIO IOMMU devices under /dev/vfio/ referenced by the symlinks in the sysfs (e.g. /sys/class/mdev_bus//iommu_group) which what qemu actually gets formatted on the command line. This patch updates all of our security drivers. Signed-off-by: Erik Skultety ---

[libvirt] [PATCH v4 10/14] qemu: cgroup: Adjust cgroups' logic to allow mediated devices

2017-03-22 Thread Erik Skultety
As goes for all the other hostdev device types, grant the qemu process access to /dev/vfio/. Signed-off-by: Erik Skultety --- src/qemu/qemu_domain.c | 14 ++ 1 file changed, 14 insertions(+) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index

[libvirt] [PATCH v4 08/14] qemu: Assign PCI addresses for mediated devices as well

2017-03-22 Thread Erik Skultety
So far, the official support is for x86_64 arch guests so unless a different device API than vfio-pci is available let's only turn on support for PCI address assignment. Once a different device API is introduced, we can enable another address type easily. Signed-off-by: Erik Skultety

[libvirt] [PATCH v4 09/14] hostdev: Maintain a driver list of active mediated devices

2017-03-22 Thread Erik Skultety
Keep track of the assigned mediated devices the same way we do it for the rest of hostdevs. Methods like 'Prepare', 'Update', and 'ReAttach' are introduced by this patch. Signed-off-by: Erik Skultety --- src/libvirt_private.syms | 3 + src/qemu/qemu_hostdev.c | 56

[libvirt] [PATCH v4 02/14] conf: hostdev: Introduce virDomainHostdevSubsysSCSIClear

2017-03-22 Thread Erik Skultety
Just a tiny wrapper over the SCSI def clearing logic to drop some if-else branches from a switch, mainly because extending the switch in the future would render the current code with branching less readable. Signed-off-by: Erik Skultety --- src/conf/domain_conf.c | 33

[libvirt] [PATCH v4 00/14] Introduce vGPU mdev framework to libvirt

2017-03-22 Thread Erik Skultety
since v1: - new attribute model introduced which tells libvirt which device API should be considered when auto-assigning guest address - device_api is properly checked, thus taking the 'model' attribute only as a hint to assign "some" address - new address type 'mdev' is introduced rather than

Re: [libvirt] [PATCH 00/22] Resolve Coverity and build issues

2017-03-22 Thread Martin Kletzander
On Wed, Mar 22, 2017 at 10:21:13AM -0400, John Ferlan wrote: Hopefully the quantity doesn't scare anyone off... These are mostly innocuous, but separated each out to appease the masses. The first patch fixes a recently uncovered Coverity warning regarding FORWARD_NULL of the 'formatStr'...

Re: [libvirt] [GSOC] project libvirt fuzzing

2017-03-22 Thread D L
On Wed, Mar 22, 2017 at 4:04 AM, Michal Privoznik wrote: > On 03/21/2017 07:04 PM, D L wrote: > > Yes, I compiled, installed, and used the binaries successfully. > > Could you confirm the location of bug list is the following, please? > > > >

Re: [libvirt] [PATCH 1/3] util: use AF_UNIX family (not AF_PACKET) for ioctl sockets

2017-03-22 Thread Michal Privoznik
On 03/21/2017 04:23 PM, Laine Stump wrote: The exact family of the socket created for the fd used by ioctl(7) doesn't matter, it just needs to be a socket and not a file. But for some reason when macvtap support was added, it used AF_PACKET/SOCK_DGRAM sockets for its ioctls; we later used the

Re: [libvirt] [PATCH 0/3] Three random small patches

2017-03-22 Thread Michal Privoznik
On 03/21/2017 04:23 PM, Laine Stump wrote: I found these while trying out some other code I decided not to use (I was going to add more attributes to the element, virNetDevIfLink, and virNetDevGetLinkInfo(), but then decided not to for now (in case Michal has a different idea of the meaning of

Re: [libvirt] [PATCH 05/22] conf: Remove NONNULL(1) for virDomainNumaGetNodeCount

2017-03-22 Thread Peter Krempa
On Wed, Mar 22, 2017 at 10:21:18 -0400, John Ferlan wrote: > Since the code checks and handles a NULL 'numa' parameter, remove the NONNULL > from the prototype. > > Signed-off-by: John Ferlan > --- > src/conf/numa_conf.h | 4 ++-- > 1 file changed, 2 insertions(+), 2

Re: [libvirt] [PATCH 01/22] qemu: Always format formatStr for blockdev-snapshot-sync

2017-03-22 Thread Peter Krempa
On Wed, Mar 22, 2017 at 10:21:14 -0400, John Ferlan wrote: > The qemuDomainSnapshotPrepare should always set a > 0 format value anyway, > so remove the check. > > Found by Coverity. > > Signed-off-by: John Ferlan > --- > src/qemu/qemu_driver.c | 3 +-- > 1 file changed, 1

Re: [libvirt] [PATCH v3 04/15] conf: Introduce new hostdev device type mdev

2017-03-22 Thread Erik Skultety
On Wed, Mar 22, 2017 at 03:23:58PM +0100, Pavel Hrdina wrote: > On Thu, Mar 16, 2017 at 01:21:08PM +0100, Erik Skultety wrote: > > A mediated device will be identified by a UUID (with 'model' now being > > a mandatory attribute to represent the mediated device API) of > > the user pre-created

[libvirt] [PATCH 2/2] network: Don't crash on domain destroy

2017-03-22 Thread Michal Privoznik
https://bugzilla.redhat.com/show_bug.cgi?id=1434882 Imagine the following scenario: 1) virsh net-start default 2) virsh start myFavouriteDomain 3) virsh net-destroy default 4) virsh destroy myFavouriteDomain (assuming myFavouriteDomain has an interface from default network) Regardless of how

[libvirt] [PATCH 0/2] Two simple network improvements

2017-03-22 Thread Michal Privoznik
The first is an improvement, the second is actually a bug fix. Michal Privoznik (2): networkUpdateState: Create virMacMap module more frequently network: Don't crash on domain destroy src/network/bridge_driver.c | 24 +++- 1 file changed, 11 insertions(+), 13

[libvirt] [PATCH 1/2] networkUpdateState: Create virMacMap module more frequently

2017-03-22 Thread Michal Privoznik
The virMacMap module is there for dumping [domain, ] pairs into a file so that libvirt_guest NSS module can use it. Whenever a interface is allocated from network (e.g. on domani startup or NIC hotplug), network is notified and so is virMacMap module subsequently. The module update functions

Re: [libvirt] [PATCH v3 04/15] conf: Introduce new hostdev device type mdev

2017-03-22 Thread Pavel Hrdina
On Thu, Mar 16, 2017 at 01:21:08PM +0100, Erik Skultety wrote: > A mediated device will be identified by a UUID (with 'model' now being > a mandatory attribute to represent the mediated device API) of > the user pre-created mediated device. The data necessary to identify a > mediated device can

Re: [libvirt] [PATCH v3 05/15] conf: Add post parse code for mdevs to virDomainHostdevDefPostParse

2017-03-22 Thread Pavel Hrdina
On Thu, Mar 16, 2017 at 01:21:09PM +0100, Erik Skultety wrote: > We need to make sure that if user explicitly provides a guest address > for a mdev device, the address type will be matching the device API > supported on that specific mediated device and error out with an > incorrect XML message. >

[libvirt] [PATCH 15/22] util: Remove NONNULL(1) for virHostdevReAttachDomainDevices

2017-03-22 Thread John Ferlan
Since the function handles a NULL 'mgr' condition, no need for the NONNULL Signed-off-by: John Ferlan --- src/util/virhostdev.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util/virhostdev.h b/src/util/virhostdev.h index 7ee0b43..45d1c2e 100644 ---

[libvirt] [PATCH 18/22] util: Remove NONNULL(2) for virNetDevBandwidthPlug

2017-03-22 Thread John Ferlan
Since the code checks and handles a NULL 'net_bandwidth' parameter, so no need for NONNNULL. Signed-off-by: John Ferlan --- src/util/virnetdevbandwidth.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/util/virnetdevbandwidth.h

[libvirt] [PATCH 22/22] cpu: Remove NONNULL(1) for cpuBaseline

2017-03-22 Thread John Ferlan
Since the code checks and handles a NULL 'cpus' anyway, so no need for the NONNULL. Signed-off-by: John Ferlan --- src/cpu/cpu.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/cpu/cpu.h b/src/cpu/cpu.h index 7d6d3e9..d23409a 100644 ---

[libvirt] [PATCH 13/22] util: Remove NONNULL(2, 3) for virHostdevReAttachSCSIVHostDevices

2017-03-22 Thread John Ferlan
The comparison code used STREQ_NULLABLE anyway for both 'drv_name' and 'dom_name', so no need. Add a NULLSTR on the 'dom_name' too. Signed-off-by: John Ferlan --- src/util/virhostdev.c | 2 +- src/util/virhostdev.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)

[libvirt] [PATCH 21/22] util: Remove NONNULL(1) for virNetDevMacVLanDeleteWithVPortProfile

2017-03-22 Thread John Ferlan
Since the source code checks 'ifname' for NULL before using, the prototype doesn't need the NONNULL Signed-off-by: John Ferlan --- src/util/virnetdevmacvlan.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util/virnetdevmacvlan.h

[libvirt] [PATCH 08/22] qemu: Remove NONNULL(1) for qemu_monitor prototypes

2017-03-22 Thread John Ferlan
The 'mon' argument validity is checked in the QEMU_CHECK_MONITOR for the following functions, so they don't need the NONNULL on their prototype: qemuMonitorUpdateVideoMemorySize qemuMonitorUpdateVideoVram64Size qemuMonitorGetAllBlockStatsInfo qemuMonitorBlockStatsUpdateCapacity Signed-off-by:

[libvirt] [PATCH 17/22] util: Remove NONNULL(1, 3, 4) from virTypedParamsFilter

2017-03-22 Thread John Ferlan
The API checks each parameter for NULL anyway and would error, so need to add NONNULL on prototype. Signed-off-by: John Ferlan --- src/util/virtypedparam.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/util/virtypedparam.h

[libvirt] [PATCH 07/22] qemu: Remove non null 'vm' check from qemuMonitorOpen

2017-03-22 Thread John Ferlan
The prototype requires not passing a NULL in the parameter and the callers all would fail far before this code would fail if 'vm' was NULL, so just remove the check. Signed-off-by: John Ferlan --- src/qemu/qemu_monitor.c | 3 +-- 1 file changed, 1 insertion(+), 2

[libvirt] [PATCH 14/22] util: Remove NONNULL(1) for virHostdevPrepareDomainDevices

2017-03-22 Thread John Ferlan
Since the code checks 'mgr == NULL' anyway, no need for the prototype to have the NONNULL arg check. Also add an error message to indicate what the failure is so that there isn't a failed for some reason error. Signed-off-by: John Ferlan --- src/util/virhostdev.c | 5 -

[libvirt] [PATCH 12/22] util: Remove NONNULL(2, 3) for virHostdevReAttachUSBDevices

2017-03-22 Thread John Ferlan
The comparison code used STREQ_NULLABLE anyway for both 'drv_name' and 'dom_name', so no need. Add a NULLSTR on the 'dom_name' too. Signed-off-by: John Ferlan --- src/util/virhostdev.c | 2 +- src/util/virhostdev.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)

[libvirt] [PATCH 09/22] util: Change return argument for virBitmapParseUnlimited

2017-03-22 Thread John Ferlan
Rather than returning an int and a *bitmap pointer, just return and check a NULL bitmap pointer Signed-off-by: John Ferlan --- src/util/virbitmap.c | 26 -- src/util/virbitmap.h | 7 +++ tests/testutils.c | 2 +- tests/virbitmaptest.c | 2

[libvirt] [PATCH 06/22] network: Remove null newBandwidth check from networkBandwidthUpdate

2017-03-22 Thread John Ferlan
The prototype requires a NONNULL argument and the only caller passes in a non-null parameter. Besides the "else if" condition would deref it anyway. Signed-off-by: John Ferlan --- src/network/bridge_driver.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[libvirt] [PATCH 00/22] Resolve Coverity and build issues

2017-03-22 Thread John Ferlan
Hopefully the quantity doesn't scare anyone off... These are mostly innocuous, but separated each out to appease the masses. The first patch fixes a recently uncovered Coverity warning regarding FORWARD_NULL of the 'formatStr'... According to an IRC response from pkrempa the format should be set

[libvirt] [PATCH 02/22] util: Remove NONNULL(1) for virNetDevGetName

2017-03-22 Thread John Ferlan
The 'ifindex' argument is not a pointer, so no need for NONNULL in prototype Signed-off-by: John Ferlan --- src/util/virnetdev.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util/virnetdev.h b/src/util/virnetdev.h index 01e9c5b..9c9daf1 100644 ---

[libvirt] [PATCH 04/22] conf: Remove NONNULL(1, 2) for virNetDevBandwidthFormat

2017-03-22 Thread John Ferlan
Since the code checks and handles NULL parameters, remove the NONNULL from the prototype. Also fix the comment in the source to reference the right name. Signed-off-by: John Ferlan --- src/conf/netdev_bandwidth_conf.c | 2 +- src/conf/netdev_bandwidth_conf.h | 3 +-- 2

[libvirt] [PATCH 16/22] util: Remove NONNULL(1) for virNetDevOpenvswitchSetMigrateData

2017-03-22 Thread John Ferlan
The code checks and handles a NULL 'migrate', so no need for NONNULL Signed-off-by: John Ferlan --- src/util/virnetdevopenvswitch.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util/virnetdevopenvswitch.h b/src/util/virnetdevopenvswitch.h index

[libvirt] [PATCH 05/22] conf: Remove NONNULL(1) for virDomainNumaGetNodeCount

2017-03-22 Thread John Ferlan
Since the code checks and handles a NULL 'numa' parameter, remove the NONNULL from the prototype. Signed-off-by: John Ferlan --- src/conf/numa_conf.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/conf/numa_conf.h b/src/conf/numa_conf.h index

[libvirt] [PATCH 03/22] conf: Remove NONNULL(2) for virNetDevBandwidthParse

2017-03-22 Thread John Ferlan
Since the code checks and handles a NULL 'node' before proceeding there's no need for the prototype with the NONNULL(2). Signed-off-by: John Ferlan --- src/conf/netdev_bandwidth_conf.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[libvirt] [PATCH 10/22] util: Remove NONNULL(1) for virBitmapParseUnlimited

2017-03-22 Thread John Ferlan
The code checks and handles a NULL 'str', so just remove the NONNULL. Update the error message to add the NULLSTR() around 'str' also. Signed-off-by: John Ferlan --- src/util/virbitmap.c | 2 +- src/util/virbitmap.h | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-)

[libvirt] [PATCH 20/22] util: Remove NONNULL's for virNetDevVPortProfile[Associate|Disassociate]

2017-03-22 Thread John Ferlan
The source code will check for NULL arguments for 'macvtap_macaddr' and 'vmuuid', so no need for the NONNULL in the prototypes. Following the stack for both arguments to virNetDevVPortProfileOpSetLink also shows called functions would handle a NULL value. Additionally, modified the prototype to

[libvirt] [PATCH 01/22] qemu: Always format formatStr for blockdev-snapshot-sync

2017-03-22 Thread John Ferlan
The qemuDomainSnapshotPrepare should always set a > 0 format value anyway, so remove the check. Found by Coverity. Signed-off-by: John Ferlan --- src/qemu/qemu_driver.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/qemu/qemu_driver.c

[libvirt] [PATCH 11/22] util: Remove NONNULL(2, 3) for virHostdevReAttachPCIDevices

2017-03-22 Thread John Ferlan
The called function uses a STRNEQ_NULLABLE anyway for both 'drv_name' and 'dom_name', so no need. Signed-off-by: John Ferlan --- src/util/virhostdev.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util/virhostdev.h b/src/util/virhostdev.h index

[libvirt] [PATCH 19/22] util: Remove NONNULL(1) for virNetDevOpenvswitchGetVhostuserIfname

2017-03-22 Thread John Ferlan
Since the code checks and handles a NULL 'path', no need for the NONNULL Signed-off-by: John Ferlan --- src/util/virnetdevopenvswitch.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util/virnetdevopenvswitch.h b/src/util/virnetdevopenvswitch.h index

Re: [libvirt] [PATCH 00/23] Add block write threshold event

2017-03-22 Thread Eric Blake
On 03/22/2017 02:55 AM, Peter Krempa wrote: > On Wed, Mar 15, 2017 at 17:37:12 +0100, Peter Krempa wrote: >> This is another version of the stuff that I've posted here: >> https://www.redhat.com/archives/libvir-list/2017-February/msg01391.html >> which was partially based on the very old

Re: [libvirt] [BUG] mlock support breakage

2017-03-22 Thread Luiz Capitulino
On Wed, 15 Mar 2017 10:11:50 +0100 Andrea Bolognani wrote: > On Wed, 2017-03-15 at 08:59 +0100, Jiri Denemark wrote: > > > > Removing all memory locking limits should be something that > > > > admins very carefully opt-in into, because of the potential > > > > host DoS

Re: [libvirt] [PATCH v2 5/5] network: check accept_ra before enabling ipv6 forwarding

2017-03-22 Thread John Ferlan
[...] > + > +static int > +virNetDevIPCheckIPv6ForwardingCallback(const struct nlmsghdr *resp, > + void *opaque) > +{ > +struct rtmsg *rtmsg = NLMSG_DATA(resp); > +int accept_ra = -1; > +struct rtattr *rta; > +char *ifname = NULL; > +

Re: [libvirt] [PATCH v2 4/5] util: add virNetDevGetName() function

2017-03-22 Thread John Ferlan
On 03/15/2017 10:45 AM, Cédric Bosdonnat wrote: [...] > > /** > * virNetDevGetIndex: > diff --git a/src/util/virnetdev.h b/src/util/virnetdev.h > index 236cf83ef..01e9c5b95 100644 > --- a/src/util/virnetdev.h > +++ b/src/util/virnetdev.h > @@ -157,6 +157,8 @@ int

Re: [libvirt] [PATCH 2/3] Debug: Remove unnecessary errors reported while parsing non-existent sysfs files.

2017-03-22 Thread Peter Krempa
On Wed, Mar 22, 2017 at 14:13:25 +0530, Prerna wrote: > I agree. Thanks for pointing out that this is a behavioural change, which > should not happen. Please don't top post on technical lists. > > I should be doing something like this: > > if (virFileReadAllQuiet(path, 1024, ) < 0 ) { >

Re: [libvirt] [PATCH 1/3] Debug: Add WARN'ing messages for when a client has opened/closed connection.

2017-03-22 Thread Prerna
I looked through what you were suggesting. I was assuming virNetSocketGetFD()would do a NULL check for the sock arg, and would return immediately if a different client executed a virNetServerClientClose() setting client->sock to null. Since this check is missing, I understand the implicit

Re: [libvirt] [PATCH] domain_capabilities: Don't report machine type for bhyve

2017-03-22 Thread Michal Privoznik
On 03/22/2017 06:46 AM, Roman Bogorodskiy wrote: Michal Privoznik wrote: For some drivers the domain's machine type makes no sense. They just don't use it. A great example is bhyve driver. Therefore it makes very less sense to report machine in domain capabilities XML. Signed-off-by: Michal

Re: [libvirt] [PATCH 2/3] Debug: Remove unnecessary errors reported while parsing non-existent sysfs files.

2017-03-22 Thread Prerna
I agree. Thanks for pointing out that this is a behavioural change, which should not happen. I should be doing something like this: if (virFileReadAllQuiet(path, 1024, ) < 0 ) { if (errno != ENOENT) { virReportSystemError(errno, _("unable to read:

Re: [libvirt] [PATCH 3/3] Debug: Report VM errors more concisely.

2017-03-22 Thread Prerna
Oops, sorry. Dropping the list was not intentional. I didnt realise I had sent a "reply" in place of "reply-all" . Adding back :) I still would argue that having the VM's name narrows down the problem space. If a client knows what operations have been fired for a VM over the last time window, it

Re: [libvirt] [PATCH 2/3] Debug: Remove unnecessary errors reported while parsing non-existent sysfs files.

2017-03-22 Thread Peter Krempa
On Wed, Mar 22, 2017 at 09:14:41 +0100, Peter Krempa wrote: > On Wed, Mar 22, 2017 at 01:02:18 -0700, Prerna Saxena wrote: > > Sample from current logs: > > error : virFileReadAll:1290 : Failed to open file > > '/sys/class/net/tap3/operstate': No such file or directory > > error :

Re: [libvirt] [PATCH 2/3] Debug: Remove unnecessary errors reported while parsing non-existent sysfs files.

2017-03-22 Thread Peter Krempa
On Wed, Mar 22, 2017 at 01:02:18 -0700, Prerna Saxena wrote: > Sample from current logs: > error : virFileReadAll:1290 : Failed to open file > '/sys/class/net/tap3/operstate': No such file or directory > error : virNetDevGetLinkInfo:1895 : unable to read: > /sys/class/net/tap3/operstate: No such

Re: [libvirt] [PATCH 3/3] Debug: Report VM errors more concisely.

2017-03-22 Thread Peter Krempa
On Wed, Mar 22, 2017 at 01:02:19 -0700, Prerna Saxena wrote: > Current logs: > error : qemuProcessFindDomainDiskByAlias:411 : internal error: no disk found > with alias ide0-0-0 > > There is no way to find which VM was seeing this error. > Makes debugging very hard, and the message itself is no

Re: [libvirt] [PATCH 1/3] Debug: Add WARN'ing messages for when a client has opened/closed connection.

2017-03-22 Thread Peter Krempa
On Wed, Mar 22, 2017 at 01:02:17 -0700, Prerna Saxena wrote: > While tracing connections from a remote client, it helps to keep track > of the connection lifecycle. Messages such as the following : > > error : virNetSocketReadWire:1574 : End of file while reading data: > Input/output error > >

Re: [libvirt] [GSOC] project libvirt fuzzing

2017-03-22 Thread Michal Privoznik
On 03/21/2017 07:04 PM, D L wrote: > Yes, I compiled, installed, and used the binaries successfully. > Could you confirm the location of bug list is the following, please? > > https://bugzilla.redhat.com/buglist.cgi?component=libvirt=Virtualization%20Tools This will fetch all bug there are/ever

[libvirt] [PATCH 3/3] Debug: Report VM errors more concisely.

2017-03-22 Thread Prerna Saxena
Current logs: error : qemuProcessFindDomainDiskByAlias:411 : internal error: no disk found with alias ide0-0-0 There is no way to find which VM was seeing this error. Makes debugging very hard, and the message itself is no good. Signed-off-by: Prerna Saxena ---

[libvirt] [PATCH 1/3] Debug: Add WARN'ing messages for when a client has opened/closed connection.

2017-03-22 Thread Prerna Saxena
While tracing connections from a remote client, it helps to keep track of the connection lifecycle. Messages such as the following : error : virNetSocketReadWire:1574 : End of file while reading data: Input/output error are rather unhelpful. They do not indicate if the client had earlier asked

[libvirt] [PATCH 2/3] Debug: Remove unnecessary errors reported while parsing non-existent sysfs files.

2017-03-22 Thread Prerna Saxena
Sample from current logs: error : virFileReadAll:1290 : Failed to open file '/sys/class/net/tap3/operstate': No such file or directory error : virNetDevGetLinkInfo:1895 : unable to read: /sys/class/net/tap3/operstate: No such file or directory These have no useful data point and are redundant.

[libvirt] [PATCH 0/3] Debug: Improve log messages.

2017-03-22 Thread Prerna Saxena
Libvirt logs include many snippets for debugging daemon state, but some of those messages are either missing vital information or end up logging "errors" for normal operating conditions as well. This series improves log messages, also adding additional WARN'ings for connection instantiation and

Re: [libvirt] [PATCH 00/23] Add block write threshold event

2017-03-22 Thread Peter Krempa
On Wed, Mar 15, 2017 at 17:37:12 +0100, Peter Krempa wrote: > This is another version of the stuff that I've posted here: > https://www.redhat.com/archives/libvir-list/2017-February/msg01391.html > which was partially based on the very old discussion at >

Re: [libvirt] [GSOC] project libvirt fuzzing

2017-03-22 Thread Peter Krempa
On Tue, Mar 21, 2017 at 17:09:58 +0100, Michal Privoznik wrote: > On 03/21/2017 04:34 PM, Peter Krempa wrote: > > On Tue, Mar 21, 2017 at 16:15:35 +0100, Michal Privoznik wrote: > > > On 03/21/2017 04:39 AM, D L wrote: > > > > On Thu, Mar 16, 2017 at 1:03 PM, Michal Privoznik