[libvirt] [PATCH] virsh: Drop dead variables

2018-08-31 Thread Eric Blake
The helper function virshSnapshotCreate (formerly vshSnapshotCreate) has had dead variables since commit a00c37f2 (Sep 2011). Signed-off-by: Eric Blake --- Pushing under the trivial rule. tools/virsh-snapshot.c | 6 -- 1 file changed, 6 deletions(-) diff --git a/tools/virsh-snapshot.c

Re: [libvirt] [PATCH v3 28/28] security_dac: Lock domain metadata

2018-08-31 Thread John Ferlan
On 08/27/2018 04:08 AM, Michal Privoznik wrote: You have nothing to say here, wow we got this far and your speechless... Or your fingers were just really tired from all those patches! > Signed-off-by: Michal Privoznik > --- > src/security/security_dac.c | 52 >

Re: [libvirt] [PATCH v3 27/28] security_dac: Move transaction handling up one level

2018-08-31 Thread John Ferlan
On 08/27/2018 04:08 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 v3 24/28] security_dac: Pass virSecurityManagerPtr to virSecurityDACRestoreFileLabelInternal

2018-08-31 Thread John Ferlan
On 08/27/2018 04:08 AM, Michal Privoznik wrote: > This function is going call security manager APIs and therefore > it needs pointer to it. > > Signed-off-by: Michal Privoznik > --- > src/security/security_dac.c | 43 ++- > 1 file changed, 18

Re: [libvirt] [PATCH v3 26/28] security_dac: Fix const correctness

2018-08-31 Thread John Ferlan
On 08/27/2018 04:08 AM, Michal Privoznik wrote: > These two functions (virSecurityDACSetOwnership and > virSecurityDACRestoreFileLabelInternal) do not really change > @src. Make it const. > > Signed-off-by: Michal Privoznik > --- > src/security/security_dac.c | 4 ++-- > 1 file changed, 2

Re: [libvirt] [PATCH v3 25/28] security_dac: Fix info messages when chown()-ing

2018-08-31 Thread John Ferlan
On 08/27/2018 04:08 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 v3 23/28] security_dac: Pass virSecurityManagerPtr to virSecurityDACSetOwnership

2018-08-31 Thread John Ferlan
On 08/27/2018 04:08 AM, Michal Privoznik wrote: > This function is going call security manager APIs and therefore > it needs pointer to it. > > Signed-off-by: Michal Privoznik > --- > src/security/security_dac.c | 37 +++-- > 1 file changed, 19 insertions(+),

Re: [libvirt] [PATCH v3 20/28] security_manager: Load lock plugin on init

2018-08-31 Thread John Ferlan
On 08/27/2018 04:08 AM, Michal Privoznik wrote: > When creating the security managers stack load the lock plugin > too. This is done by creating a single object that all secdrivers > take a reference to. We have to have one shared object so that > the connection to virlockd can be shared

Re: [libvirt] [PATCH v3 22/28] security_manager: Introduce metadata locking APIs

2018-08-31 Thread John Ferlan
On 08/27/2018 04:08 AM, Michal Privoznik wrote: > Expose two APIs to lock and unlock metadata for given path. As > the comment from the header file says, this is somewhat > cumbersome, but it does not seem there is a better way. > > The idea is that a security driver (like DAC or SELinux) will

Re: [libvirt] [PATCH v3 21/28] security_manager: Introduce virSecurityManagerLockCloseConn

2018-08-31 Thread John Ferlan
On 08/27/2018 04:08 AM, Michal Privoznik wrote: > This is basically just a wrapper over virLockManagerCloseConn() > so that no connection is left open when it shouldn't be. > > Signed-off-by: Michal Privoznik > --- > src/security/security_manager.c | 75 >

Re: [libvirt] [PATCH 4/6] conf: Move virDomainPCIAddressAsString() to device_conf

