[libvirt] [PATCH] Add support L2 table cache for qcow2 disk

2018-06-28 Thread dujiancheng
The patch add support L2 table cache for qcow2 disk. L2 table cache can improve IO read and write performance for qcow2 img. Example: random 4K read requests on a fully populated 100GB image (SSD backend and vm with directsync cacha mode), IOPS increased by 7 times. ---

Re: [libvirt] [PATCH v1 11/11] qemu: command: Enable formatting vfio-pci.display option onto cmdline

2018-06-28 Thread John Ferlan
On 06/27/2018 09:34 AM, Erik Skultety wrote: Kinda sparse for what I assume is a new "feature" (and I won't comment about you're missing a news.xml change :-P) > Signed-off-by: Erik Skultety > --- > src/qemu/qemu_command.c| 23 +++- >

Re: [libvirt] [PATCH v1 10/11] conf: Introduce new attribute 'display'

2018-06-28 Thread John Ferlan
On 06/27/2018 09:34 AM, Erik Skultety wrote: > QEMU 2.12 introduced a new type of display for mediated devices using > vfio-pci backend which allows a mediated device to be used as a VGA > compatible device as an alternative to an emulated video device. QEMU > exposes this feature via a vfio

Re: [libvirt] [PATCH v1 09/11] qemu: caps: Add vfio-pci.display capability

2018-06-28 Thread John Ferlan
On 06/27/2018 09:34 AM, Erik Skultety wrote: > QEMU 2.12 introduced a new vfio-pci device option 'display=on/off/auto'. > Initially, libvirt is only going to support values on/off only, as we > don't want to predict what the intended usage of the mediated device > will be and most importantly,

Re: [libvirt] [PATCH v1 08/11] conf: Introduce new attribute 'native' for SPICE

2018-06-28 Thread John Ferlan
On 06/27/2018 09:34 AM, Erik Skultety wrote: > Since QEMU 2.10, there's a new cmdline option '-display egl-headless' > which enables OpenGL support for cases where we can't render on a local > display (i.e. is set to either 'address' or 'network'). > This is to work around the current

Re: [libvirt] [PATCH v1 07/11] conf: Allow usage of the element with VNC graphics

2018-06-28 Thread John Ferlan
On 06/27/2018 09:34 AM, Erik Skultety wrote: > VNC doesn't support OpenGL natively, but can run with non-native > egl-headless support, so enable that. > > Signed-off-by: Erik Skultety > --- > docs/formatdomain.html.in | 6 > docs/schemas/domaincommon.rng

Re: [libvirt] [PATCH v1 06/11] conf: Make graphics's GL a standalone structure

2018-06-28 Thread John Ferlan
On 06/27/2018 09:34 AM, Erik Skultety wrote: > Since we support gl with SPICE and SDL with future VNC enablement in > sight (egl-headless), let's separate the gl-related attributes into a > standalone structure. > > Signed-off-by: Erik Skultety > --- > src/conf/domain_conf.c | 137 >

Re: [libvirt] [PATCH v1 05/11] qemu: command: Fix building of the SDL display command line

2018-06-28 Thread John Ferlan
On 06/27/2018 09:34 AM, Erik Skultety wrote: > QEMU uses a shorthand '-sdl' which maps to '-display sdl'. However, if > there are any options to be passed to SDL, the full command version must > be used. Everything seemingly worked for us until commit 5038b300437 > introduced OpenGL support for

Re: [libvirt] [PATCH v1 04/11] conf: Replace error label with cleanup in virDomainGraphicsDefParseVNCXML

2018-06-28 Thread John Ferlan
On 06/27/2018 09:34 AM, Erik Skultety wrote: > Signed-off-by: Erik Skultety > --- > src/conf/domain_conf.c | 12 ++-- > 1 file changed, 6 insertions(+), 6 deletions(-) > Reviewed-by: John Ferlan John -- libvir-list mailing list libvir-list@redhat.com

Re: [libvirt] [PATCH v1 03/11] qemu: command: Add virReportEnumRangeError to BuildHostdevCommandline

