Re: [libvirt] [PATCH 03/10] util: error: Add error message versions with info for some error codes

2018-12-06 Thread Erik Skultety
On Wed, Dec 05, 2018 at 05:47:44PM +0100, Peter Krempa wrote: > Few error codes were missing the version of the message with additional s/lacking a/missing the > info. In case of the modified messages it's not very likely they'll ever > report any additional data, but for the sake of consistency

Re: [libvirt] [PATCH 02/10] util: error: Fix error message strings to play well with additional info

2018-12-06 Thread Erik Skultety
On Thu, Dec 06, 2018 at 08:56:59AM +0100, Erik Skultety wrote: > On Wed, Dec 05, 2018 at 05:47:43PM +0100, Peter Krempa wrote: > > Additional information for a string is always in form of a string or s/for a string/for an error message s/always/either > > empty. Fix two offenders. One used %d as

Re: [libvirt] [PATCH 04/10] util: error: Export virErrorMsg for use in testsuite

2018-12-06 Thread Erik Skultety
On Wed, Dec 05, 2018 at 05:47:45PM +0100, Peter Krempa wrote: > Signed-off-by: Peter Krempa > --- > src/Makefile.am | 1 + > src/libvirt_private.syms | 1 + > src/util/Makefile.inc.am | 1 + > src/util/virerror.c | 5 - > src/util/virerrorpriv.h | 28

Re: [libvirt] [PATCH 05/10] tests: Add test for virErrorMsg message constraints

2018-12-06 Thread Erik Skultety
On Wed, Dec 05, 2018 at 05:47:46PM +0100, Peter Krempa wrote: > Make sure that we don't add any broken error message strings any more. > > This ensures that both the version with and without additional info is > populated, the version without info does not have any formatting > modifiers and the

Re: [libvirt] [PATCH 08/10] util: error: Use a more declarative approach in virErrorMsg

2018-12-06 Thread Erik Skultety
On Wed, Dec 05, 2018 at 05:47:49PM +0100, Peter Krempa wrote: > Use a macro to declare how the strings for individual error codes. This > unifies the used condition and will allow simplifying the code further. > > Signed-off-by: Peter Krempa > --- > src/libvirt_private.syms | 1 + >

Re: [libvirt] [PATCH v2 01/18] security: Unify header conditionals

2018-12-06 Thread Daniel P . Berrangé
On Thu, Nov 29, 2018 at 02:52:16PM +0100, Michal Privoznik wrote: > To avoid including a header file twice the following pattern is > used: > > #ifndef __SOMETHING__ > # define __SOMETHING__ > > where __SOMETHING__ should correspond to the header file name. > However, some of our header files

Re: [libvirt] [PATCH] version: Add ParseVersion and a Version struct

2018-12-06 Thread John Ferlan
On 12/6/18 4:04 PM, John Ferlan wrote: > > > On 10/11/18 7:58 PM, W. Trevor King wrote: >> Make it easier to convert version integers to the more human-readable >> major.minor.release format. Oh, and I'll need you to "OK" me adding an Signed-off-by: or you need to provide one. See:

Re: [libvirt] [PATCH] version: Add ParseVersion and a Version struct

2018-12-06 Thread John Ferlan
On 10/11/18 7:58 PM, W. Trevor King wrote: > Make it easier to convert version integers to the more human-readable > major.minor.release format. > --- > connect.go | 8 > version.go | 52 ++ > version_test.go | 64 >

Re: [libvirt] [PATCH 2/3] xenconfig: add support for openvswitch configuration

2018-12-06 Thread Jim Fehlig
On 12/6/18 12:44 AM, Michal Privoznik wrote: On 11/16/18 11:26 PM, Jim Fehlig wrote: Add support for converting openvswitch interface configuration to/from libvirt domXML and xl.cfg(5). The xl config syntax for virtual interfaces is described in detail in the xl-network-configuration(5) man

Re: [libvirt] [PATCH 1/3] libxl: support openvswitch interfaces

