[libvirt] [PATCH 10/16] hostdev: Maintain a driver list of active mediated devices

2017-02-06 Thread Erik Skultety
Keep track of the assigned mediated devices the same way we do it for the rest of hostdevs. Signed-off-by: Erik Skultety <eskul...@redhat.com> --- src/libvirt_private.syms | 1 + src/qemu/qemu_hostdev.c | 22 + src/qemu/qemu_hostdev.h | 4 ++ src/util/virhostdev.c

[libvirt] [PATCH 06/16] security: dac: Enable labeling of vfio mediated devices

2017-02-06 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. Signed-off-by: Erik Skultety <eskul...@redhat.com> --- src/security/security_dac.

[libvirt] [PATCH 15/16] test: Add some test cases for our test suite regarding the mdevs

2017-02-06 Thread Erik Skultety
For now, focus only on unmanaged devices, thus also testing whether the uuid element is present or not, since in case of unmanaged mediated devices it must be present. Signed-off-by: Erik Skultety <eskul...@redhat.com> --- ...qemuxml2argv-hostdev-mdev-unmanaged-no-uuid.xm

[libvirt] [PATCH 13/16] qemu: namespace: Hook up the discovery of mdevs into the namespace code

2017-02-06 Thread Erik Skultety
Again, as for all the other hostdev device types, make sure that the /dev/vfio/ device will be added to the qemu namespace. Signed-off-by: Erik Skultety <eskul...@redhat.com> --- src/qemu/qemu_domain.c | 12 1 file changed, 12 insertions(+) diff --git a/src/qemu/qemu_domain.c

[libvirt] [PATCH 12/16] qemu: cgroup: Adjust cgroups' logic to allow mediated devices

2017-02-06 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 <eskul...@redhat.com> --- src/qemu/qemu_cgroup.c | 30 ++ 1 file changed, 30 insertions(+) diff --git a/src/qemu/qemu_cgroup.c b/sr

[libvirt] [PATCH 07/16] security: selinux: Enable labeling of vfio mediated devices

2017-02-06 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. Signed-off-by: Erik Skultety <eskul...@redhat.com> --- src/security/security_selinux.

[libvirt] [PATCH 01/16] util: Introduce new module virmdev

2017-02-06 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 <eskul...@redhat.com> --- po/POTFILES.in | 1 + src/Makefile.am | 1 + src/libvirt_private.syms | 17 +++ sr

[libvirt] [PATCH 03/16] docs: Update RNG schema to reflect the new hostdev type mdev

2017-02-06 Thread Erik Skultety
element, but only if managed='yes' which is not implemented yet. Signed-off-by: Erik Skultety <eskul...@redhat.com> --- docs/schemas/domaincommon.rng | 17 + 1 file changed, 17 insertions(+) diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index c

[libvirt] [PATCH 11/16] hostdev: Introduce a reattach method for mediated devices

2017-02-06 Thread Erik Skultety
tion stays the same except that in case of mdevs the operation itself is effectively a NO-OP. Signed-off-by: Erik Skultety <eskul...@redhat.com> --- src/libvirt_private.syms | 1 + src/qemu/qemu_hostdev.c | 15 ++ src/qemu/qemu_hostdev.h | 4 src/util/virh

[libvirt] [PATCH 09/16] qemu: Assign PCI addresses for mediated devices as well

2017-02-06 Thread Erik Skultety
of address. Signed-off-by: Erik Skultety <eskul...@redhat.com> --- src/qemu/qemu_domain_address.c | 12 +--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/qemu/qemu_domain_address.c b/src/qemu/qemu_domain_address.c index 70482f2..71a2e5c 100644 --- a/sr

[libvirt] [PATCH 0/3] storage: Fix FS pool destroy not unmounting its source

2017-02-07 Thread Erik Skultety
that the pool's source is already mounted. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1417203 Erik Skultety (3): storage: Fix reporting an error on an already mounted filesystem util: Introduce virFileComparePaths storage: Fix checking whether source filesystem is mounted src

[libvirt] [PATCH 1/3] storage: Fix reporting an error on an already mounted filesystem

2017-02-07 Thread Erik Skultety
When FS pool's source is already mounted on the target location instead of just simply marking the pool as active, thus starting it we fail with an error stating that the source is indeed already mounted on the target. Signed-off-by: Erik Skultety <eskul...@redhat.com> --- src/s

[libvirt] [PATCH 2/3] util: Introduce virFileComparePaths

2017-02-07 Thread Erik Skultety
and canonicalizing the path and only then compare the 2 paths. Signed-off-by: Erik Skultety <eskul...@redhat.com> --- src/libvirt_private.syms | 1 + src/util/virfile.c | 45 + src/util/virfile.h | 2 ++ 3 files changed, 48 insertions(+) diff

[libvirt] [PATCH 3/3] storage: Fix checking whether source filesystem is mounted