2018-08-31 Thread Andrea Bolognani
On Fri, 2018-08-31 at 15:29 +0100, Daniel P. Berrangé wrote: > On Fri, Aug 31, 2018 at 04:25:25PM +0200, Andrea Bolognani wrote: > > On Fri, 2018-08-31 at 15:05 +0100, Daniel P. Berrangé wrote: > > > This should really be in src/util/virpci.{c,h}, since that's where the > > >

Re: [libvirt] [PATCH 4/6] conf: Move virDomainPCIAddressAsString() to device_conf

2018-08-31 Thread Daniel P . Berrangé
On Fri, Aug 31, 2018 at 04:25:25PM +0200, Andrea Bolognani wrote: > On Fri, 2018-08-31 at 15:05 +0100, Daniel P. Berrangé wrote: > > On Fri, Aug 31, 2018 at 04:00:45PM +0200, Andrea Bolognani wrote: > > > Unfortunately, even after this change functions > > > handling virPCIDeviceAddress are split

Re: [libvirt] [PATCH 4/6] conf: Move virDomainPCIAddressAsString() to device_conf

2018-08-31 Thread Andrea Bolognani
On Fri, 2018-08-31 at 15:05 +0100, Daniel P. Berrangé wrote: > On Fri, Aug 31, 2018 at 04:00:45PM +0200, Andrea Bolognani wrote: > > Unfortunately, even after this change functions > > handling virPCIDeviceAddress are split pretty much > > evenly between conf/device_conf and utils/virpci: > >

Re: [libvirt] [PATCH] rpc: fix handling of SSH auth failure code

2018-08-31 Thread Daniel P . Berrangé
On Fri, Aug 31, 2018 at 04:16:45PM +0200, Andrea Bolognani wrote: > On Fri, 2018-08-31 at 11:15 +0100, Daniel P. Berrangé wrote: > > The result of libssh2_userauth_password is being assigned to 'ret' in > > one branch and 'rc' in the other branch. Checks are all done against the > > 'ret'

Re: [libvirt] [PATCH] rpc: fix handling of SSH auth failure code

2018-08-31 Thread Andrea Bolognani
On Fri, 2018-08-31 at 11:15 +0100, Daniel P. Berrangé wrote: > The result of libssh2_userauth_password is being assigned to 'ret' in > one branch and 'rc' in the other branch. Checks are all done against the > 'ret' variable, so one branch never does the correct check. > > Signed-off-by: Daniel

Re: [libvirt] [PATCH 4/6] conf: Move virDomainPCIAddressAsString() to device_conf

2018-08-31 Thread Daniel P . Berrangé
On Fri, Aug 31, 2018 at 04:00:45PM +0200, Andrea Bolognani wrote: > It's a better fit than domain_conf. > > Unfortunately, even after this change functions > handling virPCIDeviceAddress are split pretty much > evenly between conf/device_conf and utils/virpci: > ideally everything would be moved

[libvirt] [PATCH 2/2] qemu: Unify generation of command line for virtio devices

2018-08-31 Thread Andrea Bolognani
A virtio device such as will be translated to one of four different QEMU devices based on the address type. This behavior is the same for all virtio devices, but unfortunately we have separate ad-hoc code dealing with each and every one of them: not only this is pointless duplication, but it

[libvirt] [PATCH 1/2] tests: Fix use of virtio-serial for aarch64/virt

2018-08-31 Thread Andrea Bolognani
virtio-serial is an alias for virtio-serial-pci, which should not have been used for a PCIe-less aarch64/virt guest but it ended up being used anyway because the virtio-mmio capability was missing and the algorithm is buggy. Fix the test case so that we can fix the algorithm next. Signed-off-by:

[libvirt] [PATCH 0/2] qemu: Unify generation of command line for virtio devices

2018-08-31 Thread Andrea Bolognani
-device virtio-blurb-pci Andrea Bolognani (2): tests: Fix use of virtio-serial for aarch64/virt qemu: Unify generation of command line for virtio devices src/qemu/qemu_command.c | 299 ++ .../mach-virt-console-virtio.args | 2 +-

[libvirt] [PATCH 3/6] conf: Change return type of *AddressIsValid() to bool