2018-12-06 Thread Jim Fehlig
On 12/6/18 12:44 AM, Michal Privoznik wrote: On 11/16/18 11:26 PM, Jim Fehlig wrote: It is currently possible to use s of type openvswitch with the libxl driver in a non-standard way, e.g. This patch adds support for openvswitch s specified in typical libvirt config

Re: [libvirt] [PATCH 06/10] util: error: Improve docs for virErrorMsg

2018-12-06 Thread Erik Skultety
On Wed, Dec 05, 2018 at 05:47:47PM +0100, Peter Krempa wrote: > Clarify how @info is used and how the returned values look like. s/how/what ...on a side note, there's no such thing as "how it looks *like*", only "how it looks". The difference between "what it looks like" and "how it looks" seems

Re: [libvirt] [PATCH 2/2] lxc: check actual type of interface not config type

2018-12-06 Thread Daniel P . Berrangé
On Wed, Dec 05, 2018 at 09:35:13PM -0500, Laine Stump wrote: > virLXCControllerGetNICIndexes() was deciding whether or not to add the > ifindex for an interface's ifname to the list of ifindexes sent to > CreateMachineWithNetwork based on the interface type stored in the > config. This would be

Re: [libvirt] [PATCH 1/2] lxc: stop incorrectly validating interface type

2018-12-06 Thread Daniel P . Berrangé
On Wed, Dec 05, 2018 at 09:35:12PM -0500, Laine Stump wrote: > Commit 017dfa27d changed a few switch statements in the LXC code to > have all possible enum values, and in the process changed the switch > statement in virLXCControllerGetNICIndexes() such that it returned > error status for any

Re: [libvirt] [PATCH 10/10] tests: virerror: Make sure that error messages stay in correct order

2018-12-06 Thread Erik Skultety
On Wed, Dec 05, 2018 at 05:47:51PM +0100, Peter Krempa wrote: > Since we don't look up the error message according to the error code but > they have to be in the correct order in virErrorMsgStrings, we need > to make sure that they stay in the correct order. > > Signed-off-by: Peter Krempa > ---

Re: [libvirt] [PATCH v2 03/18] security: Include security_util

2018-12-06 Thread Daniel P . Berrangé
On Thu, Nov 29, 2018 at 02:52:18PM +0100, Michal Privoznik wrote: > This file implements wrappers over XATTR getter/setter. It > ensures the proper XATTR namespace is used. > > Signed-off-by: Michal Privoznik > --- > src/security/Makefile.inc.am | 2 + > src/security/security_util.c | 226

Re: [libvirt] [PATCH 08/10] util: error: Use a more declarative approach in virErrorMsg

2018-12-06 Thread Peter Krempa
On Thu, Dec 06, 2018 at 11:48:15 +, Daniel Berrange wrote: > On Wed, Dec 05, 2018 at 05:47:49PM +0100, Peter Krempa wrote: > > Use a macro to declare how the strings for individual error codes. This > > unifies the used condition and will allow simplifying the code further. > > > >

Re: [libvirt] [PATCH v2 07/18] virSecurityDACRestoreAllLabel: Restore more labels

2018-12-06 Thread Daniel P . Berrangé
On Thu, Nov 29, 2018 at 02:52:22PM +0100, Michal Privoznik wrote: > We are setting label on kernel, initrd, dtb and slic_table files. > But we never restored it. > > Signed-off-by: Michal Privoznik > --- > src/security/security_dac.c | 16 > 1 file changed, 16 insertions(+)

Re: [libvirt] [PATCH v2 06/18] virSecurityDACRestoreAllLabel: Reorder device relabeling

2018-12-06 Thread Daniel P . Berrangé
On Thu, Nov 29, 2018 at 02:52:21PM +0100, Michal Privoznik wrote: > It helps whe trying to match calls with virSecurityDACSetAllLabel > if the order in which devices are set/restored is the same in > both functions. > > Signed-off-by: Michal Privoznik > --- > src/security/security_dac.c | 36

Re: [libvirt] [PATCH v2 11/18] security_selinux: Track if transaction is restore