2017-02-07 Thread Erik Skultety
/target, so in order to successfully compare these two replace plain string comparison with virFileComparePaths which will resolve all symlinks and canonicalize the paths prior to comparison. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1417203 Signed-off-by: Erik Skultety <eskul...@redhat.

Re: [libvirt] [RFC PATCH 00/16] Introduce vGPU mdev framework to libvirt

2017-02-07 Thread Erik Skultety
On Mon, Feb 06, 2017 at 09:33:14AM -0700, Alex Williamson wrote: > On Mon, 6 Feb 2017 13:19:42 +0100 > Erik Skultety <eskul...@redhat.com> wrote: > > > Finally. It's here. This is the initial suggestion on how libvirt might > > interract with the mdev framewor

Re: [libvirt] [RFC PATCH 00/16] Introduce vGPU mdev framework to libvirt

2017-02-07 Thread Erik Skultety
On Mon, Feb 06, 2017 at 04:44:37PM +, Daniel P. Berrange wrote: > On Mon, Feb 06, 2017 at 01:19:42PM +0100, Erik Skultety wrote: > > Finally. It's here. This is the initial suggestion on how libvirt might > > interract with the mdev framework, currently only focussing on the

Re: [libvirt] [PATCH] qemuBuildChrChardevStr: Don't leak @charAlias

2017-01-30 Thread Erik Skultety
On Mon, Jan 30, 2017 at 10:28:53AM +0100, Michal Privoznik wrote: > ==12618== 110 bytes in 10 blocks are definitely lost in loss record 269 of 295 > ==12618==at 0x4C2AE5F: malloc (vg_replace_malloc.c:297) > ==12618==by 0x1CFC6DD7: vasprintf (vasprintf.c:73) > ==12618==by 0x1912B2FC:

Re: [libvirt] [RFC PATCH v2 REBASE 17/18] docs: Document the new hostdev and address type 'mdev'

2017-02-22 Thread Erik Skultety
On Wed, Feb 22, 2017 at 08:20:06PM +0530, Kirti Wankhede wrote: > > > On 2/20/2017 7:58 PM, Erik Skultety wrote: > > Signed-off-by: Erik Skultety <eskul...@redhat.com> > > --- > > docs/formatdomain.html.in | 48 > >

[libvirt] [RFC PATCH v2 REBASE 11/18] hostdev: Maintain a driver list of active mediated devices

2017-02-20 Thread Erik Skultety
Keep track of the assigned mediated devices the same way we do it for the rest of hostdevs. Signed-off-by: Erik Skultety <eskul...@redhat.com> --- src/libvirt_private.syms | 1 + src/qemu/qemu_hostdev.c | 22 ++ src/qemu/qemu_hostdev.h | 4 ++ src/util/virhostdev.c

[libvirt] [RFC PATCH v2 REBASE 18/18] news: Update the NEWS.xml about the new mdev feature

2017-02-20 Thread Erik Skultety
Signed-off-by: Erik Skultety <eskul...@redhat.com> --- docs/news.xml | 9 + 1 file changed, 9 insertions(+) diff --git a/docs/news.xml b/docs/news.xml index 8d53e07..5523f29 100644 --- a/docs/news.xml +++ b/docs/news.xml @@ -62,6 +62,15 @@ strong encryption and doesn't r

[libvirt] [RFC PATCH v2 REBASE 01/18] util: Introduce new module virmdev

2017-02-20 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 <eskul...@redhat.com> --- po/POTFILES.in | 1 + src/Makefile.am | 1 + src/libvirt_private.syms | 18 +++ sr

[libvirt] [RFC PATCH v2 REBASE 03/18] conf: Introduce new address type mdev

2017-02-20 Thread Erik Skultety
other devices that can make use of the address element. Signed-off-by: Erik Skultety <eskul...@redhat.com> --- src/conf/device_conf.h | 1 + src/conf/domain_conf.c | 11 +-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/conf/device_conf.h b/src/conf/device_

[libvirt] [RFC PATCH v2 REBASE 10/18] qemu: Assign PCI addresses for mediated devices as well

2017-02-20 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 <es

[libvirt] [RFC PATCH v2 REBASE 17/18] docs: Document the new hostdev and address type 'mdev'

2017-02-20 Thread Erik Skultety
Signed-off-by: Erik Skultety <eskul...@redhat.com> --- docs/formatdomain.html.in | 48 +++ 1 file changed, 44 insertions(+), 4 deletions(-) diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index b69bd4c..13cb767 100644 ---

[libvirt] [RFC PATCH v2 REBASE 05/18] conf: Introduce virDomainHostdevDefPostParse

2017-02-20 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 <eskul...@redhat.com> --- src/conf/domain_conf.c | 76 +++--- 1 file changed, 48 inse

[libvirt] [RFC PATCH v2 REBASE 09/18] conf: Enable cold-plug of a mediated device

