Re: [libvirt] [PATCH v5 09/13] conf: Allocate/release 'uid' and 'fid' in PCI address

2018-09-17 Thread Yi Min Zhao
在 2018/9/17 下午8:05, Andrea Bolognani 写道: On Mon, 2018-09-17 at 13:43 +0800, Yi Min Zhao wrote: 在 2018/9/11 下午9:59, Andrea Bolognani 写道: +static void +virDomainZPCIAddressReleaseUid(virHashTablePtr set, + virZPCIDeviceAddressPtr addr) +{ +if

Re: [libvirt] [tck PATCH] eliminate use of deprecated brctl in network tests

2018-09-17 Thread John Ferlan
On 09/13/2018 03:11 PM, Laine Stump wrote: > brctl is part of the bridge-utils package, which has been deprecated / > replaced by the "ip" and "bridge" commands in the iproute package in > all modern distros. This patch removes the few usages of brctl in > libvirt-tck's network tests, replacing

Re: [libvirt] [PATCH v4 23/23] security_dac: Lock metadata when running transaction

2018-09-17 Thread John Ferlan
$SUBJ s/dac/selinux On 09/10/2018 05:36 AM, Michal Privoznik wrote: > Lock all the paths we want to relabel to mutually exclude other > libvirt daemons. > > The only culprit here hitch here is that directories can't be Where have I seen this before? > locked. Therefore, when relabeling a

Re: [libvirt] [PATCH v4 22/23] security_selinux: Move transaction handling up one level

2018-09-17 Thread John Ferlan
On 09/10/2018 05:36 AM, Michal Privoznik wrote: > So far the whole transaction handling is done > virSecuritySELinuxSetFileconHelper(). This needs to change for > the sake of security label remembering and locking. Otherwise we > would be locking a path when only appending it to transaction >

Re: [libvirt] [PATCH v4 21/23] virSecuritySELinuxRestoreFileLabel: Adjust code pattern

2018-09-17 Thread John Ferlan
On 09/10/2018 05:36 AM, Michal Privoznik wrote: > Firstly, the following code pattern is harder to follow: > > if (func() < 0) { > error(); > } else { > /* success */ > } > > We should put 'goto cleanup' into the error branch and move the > else branch one level up. >

Re: [libvirt] [PATCH v4 20/23] virSecuritySELinuxRestoreFileLabel: Rename 'err' label

2018-09-17 Thread John Ferlan
On 09/10/2018 05:36 AM, Michal Privoznik wrote: > This label is used in both successful and error paths. Therefore > it should be named 'cleanup' and not 'err'. > > Signed-off-by: Michal Privoznik > --- > src/security/security_selinux.c | 6 +++--- > 1 file changed, 3 insertions(+), 3

Re: [libvirt] [PATCH v4 19/23] security_dac: Lock metadata when running transaction

2018-09-17 Thread John Ferlan
On 09/10/2018 05:36 AM, Michal Privoznik wrote: > Lock all the paths we want to relabel to mutually exclude other > libvirt daemons. > > The only culprit here hitch here is that directories can't be reread the above and fix and fix ;-) > locked. Therefore, when relabeling a directory do not

Re: [libvirt] [PATCH v4 16/23] security_manager: Introduce metadata locking APIs

2018-09-17 Thread John Ferlan
[...] VIR_FROM_THIS VIR_FROM_SECURITY > > VIR_LOG_INIT("security.security_manager"); > > +virMutex lockManagerMutex = VIR_MUTEX_INITIALIZER; > + > struct _virSecurityManager { > virObjectLockable parent; > > @@ -43,6 +47,7 @@ struct _virSecurityManager { > void *privateData; >

Re: [libvirt] [PATCH v4 18/23] security_dac: Fix info messages when chown()-ing

2018-09-17 Thread John Ferlan
On 09/10/2018 05:36 AM, Michal Privoznik wrote: > Firstly, the message that says we're setting uid:gid shouldn't be > called from virSecurityDACSetOwnershipInternal() because > virSecurityDACRestoreFileLabelInternal() is calling it too. > Secondly, there are places between us reporting label

Re: [libvirt] [PATCH v4 17/23] security_dac: Move transaction handling up one level

2018-09-17 Thread John Ferlan
On 09/10/2018 05:36 AM, Michal Privoznik wrote: > So far the whole transaction handling is done > virSecurityDACSetOwnershipInternal(). This needs to change for > the sake of security label remembering and locking. Otherwise we > would be locking a path when only appending it to transaction >

Re: [libvirt] [PATCH v4 16/23] security_manager: Introduce metadata locking APIs

2018-09-17 Thread John Ferlan
On 09/10/2018 05:36 AM, Michal Privoznik wrote: > Two new APIs are added so that security driver can lock and > unlock paths it wishes to touch. These APIs are not for other > drivers to call but security drivers (DAC and SELinux). That is > the reason these APIs are not exposed through our >

Re: [libvirt] [PATCH v4 11/23] lock_driver: Introduce VIR_LOCK_MANAGER_ACQUIRE_ROLLBACK

2018-09-17 Thread John Ferlan
[...] >> cleanup: >> -if (rv != 0 && fd) >> -VIR_FORCE_CLOSE(*fd); >> +if (rv < 0) { >> +int saved_errno = errno; >> +virErrorPtr origerr; >> + >> +virErrorPreserveLast(); >> +if (fd) >> +VIR_FORCE_CLOSE(*fd); >> + >> +if

Re: [libvirt] [PATCH v4 15/23] security_manager: Load lock plugin on init

2018-09-17 Thread John Ferlan
On 09/10/2018 05:36 AM, Michal Privoznik wrote: > Now that we know what metadata lock manager user wishes to use we > can load it when initializing security driver. This is achieved > by adding new argument to virSecurityManagerNewDriver() and > subsequently to all functions that end up calling

Re: [libvirt] [PATCH v4 12/23] lock_daemon_dispatch: Check for ownerPid rather than ownerId

2018-09-17 Thread John Ferlan
On 09/10/2018 05:36 AM, Michal Privoznik wrote: > At the beginning of each dispatch function we check if owner > attributes were registered (these consist of ID, UUID, PID and > name). The check then consists of checking if ID is not zero. > This is not going to work with >

Re: [libvirt] [PATCH v4 11/23] lock_driver: Introduce VIR_LOCK_MANAGER_ACQUIRE_ROLLBACK

2018-09-17 Thread John Ferlan
On 09/10/2018 05:36 AM, Michal Privoznik wrote: > Soon there will be a virtlockd client that wants to either lock > all the resources or none (in order to avoid virtlockd killing > the client on connection close). Because on the RPC layer we can > only acquire one resource at a time, we have to

Re: [libvirt] [PATCH v4 09/23] _virLockManagerLockDaemonPrivate: Move @hasRWDisks into dom union

2018-09-17 Thread John Ferlan
On 09/10/2018 05:36 AM, Michal Privoznik wrote: > The fact whether domain has or doesn't have RW disks is specific > to VIR_LOCK_MANAGER_OBJECT_TYPE_DOMAIN and therefore should > reside in union specific to it. > > Signed-off-by: Michal Privoznik > --- > src/locking/lock_driver_lockd.c | 8

Re: [libvirt] [PATCH v4 08/23] lock_driver: Introduce new VIR_LOCK_MANAGER_OBJECT_TYPE_DAEMON

2018-09-17 Thread John Ferlan
On 09/10/2018 05:36 AM, Michal Privoznik wrote: > We will want virtlockd to lock files on behalf of libvirtd and > not qemu process, because it is libvirtd that needs an exclusive > access not qemu. This requires new lock context. > > Signed-off-by: Michal Privoznik > --- >

Re: [libvirt] [PATCH] api,qemu: add block latency histogram

2018-09-17 Thread Vladimir Sementsov-Ogievskiy
11.09.2018 14:36, Vladimir Sementsov-Ogievskiy wrote: 04.09.2018 09:59, Nikolay Shirokovskiy wrote: Hi, Peter. I have questions to several of your comments: On 03.09.2018 14:59, Peter Krempa wrote: On Mon, Sep 03, 2018 at 13:58:31 +0300, Nikolay Shirokovskiy wrote: This patch adds option to

Re: [libvirt] [PATCH V3 1/2] libxl: drop support for Xen < 4.6

2018-09-17 Thread Jim Fehlig
On 9/17/18 2:59 AM, Andrea Bolognani wrote: On Tue, 2018-09-11 at 16:38 -0600, Jim Fehlig wrote: [...] Since Xen 4.6 contains a pkgconfig file, drop the now unused code that falls back to using LIBVIRT_CHECK_LIB in the absence of pkgconfig file. [...] - dnl pkgconfig file not found,

Re: [libvirt] [PATCH v7] qemu: Introduce state_lock_timeout to qemu.conf

2018-09-17 Thread Michal Privoznik
On 09/13/2018 01:19 PM, Peter Krempa wrote: > On Thu, Sep 13, 2018 at 18:47:55 +0800, Yi Wang wrote: >> When doing some job holding state lock for a long time, >> we may come across error: >> >> "Timed out during operation: cannot acquire state change lock" >> >> Well, sometimes it's not a problem

[libvirt] [PATCH] tests: Follow up on qemucaps2xmldata rename

2018-09-17 Thread Andrea Bolognani
The directory has been renamed in 562990849a9d, but a reference to it was not updated at the same time, causing 'make dist' to fail ever since. Fix it. Signed-off-by: Andrea Bolognani --- Pushed under the Pink Bunny Ears of Shame™ rule. tests/Makefile.am | 2 +- 1 file changed, 1 insertion(+),

[libvirt] [PATCH v2 2/3] qemu: check memory-backend-memfd.hugetlb capability

2018-09-17 Thread marcandre . lureau
From: Marc-André Lureau QEMU 3.1 should only expose the property if the host is actually capable of creating hugetable-backed memfd. However, it may fail at runtime depending on requested "hugetlbsize". Reviewed-by: John Ferlan Signed-off-by: Marc-André Lureau Signed-off-by: John Ferlan ---

[libvirt] [PATCH v2 3/3] qemu: add memfd source type

2018-09-17 Thread marcandre . lureau
From: Marc-André Lureau Add a new memoryBacking source type "memfd", supported by QEMU (when the apability is available). A memfd is a specialized anonymous memory kind. As such, an anonymous source type could be automatically using a memfd. However, there are some complications when migrating

[libvirt] [PATCH v2 0/3] Add "memfd" memory backing type

2018-09-17 Thread marcandre . lureau
From: Marc-André Lureau Hi, This is an alternative series from "[PATCH 0/5] Use memfd if possible". Instead of automatically using memfd for anonymous memory when available (as suggested by Daniel), it introduces the "memfd" memory backing type. Although using memfd transparently when possible

[libvirt] [PATCH v2 1/3] qemu: add memory-backend-memfd capability check

2018-09-17 Thread marcandre . lureau
From: Marc-André Lureau Check availability of "-object memory-backend-memfd". Reviewed-by: John Ferlan Signed-off-by: Marc-André Lureau Signed-off-by: John Ferlan --- src/qemu/qemu_capabilities.c | 2 ++ src/qemu/qemu_capabilities.h | 1 +

Re: [libvirt] [PATCH v5 11/13] qemu: Add hotpluging support for PCI devices on S390 guests

2018-09-17 Thread Andrea Bolognani
On Mon, 2018-09-17 at 14:10 +0800, Yi Min Zhao wrote: > 在 2018/9/11 下午11:21, Andrea Bolognani 写道: > > > @@ -805,8 +869,13 @@ qemuDomainAttachDiskGeneric(virQEMUDriverPtr driver, > > > if (qemuHotplugDiskSourceAttach(priv->mon, diskdata) < 0) > > > goto exit_monitor; > > > > > >

Re: [libvirt] [PATCH v5 10/13] qemu: Generate and use zPCI device in QEMU command line

2018-09-17 Thread Andrea Bolognani
On Mon, 2018-09-17 at 13:51 +0800, Yi Min Zhao wrote: > 在 2018/9/11 下午10:31, Andrea Bolognani 写道: > > > +{ > > > +if (!virZPCIDeviceAddressIsEmpty(>addr.pci.zpci)) > > > +return qemuAppendZPCIDevStr(cmd, dev); > > > + > > > +return 0; > > > > I'd rather see this as > > > >if

Re: [libvirt] [PATCH 6/5] qemu: Avoid probing non-native binaries all the time

2018-09-17 Thread Jiri Denemark
On Mon, Sep 17, 2018 at 13:22:59 +0200, Andrea Bolognani wrote: > A side effect of recent changes is that we would always try > to regenerate the capabilities cache for non-native QEMU > binaries based on /dev/kvm availability, which is of course > complete nonsense. Make sure that doesn't happen.

Re: [libvirt] [PATCHv2 0/6] Introduce syntax-check rule for incorrect indentation and blank first line in function body

2018-09-17 Thread Shi Lei
On 2018-09-17 at 19:52, Michal Privoznik wrote: >On 09/13/2018 10:55 AM, Shi Lei wrote: >> v1 here: >> https://www.redhat.com/archives/libvir-list/2018-September/msg00497.html >> >> Diff from v1: (according to the comments from Jano) >>   - Change build-aux/check-spacing.pl rather than cfg.mk >>  

Re: [libvirt] [PATCH v5 09/13] conf: Allocate/release 'uid' and 'fid' in PCI address

2018-09-17 Thread Andrea Bolognani
On Mon, 2018-09-17 at 13:43 +0800, Yi Min Zhao wrote: > 在 2018/9/11 下午9:59, Andrea Bolognani 写道: > > > +static void > > > +virDomainZPCIAddressReleaseUid(virHashTablePtr set, > > > + virZPCIDeviceAddressPtr addr) > > > +{ > > > +if (virHashRemoveEntry(set, >uid) <

Re: [libvirt] : Re: [PATCH v2] qemu: fix deadlock if createqemuProcessReconnect thread failed

2018-09-17 Thread wang.yechao255
> On 09/13/2018 10:11 PM, wang.yechao...@zte.com.cn wrote: > > I just code review, found there may be problem. > > > > The follow statement in founction qemuProcessReconnectHelper: > > > > "if (virThreadCreate(, false, qemuProcessReconnect, data) < 0) " > > > > may be failed (no one can

Re: [libvirt] [PATCHv2 0/6] Introduce syntax-check rule for incorrect indentation and blank first line in function body

2018-09-17 Thread Michal Privoznik
On 09/13/2018 10:55 AM, Shi Lei wrote: > v1 here: > https://www.redhat.com/archives/libvir-list/2018-September/msg00497.html > > Diff from v1: (according to the comments from Jano) > - Change build-aux/check-spacing.pl rather than cfg.mk > - Don't exempt '/' (which matches comments in

Re: [libvirt] [PATCH 0/5] qemu: Detect KVM usability correctly

2018-09-17 Thread Andrea Bolognani
On Fri, 2018-09-14 at 16:35 +0200, Jiri Denemark wrote: > On Fri, Sep 14, 2018 at 15:36:42 +0200, Andrea Bolognani wrote: > > How ridiculous would it be to invalidate capabilities whenever > > the daemon is restarted? That might strike a somewhat reasonable > > balance between requiring the admin

[libvirt] [PATCH 6/5] qemu: Avoid probing non-native binaries all the time

2018-09-17 Thread Andrea Bolognani
A side effect of recent changes is that we would always try to regenerate the capabilities cache for non-native QEMU binaries based on /dev/kvm availability, which is of course complete nonsense. Make sure that doesn't happen. Signed-off-by: Andrea Bolognani --- A better spot would be between

Re: [libvirt] [PATCH 5/5] tests: add qemuxml2argv memfd-memory-numa test

2018-09-17 Thread Marc-André Lureau
Hi On Mon, Sep 17, 2018 at 3:07 PM, Michal Privoznik wrote: > On 09/17/2018 11:30 AM, Marc-André Lureau wrote: >> Hi >> >> On Fri, Sep 14, 2018 at 11:44 AM, Michal Prívozník >> wrote: >>> On 09/13/2018 11:51 PM, John Ferlan wrote: On 09/13/2018 10:09 AM, John Ferlan wrote: >

Re: [libvirt] [PATCH 5/5] tests: add qemuxml2argv memfd-memory-numa test

2018-09-17 Thread Michal Privoznik
On 09/17/2018 11:30 AM, Marc-André Lureau wrote: > Hi > > On Fri, Sep 14, 2018 at 11:44 AM, Michal Prívozník > wrote: >> On 09/13/2018 11:51 PM, John Ferlan wrote: >>> >>> >>> On 09/13/2018 10:09 AM, John Ferlan wrote: On 09/13/2018 03:39 AM, Marc-André Lureau wrote: > Hi

Re: [libvirt] [PATCH] conf: fix starting a domain with cpuset=""

2018-09-17 Thread wang.yi59
> On Sat, Sep 15, 2018 at 04:29:24PM +0800, Yi Wang wrote: > > Domain fails to start when its config xml including: > > 64 > > > > # virsh create vm.xml > > error: Failed to create domain from vm.xml > > error: invalid argument: Failed to parse bitmap '' > > > > This patch fixes this. > >

Re: [libvirt] [PATCH v2] nwfilter: fix deadlock when nwfilter reload

2018-09-17 Thread wang.yechao255
I'm sorry about many v1 patches posted. I fix some syntax errors in all v2 patches, and should note the changes in these patches. I will learn more about posting patch correctly. Thanks John. --- Best wishes, Wang Yechao 原始邮件 发件人:JohnFerlan

Re: [libvirt] [PATCH 5/5] tests: add qemuxml2argv memfd-memory-numa test

2018-09-17 Thread Marc-André Lureau
Hi On Fri, Sep 14, 2018 at 11:44 AM, Michal Prívozník wrote: > On 09/13/2018 11:51 PM, John Ferlan wrote: >> >> >> On 09/13/2018 10:09 AM, John Ferlan wrote: >>> >>> >>> On 09/13/2018 03:39 AM, Marc-André Lureau wrote: Hi On Thu, Sep 13, 2018 at 2:25 AM, John Ferlan wrote: >

Re: [libvirt] [PATCH V3 1/2] libxl: drop support for Xen < 4.6

2018-09-17 Thread Andrea Bolognani
On Tue, 2018-09-11 at 16:38 -0600, Jim Fehlig wrote: [...] > Since Xen 4.6 contains a pkgconfig file, drop the now unused code > that falls back to using LIBVIRT_CHECK_LIB in the absence of > pkgconfig file. [...] > - dnl pkgconfig file not found, fallback to lib probe > - if test

Re: [libvirt] [PATCH v2 1/2] qemu: Remove network type limitation for qemuARPGetInterfaces

2018-09-17 Thread Lin Ma
On 09/14/2018 11:27 PM, John Ferlan wrote: On 09/13/2018 03:54 AM, Lin Ma wrote: When we call qemuARPGetInterfaces to get IP from the host's arp table, We ignore VIR_DOMAIN_NET_TYPE_ETHERNET, VIR_DOMAIN_NET_TYPE_VHOSTUSER and s/ignore/should ignore/ VIR_DOMAIN_NET_TYPE_DIRECT due to the

Re: [libvirt] [PATCH v2 1/2] qemu: Remove network type limitation for qemuARPGetInterfaces

2018-09-17 Thread Lin Ma
On 09/15/2018 07:14 AM, Laine Stump wrote: On 09/13/2018 03:54 AM, Lin Ma wrote: When we call qemuARPGetInterfaces to get IP from the host's arp table, We ignore VIR_DOMAIN_NET_TYPE_ETHERNET, VIR_DOMAIN_NET_TYPE_VHOSTUSER and VIR_DOMAIN_NET_TYPE_DIRECT due to the host's arp table won't

Re: [libvirt] [PATCH] conf: fix starting a domain with cpuset=""

2018-09-17 Thread Erik Skultety
On Sat, Sep 15, 2018 at 04:29:24PM +0800, Yi Wang wrote: > Domain fails to start when its config xml including: > 64 > > # virsh create vm.xml > error: Failed to create domain from vm.xml > error: invalid argument: Failed to parse bitmap '' > > This patch fixes this. > > Signed-off-by: Yi

Re: [libvirt] [PATCH v5 11/13] qemu: Add hotpluging support for PCI devices on S390 guests

2018-09-17 Thread Yi Min Zhao
在 2018/9/11 下午11:21, Andrea Bolognani 写道: On Tue, 2018-09-04 at 16:39 +0800, Yi Min Zhao wrote: [...] +static int +qemuDomainAttachExtensionDevice(qemuMonitorPtr mon, +virDomainDeviceInfoPtr info) +{ +if (!virZPCIDeviceAddressIsEmpty(>addr.pci.zpci)) +