2018-12-06 Thread Daniel P . Berrangé
On Thu, Nov 29, 2018 at 02:52:26PM +0100, Michal Privoznik wrote: > It is going to be important to know if the current transaction we > are running is a restore operation or set label operation. Might be worth saying why it is important :-) > > Signed-off-by: Michal Privoznik > --- >

Re: [libvirt] [PATCH v2 18/18] qemu.conf: Allow users to enable/disable label remembering

2018-12-06 Thread Daniel P . Berrangé
On Thu, Nov 29, 2018 at 02:52:33PM +0100, Michal Privoznik wrote: > Signed-off-by: Michal Privoznik > --- > src/qemu/libvirtd_qemu.aug | 1 + > src/qemu/qemu.conf | 6 ++ > src/qemu/qemu_conf.c | 4 > src/qemu/test_libvirtd_qemu.aug.in | 1 + > 4

Re: [libvirt] [PATCH 1/2] qemu: Save qemuDomainGetStats error

2018-12-06 Thread Ján Tomko
On Thu, Dec 06, 2018 at 02:49:59PM +0100, Ján Tomko wrote: On Tue, Nov 27, 2018 at 11:23:22AM -0500, John Ferlan wrote: During qemuConnectGetAllDomainStats if qemuDomainGetStats causes a failure, then when collecting more than one domain's worth of statistics the loop in

Re: [libvirt] [PATCH v2 03/18] security: Include security_util

2018-12-06 Thread Daniel P . Berrangé
On Thu, Dec 06, 2018 at 04:12:45PM +0100, Michal Privoznik wrote: > On 12/6/18 3:34 PM, Daniel P. Berrangé wrote: > > On Thu, Dec 06, 2018 at 03:17:47PM +0100, Michal Privoznik wrote: > >> On 12/6/18 12:38 PM, Daniel P. Berrangé wrote: > >>> On Thu, Nov 29, 2018 at 02:52:18PM +0100, Michal

Re: [libvirt] [PATCH 08/10] util: error: Use a more declarative approach in virErrorMsg

2018-12-06 Thread Peter Krempa
On Thu, Dec 06, 2018 at 12:29:27 +0100, Erik Skultety wrote: > On Wed, Dec 05, 2018 at 05:47:49PM +0100, Peter Krempa wrote: > > Use a macro to declare how the strings for individual error codes. This > > unifies the used condition and will allow simplifying the code further. > > > >

Re: [libvirt] [PATCH v2 16/18] virSecuritySELinuxRestoreAllLabel: Restore more labels

2018-12-06 Thread Daniel P . Berrangé
On Thu, Nov 29, 2018 at 02:52:31PM +0100, Michal Privoznik wrote: > We are setting label on kernel, initrd, dtb and slic_table files. > But we never restored it. > > Signed-off-by: Michal Privoznik > --- > src/security/security_selinux.c | 16 > 1 file changed, 16 insertions(+)

Re: [libvirt] [PATCH v3] qemu: Add check for whether KVM nesting is enabled

2018-12-06 Thread John Ferlan
ping? Thanks - John On 11/28/18 8:55 PM, John Ferlan wrote: > Support for nested KVM is handled via a kernel module configuration > parameters values for kvm_intel, kvm_amd, kvm_hv (PPC), or kvm (s390). > While it's possible to fetch the kmod config values via virKModConfig, > unfortunately

Re: [libvirt] [PATCH 0/2] Fix a couple get all domain stats issues

2018-12-06 Thread John Ferlan
ping? Tks, John On 11/27/18 11:23 AM, John Ferlan wrote: > One is longer term (patch1), while the other is sourced in this > release (4.10.0) when IOThread stats were added. > > John Ferlan (2): > qemu: Save qemuDomainGetStats error > qemu: Don't fail stats collection due to IOThread

Re: [libvirt] [PATCH 1/2] qemu: Save qemuDomainGetStats error

2018-12-06 Thread Ján Tomko
On Tue, Nov 27, 2018 at 11:23:22AM -0500, John Ferlan wrote: During qemuConnectGetAllDomainStats if qemuDomainGetStats causes a failure, then when collecting more than one domain's worth of statistics the loop in virDomainStatsRecordListFree would call virDomainFree which would call