2017-02-20 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 <eskul...@redhat.com> --- src/conf/domain_conf.c | 14 ++ 1 file c

[libvirt] [RFC PATCH v2 REBASE 16/18] test: Add some test cases for our test suite regarding the mdevs

2017-02-20 Thread Erik Skultety
For now, these only cover the unmanaged, i.e. user pre-created devices. Signed-off-by: Erik Skultety <eskul...@redhat.com> --- .../qemuxml2argv-hostdev-mdev-unmanaged.args | 25 ++ .../qemuxml2argv-hostdev-mdev-unmanaged.xml| 37

[libvirt] [RFC PATCH v2 REBASE 12/18] hostdev: Introduce a reattach method for mediated devices

2017-02-20 Thread Erik Skultety
tion stays the same except that in case of mdevs the operation itself is effectively a NO-OP. Signed-off-by: Erik Skultety <eskul...@redhat.com> --- src/libvirt_private.syms | 1 + src/qemu/qemu_hostdev.c | 15 ++ src/qemu/qemu_hostdev.h | 4 src/util/virh

[libvirt] [RFC PATCH v2 REBASE 15/18] qemu: Format mdevs on qemu command line

2017-02-20 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 <eskul...@redhat.com> --- src/qemu/qemu_command.c | 49 + src/qemu/qemu_command.h | 5 + 2 files c

[libvirt] [RFC PATCH v2 REBASE 02/18] conf: Introduce new hostdev device type mdev

2017-02-20 Thread Erik Skultety
A mediated device will be identified by a UUID 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 devices should be enabled. Signed-off-by: Erik Skultety <eskul...@redhat.com> --

[libvirt] [RFC PATCH v2 REBASE 13/18] qemu: cgroup: Adjust cgroups' logic to allow mediated devices

2017-02-20 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 <eskul...@redhat.com> --- src/qemu/qemu_domain.c | 13 + 1 file changed, 13 insertions(+) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c

[libvirt] [RFC PATCH v2 REBASE 08/18] security: selinux: Enable labeling of vfio mediated devices

2017-02-20 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. Signed-off-by: Erik Skultety <eskul...@redhat.com> --- src/security/security_selinux.

[libvirt] [RFC PATCH v2 REBASE 06/18] conf: Add post parse code for mdevs to virDomainHostdevDefPostParse

2017-02-20 Thread Erik Skultety
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. Signed-off-by: Erik Skultety <eskul...@redhat.com> --- sr

[libvirt] [RFC PATCH v2 REBASE 07/18] security: dac: Enable labeling of vfio mediated devices

2017-02-20 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. Signed-off-by: Erik Skultety <eskul...@redhat.com> --- src/security/security_dac.

[libvirt] [RFC PATCH v2 REBASE 00/18] Introduce vGPU mdev framework to libvirt

2017-02-20 Thread Erik Skultety
-February/msg00739.html Erik Skultety (18): util: Introduce new module virmdev conf: Introduce new hostdev device type mdev conf: Introduce new address type mdev conf: Update XML parser, formatter, and RNG schema to support mdev conf: Introduce virDomainHostdevDefPostParse conf: Add post

[libvirt] [RFC PATCH v2 REBASE 04/18] conf: Update XML parser, formatter, and RNG schema to support mdev

2017-02-20 Thread Erik Skultety
. vfio-pci) through the 'model' attribute. Signed-off-by: Erik Skultety <eskul...@redhat.com> --- docs/schemas/domaincommon.rng | 26 ++ src/conf/domain_conf.c| 50 +++ 2 files changed, 76 insertions(+) diff --git a/docs/s

[libvirt] [RFC PATCH v2 REBASE 14/18] qemu: Bump the memory locking limit for mdevs as well

2017-02-20 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 <eskul...@redhat.com> --- src/qemu/qemu_domain.c | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git

Re: [libvirt] [PATCH] libvirt-override: fix flags mutually exclusize

2017-02-17 Thread Erik Skultety
On Fri, Feb 17, 2017 at 07:19:25PM +0800, Jie Wang wrote: Just a nit that we tend to prefix the patch with [libvirt-python] instead of just [libvirt] so it's absolutely clear which repository you're sending the patch against and in this case it's a python bindings fix. > As

Re: [libvirt] [PATCH] libvirt-override: fix flags mutually exclusize

2017-02-17 Thread Erik Skultety
On Fri, Feb 17, 2017 at 02:26:21PM +, Daniel P. Berrange wrote: > On Fri, Feb 17, 2017 at 03:22:12PM +0100, Erik Skultety wrote: > > On Fri, Feb 17, 2017 at 07:19:25PM +0800, Jie Wang wrote: > > > > Just a nit that we tend to prefix the patch with [libvirt-python] instead

[libvirt] [PATCH] virfile: Fix virFileExists commentary