2018-08-31 Thread Andrea Bolognani
These are simple predicates, which makes bool a more appropriate return type than int. Signed-off-by: Andrea Bolognani --- src/conf/device_conf.c | 31 --- src/conf/device_conf.h | 10 +- 2 files changed, 21 insertions(+), 20 deletions(-) diff --git

[libvirt] [PATCH 1/6] conf: Move virDomainDeviceAddressType to device_conf

2018-08-31 Thread Andrea Bolognani
It's used in virDomainDeviceInfo, which makes domain_conf the wrong place to declare it. Signed-off-by: Andrea Bolognani --- src/conf/device_conf.c | 15 +++ src/conf/device_conf.h | 2 ++ src/conf/domain_conf.c | 14 -- src/conf/domain_conf.h | 1 -

[libvirt] [PATCH 5/6] conf: Rename virDomainPCIAddressAsString()

2018-08-31 Thread Andrea Bolognani
The struct is called virPCIDeviceAddress and the functions operating on it should be named accordingly. Signed-off-by: Andrea Bolognani --- src/conf/device_conf.c | 2 +- src/conf/device_conf.h | 2 +- src/conf/domain_addr.c | 6 +++--- src/libvirt_private.syms | 2

[libvirt] [PATCH 4/6] conf: Move virDomainPCIAddressAsString() to device_conf

2018-08-31 Thread Andrea Bolognani
It's a better fit than domain_conf. Unfortunately, even after this change functions handling virPCIDeviceAddress are split pretty much evenly between conf/device_conf and utils/virpci: ideally everything would be moved to the former, including the struct declaration itself, and all the names

[libvirt] [PATCH 2/6] conf: Move virDomainDeviceAddressIsValid() to device_conf

2018-08-31 Thread Andrea Bolognani
The function is called on a virDomainDeviceInfo, so it should be declared along with it. Moving this function requires moving and making public virDomainDeviceCCWAddressIsValid() as well, but that's perfectly fine since the same reasoning above also applies to it, due to virDomainDeviceCCWAddress

[libvirt] [PATCH 6/6] conf: Move *AddressParseXML() to device_conf

2018-08-31 Thread Andrea Bolognani
The corresponding structs are declared there. Signed-off-by: Andrea Bolognani --- src/conf/device_conf.c | 267 ++ src/conf/device_conf.h | 17 +++ src/conf/domain_conf.c | 270 --- src/libvirt_private.syms | 6 +

[libvirt] [PATCH 0/6] conf: Move a bunch of stuff to device_conf

2018-08-31 Thread Andrea Bolognani
These are the times where I wish we were using a language with support for proper classes and modules like, I dunno, PHP or something. Andrea Bolognani (6): conf: Move virDomainDeviceAddressType to device_conf conf: Move virDomainDeviceAddressIsValid() to device_conf conf: Change return

Re: [libvirt] [PATCH v3 19/28] qemu_conf: Introduce metadata_lock_manager

2018-08-31 Thread John Ferlan
On 08/27/2018 04:08 AM, Michal Privoznik wrote: > This config option allows users to set and enable lock manager > for domain metadata. The lock manager is going to be used by > security drivers to serialize each other when changing a file > ownership or changing the SELinux label. The only

Re: [libvirt] [PATCH 01/10] docs: don't refer to deprecated 'linux' ostype in example

2018-08-31 Thread Marek Marczykowski-Górecki
On Thu, Aug 30, 2018 at 03:29:41PM +0100, Daniel P. Berrangé wrote: > On Thu, Aug 30, 2018 at 04:27:06PM +0200, Marek Marczykowski-Górecki wrote: > > On Mon, Aug 27, 2018 at 03:23:16PM -0600, Jim Fehlig wrote: > > > On 08/05/2018 03:48 PM, Marek Marczykowski-Górecki wrote: > > > > Use preferred

Re: [libvirt] [PATCH v3 18/28] lock_manager: Allow disabling configFile for virLockManagerPluginNew