Re: [libvirt] [PATCH v2 09/18] security_dac: Remember old labels

2018-12-06 Thread Daniel P . Berrangé
On Thu, Nov 29, 2018 at 02:52:24PM +0100, Michal Privoznik wrote: > Signed-off-by: Michal Privoznik > --- > src/security/security_dac.c | 48 ++--- > 1 file changed, 40 insertions(+), 8 deletions(-) Reviewed-by: Daniel P. Berrangé Regards, Daniel -- |:

Re: [libvirt] [PATCH v2 02/18] util: Introduce xattr getter/setter/remover

2018-12-06 Thread Daniel P . Berrangé
On Thu, Nov 29, 2018 at 02:52:17PM +0100, Michal Privoznik wrote: > Signed-off-by: Michal Privoznik > --- > src/libvirt_private.syms | 3 + > src/util/virfile.c | 121 +++ > src/util/virfile.h | 11 > 3 files changed, 135 insertions(+) > >

Re: [libvirt] [PATCH 08/10] util: error: Use a more declarative approach in virErrorMsg

2018-12-06 Thread Daniel P . Berrangé
On Wed, Dec 05, 2018 at 05:47:49PM +0100, Peter Krempa wrote: > Use a macro to declare how the strings for individual error codes. This > unifies the used condition and will allow simplifying the code further. > > Signed-off-by: Peter Krempa > --- > src/libvirt_private.syms | 1 + >

Re: [libvirt] [PATCH 08/10] util: error: Use a more declarative approach in virErrorMsg

2018-12-06 Thread Daniel P . Berrangé
On Wed, Dec 05, 2018 at 05:47:49PM +0100, Peter Krempa wrote: > Use a macro to declare how the strings for individual error codes. This > unifies the used condition and will allow simplifying the code further. > > Signed-off-by: Peter Krempa > --- > src/libvirt_private.syms | 1 + >

Re: [libvirt] [PATCH v2 10/18] virSecurityDACRestoreImageLabelInt: Restore even shared/RO disks

2018-12-06 Thread Daniel P . Berrangé
On Thu, Nov 29, 2018 at 02:52:25PM +0100, Michal Privoznik wrote: > Now that we have seclabel remembering we can safely restore > labels for shared and RO disks. In fact we need to do that to > keep seclabel refcount stored in XATTRs in sync with reality. > > Signed-off-by: Michal Privoznik >

Re: [libvirt] [PATCH 08/10] util: error: Use a more declarative approach in virErrorMsg

2018-12-06 Thread Peter Krempa
On Thu, Dec 06, 2018 at 11:42:44 +, Daniel Berrange wrote: > On Wed, Dec 05, 2018 at 05:47:49PM +0100, Peter Krempa wrote: > > Use a macro to declare how the strings for individual error codes. This > > unifies the used condition and will allow simplifying the code further. > > > >

Re: [libvirt] [PATCH v2 05/18] virSecurityDACTransactionRun: Implement rollback

2018-12-06 Thread Daniel P . Berrangé
On Thu, Nov 29, 2018 at 02:52:20PM +0100, Michal Privoznik wrote: > When iterating over list of paths/disk sources to relabel it may > happen that the process fails at some point. In that case, for > the sake of keeping seclabel refcount (stored in XATTRs) in sync > with reality we have to perform

Re: [libvirt] [PATCH v2 04/18] security_dac: Restore label on failed chown() attempt

2018-12-06 Thread Daniel P . Berrangé
On Thu, Nov 29, 2018 at 02:52:19PM +0100, Michal Privoznik wrote: > It's important to keep XATTRs untouched (well, in the same state > they were in when entering the function). Otherwise our > refcounting would be messed up. > > Signed-off-by: Michal Privoznik > --- >

Re: [libvirt] [PATCH v2 08/18] security_dac: Allow callers to enable/disable label remembering/recall

2018-12-06 Thread Daniel P . Berrangé
On Thu, Nov 29, 2018 at 02:52:23PM +0100, Michal Privoznik wrote: > Because the implementation that will be used for label > remembering/recall is not atomic we have to give callers a chance > to enable or disable it. That is, enable it if and only if > metadata locking is enabled. Otherwise the