2017-02-24 Thread Erik Skultety
Arguably though, function returning only on success is a very interesting, although quite impractical concept. Also, the errno isn't and shouldn't be preserved in this case, since the errno can be directly fed to the virReportSystemError. Signed-off-by: Erik Skultety <eskul...@redhat.

Re: [libvirt] [PATCH] news: add entries for recent nodedev driver improvements

2017-02-20 Thread Erik Skultety
On Fri, Feb 17, 2017 at 04:53:37PM +0100, Michal Privoznik wrote: > Signed-off-by: Michal Privoznik > --- > docs/news.xml | 17 + > 1 file changed, 17 insertions(+) > > diff --git a/docs/news.xml b/docs/news.xml > index 54337f782..8d53e0797 100644 > ---

Re: [libvirt] Introduce vGPU mdev framework to libvirt

2017-02-15 Thread Erik Skultety
: > > > >On Tue, 7 Feb 2017 17:26:51 +0100 > > > >Erik Skultety <eskul...@redhat.com> wrote: > > > > > > > >> On Mon, Feb 06, 2017 at 09:33:14AM -0700, Alex Williamson wrote: > > > >> > On Mon, 6 Feb 2017

Re: [libvirt] [PATCH] docs: document bhyve e1000 support

2017-02-13 Thread Erik Skultety
On Sun, Feb 12, 2017 at 08:44:59PM +0400, Roman Bogorodskiy wrote: > Roman Bogorodskiy wrote: > > > * Add bhyve e1000 support entry to release nodes > ^ > Oops, should be 'notes'. > > > * Update the bhyve driver page with usage sample > > ---

Re: [libvirt] [PATCH 2/3] util: Introduce virFileComparePaths

2017-02-10 Thread Erik Skultety
> > + * Returns 0 if the paths are equal, 1 if they're not or -1 in case of an > > + * error. > > + */ > > +int > > +virFileComparePaths(const char *p1, const char *p2) > > I think this be "virFileCompareResolvedPaths" - change all the places... > Better representation than just ComparePaths >

Re: [libvirt] [PATCH 3/3] storage: Fix checking whether source filesystem is mounted