2018-06-28 Thread John Ferlan
On 06/27/2018 09:34 AM, Erik Skultety wrote: > Adding the 'default' case to our enum-typecasted switches is the current > safety trend, so add it here for mdevs too. > > Signed-off-by: Erik Skultety > --- > src/qemu/qemu_command.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-)

Re: [libvirt] [PATCH v1 01/11] conf: Remove a redundant model/address-type check in mdev post parse

2018-06-28 Thread John Ferlan
On 06/27/2018 09:34 AM, Erik Skultety wrote: > It's pointless to check the same thing multiple times. > Fix the indentation along the way too. > > Signed-off-by: Erik Skultety > --- > src/conf/domain_conf.c | 14 ++ > 1 file changed, 2 insertions(+), 12 deletions(-) > I think

[libvirt] [PATCH 0/2] domain_addr: move qemu function and rename

2018-06-28 Thread Anya Harter
qemuDomainCCWAddrSetCreateFromDomain moved from qemu_domain_addr to domain_addr and rename to virDomainCCWAddrSetCreateFromDomain because it is not a qemu-specific function Anya Harter (2): qemu: move qemuDomainCCWAddrSetCreateFromDomain domain_addr: refactor

[libvirt] [PATCH 2/2] domain_addr: refactor qemuDomainCCWAddrSetCreateFromDomain

2018-06-28 Thread Anya Harter
to virDomainCCWAddrSetCreateFromDomain Signed-off-by: Anya Harter --- src/conf/domain_addr.c | 2 +- src/conf/domain_addr.h | 2 +- src/qemu/qemu_domain_address.c | 4 ++-- src/qemu/qemu_hotplug.c| 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git

[libvirt] [PATCH 1/2] qemu: move qemuDomainCCWAddrSetCreateFromDomain

2018-06-28 Thread Anya Harter
from src/qemu/qemu_domain_address.[ch] to src/conf/domain_addr.[ch] Signed-off-by: Anya Harter --- src/conf/domain_addr.c | 24 src/conf/domain_addr.h | 4 src/qemu/qemu_domain_address.c | 22 -- src/qemu/qemu_domain_address.h |

Re: [libvirt] CPU model versioning separate from machine type versioning ?

2018-06-28 Thread Eduardo Habkost
On Thu, Jun 28, 2018 at 04:45:02PM +0100, Daniel P. Berrangé wrote: [...] > What if we can borrow the concept of versioning from machine types and apply > it to CPU models directly. For example, considering the history of "Haswell" > in QEMU, if we had versioned things, we would by now have: > >

Re: [libvirt] [Qemu-devel] CPU model versioning separate from machine type versioning ?

2018-06-28 Thread Eduardo Habkost
On Thu, Jun 28, 2018 at 07:59:38PM +0100, Dr. David Alan Gilbert wrote: [...] > > An application like virt-manager which wants a simple UI can forever be > > happy simply giving users a list of bare CPU model names, and allowing > > libvirt / QEMU to automatically expand to the best versioned

Re: [libvirt] [Qemu-devel] CPU model versioning separate from machine type versioning ?

2018-06-28 Thread Dr. David Alan Gilbert
* Daniel P. Berrangé (berra...@redhat.com) wrote: > This post is to raise question about helping use of named CPU models with > KVM ie any case not using -cpu host. > > In the old days (ie before 2018), the world was innocent and we had a nice > set of named CPU models that corresponded to

[libvirt] CPU model versioning separate from machine type versioning ?