Re: [libvirt] [PATCH v2 13/18] security_selinux: Restore label on failed setfilecon() attempt

2018-12-06 Thread Daniel P . Berrangé
On Thu, Nov 29, 2018 at 02:52:28PM +0100, Michal Privoznik wrote: > It's important to keep XATTRs untouched (well, in the same state > they were in when entering the function). Otherwise our > refcounting would be messed up. > > Signed-off-by: Michal Privoznik > --- >

Re: [libvirt] [PATCH v2 15/18] virSecuritySELinuxRestoreAllLabel: Reorder device relabeling

2018-12-06 Thread Daniel P . Berrangé
On Thu, Nov 29, 2018 at 02:52:30PM +0100, Michal Privoznik wrote: > It helps whe trying to match calls with virSecuritySELinuxSetAllLabel > if the order in which devices are set/restored is the same in > both functions. > > Signed-off-by: Michal Privoznik > --- > src/security/security_selinux.c

Re: [libvirt] [PATCH v2 14/18] virSecuritySELinuxTransactionRun: Implement rollback

2018-12-06 Thread Daniel P . Berrangé
On Thu, Nov 29, 2018 at 02:52:29PM +0100, Michal Privoznik wrote: > When iterating over list of paths/disk sources to relabel it may > happen that the process fails at some point. In that case, for > the sake of keeping seclabel refcount (stored in XATTRs) in sync > with reality we have to perform

Re: [libvirt] [PATCH v2 12/18] security_selinux: Remember old labels

2018-12-06 Thread Daniel P . Berrangé
On Thu, Nov 29, 2018 at 02:52:27PM +0100, Michal Privoznik wrote: > Signed-off-by: Michal Privoznik > --- > src/security/security_selinux.c | 161 ++-- > 1 file changed, 114 insertions(+), 47 deletions(-) Reviewed-by: Daniel P. Berrangé Regards, Daniel -- |:

Re: [libvirt] [PATCH v2 17/18] tools: Provide a script to recover fubar'ed XATTRs setup

2018-12-06 Thread Daniel P . Berrangé
On Thu, Nov 29, 2018 at 02:52:32PM +0100, Michal Privoznik wrote: > Our code is not bug free. The refcounting I introduced will > almost certainly not work in some use cases. Provide a script > that will remove all the XATTRs set by libvirt so that it can > start cleanly. On this point, it would

Re: [libvirt] [PATCH 2/2] qemu: Don't fail stats collection due to IOThread capability

2018-12-06 Thread Ján Tomko
On Tue, Nov 27, 2018 at 11:23:23AM -0500, John Ferlan wrote: Commit 212dc9286 made a generic qemuDomainGetIOThreadsMon which would fail if the QEMU_CAPS_OBJECT_IOTHREAD didn't exist. Then commit d1eac927 used that helper for the collection of all domain stats. However, if the capability doesn't

[libvirt] [PATCH] domain: conf: graphics: Fix picking DRI renderer automatically for SPICE

2018-12-06 Thread Erik Skultety
Commit 255e0732 introduced a few graphics-related helpers. The problem is that virDomainGraphicsNeedsAutoRenderNode returns true if it gets NULL as a response from virDomainGraphicsNeedsAutoRenderNode. That's okay for egl-headless because that one always needs a DRM render node, the same is not

Re: [libvirt] [PATCH 1/2] qemu: Save qemuDomainGetStats error

2018-12-06 Thread John Ferlan
On 12/6/18 10:15 AM, Ján Tomko wrote: > On Thu, Dec 06, 2018 at 02:49:59PM +0100, Ján Tomko wrote: >> On Tue, Nov 27, 2018 at 11:23:22AM -0500, John Ferlan wrote: >>> During qemuConnectGetAllDomainStats if qemuDomainGetStats causes >>> a failure, then when collecting more than one domain's

[libvirt] [PATCH v2 2/2] lxc: don't forbid