2017-02-10 Thread Erik Skultety
On Thu, Feb 09, 2017 at 06:05:41PM -0500, John Ferlan wrote: > > > On 02/07/2017 09:16 AM, Erik Skultety wrote: > > Right now, we use simple string comparison both on the source paths > > (mount's output vs pool's source) and the target (mount's mnt_dir vs > >

Re: [libvirt] [PATCH] news: add entries for libxl driver improvements and bug fixes

2017-02-16 Thread Erik Skultety
On Wed, Feb 15, 2017 at 09:31:57PM -0700, Jim Fehlig wrote: > Signed-off-by: Jim Fehlig > --- > > Since news changes are not candidates for backport I assume it is fine > to include recent libxl improvements and bug fixes in a single commit. > I can break this up if that

Re: [libvirt] [PATCH] Revert "news: fix spelling of tunneled"

2017-02-16 Thread Erik Skultety
On Wed, Feb 15, 2017 at 07:53:40PM -0700, Jim Fehlig wrote: > Use of 'tunnelled' is over 100x that of 'tunneled' throughout the > code. Also, the commit providing this news item used 'tunnelled'. > I don't think it matters at all, both should be grammatically correct, it's just a matter of

[libvirt] [RFC PATCH v2 14.5/18] qemu: Bump the memory locking limit for mdevs as well

2017-02-16 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 <eskul...@redhat.com> --- src/qemu/qemu_domain.c | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git

[libvirt] [RFC PATCH v2 03/18] conf: Introduce new address type mdev

2017-02-15 Thread Erik Skultety
other devices that can make use of the address element. Signed-off-by: Erik Skultety <eskul...@redhat.com> --- src/conf/device_conf.h | 1 + src/conf/domain_conf.c | 11 +-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/conf/device_conf.h b/src/conf/device_

[libvirt] [RFC PATCH v2 05/18] conf: Introduce virDomainHostdevDefPostParse

2017-02-15 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 <eskul...@redhat.com> --- src/conf/domain_conf.c | 76 +++--- 1 file changed, 48 inse

[libvirt] [RFC PATCH v2 09/18] conf: Enable cold-plug of a mediated device

2017-02-15 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 <eskul...@redhat.com> --- src/conf/domain_conf.c | 14 ++ 1 file c

[libvirt] [RFC PATCH v2 13/18] qemu: cgroup: Adjust cgroups' logic to allow mediated devices

2017-02-15 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 <eskul...@redhat.com> --- src/qemu/qemu_cgroup.c | 29 + 1 file changed, 29 insertions(+) diff --git a/src/qemu/qemu_cgroup.c b/sr

[libvirt] [RFC PATCH v2 11/18] hostdev: Maintain a driver list of active mediated devices

2017-02-15 Thread Erik Skultety
Keep track of the assigned mediated devices the same way we do it for the rest of hostdevs. Signed-off-by: Erik Skultety <eskul...@redhat.com> --- src/libvirt_private.syms | 1 + src/qemu/qemu_hostdev.c | 22 ++ src/qemu/qemu_hostdev.h | 4 ++ src/util/virhostdev.c

[libvirt] [RFC PATCH v2 18/18] news: Update the NEWS.xml about the new mdev feature

2017-02-15 Thread Erik Skultety
Signed-off-by: Erik Skultety <eskul...@redhat.com> --- docs/news.xml | 11 +++ 1 file changed, 11 insertions(+) diff --git a/docs/news.xml b/docs/news.xml index b756a97..55fa5ed 100644 --- a/docs/news.xml +++ b/docs/news.xml @@ -53,6 +53,17 @@ was virt

[libvirt] [RFC PATCH v2 01/18] util: Introduce new module virmdev

2017-02-15 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 <eskul...@redhat.com> --- po/POTFILES.in | 1 + src/Makefile.am | 1 + src/libvirt_private.syms | 18 +++ sr

[libvirt] [RFC PATCH v2 10/18] qemu: Assign PCI addresses for mediated devices as well

2017-02-15 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 <es

[libvirt] [RFC PATCH v2 08/18] security: selinux: Enable labeling of vfio mediated devices

2017-02-15 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. Signed-off-by: Erik Skultety <eskul...@redhat.com> --- src/security/security_selinux.

[libvirt] [RFC PATCH v2 02/18] conf: Introduce new hostdev device type mdev

2017-02-15 Thread Erik Skultety
A mediated device will be identified by a UUID 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 devices should be enabled. Signed-off-by: Erik Skultety <eskul...@redhat.com> --

[libvirt] [RFC PATCH v2 15/18] qemu: Format mdevs on the qemu command line

2017-02-15 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 <eskul...@redhat.com> --- src/qemu/qemu_command.c | 49 + src/qemu/qemu_command.h | 5 + 2 files c

[libvirt] [RFC PATCH v2 12/18] hostdev: Introduce a reattach method for mediated devices

2017-02-15 Thread Erik Skultety
tion stays the same except that in case of mdevs the operation itself is effectively a NO-OP. Signed-off-by: Erik Skultety <eskul...@redhat.com> --- src/libvirt_private.syms | 1 + src/qemu/qemu_hostdev.c | 15 ++ src/qemu/qemu_hostdev.h | 4 src/util/virh

[libvirt] [RFC PATCH v2 04/18] conf: Update XML parser, formatter, and RNG schema to support mdev

2017-02-15 Thread Erik Skultety
. vfio-pci) through the 'model' attribute. Signed-off-by: Erik Skultety <eskul...@redhat.com> --- docs/schemas/domaincommon.rng | 26 ++ src/conf/domain_conf.c| 50 +++ 2 files changed, 76 insertions(+) diff --git a/docs/s

[libvirt] [RFC PATCH v2 00/18] Introduce vGPU mdev framework to libvirt

2017-02-15 Thread Erik Skultety
ather than using plain element, since the address element is more conveniently extendable. - the emulated mtty driver now works as well out of the box, so no HW needed to review this series --> let's try it :) - fixed all the nits from v1 Erik Skultety (18): util: Introduce new module v

[libvirt] [RFC PATCH v2 07/18] security: dac: Enable labeling of vfio mediated devices

2017-02-15 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. Signed-off-by: Erik Skultety <eskul...@redhat.com> --- src/security/security_dac.

[libvirt] [RFC PATCH v2 17/18] docs: Document the new hostdev and address type 'mdev'

2017-02-15 Thread Erik Skultety
Signed-off-by: Erik Skultety <eskul...@redhat.com> --- docs/formatdomain.html.in | 48 +++ 1 file changed, 44 insertions(+), 4 deletions(-) diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index 0a115f5..8f21436 100644 ---

[libvirt] [RFC PATCH v2 14/18] qemu: namespace: Hook up the discovery of mdevs into the namespace code

2017-02-15 Thread Erik Skultety
Again, as for all the other hostdev device types, make sure that the /dev/vfio/ device will be added to the qemu namespace. Signed-off-by: Erik Skultety <eskul...@redhat.com> --- src/qemu/qemu_domain.c | 11 +++ 1 file changed, 11 insertions(+) diff --git a/src/qemu/qemu_domain.c

[libvirt] [RFC PATCH v2 06/18] conf: Add post parse code for mdevs to virDomainHostdevDefPostParse

2017-02-15 Thread Erik Skultety
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. Signed-off-by: Erik Skultety <eskul...@redhat.com> --- sr

[libvirt] [RFC PATCH v2 16/18] test: Add some test cases for our test suite regarding the mdevs