2018-06-28 Thread Daniel P . Berrangé
This post is to raise question about helping use of named CPU models with KVM ie any case not using -cpu host. In the old days (ie before 2018), the world was innocent and we had a nice set of named CPU models that corresponded to different Intel/AMD physical CPU families/generations (lets

Re: [libvirt] [PATCH] qemu: Report error on unexpected job stats type

2018-06-28 Thread Michal Privoznik
On 06/28/2018 04:30 PM, Jiri Denemark wrote: > On Thu, Jun 28, 2018 at 15:45:12 +0200, Michal Privoznik wrote: >> On 06/28/2018 03:29 PM, Jiri Denemark wrote: >>> If we ever fail to properly set jobinfo->statsType, >>> qemuDomainJobInfoToParams would return -1 without setting an error. >> >> Have

Re: [libvirt] [PATCH] qemu: Report error on unexpected job stats type

2018-06-28 Thread Jiri Denemark
On Thu, Jun 28, 2018 at 15:45:12 +0200, Michal Privoznik wrote: > On 06/28/2018 03:29 PM, Jiri Denemark wrote: > > If we ever fail to properly set jobinfo->statsType, > > qemuDomainJobInfoToParams would return -1 without setting an error. > > Have you actually seen such error? Looks to me like

[libvirt] [PATCH 0/2] qemu_migration: Check for active domain after talking to remote daemon

2018-06-28 Thread Jiri Denemark
https://bugzilla.redhat.com/show_bug.cgi?id=1589730 Jiri Denemark (2): qemu_migration: Rename 'offline' variable in SrcPerformPeer2Peer qemu_migration: Check for active domain after talking to remote daemon src/qemu/qemu_domain.c| 14 ++- src/qemu/qemu_domain.h| 5 ++--

[libvirt] [PATCH 2/2] qemu_migration: Check for active domain after talking to remote daemon

2018-06-28 Thread Jiri Denemark
Once we called qemuDomainObjEnterRemote to talk to the destination daemon during a peer to peer migration, the vm lock is released and we only hold an async job. If the source domain dies at this point the monitor EOF callback is allowed to do its job and (among other things) clear all private

[libvirt] [PATCH 1/2] qemu_migration: Rename 'offline' variable in SrcPerformPeer2Peer

2018-06-28 Thread Jiri Denemark
The variable is used to store the offline migration capability of the destination daemon. Let's call it 'dstOffline' so that we can later use 'offline' to indicate whether we were asked to do offline migration. Signed-off-by: Jiri Denemark --- src/qemu/qemu_migration.c | 8 1 file

[libvirt] [PATCH v4 3/6] util: Add helper APIs to get/verify VF Representor name

2018-06-28 Thread Jai Singh Rana
Introduce new APIs virNetdevHostdevGetVFRIfName and virNetdevHostdevCheckVFRIfName to fetch/verify VF Representor name according to switch model for network devices in linux. Switchdev VF representor interface name on host is queried based on Bus:Device:Function information of pci SR-IOV device

[libvirt] [PATCH v4 6/6] docs: Update news about Network stats support for VF Representor

2018-06-28 Thread Jai Singh Rana
Signed-off-by: Jai Singh Rana --- docs/news.xml | 9 + 1 file changed, 9 insertions(+) diff --git a/docs/news.xml b/docs/news.xml index 468d34093a..c6394a8f0f 100644 --- a/docs/news.xml +++ b/docs/news.xml @@ -130,6 +130,15 @@ or virStorageVolCreateXMLFrom.

[libvirt] [PATCH v4 4/6] conf: util: Add API to find net def given its domain's hostdev

2018-06-28 Thread Jai Singh Rana
Introduce API virDomainNetFindByHostdev which retrieves net def in given domain for the given hostdev def. This API will now be used by virDomainNetFind to further probe net for hostdev network devices. Signed-off-by: Jai Singh Rana --- src/conf/domain_conf.c | 43

[libvirt] [PATCH v4 0/6] Support network stats for VF representor interface

2018-06-28 Thread Jai Singh Rana
With availability of switchdev model in linux, it is possible to capture stats for SR-IOV device with interface_type as 'hostdev' provided device supports VF represontor in switchdev mode on host. These stats are supported by adding helper APIs for getting/verifying VF representor name based on

[libvirt] [PATCH v4 1/6] util: Add helper function to clean extra spaces

2018-06-28 Thread Jai Singh Rana
This patch adds string manupulation helper function which takes string as input and returns string with all but one space removed between letters, numbers or words. Signed-off-by: Jai Singh Rana --- src/libvirt_private.syms | 1 + src/util/virstring.c | 36

[libvirt] [PATCH v4 2/6] util: Add generic API to fetch network stats from procfs

2018-06-28 Thread Jai Singh Rana
This patch introduces virNetDevGetProcNetdevStats API for linux which returns stats for the given interface from /proc/net/dev by properly mapping stats entries in probed column to column header. Tap and hostdev network devices will now be using this API. Currently function

[libvirt] [PATCH v4 5/6] qemu: Network stats support for VF Representor

2018-06-28 Thread Jai Singh Rana
In case of pci SR-IOV device with interface_type as 'hostdev', return network stats if it has a VF Representor interface enabled on host for pci SR-IOV device according to switchdev model. Signed-off-by: Jai Singh Rana --- src/qemu/qemu_driver.c | 34 ++ 1 file

Re: [libvirt] [PATCH] qemu: Report error on unexpected job stats type

2018-06-28 Thread Michal Privoznik
On 06/28/2018 03:29 PM, Jiri Denemark wrote: > If we ever fail to properly set jobinfo->statsType, > qemuDomainJobInfoToParams would return -1 without setting an error. Have you actually seen such error? Looks to me like both callers handle this case properly. > > Signed-off-by: Jiri Denemark

Re: [libvirt] [PATCH python] Fix bugs in nwfilter binding APIs

2018-06-28 Thread Michal Privoznik
On 06/28/2018 01:30 PM, Daniel P. Berrangé wrote: > We did not correctly mangle the API names in two cases, and we also > forgot to specialize the lookup method name in the sanity test. > > Signed-off-by: Daniel P. Berrangé > --- > generator.py | 5 - > sanitytest.py | 2 +- > 2 files

[libvirt] [PATCH] qemu: Report error on unexpected job stats type

2018-06-28 Thread Jiri Denemark
If we ever fail to properly set jobinfo->statsType, qemuDomainJobInfoToParams would return -1 without setting an error. Signed-off-by: Jiri Denemark --- src/qemu/qemu_domain.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index

Re: [libvirt] [PATCH] qemu: Allow cachetune only for KVM domains

2018-06-28 Thread Pavel Hrdina
On Thu, Jun 28, 2018 at 02:45:38PM +0200, Michal Privoznik wrote: > https://bugzilla.redhat.com/show_bug.cgi?id=1541921 > > In TCG mode, there are no vCPU threads and thus there's nothing > to be placed into resctrl CGroup. Forbid such configuration. Just a small nit, resctrl is not a CGroup.

Re: [libvirt] [PATCH] qemu: Allow cachetune only for KVM domains

2018-06-28 Thread Daniel P . Berrangé
On Thu, Jun 28, 2018 at 02:45:38PM +0200, Michal Privoznik wrote: > https://bugzilla.redhat.com/show_bug.cgi?id=1541921 > > In TCG mode, there are no vCPU threads and thus there's nothing > to be placed into resctrl CGroup. Forbid such configuration. This reminds me (again) that we need to add

[libvirt] [PATCH] qemu: Allow cachetune only for KVM domains

2018-06-28 Thread Michal Privoznik
https://bugzilla.redhat.com/show_bug.cgi?id=1541921 In TCG mode, there are no vCPU threads and thus there's nothing to be placed into resctrl CGroup. Forbid such configuration. Signed-off-by: Michal Privoznik --- src/qemu/qemu_domain.c | 7 +++ 1 file changed, 7 insertions(+) diff --git

Re: [libvirt] [PATCH] qemu: don't use chardev FD passing with standalone args

2018-06-28 Thread Eric Blake
On 06/28/2018 06:50 AM, Daniel P. Berrangé wrote: When using domxml-to-native, we must generate CLI args that can be used in a standalone scenario. This means no FD passing can be used. To achieve this we must clear the QEMU_CAPS_CHARDEV_FD_PASS capability bit. Signed-off-by: Daniel P. Berrangé

Re: [libvirt] [PATCH] qemu: don't use chardev FD passing with standalone args

2018-06-28 Thread Daniel P . Berrangé
On Thu, Jun 28, 2018 at 07:42:33AM -0500, Eric Blake wrote: > On 06/28/2018 06:50 AM, Daniel P. Berrangé wrote: > > When using domxml-to-native, we must generate CLI args that can be used > > in a standalone scenario. This means no FD passing can be used. To > > achieve this we must clear the

[libvirt] [PATCH 1/5] qemu: address: Handle all the video devices within a single loop

2018-06-28 Thread Erik Skultety
We've been handling the primary video device separately from all the other ones when in fact the code to do that was the same. Therefore, let's handle all the devices within the existing 'for' loop. Signed-off-by: Erik Skultety --- src/qemu/qemu_domain_address.c | 10 ++ 1 file changed,

[libvirt] [PATCH 0/5] Introduce new video model type 'none'

2018-06-28 Thread Erik Skultety
Historically, we've always been adding a default video device onto the cmdline whenever a graphical framebuffer was requested but a video device was missing. With the appearance of mdev vgpus, having an emulated video device is suboptimal, especially with spice where the streaming client will by

[libvirt] [PATCH 4/5] qemu: validate: Enforce compile time switch type checking for videos

2018-06-28 Thread Erik Skultety
There wasn't an explicit type case to the video type enum in qemuDomainDeviceDefValidateVideo, _TYPE_GOP was also missing from the switch. Signed-off-by: Erik Skultety --- src/conf/domain_conf.h | 2 +- src/qemu/qemu_domain.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git

[libvirt] [PATCH 5/5] conf: Introduce new video type 'none'

2018-06-28 Thread Erik Skultety
Historically, we've always enabled an emulated video device every time we see that graphics should be supported with a guest. With the appearance of mediated devices which can support QEMU's vfio-display capability, users might want to use such a device as the only video device. Therefore

[libvirt] [PATCH 2/5] conf: Introduce virDomainVideoDefClear helper

2018-06-28 Thread Erik Skultety
Future patches rely on the ability to reset the contents of the virDomainVideoDef structure rather than re-allocating it. Signed-off-by: Erik Skultety --- src/conf/domain_conf.c | 14 +- src/conf/domain_conf.h | 1 + src/libvirt_private.syms | 1 + 3 files changed, 15

[libvirt] [PATCH 3/5] conf: Introduce virDomainDefPostParseVideo helper

2018-06-28 Thread Erik Skultety
Move the video post parse bits into a separate helper as the logic is going to be extended in the future. Signed-off-by: Erik Skultety --- src/conf/domain_conf.c | 45 ++--- 1 file changed, 30 insertions(+), 15 deletions(-) diff --git

[libvirt] [PATCH] qemu: don't use chardev FD passing with standalone args

2018-06-28 Thread Daniel P . Berrangé
When using domxml-to-native, we must generate CLI args that can be used in a standalone scenario. This means no FD passing can be used. To achieve this we must clear the QEMU_CAPS_CHARDEV_FD_PASS capability bit. Signed-off-by: Daniel P. Berrangé --- src/qemu/qemu_process.c | 5 +

[libvirt] [PATCH python] Fix bugs in nwfilter binding APIs

2018-06-28 Thread Daniel P . Berrangé
We did not correctly mangle the API names in two cases, and we also forgot to specialize the lookup method name in the sanity test. Signed-off-by: Daniel P. Berrangé --- generator.py | 5 - sanitytest.py | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/generator.py

Re: [libvirt] [PATCH] security: Add swtpm paths to the domain's AppArmor profile

2018-06-28 Thread Stefan Berger
On 06/28/2018 03:55 AM, Michal Prívozník wrote: On 06/19/2018 03:52 PM, Stefan Berger wrote: This patch extends the AppArmor domain profile with file paths the swtpm accesses for state, log, pid, and socket files. Both, QEMU and swtpm, use this AppArmor profile. Signed-off-by: Stefan Berger

Re: [libvirt] [PATCH v1 06/11] conf: Make graphics's GL a standalone structure

2018-06-28 Thread Erik Skultety
... > diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c > index f8a662f747..948b9b7fd0 100644 > --- a/src/qemu/qemu_domain.c > +++ b/src/qemu/qemu_domain.c > @@ -11290,11 +11290,12 @@ qemuDomainSetupGraphics(virQEMUDriverConfigPtr cfg > ATTRIBUTE_UNUSED, >

Re: [libvirt] [PATCH] lxc: Rearrange order in lxcDomainUpdateDeviceFlags

2018-06-28 Thread Michal Prívozník
On 06/26/2018 08:27 PM, John Ferlan wrote: > Although commit e3497f3f noted that the LIVE option doesn't > matter and removed the call to virDomainDefCompatibleDevice, > it didn't go quite far enough and change the order of the checks. > > Since we don't have the possibility of LIVE succeeding

Re: [libvirt] [PATCH 0/2] tests: qemumonitorjson: Fix blockstats test case

2018-06-28 Thread Michal Prívozník
On 06/27/2018 02:06 PM, Peter Krempa wrote: > Peter Krempa (2): > tests: qemumonitorjson: Add only required replies for blockstats test > tests: qemumonitorjson: Fix name and call apropriate API > > tests/qemumonitorjsontest.c | 19 +-- > 1 file changed, 9 insertions(+), 10

Re: [libvirt] [PATCH] qemu: domain: update only newly detected images in qemuDomainDetermineDiskChain

2018-06-28 Thread Michal Prívozník
On 06/27/2018 02:03 PM, Peter Krempa wrote: > The processing code which prepares images should be executed really only > for the images which were detected. The code actually tried to update > the last user-specified layer as well. Thankfully we don't do anything > that would be a problem at this

Re: [libvirt] [PATCH] esx_driver: Simplify IsEncrypted and IsSecure

2018-06-28 Thread Michal Prívozník
On 06/27/2018 01:39 AM, Marcos Paulo de Souza wrote: > Signed-off-by: Marcos Paulo de Souza > --- > src/esx/esx_driver.c | 12 ++-- > 1 file changed, 2 insertions(+), 10 deletions(-) ACK. Will push after the freeze is over. Congratulations on your first libvirt contribution! Michal

Re: [libvirt] [PATCH] nwfilter: Remove redundant check if object exists

2018-06-28 Thread Daniel P . Berrangé
On Thu, Jun 28, 2018 at 09:53:48AM +0200, Pavel Hrdina wrote: > The same check is done by virNWFilterBindingObjListAdd(). The main > issue with the current code is that if the object already exists we > would leak 'def' because 'obj' would be set and the cleanup code frees > 'def' only if 'obj'

Re: [libvirt] [PATCH v2 0/2] {lxc, util}: Fix issues with NULL argument 'type' for mount().

2018-06-28 Thread Michal Prívozník
On 06/27/2018 05:06 PM, Julio Faracco wrote: > This serie fixes the argument 'type' of syscall mount(). Valgrind is > throwing an issue when that parameter 'type' of the syscall is NULL. > The best option to fix this issue is replace NULL to "none" > filesystem. For more details about the Valgrind

Re: [libvirt] [PATCH] security: Add swtpm paths to the domain's AppArmor profile

2018-06-28 Thread Michal Prívozník
On 06/19/2018 03:52 PM, Stefan Berger wrote: > This patch extends the AppArmor domain profile with file paths > the swtpm accesses for state, log, pid, and socket files. > > Both, QEMU and swtpm, use this AppArmor profile. > > Signed-off-by: Stefan Berger > Cc: Christian Ehrhardt > --- >

[libvirt] [PATCH] nwfilter: Remove redundant check if object exists

2018-06-28 Thread Pavel Hrdina
The same check is done by virNWFilterBindingObjListAdd(). The main issue with the current code is that if the object already exists we would leak 'def' because 'obj' would be set and the cleanup code frees 'def' only if 'obj' is NULL. Signed-off-by: Pavel Hrdina ---

Re: [libvirt] [PATCH] nwfilter: variable 'obj' must be initialized inside nwfilterBindingCreateXML().

2018-06-28 Thread Pavel Hrdina
On Tue, Jun 26, 2018 at 11:47:53PM -0300, Julio Faracco wrote: > The function nwfilterBindingCreateXML() is failing to compile due to a > conditional branch which leads to a undefined 'obj' variable. So 'obj' > must have a initial value to avoid compilation errors. See the problem: > > CC

Re: [libvirt] [python PATCH] Add support for nwfilter binding objects / apis

2018-06-28 Thread Michal Privoznik
On 06/26/2018 12:18 PM, Daniel P. Berrangé wrote: > Signed-off-by: Daniel P. Berrangé > --- > generator.py | 33 -- > libvirt-override-api.xml | 6 > libvirt-override-virConnect.py | 12 > libvirt-override.c | 51