2018-08-31 Thread John Ferlan
On 08/27/2018 04:08 AM, Michal Privoznik wrote: > In some cases we might want to not load the lock driver config. > Alter virLockManagerPluginNew() and the lock drivers to cope with > this fact. No current cases, but sometime in the future the requirement that a configFile exists will be

Re: [libvirt] [PATCH v3 00/28] Introduce metadata locking

2018-08-31 Thread Daniel P . Berrangé
On Mon, Aug 27, 2018 at 10:08:13AM +0200, Michal Privoznik wrote: > v3 of: > > https://www.redhat.com/archives/libvir-list/2018-August/msg00814.html > > What has changed since v2? A lot. > - The lock manager was moved into security manager (which requires a lot > of preparation which is done

Re: [libvirt] [PATCH v3 17/28] lock_manager: Introduce virLockManagerCloseConn

2018-08-31 Thread John Ferlan
On 08/27/2018 04:08 AM, Michal Privoznik wrote: > After the previous commit we have VIR_LOCK_MANAGER_ACQUIRE_KEEP_OPEN > flag. This is not enough because it will keep connection open for only > one instance of drvAcquire + drvRelease call. And when starting up a > domain there will be a lot of

[libvirt] [PATCH] qemu: mdev: Set vfio device property 'display' to off only if mdev is vfio-pci

2018-08-31 Thread Farhan Ali
S390 is aware of both vfio-pci and vfio-ccw devices, so on S390 the capability QEMU_CAPS_VFIO_PCI_DISPLAY will be available. Add an extra check to make sure we only set the display to off for vfio-pci mediated devices. Otherwise we add display for vfio-ccw device and this breaks vfio-ccw device

Re: [libvirt] [PATCH v3 16/28] lock_driver: Introduce KEEP_OPEN flags

2018-08-31 Thread John Ferlan
On 08/27/2018 04:08 AM, Michal Privoznik wrote: > This flag causes connection to be opened when needed (e.g. when > calling virLockManagerLockDaemonAcquire for the first time) and > instead of closing it at the end of such API store it in > privateData so that it can be reused by later calls. >

Re: [libvirt] [PATCH] qemu: mdev: Set vfio device property 'display' to off only if mdev is vfio-pci

2018-08-31 Thread Erik Skultety
On Thu, Aug 30, 2018 at 01:07:34PM -0400, Farhan Ali wrote: > S390 is aware of both vfio-pci and vfio-ccw devices, so > on S390 the capability QEMU_CAPS_VFIO_PCI_DISPLAY will be > available. Add an extra check to make sure we only set the > display to off for vfio-pci mediated devices. Otherwise

Re: [libvirt] [PATCH] Add virNetlinkNewLink for simplifying virNetDev*Create

2018-08-31 Thread Erik Skultety
On Thu, Aug 30, 2018 at 02:27:05PM +0800, Shi Lei wrote: > Thanks for your comments. > But I have several questions, please see below... > > On 2018-08-29 at 19:43, Erik Skultety wrote: > >On Thu, Aug 23, 2018 at 12:15:08PM +0800, Shi Lei wrote: > >> This patch adds virNetlinkNewLink for

Re: [libvirt] [PATCH] qga: ignore non present cpus when handling qmp_guest_get_vcpus()