2017-02-15 Thread Erik Skultety
For now, these only cover the unmanaged, i.e. user pre-created devices. Signed-off-by: Erik Skultety <eskul...@redhat.com> --- .../qemuxml2argv-hostdev-mdev-unmanaged.args | 25 ++ .../qemuxml2argv-hostdev-mdev-unmanaged.xml| 37

Re: [libvirt] [RFC PATCH v2 14.5/18] qemu: Bump the memory locking limit for mdevs as well

2017-02-16 Thread Erik Skultety
> > Nice! For series: > > > > Tested-by: Alex Williamson > > > > (with KVMGT vGPU mdev) > Thank you very much for the effort Alex. Given its current state, I'm glad KVMGT was testable with my patches :). > Nit, if I configure a VM for an invalid mdev uuid, I get

Re: [libvirt] [PATCH] cputest: Fix name of the file removed by cpu-parse.sh

2017-02-17 Thread Erik Skultety
On Thu, Feb 16, 2017 at 02:46:04PM +0100, Jiri Denemark wrote: > We want to remove the file created by > > json <<<"$data" >$fname.json > > in case it was empty. > > Signed-off-by: Jiri Denemark > --- > tests/cputestdata/cpu-parse.sh | 2 +- > 1 file changed, 1

Re: [libvirt] [PATCH 1/2] security: DAC: fix the transaction model's list append

2017-01-17 Thread Erik Skultety
> > -if (VIR_APPEND_ELEMENT(list->items, list->nItems, item) < 0) { > > -VIR_FREE(item); > > -return -1; > > -} > > +if (VIR_APPEND_ELEMENT(list->items, list->nItems, item) < 0) > > +goto cleanup; > > > > -return 0; > > +tmp = NULL; > > +item =

[libvirt] [PATCH 2/2] security: SELinux: fix the transaction model's list append

2017-01-17 Thread Erik Skultety
-by: Erik Skultety <eskul...@redhat.com> --- src/security/security_selinux.c | 30 +- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/src/security/security_selinux.c b/src/security/security_selinux.c index f229b51..c799056 100644 --- a/src/se

[libvirt] [PATCH 1/2] security: DAC: fix the transaction model's list append

2017-01-17 Thread Erik Skultety
-by: Erik Skultety <eskul...@redhat.com> --- src/security/security_dac.c | 30 +- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/src/security/security_dac.c b/src/security/security_dac.c index d457e6a..d7a2de4 100644 --- a/src/security/security_dac.c

[libvirt] [PATCH 0/2] security: Fix the transaction model's list appending

2017-01-17 Thread Erik Skultety
The problem lies in how elements are appended into the transaction list - instead of making a deep copy of a string we were doing a shallow copy only. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1413773 Erik Skultety (2): security: DAC: fix the transaction model's list append

Re: [libvirt] [PATCH 2/2] security: SELinux: fix the transaction model's list append