2018-12-06 Thread Laine Stump
Commit 017dfa27d changed a few switch statements in the LXC code to have all possible enum values, and in the process changed the switch statement in virLXCControllerGetNICIndexes() to return an error status for unsupported interface types, but it erroneously put type='direct' on the list of

[libvirt] [PATCH v2 0/2] Fix 2 small LXC network interface bugs

2018-12-06 Thread Laine Stump
danpb suggested that I shouldn't completely remove the validation of interface type I had removed in V1: https://www.redhat.com/archives/libvir-list/2018-December/msg00120.html This also re-orders the two patches, so the "check actual type" patch loses its previous ACK due to modifications.

[libvirt] [PATCH v2 1/2] lxc: check actual type of interface not config type

2018-12-06 Thread Laine Stump
virLXCControllerGetNICIndexes() was deciding whether or not to add the ifindex for an interface's ifname to the list of ifindexes sent to CreateMachineWithNetwork based on the interface type stored in the config. This would be incorrect in the case of where the network was giving out macvlan

Re: [libvirt] [PATCH v2 03/18] security: Include security_util

2018-12-06 Thread Michal Privoznik
On 12/6/18 12:38 PM, Daniel P. Berrangé wrote: > On Thu, Nov 29, 2018 at 02:52:18PM +0100, Michal Privoznik wrote: >> This file implements wrappers over XATTR getter/setter. It >> ensures the proper XATTR namespace is used. >> >> Signed-off-by: Michal Privoznik >> --- >>

Re: [libvirt] [PATCH 1/2] lxc: stop incorrectly validating interface type

2018-12-06 Thread Laine Stump
On 12/6/18 4:50 AM, Daniel P. Berrangé wrote: > On Wed, Dec 05, 2018 at 09:35:12PM -0500, Laine Stump wrote: >> Commit 017dfa27d changed a few switch statements in the LXC code to >> have all possible enum values, and in the process changed the switch >> statement in

Re: [libvirt] [PATCH 1/2] lxc: stop incorrectly validating interface type

2018-12-06 Thread Daniel P . Berrangé
On Thu, Dec 06, 2018 at 09:37:09AM -0500, Laine Stump wrote: > On 12/6/18 4:50 AM, Daniel P. Berrangé wrote: > > On Wed, Dec 05, 2018 at 09:35:12PM -0500, Laine Stump wrote: > >> Commit 017dfa27d changed a few switch statements in the LXC code to > >> have all possible enum values, and in the

Re: [libvirt] [PATCH v3] openvswitch: Add new port VLAN mode "dot1q-tunnel"

2018-12-06 Thread 芦志朋
发件人:Laine Stump 发送日期:2018-12-03 22:37:36 收件人:libvir-list@redhat.com 抄送人:luzhip...@uniudc.com 主题:Re: [libvirt] [PATCH v3] openvswitch: Add new port VLAN mode "dot1q-tunnel">On 12/2/18 10:18 PM, luzhip...@uniudc.com wrote: >> From: ZhiPeng Lu >> >> Signed-off-by: ZhiPeng Lu > > >Please include a

Re: [libvirt] [PATCH v2 03/18] security: Include security_util

2018-12-06 Thread Daniel P . Berrangé
On Thu, Dec 06, 2018 at 03:17:47PM +0100, Michal Privoznik wrote: > On 12/6/18 12:38 PM, Daniel P. Berrangé wrote: > > On Thu, Nov 29, 2018 at 02:52:18PM +0100, Michal Privoznik wrote: > >> This file implements wrappers over XATTR getter/setter. It > >> ensures the proper XATTR namespace is used.

Re: [libvirt] [PATCH v2 03/18] security: Include security_util

2018-12-06 Thread Michal Privoznik
On 12/6/18 3:34 PM, Daniel P. Berrangé wrote: > On Thu, Dec 06, 2018 at 03:17:47PM +0100, Michal Privoznik wrote: >> On 12/6/18 12:38 PM, Daniel P. Berrangé wrote: >>> On Thu, Nov 29, 2018 at 02:52:18PM +0100, Michal Privoznik wrote: This file implements wrappers over XATTR getter/setter. It