2018-08-31 Thread Laszlo Ersek
On 08/31/18 10:00, Igor Mammedov wrote: > On Thu, 30 Aug 2018 17:51:13 +0200 > Laszlo Ersek wrote: > >> +Drew >> >> On 08/30/18 14:08, Igor Mammedov wrote: >>> If VM has VCPUs plugged sparselly (for example a VM started with >>> 3 VCPUs (cpu0, cpu1 and cpu2) and then cpu1 was hotunplugged so >>>

Re: [libvirt] [jenkins-ci PATCH 1/8] lcitool: Add "-r REVISION" argument for build

2018-08-31 Thread Andrea Bolognani
On Wed, 2018-08-29 at 17:08 +0200, Andrea Bolognani wrote: > This will allow users to build arbitrary branches from > arbitrary git repositories, but for the moment all it > does is parse the argument and pass it down to the > Ansible playbook. > > Signed-off-by: Andrea Bolognani > --- >

[libvirt] [PATCH] rpc: fix handling of SSH auth failure code

2018-08-31 Thread Daniel P . Berrangé
The result of libssh2_userauth_password is being assigned to 'ret' in one branch and 'rc' in the other branch. Checks are all done against the 'ret' variable, so one branch never does the correct check. Signed-off-by: Daniel P. Berrangé --- src/rpc/virnetsshsession.c | 10 +- 1 file

Re: [libvirt] [PATCH 5/5] tests: pass ULLONG_MAX to qemuMonitorJSONGetBalloonInfo

2018-08-31 Thread Daniel P . Berrangé
On Tue, Aug 28, 2018 at 12:22:55PM +0200, Ján Tomko wrote: > Test that we correctly accept 64-bit unsigned numbers for QEMU. > > Signed-off-by: Ján Tomko > --- > tests/qemumonitorjsontest.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) Reviewed-by: Daniel P. Berrangé Regards,

Re: [libvirt] [PATCH 4/5] Test parsing of large numbers in JSON

2018-08-31 Thread Daniel P . Berrangé
On Tue, Aug 28, 2018 at 12:22:54PM +0200, Ján Tomko wrote: > We expect to get numbers as big as ULLONG_MAX from QEMU, > add a test for them. > > Signed-off-by: Ján Tomko > --- > tests/virjsontest.c | 3 +++ > 1 file changed, 3 insertions(+) Reviewed-by: Daniel P. Berrangé Regards, Daniel --

Re: [libvirt] [PATCH 3/5] virjsontest: use the test name in AddRemove test

2018-08-31 Thread Daniel P . Berrangé
On Tue, Aug 28, 2018 at 12:22:53PM +0200, Ján Tomko wrote: > Instead of printing the whole JSON in error messages, > print just the test name. > > Signed-off-by: Ján Tomko > --- > tests/virjsontest.c | 8 > 1 file changed, 4 insertions(+), 4 deletions(-) Reviewed-by: Daniel P.

Re: [libvirt] [PATCH 2/5] virjsontest: use name instead of doc for deflatten test

2018-08-31 Thread Daniel P . Berrangé
On Tue, Aug 28, 2018 at 12:22:52PM +0200, Ján Tomko wrote: > This test gets its JSON docs from files. > > Now that we have a 'name' field in testInfo, use it instead > of abusing the 'doc' field. > > Signed-off-by: Ján Tomko > --- > tests/virjsontest.c | 8 > 1 file changed, 4

Re: [libvirt] [PATCH 1/5] virjsontest: store name in testInfo

2018-08-31 Thread Daniel P . Berrangé
On Tue, Aug 28, 2018 at 12:22:51PM +0200, Ján Tomko wrote: > Give the testing function access to the test name instead of only > passing it to virTestRun. > > Signed-off-by: Ján Tomko > --- > tests/virjsontest.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) Reviewed-by: Daniel P.

Re: [libvirt] [PATCH] qga: ignore non present cpus when handling qmp_guest_get_vcpus()

2018-08-31 Thread Igor Mammedov
On Thu, 30 Aug 2018 17:51:13 +0200 Laszlo Ersek wrote: > +Drew > > On 08/30/18 14:08, Igor Mammedov wrote: > > If VM has VCPUs plugged sparselly (for example a VM started with > > 3 VCPUs (cpu0, cpu1 and cpu2) and then cpu1 was hotunplugged so > > only cpu0 and cpu2 are present), QGA will rise

[libvirt] [PATCH] virhostdev: Fix PCI devices are still attatched to stub driver bug

2018-08-31 Thread Wu Zongyong
Currently, PCI devices will not be rebound to host drivers but attached to the stub driver when: 1) use libvirt to start a virtual machine with PCI devices assigned, then stop libvirtd process and shutdown the virtual machine. Finally, PCI devices are still bound to the stub driver instead of