2017-01-17 Thread Erik Skultety
> > @@ -111,21 +111,31 @@ > > virSecuritySELinuxContextListAppend(virSecuritySELinuxContextListPtr list, > > const char *tcon, > > bool optional) > > { > > -virSecuritySELinuxContextItemPtr item; > > +int ret = -1;

Re: [libvirt] [RFC PATCH v2 REBASE 00/18] Introduce vGPU mdev framework to libvirt

2017-02-27 Thread Erik Skultety
On Fri, Feb 24, 2017 at 11:10:00AM -0700, Alex Williamson wrote: > On Mon, 20 Feb 2017 15:28:13 +0100 > Erik Skultety <eskul...@redhat.com> wrote: > > > since the original v2 [1]: > > - resolved a few merge conflicts caused by @9d92f533 which refactored out > &

Re: [libvirt] docs: Document the new hostdev and address type 'mdev'

2017-02-27 Thread Erik Skultety
On Mon, Feb 27, 2017 at 09:33:51AM +0100, Martin Polednik wrote: > On 20/02/17 15:28 +0100, Erik Skultety wrote: > > Signed-off-by: Erik Skultety <eskul...@redhat.com> > > --- > > docs/formatdomain.html.in | 48 > > +++

[libvirt] virt-admin commands aliases

2016-09-05 Thread Erik Skultety
Hi there, after my presentation at KVM Forum, it was pointed out from the audience that we might think about doing something about the naming of the virt-admin's comands, since there is some sort of inconsistency: srv- vs. client- vs. dmn- (not merged yet). When I sent patches to upstream I

Re: [libvirt] virt-admin commands aliases

2016-09-06 Thread Erik Skultety
On 05/09/16 19:48, Daniel P. Berrange wrote: > On Mon, Sep 05, 2016 at 05:37:07PM +0200, Erik Skultety wrote: >> Hi there, >> >> after my presentation at KVM Forum, it was pointed out from the audience >> that we might think about doing something about the naming of

Re: [libvirt] [PATCH] virsh: Fix *-event error string

2016-09-06 Thread Erik Skultety
On 06/09/16 13:17, Christophe Fergeau wrote: > When using > virsh net-event non-existing-net > the error message says that 'either --list or event type is required' > This is misleading as 'virsh net-event $valid-event-type' is not going > to work either. What is expected is 'virsh net-event

Re: [libvirt] virt-admin commands aliases

2016-09-06 Thread Erik Skultety
On 06/09/16 11:52, Martin Kletzander wrote: > On Tue, Sep 06, 2016 at 09:02:19AM +0200, Erik Skultety wrote: >> On 05/09/16 19:48, Daniel P. Berrange wrote: >>> On Mon, Sep 05, 2016 at 05:37:07PM +0200, Erik Skultety wrote: >>>> Hi there, >>>&g

[libvirt] [PATCH] virt-admin: Document srv-list command in virt-admin's man page

2016-09-07 Thread Erik Skultety
srv-list command was missing in the man page. Signed-off-by: Erik Skultety <eskul...@redhat.com> --- tools/virt-admin.pod | 14 ++ 1 file changed, 14 insertions(+) diff --git a/tools/virt-admin.pod b/tools/virt-admin.pod index 2199038..c74707a 100644 --- a/tools/virt-admin.pod

[libvirt] [PATCH] virt-admin: Output srv-clients-set data as unsigned int rather than signed

2016-09-07 Thread Erik Skultety
-by: Erik Skultety <eskul...@redhat.com> --- Pushed under trivial rule. Erik tools/virt-admin.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/virt-admin.c b/tools/virt-admin.c index 513054b..12ec057 100644 --- a/tools/virt-admin.c +++ b/tools/virt-admin.c @@ -857,7

[libvirt] [PATCH] virt-admin: Fix some English grammar in the manpage

2016-09-08 Thread Erik Skultety
Signed-off-by: Erik Skultety <eskul...@redhat.com> --- tools/virt-admin.pod | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) Pushed as trivial. diff --git a/tools/virt-admin.pod b/tools/virt-admin.pod index 0195001..020eb51 100644 --- a/tools/virt-admin.pod +++ b/tools/virt-adm

Re: [libvirt] [PATCH] virt-admin: Document srv-list command in virt-admin's man page

2016-09-08 Thread Erik Skultety
On 08/09/16 10:27, Andrea Bolognani wrote: > On Wed, 2016-09-07 at 13:43 +0200, Erik Skultety wrote: >> srv-list command was missing in the man page. >> >> Signed-off-by: Erik Skultety <eskul...@redhat.com> >> --- >> tools/virt-admin.pod | 14 ++

[libvirt] [PATCH 4/4] virt-admin: Replace the (now) aliases with new command names in the man page

2016-09-12 Thread Erik Skultety
Since the old command names are being shadowed by the new ones in the code as well as in the help messages, update the man page accordingly. Signed-off-by: Erik Skultety <eskul...@redhat.com> --- tools/virt-admin.pod | 30 +++--- 1 file changed, 15 insertions(

[libvirt] [PATCH 0/4] Introduce aliases for virt-admin's srv-* commands

2016-09-12 Thread Erik Skultety
an alias for a different command, while linking the alias with the original command's data by using new element '.alias'. [1] https://www.redhat.com/archives/libvir-list/2016-September/msg00129.html Erik Skultety (4): tests: fix incorrect status handling by virsh-self-test virt-admin: Tweak

[libvirt] [PATCH 3/4] virt-admin: Add some command aliases to provide syntax sugar over ugly commands

2016-09-12 Thread Erik Skultety
Make use of the new recently introduced alias handling for virt-admin srv-* commands. Signed-off-by: Erik Skultety <eskul...@redhat.com> --- tools/virt-admin.c | 24 1 file changed, 24 insertions(+) diff --git a/tools/virt-admin.c b/tools/virt-admin.c index 1

[libvirt] [PATCH 1/4] tests: fix incorrect status handling by virsh-self-test

2016-09-12 Thread Erik Skultety
and test then appears as successful which it most certainly wasn't. Therefore, flip the logic to compare against 0 instead and every other result will be treated as a failed test case. Signed-off-by: Erik Skultety <eskul...@redhat.com> --- tests/virsh-self-test | 2 +- 1 file changed, 1 ins

[libvirt] [PATCH 2/4] virt-admin: Tweak command parsing logic so that aliases point to new commands

2016-09-12 Thread Erik Skultety
format. Signed-off-by: Erik Skultety <eskul...@redhat.com> --- tools/virsh-nodedev.c | 6 ++ tools/virsh.c | 3 ++- tools/vsh.c | 6 ++ tools/vsh.h | 1 + 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/tools/virsh-nodedev.c b/tools/virsh-nod

[libvirt] [PATCH v2 2/3] virt-admin: Add some command aliases to provide syntax sugar over ugly commands

2016-09-13 Thread Erik Skultety
Make use of the new recently introduced alias handling for virt-admin srv-* commands. Signed-off-by: Erik Skultety <eskul...@redhat.com> --- tools/virt-admin.c | 24 1 file changed, 24 insertions(+) diff --git a/tools/virt-admin.c b/tools/virt-admin.c index 1

[libvirt] [PATCH v2 1/3] virt-admin: Tweak command parsing logic so that aliases point to new commands

2016-09-13 Thread Erik Skultety
structure. Signed-off-by: Erik Skultety <eskul...@redhat.com> --- tools/virsh-nodedev.c | 6 ++ tools/virsh.c | 10 ++ tools/virsh.pod | 2 -- tools/vsh.c | 6 ++ tools/vsh.h | 1 + 5 files changed, 15 insertions(+), 10 deletions(-) diff

[libvirt] [PATCH v2 0/3] Introduce aliases for virt-admin's srv-* commands

2016-09-13 Thread Erik Skultety
) - patches 2-3 remained untouched Erik Skultety (3): virt-admin: Tweak command parsing logic so that aliases point to new commands virt-admin: Add some command aliases to provide syntax sugar over ugly commands virt-admin: Replace the (now) aliases with new command names

