Re: [libvirt] Questions about function virPCIDeviceIsBehindSwitchLackingACS in virpci.c

2017-09-20 Thread Alex Williamson
On Wed, 20 Sep 2017 21:39:55 -0400 Laine Stump wrote: > On 09/20/2017 09:25 PM, Wuzongyong (Euler Dept) wrote: > >> -Original Message- > >> From: sendmail [mailto:justsendmailnothinge...@gmail.com] On Behalf Of > >> Laine Stump > >> Sent: Thursday, September 21, 2017 8:57 AM > >> To: libv

Re: [libvirt] Questions about function virPCIDeviceIsBehindSwitchLackingACS in virpci.c

2017-09-20 Thread Laine Stump
On 09/20/2017 09:25 PM, Wuzongyong (Euler Dept) wrote: >> -Original Message- >> From: sendmail [mailto:justsendmailnothinge...@gmail.com] On Behalf Of >> Laine Stump >> Sent: Thursday, September 21, 2017 8:57 AM >> To: libvirt-l...@redhat.com >> Cc: Wuzongyong (Euler Dept) ; Wanzongshun >>

Re: [libvirt] Questions about function virPCIDeviceIsBehindSwitchLackingACS in virpci.c

2017-09-20 Thread Wuzongyong (Euler Dept)
> -Original Message- > From: sendmail [mailto:justsendmailnothinge...@gmail.com] On Behalf Of > Laine Stump > Sent: Thursday, September 21, 2017 8:57 AM > To: libvirt-l...@redhat.com > Cc: Wuzongyong (Euler Dept) ; Wanzongshun > (Vincent) ; Alex Williamson > > Subject: Re: [libvirt] Quest

Re: [libvirt] Questions about function virPCIDeviceIsBehindSwitchLackingACS in virpci.c