[libvirt] [PATCH v2 3/3] virt-admin: Replace the (now) aliases with new command names in the man page

2016-09-13 Thread Erik Skultety
Since the old command names are being shadowed by the new ones in the code as well as in the help messages, update the man page accordingly. Signed-off-by: Erik Skultety <eskul...@redhat.com> --- tools/virt-admin.pod | 30 +++--- 1 file changed, 15 insertions(

Re: [libvirt] [PATCH 2/2] tests: Self test virt-admin

2016-09-14 Thread Erik Skultety
On 14/09/16 12:50, Michal Privoznik wrote: > On 14.09.2016 12:39, Erik Skultety wrote: >> On 14/09/16 10:17, Michal Privoznik wrote: >>> Just like we are running 'virsh self-test' from within our test >>> suite, we should run 'virt-admin self-test' too. >>>

Re: [libvirt] [PATCH 2/2] tests: Self test virt-admin

2016-09-14 Thread Erik Skultety
On 14/09/16 10:17, Michal Privoznik wrote: > Just like we are running 'virsh self-test' from within our test > suite, we should run 'virt-admin self-test' too. > > Signed-off-by: Michal Privoznik > --- > .gitignore | 1 + > tests/Makefile.am | 1 +

Re: [libvirt] [PATCH 1/2] virsh: Move cmdSelfTest to vsh

2016-09-14 Thread Erik Skultety
On 14/09/16 10:17, Michal Privoznik wrote: > This command should be exposed to other shells of ours. > They are gonna need it as soon as we want to test them too. > > Signed-off-by: Michal Privoznik > --- > tools/virsh.c | 45 + >

Re: [libvirt] [PATCH v2 0/3] Introduce aliases for virt-admin's srv-* commands

2016-09-14 Thread Erik Skultety
On 13/09/16 17:11, Erik Skultety wrote: > the original version: > https://www.redhat.com/archives/libvir-list/2016-September/msg00312.html > > since v1: > - tweaked the virsh-self-test so that it also checks the aliased commands > instead of skipping them (since there

Re: [libvirt] [PATCH 2/4] virt-admin: Tweak command parsing logic so that aliases point to new commands

2016-09-13 Thread Erik Skultety
On 13/09/16 14:30, Michal Privoznik wrote: > On 12.09.2016 10:20, Erik Skultety wrote: >> Change the logic in a way, so that VSH_CMD_FLAG_ALIAS behaves similarly to >> how VSH_OT_ALIAS for command options, i.e. there is no need for code >> duplication >> for the al

[libvirt] [PATCH v3 6/8] virt-admin: Tweak command parsing logic so that aliases point to new commands

2016-09-16 Thread Erik Skultety
format. Also, since this patch introduces a new command structure element, adjust the virsh-self-test test to make sure we won't ever miss to specify the '.alias' member for an aliased command because doing that would lead to an internal error. Signed-off-by: Erik Skultety <eskul...@redhat.

[libvirt] [PATCH v3 2/8] vsh: vshCmddefHelp: Drop the unnecessary 'else' branch

2016-09-16 Thread Erik Skultety
-by: Erik Skultety <eskul...@redhat.com> --- tools/vsh.c | 222 ++-- 1 file changed, 111 insertions(+), 111 deletions(-) diff --git a/tools/vsh.c b/tools/vsh.c index 3772d92..4c63bd3 100644 --- a/tools/vsh.c +++ b/tools/vsh.c @@ -624,131 +6

<    3   4   5   6   7   8   9   10   11   12   >