2017-09-20 Thread Laine Stump
On 09/18/2017 09:24 PM, Wuzongyong (Euler Dept) wrote: > > Hi, > >   > > In function virPCIDeviceIsBehindSwitchLackingACS, I noticed that(line 8): > >   > > 1    if (virPCIDeviceGetParent(dev, &parent) < 0) > > 2    return -1; > > 3    if (!parent) { > > 4    /* if we have no parent, and th

Re: [libvirt] [PATCH v9 4/4] qemu: Add TLS support for Veritas HyperScale (VxHS)

2017-09-20 Thread ashish mittal
Hi, I have done TLS testing with this patch series and the tests passed fine with the secAlias fix in place. (1) Applied all the v9 patches. (2) make install. Reload and restart the libvirtd daemon. (3) Make sure able to start guest with TLS enabled VxHS disk in the domain XML. (4) Try to hot-plu

Re: [libvirt] [PATCH v3] Avoid a possible NULL pointer dereference in qemuDomainGetTLSObjects

2017-09-20 Thread ashish mittal
On Wed, Sep 20, 2017 at 6:11 AM, Erik Skultety wrote: > On Wed, Sep 20, 2017 at 05:32:29AM -0700, Ashish Mittal wrote: > > Passing a NULL value for the argument secAlias to the function > > qemuDomainGetTLSObjects would cause a segmentation fault in > > libvirtd. > > > > Changed code to not deref

[libvirt] [PATCH libvirt-glib 3/5] configure: Look for Perl interpreter path

2017-09-20 Thread Andrea Bolognani
The $(PERL) variable is used in several places, but configure is not actually looking for the Perl interpreter path, so it will always end up being empty. Signed-off-by: Andrea Bolognani --- configure.ac | 2 ++ 1 file changed, 2 insertions(+) diff --git a/configure.ac b/configure.ac index 43b0

[libvirt] [PATCH libvirt-glib 1/5] maint: Drop autobuild.sh

2017-09-20 Thread Andrea Bolognani
The Test-AutoBuild project, that this script is supposed to be used with, hasn't seen any activity in ~6 years; libvirt's own CI, which also performs periodic builds of libvirt-glib, is running on Jenkins with a completely independent setup that doesn't use the script at all. Signed-off-by: Andrea

Re: [libvirt] [PATCH] iohelper: avoid calling read() with misaligned buffers for O_DIRECT

2017-09-20 Thread Eric Blake
On 09/20/2017 10:31 AM, Daniel P. Berrange wrote: > The iohelper currently calls saferead() to get data from the > underlying file. This has a problem with O_DIRECT when hitting > end-of-file. saferead() is asked to read 1MB, but the first > read() it does may return only a few KB, so it'll try ano

[libvirt] [PATCH libvirt-glib 5/5] scripts: Fix sha-bang lines

2017-09-20 Thread Andrea Bolognani
This is particularly useful on operating systems that don't ship Perl or Python as part of the base system (eg. FreeBSD) while still working just as well as it did before on Linux. While at it, make it explicit that our scripts are only going to work with Python 2, add a couple of missing sha-bang

[libvirt] [PATCH libvirt-glib 4/5] tests: Don't rely on non-portable paths

2017-09-20 Thread Andrea Bolognani
The test-events program sets up a watch on /bin/true; however, that path is not portable: FreeBSD uses /usr/bin/true for example. Remove the portability issue by using /dev/null instead. Signed-off-by: Andrea Bolognani --- tests/test-events.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-

[libvirt] [PATCH libvirt-glib 2/5] configure: Bump required libvirt version to 1.2.5

2017-09-20 Thread Andrea Bolognani
That's the version that introduced VIR_DOMAIN_TIME_SYNC, which we use in the library. Signed-off-by: Andrea Bolognani --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 7981d23..43b0ffb 100644 --- a/configure.ac +++ b/configure.

[libvirt] [PATCH libvirt-glib 0/5] Portability fixes

2017-09-20 Thread Andrea Bolognani
Currently, trying to build libvirt-glib on FreeBSD results in all sorts of interesting failures. After applying this series, it's possible to build libvirt-glib and run the test suite successfully. There's even a couple of clean-ups thrown in for good measure :) Andrea Bolognani (5): maint: Dr

Re: [libvirt] [PATCH] apparmor: support finer-grained ptrace checks

2017-09-20 Thread Jim Fehlig
On 09/20/2017 08:57 AM, Jim Fehlig wrote: On 09/20/2017 12:51 AM, Guido Günther wrote: Hi Jim, On Mon, Sep 18, 2017 at 02:06:13PM -0600, Jim Fehlig wrote: Kernel 4.13 introduced finer-grained ptrace checks https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git/commit/?h=v4.13.

Re: [libvirt] [PATCH v3] Avoid a possible NULL pointer dereference in qemuDomainGetTLSObjects

2017-09-20 Thread Erik Skultety
On Wed, Sep 20, 2017 at 10:41:49AM -0400, John Ferlan wrote: > > > On 09/20/2017 09:11 AM, Erik Skultety wrote: > > On Wed, Sep 20, 2017 at 05:32:29AM -0700, Ashish Mittal wrote: > >> Passing a NULL value for the argument secAlias to the function > >> qemuDomainGetTLSObjects would cause a segmentat

Re: [libvirt] [PATCH v3] Avoid a possible NULL pointer dereference in qemuDomainGetTLSObjects

2017-09-20 Thread John Ferlan
On 09/20/2017 11:26 AM, Erik Skultety wrote: > On Wed, Sep 20, 2017 at 10:41:49AM -0400, John Ferlan wrote: >> >> >> On 09/20/2017 09:11 AM, Erik Skultety wrote: >>> On Wed, Sep 20, 2017 at 05:32:29AM -0700, Ashish Mittal wrote: Passing a NULL value for the argument secAlias to the function

[libvirt] [PATCH] iohelper: avoid calling read() with misaligned buffers for O_DIRECT

2017-09-20 Thread Daniel P. Berrange
The iohelper currently calls saferead() to get data from the underlying file. This has a problem with O_DIRECT when hitting end-of-file. saferead() is asked to read 1MB, but the first read() it does may return only a few KB, so it'll try another read() to fill the remaining buffer. Unfortunately th

Re: [libvirt] [PATCH v2 2/2] conf: Add all controllers using virDomainControllerInsert()

2017-09-20 Thread Laine Stump
On 09/07/2017 01:00 PM, Andrea Bolognani wrote: > Doing so is smarter than just appending them, because it takes the > controller index into account and will prevent problematic situations > such as a PCI Bridge being listed before the PCI controller it's > supposed to be plugged into, which QEMU c

Re: [libvirt] [PATCH v2] iohelper: fix reading with O_DIRECT

2017-09-20 Thread Nikolay Shirokovskiy
On 20.09.2017 17:48, Daniel P. Berrange wrote: > On Wed, Sep 20, 2017 at 02:58:55PM +0300, Nikolay Shirokovskiy wrote: >> saferead is not suitable for direct reads. If file size is not multiple >> of align size then we get EINVAL on the read(2) that is supposed to >> return 0 because read buffer

[libvirt] [PATCH 2/4] virt-aa-helper: fix libusb access to udev usb data

2017-09-20 Thread Christian Ehrhardt
libusb as used by qemu needs to read data from /run/udev/data/ about usb devices. That is read once on the first initialization of libusb_init by qemu. Therefore generating just the device we need would not be sufficient as another hotplug later can need another device which would fail as the data

[libvirt] [PATCH 3/4] virt-aa-helper: allow spaces in vm names

2017-09-20 Thread Christian Ehrhardt
libvirt allows spaces in vm names, there were issues in the past but it seems not removed so the assumption has to be that spaces are continuing to be allowed. Therefore virt-aa-helper should not reject spaces in vm names anymore if it is goign to be refused causing issues then the parser or xml s

[libvirt] [PATCH 4/4] virt-aa-helper: put static rules in quotes

2017-09-20 Thread Christian Ehrhardt
To avoid any issues later on if paths ever change (unlikely but possible) and to match the style of other generated rules the paths of the static rules have to be quoted as well. Signed-off-by: Christian Ehrhardt --- src/security/virt-aa-helper.c | 6 +++--- 1 file changed, 3 insertions(+), 3 de

Re: [libvirt] [PATCH] apparmor: support finer-grained ptrace checks

2017-09-20 Thread Jim Fehlig
On 09/20/2017 12:51 AM, Guido Günther wrote: Hi Jim, On Mon, Sep 18, 2017 at 02:06:13PM -0600, Jim Fehlig wrote: Kernel 4.13 introduced finer-grained ptrace checks https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git/commit/?h=v4.13.2&id=290f458a4f16f9cf6cb6562b249e69fe1c3c3a

Re: [libvirt] [PATCH v2] iohelper: fix reading with O_DIRECT

2017-09-20 Thread Nikolay Shirokovskiy
On 20.09.2017 18:05, Daniel P. Berrange wrote: > On Wed, Sep 20, 2017 at 06:00:59PM +0300, Nikolay Shirokovskiy wrote: >> >> >> On 20.09.2017 17:48, Daniel P. Berrange wrote: >>> >>> IOW can simplify your patch to just this I believe:> >>> diff --git a/src/util/iohelper.c b/src/util/iohelper.c >

Re: [libvirt] [PATCH] vhost-user: add support reconnect for vhost-user ports

2017-09-20 Thread Pavel Hrdina
On Fri, Sep 08, 2017 at 05:12:09PM +0800, ZhiPeng Lu wrote: > For vhost-user ports, Open vSwitch acts as the server and QEMU the client. > When OVS crashed or restart, QEMU shoule be reconnect to OVS. > > Signed-off-by: ZhiPeng Lu > --- > docs/formatdomain.html.in | 6 +

[libvirt] [PATCH 1/4] virt-aa-helper: fix paths for usb hostdevs

2017-09-20 Thread Christian Ehrhardt
If users only specified vendor&product (the common case) then parsing the xml via virDomainHostdevSubsysUSBDefParseXML would only set these. Bus and Device would much later be added when the devices are prepared to be added. Due to that a hot-add of a usb hostdev works as the device is prepared an

Re: [libvirt] [PATCH v2] iohelper: fix reading with O_DIRECT

2017-09-20 Thread Daniel P. Berrange
On Wed, Sep 20, 2017 at 06:00:59PM +0300, Nikolay Shirokovskiy wrote: > > > On 20.09.2017 17:48, Daniel P. Berrange wrote: > > > > IOW can simplify your patch to just this I believe:> > > diff --git a/src/util/iohelper.c b/src/util/iohelper.c > > index fe15a92e6..5416d4506 100644 > > --- a/src/

[libvirt] [PATCH 0/4] misc virt-aa-helper fixes

2017-09-20 Thread Christian Ehrhardt
Hi, this was mostly created by clearing old libvirt bugs in Ubuntu. USB passthrough so far often used workarounds but can be fixed in virt-aa-helper. I have some more changes planned but these seem to become longer term activities so I didn't want to postpone those easier ones due to that and submi

Re: [libvirt] [PATCH v4 7/7] nodedev: Work around the uevent race by hooking up virFileWaitForAccess

2017-09-20 Thread John Ferlan
On 09/18/2017 12:34 PM, Erik Skultety wrote: > If we find ourselves in the situation that the 'add' uevent has been > fired earlier than the sysfs tree for a device was created, we should > use the best-effort approach and give kernel some predetermined amount > of time, thus waiting for the attr

Re: [libvirt] [PATCH v2] iohelper: fix reading with O_DIRECT

2017-09-20 Thread Daniel P. Berrange
On Wed, Sep 20, 2017 at 04:45:35PM +0300, Nikolay Shirokovskiy wrote: > > > On 20.09.2017 16:41, Daniel P. Berrange wrote: > > On Wed, Sep 20, 2017 at 04:35:58PM +0300, Nikolay Shirokovskiy wrote: > >> > >> > >> On 20.09.2017 16:30, Daniel P. Berrange wrote: > >>> On Wed, Sep 20, 2017 at 02:58:55

Re: [libvirt] [PATCH v3] Avoid a possible NULL pointer dereference in qemuDomainGetTLSObjects

2017-09-20 Thread John Ferlan
On 09/20/2017 09:11 AM, Erik Skultety wrote: > On Wed, Sep 20, 2017 at 05:32:29AM -0700, Ashish Mittal wrote: >> Passing a NULL value for the argument secAlias to the function >> qemuDomainGetTLSObjects would cause a segmentation fault in >> libvirtd. >> >> Changed code to not dereference a NULL

Re: [libvirt] [PATCH v2] iohelper: fix reading with O_DIRECT

2017-09-20 Thread Daniel P. Berrange
On Wed, Sep 20, 2017 at 02:58:55PM +0300, Nikolay Shirokovskiy wrote: > saferead is not suitable for direct reads. If file size is not multiple > of align size then we get EINVAL on the read(2) that is supposed to > return 0 because read buffer will not be aligned at this point. > > Let's not read

Re: [libvirt] [PATCH] vhost-user: add support reconnect for vhost-user ports

2017-09-20 Thread Michal Privoznik
On 09/20/2017 03:59 PM, Pavel Hrdina wrote: > On Wed, Sep 20, 2017 at 03:15:23PM +0200, Michal Privoznik wrote: >> On 09/08/2017 11:12 AM, ZhiPeng Lu wrote: >>> For vhost-user ports, Open vSwitch acts as the server and QEMU the client. >>> When OVS crashed or restart, QEMU shoule be reconnect to OV

Re: [libvirt] [PATCH] vhost-user: add support reconnect for vhost-user ports

2017-09-20 Thread Pavel Hrdina
On Wed, Sep 20, 2017 at 03:15:23PM +0200, Michal Privoznik wrote: > On 09/08/2017 11:12 AM, ZhiPeng Lu wrote: > > For vhost-user ports, Open vSwitch acts as the server and QEMU the client. > > When OVS crashed or restart, QEMU shoule be reconnect to OVS. > > > > Signed-off-by: ZhiPeng Lu > > ---

Re: [libvirt] [PATCH v4 6/7] util: Introduce virFileWaitForExists

2017-09-20 Thread John Ferlan
On 09/18/2017 12:34 PM, Erik Skultety wrote: > Since we have a number of places where we workaround timing issues with > devices, attributes (files in general) not being available at the time > of processing them by calling usleep in a loop for a fixed number of > tries, we could as well have a u

[libvirt] [PATCH] qemu: report a nicer error when USB is disabled

2017-09-20 Thread Ján Tomko
If the user tries to define a domain that has and also some USB devices, we report an error: error: internal error: No free USB ports Which is technically still correct for a domain with no USB ports. Change it to: USB is disabled for this domain, but USB devices are present in the domain

Re: [libvirt] [PATCH] news: remove kernel version reference from switchdev entry

2017-09-20 Thread John Ferlan
On 09/20/2017 09:46 AM, Ján Tomko wrote: > The functionality was added in 4.8, but due to a rename of > the DEVLINK_CMD_ESWITCH_GET constant in the kernel headers, > the headers from kernel 4.11 are required by the libvirt code. > > Remove the reference from the news entry, since it could be > m

Re: [libvirt] [PATCH v4 5/7] nodedev: Disable/re-enable polling on the udev fd

2017-09-20 Thread John Ferlan
On 09/18/2017 12:34 PM, Erik Skultety wrote: > The event loop may get scheduled earlier than the udev event handler > thread which means that it would keep invoking the handler callback with > "new" events, while in fact it's most likely still the same event which > the handler thread hasn't mana

[libvirt] [PATCH] Revert "vhost-user: add support reconnect for vhost-user ports"

2017-09-20 Thread Pavel Hrdina
This reverts commit edaf4ebe95a5995585c8ab7bc5b92887286d4431. This uses "reconnect" as attribute for element, but we already have a element for element for chardev devices. Since this is the same feature for different device it should be presented in XML the same way. Signed-off-by: Pavel Hrd

Re: [libvirt] [PATCH v2] util: Fix configure.ac check for DEVLINK_CMD_ESWITCH_GET

2017-09-20 Thread Ján Tomko
On Tue, Sep 19, 2017 at 11:15:28AM -0400, John Ferlan wrote: Turns out the mechanism of providing multiple definitions to check via AC_CHECK_DECLS in order to determine whether HAVE_DECL_DEVLINK should be set resulted in a false positive since as long as one of the defs was true, then the HAVE_DE

Re: [libvirt] [PATCH v2] iohelper: fix reading with O_DIRECT

2017-09-20 Thread Nikolay Shirokovskiy
On 20.09.2017 16:41, Daniel P. Berrange wrote: > On Wed, Sep 20, 2017 at 04:35:58PM +0300, Nikolay Shirokovskiy wrote: >> >> >> On 20.09.2017 16:30, Daniel P. Berrange wrote: >>> On Wed, Sep 20, 2017 at 02:58:55PM +0300, Nikolay Shirokovskiy wrote: saferead is not suitable for direct reads.

Re: [libvirt] [PATCH v2 1/2] conf: Add USB companion controllers with virDomainControllerInsert()

2017-09-20 Thread Laine Stump
On 09/07/2017 01:00 PM, Andrea Bolognani wrote: > virDomainDefAddController() is very convenient, but it is only passed > a limited number of information about the controller. > > When adding USB controllers, knowing whether the controller is a > master or a companion is important because it can in

[libvirt] [PATCH] news: remove kernel version reference from switchdev entry

2017-09-20 Thread Ján Tomko
The functionality was added in 4.8, but due to a rename of the DEVLINK_CMD_ESWITCH_GET constant in the kernel headers, the headers from kernel 4.11 are required by the libvirt code. Remove the reference from the news entry, since it could be misleading. --- docs/news.xml | 2 +- 1 file changed, 1

Re: [libvirt] [PATCH v2] iohelper: fix reading with O_DIRECT

2017-09-20 Thread Daniel P. Berrange
On Wed, Sep 20, 2017 at 04:35:58PM +0300, Nikolay Shirokovskiy wrote: > > > On 20.09.2017 16:30, Daniel P. Berrange wrote: > > On Wed, Sep 20, 2017 at 02:58:55PM +0300, Nikolay Shirokovskiy wrote: > >> saferead is not suitable for direct reads. If file size is not multiple > >> of align size then

Re: [libvirt] [PATCH v4 4/7] udev: Convert udevEventHandleThread to an actual thread routine

2017-09-20 Thread John Ferlan
On 09/18/2017 12:34 PM, Erik Skultety wrote: > Adjust udevEventHandleThread to be a proper thread routine running in an > infinite loop handling devices. Also introduce udevEventThreadData > private structure. > Every time there's and incoming event from udev, udevEventHandleCallback > only incre

Re: [libvirt] [PATCH v2] iohelper: fix reading with O_DIRECT

2017-09-20 Thread Daniel P. Berrange
On Wed, Sep 20, 2017 at 02:58:55PM +0300, Nikolay Shirokovskiy wrote: > saferead is not suitable for direct reads. If file size is not multiple > of align size then we get EINVAL on the read(2) that is supposed to > return 0 because read buffer will not be aligned at this point. > > Let's not read

Re: [libvirt] [PATCH v2] iohelper: fix reading with O_DIRECT

2017-09-20 Thread Nikolay Shirokovskiy
On 20.09.2017 16:30, Daniel P. Berrange wrote: > On Wed, Sep 20, 2017 at 02:58:55PM +0300, Nikolay Shirokovskiy wrote: >> saferead is not suitable for direct reads. If file size is not multiple >> of align size then we get EINVAL on the read(2) that is supposed to >> return 0 because read buffer

Re: [libvirt] [PATCH] vhost-user: add support reconnect for vhost-user ports

2017-09-20 Thread Michal Privoznik
On 09/08/2017 11:12 AM, ZhiPeng Lu wrote: > For vhost-user ports, Open vSwitch acts as the server and QEMU the client. > When OVS crashed or restart, QEMU shoule be reconnect to OVS. > > Signed-off-by: ZhiPeng Lu > --- > docs/formatdomain.html.in | 6 +++-- > docs/schem

Re: [libvirt] [PATCH v4 2/7] nodedev: udev: Lock the driver in udevEventCheckMonitorFd

2017-09-20 Thread John Ferlan
On 09/18/2017 12:34 PM, Erik Skultety wrote: > The udev monitor is not an immutable resource, so better protect every > access to it. > > Signed-off-by: Erik Skultety > --- > src/node_device/node_device_udev.c | 3 +++ > 1 file changed, 3 insertions(+) > Of course this one will have the obvi

Re: [libvirt] [PATCH v4 1/7] nodedev: Introduce udevEventCheckMonitorFD helper function

2017-09-20 Thread Erik Skultety
On Wed, Sep 20, 2017 at 08:52:26AM -0400, John Ferlan wrote: > > > On 09/18/2017 12:34 PM, Erik Skultety wrote: > > We need to perform some sanity checks on the udev monitor before every > > use so that we know nothing changed in the meantime. The reason for > > moving the code to a separate functi

Re: [libvirt] [PATCH v3] Avoid a possible NULL pointer dereference in qemuDomainGetTLSObjects

2017-09-20 Thread Erik Skultety
On Wed, Sep 20, 2017 at 05:32:29AM -0700, Ashish Mittal wrote: > Passing a NULL value for the argument secAlias to the function > qemuDomainGetTLSObjects would cause a segmentation fault in > libvirtd. > > Changed code to not dereference a NULL secAlias. > > Signed-off-by: Ashish Mittal > --- > s

Re: [libvirt] [PATCH v4 3/7] udev: Split udevEventHandleCallback in two functions

2017-09-20 Thread John Ferlan
On 09/18/2017 12:34 PM, Erik Skultety wrote: > This patch splits udevEventHandleCallback in two (introduces > udevEventHandleThread) in order to be later able to refactor the latter > to actually become a detached thread which will wait some time for the > kernel to create the whole sysfs tree fo

Re: [libvirt] [PATCH v4 1/7] nodedev: Introduce udevEventCheckMonitorFD helper function

2017-09-20 Thread John Ferlan
On 09/18/2017 12:34 PM, Erik Skultety wrote: > We need to perform some sanity checks on the udev monitor before every > use so that we know nothing changed in the meantime. The reason for > moving the code to a separate function is to be able to perform the same > check from a worker thread that

[libvirt] [PATCH v3] Avoid a possible NULL pointer dereference in qemuDomainGetTLSObjects

2017-09-20 Thread Ashish Mittal
Passing a NULL value for the argument secAlias to the function qemuDomainGetTLSObjects would cause a segmentation fault in libvirtd. Changed code to not dereference a NULL secAlias. Signed-off-by: Ashish Mittal --- src/qemu/qemu_hotplug.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)

Re: [libvirt] [PATCH] Stop linking tests/commandhelper to libvirt code

2017-09-20 Thread Martin Kletzander
On Wed, Sep 20, 2017 at 12:08:59PM +0100, Daniel P. Berrange wrote: The commandhelper binary is a helper for commandtest that validates what file handles were inherited. For this to work reliably we must not have any libraries that leak file descriptors into commandhelper. Unfortunately some vers

[libvirt] [PATCH v2] iohelper: fix reading with O_DIRECT

2017-09-20 Thread Nikolay Shirokovskiy
saferead is not suitable for direct reads. If file size is not multiple of align size then we get EINVAL on the read(2) that is supposed to return 0 because read buffer will not be aligned at this point. Let's not read again after partial read and check that we read everything by comparing the num

Re: [libvirt] [PATCH v2] Fix libvirtd crash in qemuDomainGetTLSObjects

2017-09-20 Thread Erik Skultety
On Wed, Sep 20, 2017 at 05:02:36AM -0700, Ashish Mittal wrote: > Passing a NULL value for the argument secAlias to the function > qemuDomainGetTLSObjects causes a segmentation fault. > > Thread 3 "libvirtd" received signal SIGSEGV, Segmentation fault. > 0x7f97c9c42a3d in qemuDomainGetTLSObjects

Re: [libvirt] [PATCH v2] Fix libvirtd crash in qemuDomainGetTLSObjects

2017-09-20 Thread Peter Krempa
On Wed, Sep 20, 2017 at 08:14:39 -0400, John Ferlan wrote: > > > On 09/20/2017 08:11 AM, Erik Skultety wrote: > > On Wed, Sep 20, 2017 at 05:02:36AM -0700, Ashish Mittal wrote: > >> Passing a NULL value for the argument secAlias to the function > >> qemuDomainGetTLSObjects causes a segmentation f

Re: [libvirt] [PATCH v2] Fix libvirtd crash in qemuDomainGetTLSObjects

2017-09-20 Thread John Ferlan
On 09/20/2017 08:11 AM, Erik Skultety wrote: > On Wed, Sep 20, 2017 at 05:02:36AM -0700, Ashish Mittal wrote: >> Passing a NULL value for the argument secAlias to the function >> qemuDomainGetTLSObjects causes a segmentation fault. >> >> Thread 3 "libvirtd" received signal SIGSEGV, Segmentation f

Re: [libvirt] [PATCH] util: Fix stack smashing in virNetDevGetFamilyId

2017-09-20 Thread Erik Skultety
On Wed, Sep 20, 2017 at 12:48:01PM +0200, Jiri Denemark wrote: > After commit 8708ca01c0d libvirtd consistently aborts with > "stack smashing detected" when nodedev driver is initialized. > > Apparently this is caused by nlmsg_parse trying to write more than > CTRL_ATTR_MAX bytes in tb because it i

Re: [libvirt] [PATCH] Fix libvirtd crash in qemuDomainGetTLSObjects

2017-09-20 Thread ashish mittal
On Wed, Sep 20, 2017 at 12:52 AM, Erik Skultety wrote: > On Wed, Sep 20, 2017 at 09:03:18AM +0200, Erik Skultety wrote: > > On Tue, Sep 19, 2017 at 09:58:34PM -0700, Ashish Mittal wrote: > > > Passing a NULL value for the argument secAlias to the function > > > qemuDomainGetTLSObjects causes a se

Re: [libvirt] [PATCH] util: Fix stack smashing in virNetDevGetFamilyId

2017-09-20 Thread John Ferlan
On 09/20/2017 06:48 AM, Jiri Denemark wrote: > After commit 8708ca01c0d libvirtd consistently aborts with > "stack smashing detected" when nodedev driver is initialized. > > Apparently this is caused by nlmsg_parse trying to write more than > CTRL_ATTR_MAX bytes in tb because it is told tb can a

[libvirt] [PATCH v2] Fix libvirtd crash in qemuDomainGetTLSObjects

2017-09-20 Thread Ashish Mittal
Passing a NULL value for the argument secAlias to the function qemuDomainGetTLSObjects causes a segmentation fault. Thread 3 "libvirtd" received signal SIGSEGV, Segmentation fault. 0x7f97c9c42a3d in qemuDomainGetTLSObjects (..., secAlias=0x0) at qemu/qemu_hotplug.c:1736 Changed code to not de

Re: [libvirt] [PATCH] Stop linking tests/commandhelper to libvirt code

2017-09-20 Thread Daniel P. Berrange
On Wed, Sep 20, 2017 at 12:08:59PM +0100, Daniel P. Berrange wrote: > The commandhelper binary is a helper for commandtest that > validates what file handles were inherited. For this to > work reliably we must not have any libraries that leak > file descriptors into commandhelper. Unfortunately som

[libvirt] [PATCH] Stop linking tests/commandhelper to libvirt code

2017-09-20 Thread Daniel P. Berrange
The commandhelper binary is a helper for commandtest that validates what file handles were inherited. For this to work reliably we must not have any libraries that leak file descriptors into commandhelper. Unfortunately some versions of gnutls will intentionally open file handles at library load ti

[libvirt] [PATCH] util: Fix stack smashing in virNetDevGetFamilyId

2017-09-20 Thread Jiri Denemark
After commit 8708ca01c0d libvirtd consistently aborts with "stack smashing detected" when nodedev driver is initialized. Apparently this is caused by nlmsg_parse trying to write more than CTRL_ATTR_MAX bytes in tb because it is told tb can accommodate CTRL_CMD_MAX bytes. Signed-off-by: Jiri Denem

Re: [libvirt] [PATCH] Link libvirt_util.la with gnutls

2017-09-20 Thread Daniel P. Berrange
On Wed, Sep 20, 2017 at 11:35:14AM +0200, Martin Kletzander wrote: > On Wed, Sep 20, 2017 at 09:41:24AM +0100, Daniel P. Berrange wrote: > > The util/vircrypto.c file uses gnutls, so we must directly link > > libvirt_util.la with gnutls to avoid errors on OS which do not > > resolve symbols against

Re: [libvirt] [PATCH] storage: Add new events for *PoolBuild() and *PoolDelete().

2017-09-20 Thread Michal Privoznik
On 09/09/2017 05:09 PM, Julio Faracco wrote: > This commit adds new events for two methods and operations: *PoolBuild() and > *PoolDelete(). Using the event-test and the commands set below we have the > following outputs: > > $ sudo ./event-test > Registering event callbacks > myStoragePoolEventCa

Re: [libvirt] [PATCH] Link libvirt_util.la with gnutls

2017-09-20 Thread Martin Kletzander
On Wed, Sep 20, 2017 at 09:41:24AM +0100, Daniel P. Berrange wrote: The util/vircrypto.c file uses gnutls, so we must directly link libvirt_util.la with gnutls to avoid errors on OS which do not resolve symbols against indirectly linked libraries. This fixes a build failure on Ubuntu Trusty CC

Re: [libvirt] [PATCH v2] qemu: handle reconnect on chardev hotplug

2017-09-20 Thread Michal Privoznik
On 09/13/2017 02:33 AM, ZhiPeng Lu wrote: > The patch passes the reconnect timeout to QEMU by monitor on chardev hotplug. > > Signed-off-by: ZhiPeng Lu > --- > v1->v2: > - Fix syntax errors about Curly brackets > --- > src/qemu/qemu_monitor_json.c | 17 + > 1 file changed, 17 in

Re: [libvirt] Questions about function virPCIDeviceIsBehindSwitchLackingACS in virpci.c

2017-09-20 Thread Michal Privoznik
On 09/19/2017 03:24 AM, Wuzongyong (Euler Dept) wrote: > Hi, > > In function virPCIDeviceIsBehindSwitchLackingACS, I noticed that(line 8): > > 1if (virPCIDeviceGetParent(dev, &parent) < 0) > 2return -1; > 3if (!parent) { > 4/* if we have no parent, and this is the root bus

[libvirt] [PATCH] Link libvirt_util.la with gnutls

2017-09-20 Thread Daniel P. Berrange
The util/vircrypto.c file uses gnutls, so we must directly link libvirt_util.la with gnutls to avoid errors on OS which do not resolve symbols against indirectly linked libraries. This fixes a build failure on Ubuntu Trusty CCLD storagevolxml2argvtest /usr/bin/ld: ../src/.libs/libvirt_util.

Re: [libvirt] [PATCH] Fix libvirtd crash in qemuDomainGetTLSObjects

2017-09-20 Thread Erik Skultety
On Wed, Sep 20, 2017 at 09:03:18AM +0200, Erik Skultety wrote: > On Tue, Sep 19, 2017 at 09:58:34PM -0700, Ashish Mittal wrote: > > Passing a NULL value for the argument secAlias to the function > > qemuDomainGetTLSObjects causes a segmentation fault. > > > > Thread 3 "libvirtd" received signal SIG

Re: [libvirt] [PATCH] Fix libvirtd crash in qemuDomainGetTLSObjects

2017-09-20 Thread Erik Skultety
On Tue, Sep 19, 2017 at 09:58:34PM -0700, Ashish Mittal wrote: > Passing a NULL value for the argument secAlias to the function > qemuDomainGetTLSObjects causes a segmentation fault. > > Thread 3 "libvirtd" received signal SIGSEGV, Segmentation fault. > 0x7f97c9c42a3d in qemuDomainGetTLSObjects

Re: [libvirt] [PATCH] apparmor: support finer-grained ptrace checks

2017-09-20 Thread Guido Günther
Hi Jim, On Mon, Sep 18, 2017 at 02:06:13PM -0600, Jim Fehlig wrote: > Kernel 4.13 introduced finer-grained ptrace checks > > https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git/commit/?h=v4.13.2&id=290f458a4f16f9cf6cb6562b249e69fe1c3c3a07 > > When Apparmor is enabled and libvi