[libvirt] [PATCH] qemu: enalbe hotplugging of macvtap device with multiqueue

2016-02-25 Thread Shanzhi Yu
in commit 81a110, multiqueue for macvtap is enabled but forget to support hotplugging enabled Signed-off-by: Shanzhi Yu --- src/qemu/qemu_hotplug.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index

Re: [libvirt] [PATCH 2/2] qemu: Allow setting pinning of emulator/iohtread with automatic placement

2016-02-25 Thread John Ferlan
$SUBJ "emulator/iothread" On 02/24/2016 08:45 AM, Peter Krempa wrote: > We honour the placement bitmaps when starting up, so there's no point in > having this check. Additionally the check was buggy since it checked > vm->def all the time even if the user requested to modify the persistent >

Re: [libvirt] [PATCH 1/2] qemu: process: Move emulator thread setting code into one function

2016-02-25 Thread John Ferlan
On 02/24/2016 08:45 AM, Peter Krempa wrote: > Similarly to the refactors to iothreads and vcpus, move the code that > initializes the emulator thread settings into single function. > --- > src/qemu/qemu_cgroup.c | 66 - > src/qemu/qemu_cgroup.h | 1 - >

Re: [libvirt] [PATCH 4/9] util: cgroups do not implicitly add task to new machine cgroup

2016-02-25 Thread John Ferlan
On 02/23/2016 10:58 AM, Henning Schild wrote: > virCgroupNewMachine used to add the pidleader to the newly created > machine cgroup. Do not do this implicit anymore. > > Signed-off-by: Henning Schild > --- > src/lxc/lxc_cgroup.c | 11 +++ >

Re: [libvirt] [PATCH 5/9] qemu_cgroup: put qemu right into emulator sub-cgroup

2016-02-25 Thread John Ferlan
On 02/23/2016 10:58 AM, Henning Schild wrote: > Move qemuSetupCgroupForEmulator up under qemuSetupCgroup. That way > we move the one main thread right into the emulator cgroup, instead > of moving multiple threads later on. And we do not actually want any > threads running in the parent cgroups

Re: [libvirt] [PATCH 3/9] vircgroup: introduce controller mask for threads

2016-02-25 Thread John Ferlan
On 02/23/2016 10:58 AM, Henning Schild wrote: > When using a cgroups hierarchy threads have child cgroups for > certain controllers. Introduce an enum for later reuse. > > Signed-off-by: Henning Schild > --- > src/util/vircgroup.c | 12 +++- >

Re: [libvirt] [PATCH 2/9] vircgroup: add assertion to allow cgroup controllers to stay empty

2016-02-25 Thread John Ferlan
On 02/23/2016 10:58 AM, Henning Schild wrote: > When using a hierarchy of cgroups we might want to add tasks just to > the children cgroups but never to the parent. To make sure we do not > use a parent cgroup by accident add a mechanism that lets us assert > a correct implementation in cases we

Re: [libvirt] [PATCH 1/9] vircgroup: one central point for adding tasks to cgroups

2016-02-25 Thread John Ferlan
On 02/23/2016 10:58 AM, Henning Schild wrote: > Use virCgroupAddTaskController in virCgroupAddTask so we have one > single point where we add tasks to cgroups. > > Signed-off-by: Henning Schild > --- > src/util/vircgroup.c | 2 +- > 1 file changed, 1 insertion(+),

Re: [libvirt] [PATCHv2 5/5] qemu: error out on missing machine type in configs

2016-02-25 Thread John Ferlan
On 02/25/2016 10:40 AM, Ján Tomko wrote: > Commit f1a89a8 allowed parsing configs from /etc/libvirt > without validating the emulator capabilities. > > Check for the presence of a machine type in the qemu driver's > post parse function instead of crashing. > >

[libvirt] [PATCH 0/2] Fix some issues in storage driver error paths

2016-02-25 Thread John Ferlan
While working through the pool driver, I found a couple of issues in error paths for the storage driver. John Ferlan (2): storage: Fix error path in virStoragePoolObjLoad storage: Fix error path in storagePoolDefineXML src/conf/storage_conf.c | 4 ++-- src/storage/storage_driver.c | 1

[libvirt] [PATCH 2/2] storage: Fix error path in storagePoolDefineXML

2016-02-25 Thread John Ferlan
Found by inspection - after calling virStoragePoolObjAssignDef the pool is part of the driver->pools.objs list and the failure path for the virStoragePoolObjSaveDef will use virStoragePoolObjRemove to remove the pool from the objs list which will unlock and free the pool pointer (as pools->objs[i]

[libvirt] [PATCH 1/2] storage: Fix error path in virStoragePoolObjLoad

2016-02-25 Thread John Ferlan
While reviewing how storage driver used ObjListPtr's for reference in some recent secret driver patches to use the same mechanism, I came across an instance where the wrong API was called for error paths after successfully allocating the storage pool pointer and inserting into the driver pool

Re: [libvirt] [PATCH 09/14] secret: Create a 'configFile' in virSecretObj

2016-02-25 Thread John Ferlan
On 02/25/2016 09:03 AM, John Ferlan wrote: > This patch removes the need for secretXMLPath. Instead save 'path' during > loadSecret as 'configFile'. The secretXMLPath is nothing more than an > open coded virFileBuildPath. All that code did was concantenate the > driver->configDir, the UUID of

Re: [libvirt] [PATCH] libxl: unref objects in error paths

2016-02-25 Thread Jim Fehlig
Michal Privoznik wrote: > On 24.02.2016 23:55, Jim Fehlig wrote: >> libxlMakeNic opens a virConnect object and takes a reference on a >> virNetwork object, but doesn't drop the references on all error >> paths. Rework the function to follow the standard libvirt pattern >> of using a local 'ret'

Re: [libvirt] [PATCH] virfile: properly detect NFS storage

2016-02-25 Thread Cole Robinson
On 02/25/2016 01:38 PM, John Ferlan wrote: > > > On 02/25/2016 10:25 AM, Cole Robinson wrote: >> On 02/24/2016 09:31 AM, Pavel Hrdina wrote: >>> Commit 35847860 introduced virFileUnlink() to fix an issue with deleting >>> volumes on NFS root-squashed environment. This patch replace the uid >>>

Re: [libvirt] libvirt 1.2.9.3 - test for vircgrouptest fails

2016-02-25 Thread Florian Hubold
Am 25.02.2016 um 07:25 schrieb Michal Privoznik: > On 24.02.2016 21:36, Florian Hubold wrote: >> Hi, >> >> one of the seems to fail on our build system, vircgrouptest fails with >> Unexpected: nodeGetCPUCount() yields: -1 >> >> The test runs fine locally. >> Here are the contents from

Re: [libvirt] [PATCH] virfile: properly detect NFS storage

2016-02-25 Thread John Ferlan
On 02/25/2016 10:25 AM, Cole Robinson wrote: > On 02/24/2016 09:31 AM, Pavel Hrdina wrote: >> Commit 35847860 introduced virFileUnlink() to fix an issue with deleting >> volumes on NFS root-squashed environment. This patch replace the uid >> and gid magic by virFileIsSharedFSType() to correctly

Re: [libvirt] [PATCHv2 0/5] Fix machine type parsing regressions

2016-02-25 Thread Cole Robinson
On 02/25/2016 10:40 AM, Ján Tomko wrote: > Patch 2/5 is the important one, fixing persistent non-QEMU domains. > > Ján Tomko (5): > testCompareDomXML2XMLFiles: add parseFlags parameter > Revert "Error out on missing machine type in machine configs" > tests: add a test for persistent LXC XML

Re: [libvirt] [PATCH v4 3/3] virsh: Add support for text based polkit authentication

2016-02-25 Thread Daniel P. Berrange
On Thu, Feb 25, 2016 at 12:01:59PM -0500, John Ferlan wrote: > https://bugzilla.redhat.com/show_bug.cgi?id=872166 > > When the login session doesn't have an ssh -X type display agent in > order for libvirtd to run the polkit session authentication, attempts > to run 'virsh -c qemu:///system list'

Re: [libvirt] [PATCH v4 2/3] util: Introduce API's for Polkit text authentication

2016-02-25 Thread Daniel P. Berrange
On Thu, Feb 25, 2016 at 12:01:05PM -0500, John Ferlan wrote: > Introduce virPolkitAgentCreate and virPolkitAgentDestroy > > virPolkitAgentCreate will run the polkit pkttyagent image as an asynchronous > command in order to handle the local agent authentication via stdin/stdout. > The code makes

[libvirt] [PATCH v4 3/3] virsh: Add support for text based polkit authentication

2016-02-25 Thread John Ferlan
https://bugzilla.redhat.com/show_bug.cgi?id=872166 When the login session doesn't have an ssh -X type display agent in order for libvirtd to run the polkit session authentication, attempts to run 'virsh -c qemu:///system list' from an unauthorized user (or one that isn't part of the libvirt

[libvirt] [PATCH v4 2/3] util: Introduce API's for Polkit text authentication

2016-02-25 Thread John Ferlan
Introduce virPolkitAgentCreate and virPolkitAgentDestroy virPolkitAgentCreate will run the polkit pkttyagent image as an asynchronous command in order to handle the local agent authentication via stdin/stdout. The code makes use of the pkttyagent --notify-fd mechanism to let it know when the

Re: [libvirt] [PATCH v3 2/3] util: Introduce API's for Polkit text authentication

2016-02-25 Thread Daniel P. Berrange
On Thu, Feb 25, 2016 at 11:47:03AM -0500, John Ferlan wrote: > > > On 02/25/2016 09:25 AM, Daniel P. Berrange wrote: > >> int virPolkitCheckAuth(const char *actionid, > >> pid_t pid, > >> unsigned long long startTime, > >> @@ -31,4 +33,7 @@ int

Re: [libvirt] [PATCH v3 2/3] util: Introduce API's for Polkit text authentication

2016-02-25 Thread John Ferlan
On 02/25/2016 09:25 AM, Daniel P. Berrange wrote: > On Fri, Feb 12, 2016 at 12:12:32PM -0500, John Ferlan wrote: >> Introduce virPolkitAgentCreate and virPolkitAgentDestroy >> >> virPolkitAgentCreate will run the polkit pkttyagent image as an asynchronous >> command in order to handle the local

Re: [libvirt] [PATCH 1/2] netdev: Use virNetDevIsVirtualFunction() properly

2016-02-25 Thread Andrea Bolognani
On Thu, 2016-02-25 at 15:51 +0100, Michal Privoznik wrote: > On 25.02.2016 14:02, Andrea Bolognani wrote: > > > > virNetDevIsVirtualFunction() returns 1 if the interface is a > > virtual function, 0 if it isn't and -1 on error. This means that, > > despite the name suggesting otherwise, using it

Re: [libvirt] [PATCH 2/2] hostdev: Remove temporary variable when checking for VF

2016-02-25 Thread Andrea Bolognani
On Thu, 2016-02-25 at 15:51 +0100, Michal Privoznik wrote: > On 25.02.2016 14:02, Andrea Bolognani wrote: > > > > The virHostdevIsVirtualFunction() was called exactly twice, and in > > both cases the return value was saved to a temporary variable before > > being checked. This would be okay if it

Re: [libvirt] [python PATCH 0/4] formatting and (un)signed improvements

2016-02-25 Thread Michal Privoznik
On 23.02.2016 13:56, Pavel Hrdina wrote: > Pavel Hrdina (4): > libvirt-override: all flags should be defined as unsigned int > libvirt-override: fix PyArg_ParseTuple for unsigned int > libvirt-override: fix PyArg_ParseTuple for unsigned long long > libvirt-override: fix PyArg_ParseTuple

[libvirt] [PATCHv2 3/5] tests: add a test for persistent LXC XML parsing

2016-02-25 Thread Ján Tomko
Check if we correctly parse the persistent config even with the VIR_DOMAIN_DEF_PARSE_SKIP_OSTYPE_CHECKS flag. --- tests/lxcxml2xmltest.c | 14 +- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/tests/lxcxml2xmltest.c b/tests/lxcxml2xmltest.c index 8174a54..0b51340 100644

[libvirt] [PATCHv2 4/5] tests: add parseFlags to qemuxml2argvtest

2016-02-25 Thread Ján Tomko
--- tests/qemuxml2argvtest.c | 35 --- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 854623d..517f996 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -253,7 +253,8

[libvirt] [PATCHv2 1/5] testCompareDomXML2XMLFiles: add parseFlags parameter

2016-02-25 Thread Ján Tomko
Allow testing XML parsing with different flags. --- tests/bhyvexml2xmltest.c | 2 +- tests/genericxml2xmltest.c | 2 +- tests/lxcxml2xmltest.c | 2 +- tests/qemuxml2xmltest.c| 4 ++-- tests/testutils.c | 5 - tests/testutils.h | 3 ++- 6 files changed, 11

[libvirt] [PATCHv2 2/5] Revert "Error out on missing machine type in machine configs"

2016-02-25 Thread Ján Tomko
Revert commit 55e6d8cd9eac7eb2aaa4d221585e9402cf7269d5. This fix for https://bugzilla.redhat.com/show_bug.cgi?id=1267256 unconditionally required a machine type for all machine types even though qemu is the only emulator using them. Revert it to fix persistent configs for drivers with no machine

[libvirt] [PATCHv2 5/5] qemu: error out on missing machine type in configs

2016-02-25 Thread Ján Tomko
Commit f1a89a8 allowed parsing configs from /etc/libvirt without validating the emulator capabilities. Check for the presence of a machine type in the qemu driver's post parse function instead of crashing. https://bugzilla.redhat.com/show_bug.cgi?id=1267256 --- src/qemu/qemu_domain.c

[libvirt] [PATCHv2 0/5] Fix machine type parsing regressions

2016-02-25 Thread Ján Tomko
Patch 2/5 is the important one, fixing persistent non-QEMU domains. Ján Tomko (5): testCompareDomXML2XMLFiles: add parseFlags parameter Revert "Error out on missing machine type in machine configs" tests: add a test for persistent LXC XML parsing tests: add parseFlags to qemuxml2argvtest

Re: [libvirt] [PATCH 1/3] openvz: Use virStringSplitCount instead of strtok_r

2016-02-25 Thread Michal Privoznik
On 25.02.2016 15:21, John Ferlan wrote: > When parsing the barrier:limit values, use virStringSplitCount in order > to split the pair and make the approriate checks to get the data. > > Signed-off-by: John Ferlan > --- > src/openvz/openvz_conf.c | 32

Re: [libvirt] [PATCH 0/3] More Coverity changes

2016-02-25 Thread Michal Privoznik
On 25.02.2016 15:21, John Ferlan wrote: > All the issues here are found by a later version of Coverity than > the one used by our internal testing. Two were false positives and > one just an ordering issue with the virCheckFlags in the zfs backend. > > The future coverity really has a problem

Re: [libvirt] [PATCH] virfile: properly detect NFS storage

2016-02-25 Thread Cole Robinson
On 02/24/2016 09:31 AM, Pavel Hrdina wrote: > Commit 35847860 introduced virFileUnlink() to fix an issue with deleting > volumes on NFS root-squashed environment. This patch replace the uid > and gid magic by virFileIsSharedFSType() to correctly detect that the > volume is on NFS storage. > >

Re: [libvirt] [PATCH 2/7] qemu: Properly update completed migration stats

2016-02-25 Thread Jiri Denemark
On Tue, Feb 23, 2016 at 16:41:41 +0100, Jiri Denemark wrote: > We should not overwrite all migration statistics on the source with the > numbers sent by the destination since the source may have an updated > view in some cases (such as post-copy migration). It's safer to update > just the timing

Re: [libvirt] [PATCH v4 2/2] qemu: emit 'defined' event after reverted to snapshot without state changes

2016-02-25 Thread Cole Robinson
On 02/18/2016 05:06 AM, Dmitry Andreev wrote: > When domain is reverted to a snapshot it's configuration and state > may be changed. If the domain state was changed libvirt emits one > or more _FROM_SNAPSHOT events. > > In case when domain and target states both are offline there will be > no

Re: [libvirt] [PATCH 2/2] hostdev: Remove temporary variable when checking for VF

2016-02-25 Thread Michal Privoznik
On 25.02.2016 14:02, Andrea Bolognani wrote: > The virHostdevIsVirtualFunction() was called exactly twice, and in > both cases the return value was saved to a temporary variable before > being checked. This would be okay if it improved readability, but in > this case is pretty pointless. > > Get

Re: [libvirt] [PATCH 1/2] netdev: Use virNetDevIsVirtualFunction() properly

2016-02-25 Thread Michal Privoznik
On 25.02.2016 14:02, Andrea Bolognani wrote: > virNetDevIsVirtualFunction() returns 1 if the interface is a > virtual function, 0 if it isn't and -1 on error. This means that, > despite the name suggesting otherwise, using it as a predicate is > not correct. > > Fix two callers that were doing so

Re: [libvirt] [PATCH v3 3/3] virsh: Add support for text based polkit authentication

2016-02-25 Thread Daniel P. Berrange
On Fri, Feb 12, 2016 at 12:12:33PM -0500, John Ferlan wrote: > https://bugzilla.redhat.com/show_bug.cgi?id=872166 > > When the login session doesn't have an ssh -X type display agent in > order for libvirtd to run the polkit session authentication, attempts > to run 'virsh -c qemu:///system list'

Re: [libvirt] [PATCH v3 2/3] util: Introduce API's for Polkit text authentication

2016-02-25 Thread Daniel P. Berrange
On Fri, Feb 12, 2016 at 12:12:32PM -0500, John Ferlan wrote: > Introduce virPolkitAgentCreate and virPolkitAgentDestroy > > virPolkitAgentCreate will run the polkit pkttyagent image as an asynchronous > command in order to handle the local agent authentication via stdin/stdout. > The code makes

Re: [libvirt] [PATCH] libxl: unref objects in error paths

2016-02-25 Thread Michal Privoznik
On 24.02.2016 23:55, Jim Fehlig wrote: > libxlMakeNic opens a virConnect object and takes a reference on a > virNetwork object, but doesn't drop the references on all error > paths. Rework the function to follow the standard libvirt pattern > of using a local 'ret' variable to hold the function

Re: [libvirt] [PATCH] build: work around gcc 6.0 warnings

2016-02-25 Thread Peter Krempa
On Thu, Feb 25, 2016 at 14:52:16 +0100, Ján Tomko wrote: > On Thu, Feb 25, 2016 at 06:46:55AM -0700, Eric Blake wrote: > > D'oh. I blame emacs - I have it set to remind me to automatically update > > copyright, and must have accidentally said yes to updating the diff. > > I'll need to teach my

Re: [libvirt] [PATCH v3 1/3] polkit: Adjust message when authentication agent isn't found

2016-02-25 Thread Daniel P. Berrange
On Fri, Feb 12, 2016 at 12:12:31PM -0500, John Ferlan wrote: > When there isn't a ssh -X type session running and a user has not > been added to the libvirt group, attempts to run 'virsh -c qemu:///system' > commands from an otherwise unprivileged user will fail with rather > generic or opaque

[libvirt] [PATCH 1/3] openvz: Use virStringSplitCount instead of strtok_r

2016-02-25 Thread John Ferlan
When parsing the barrier:limit values, use virStringSplitCount in order to split the pair and make the approriate checks to get the data. Signed-off-by: John Ferlan --- src/openvz/openvz_conf.c | 32 +++- 1 file changed, 11 insertions(+), 21

[libvirt] [PATCH 3/3] storage: No need to check ret after VIR_APPEND_ELEMENT

2016-02-25 Thread John Ferlan
Generates a false positive for Coverity, but it turns out there's no need to check ret == -1 since if VIR_APPEND_ELEMENT is successful, the local vol pointer is cleared anyway. Signed-off-by: John Ferlan --- src/storage/storage_backend_logical.c | 2 +-

[libvirt] [PATCH 0/3] More Coverity changes

2016-02-25 Thread John Ferlan
All the issues here are found by a later version of Coverity than the one used by our internal testing. Two were false positives and one just an ordering issue with the virCheckFlags in the zfs backend. The future coverity really has a problem with strtok_r usage after a VIR_STRDUP which only

[libvirt] [PATCH 2/3] zfs: Resolve RESOURCE_LEAK

2016-02-25 Thread John Ferlan
Found by my Coverity checker - virCheckFlags call could return -1, but not virCommandFree(destroy_cmd). Signed-off-by: John Ferlan --- src/storage/storage_backend_zfs.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/storage/storage_backend_zfs.c

Re: [libvirt] [PATCH] Revert "Error out on missing machine type in machine configs"

2016-02-25 Thread Cole Robinson
On 02/25/2016 09:10 AM, Ján Tomko wrote: > On Thu, Feb 25, 2016 at 08:58:23AM -0500, Cole Robinson wrote: >> On 02/25/2016 08:50 AM, Ján Tomko wrote: >>> On Thu, Feb 25, 2016 at 07:45:17AM -0500, Cole Robinson wrote: On 02/25/2016 07:24 AM, Ján Tomko wrote: > Revert commit

Re: [libvirt] [PATCH] Revert "Error out on missing machine type in machine configs"

2016-02-25 Thread Ján Tomko
On Thu, Feb 25, 2016 at 08:58:23AM -0500, Cole Robinson wrote: > On 02/25/2016 08:50 AM, Ján Tomko wrote: > > On Thu, Feb 25, 2016 at 07:45:17AM -0500, Cole Robinson wrote: > >> On 02/25/2016 07:24 AM, Ján Tomko wrote: > >>> Revert commit 55e6d8cd9eac7eb2aaa4d221585e9402cf7269d5. > >>> > >>> It

[libvirt] [PATCH 00/14] Secret driver updates

2016-02-25 Thread John Ferlan
This started as a 'simple' change to use virFileRewrite instead of replaceFile (as pointed out by jtomko in his reply to my review comments of the safewrite_str series:) http://www.redhat.com/archives/libvir-list/2016-February/msg01141.html However, as I was looking at the code I thought - well

[libvirt] [PATCH 04/14] secret: Remove local virSecretPtr 'secret'

2016-02-25 Thread John Ferlan
Remove the need for the local 'secret' in secretConnectListAllSecrets. A subsequent patch will rename the ObjPtr entry to secret. Signed-off-by: John Ferlan --- src/secret/secret_driver.c | 11 +-- 1 file changed, 5 insertions(+), 6 deletions(-) diff --git

[libvirt] [PATCH 07/14] secret: Rename directory to configDir

2016-02-25 Thread John Ferlan
This follows other drivers usage model. Signed-off-by: John Ferlan --- src/secret/secret_driver.c | 22 +++--- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/secret/secret_driver.c b/src/secret/secret_driver.c index c2bd72a..abeefc3

[libvirt] [PATCH 03/14] secret: Rename virSecretEntry

2016-02-25 Thread John Ferlan
Rename to virSecretObj - preparation for future patch, but also follows similar code in other drivers. Signed-off-by: John Ferlan --- src/secret/secret_driver.c | 84 +++--- 1 file changed, 42 insertions(+), 42 deletions(-) diff --git

[libvirt] [PATCH 13/14] secret: Rename loadSecrets

2016-02-25 Thread John Ferlan
Rename to secretLoadAllConfigs and add the 'driver->configDir' as a parameter. Signed-off-by: John Ferlan --- src/secret/secret_driver.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/secret/secret_driver.c

[libvirt] [PATCH 14/14] secret: Introduce virSecretObjList

2016-02-25 Thread John Ferlan
This patch replaces the listInsert and listUnlink with the more commonly used VIR_APPEND_ELEMENT and VIR_REMOVE_ELEMENT macros used for list mgmt. Of course that does require any code walking the ->next list to instead use the ->count for loop Signed-off-by: John Ferlan ---

[libvirt] [PATCH 10/14] secret: Create a 'base64File' in virSecretObj

2016-02-25 Thread John Ferlan
This patch removes need for secretBase64Path and secretComputePath. Similar to the configFile, create an entry for base64File, which will be generated as the driver->configDir, the UUID value, plus the ".base" suffix. Rather than generating on the fly, store this in the virSecretObj. The buildup

[libvirt] [PATCH 08/14] secret: Adjust logic to build file path in secretLoad

2016-02-25 Thread John Ferlan
The 'secretLoad' was essentially open coding virFileBuildPath. Adjust the logic to have the caller build the path and pass it. The net sum of ignoring the virFileBuildPath failure is the same as before where the failure to virAsprintf the path would have been ignored anyway in the secretLoad

[libvirt] [PATCH 11/14] secret: Introduce listUnlinkSecret

2016-02-25 Thread John Ferlan
Add a temporary helper to search for a specific secret by address on the list and remove it if it's found. The following patch will introduce a common allocation and listInsert helper. That means error paths of the routines calling would need a way to remove the secret off the list.

[libvirt] [PATCH 01/14] secret: Various formatting cleanups

2016-02-25 Thread John Ferlan
Rather than having it interspersed with other changes, do it once. Remove a couple ^L, 1 argument per line for functions, less than 80 chars per line, use of spacing between logical groups of code, use of one line if statements when doing fetch followed by comparison, use direct return when no

[libvirt] [PATCH 09/14] secret: Create a 'configFile' in virSecretObj

2016-02-25 Thread John Ferlan
This patch removes the need for secretXMLPath. Instead save 'path' during loadSecret as 'configFile'. The secretXMLPath is nothing more than an open coded virFileBuildPath. All that code did was concantenate the driver->configDir, the UUID of the secret, and the ".xml" suffix to form the

[libvirt] [PATCH 12/14] secret: Introduce secretAssignDef

2016-02-25 Thread John Ferlan
This new API will allocate the secret, assign the def pointer, and insert the secret onto the passed list. Whether that's the temporary list in loadSecrets which gets loaded into the driver list or driver list during secretDefineXML. Signed-off-by: John Ferlan ---

[libvirt] [PATCH 05/14] secret: Rename virSecretObjPtr 'entry' to 'secret'

2016-02-25 Thread John Ferlan
Just renaming the variable in secretConnectListAllSecrets. Signed-off-by: John Ferlan --- src/secret/secret_driver.c | 22 +++--- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/secret/secret_driver.c b/src/secret/secret_driver.c index

[libvirt] [PATCH 06/14] secret: Use 'secret' instead of 's' for variable name

2016-02-25 Thread John Ferlan
Remove one letter variable. Signed-off-by: John Ferlan --- src/secret/secret_driver.c | 52 +++--- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/src/secret/secret_driver.c b/src/secret/secret_driver.c index

[libvirt] [PATCH 02/14] secret: Use virFileRewrite instead of replaceFile

2016-02-25 Thread John Ferlan
Use the common API instead of essentially open coding same functionality. Signed-off-by: John Ferlan --- src/secret/secret_driver.c | 55 +- 1 file changed, 10 insertions(+), 45 deletions(-) diff --git a/src/secret/secret_driver.c

Re: [libvirt] [PATCH] build: work around gcc 6.0 warnings

2016-02-25 Thread Michal Privoznik
On 25.02.2016 14:48, Eric Blake wrote: > On 02/25/2016 04:15 AM, Pavel Hrdina wrote: >> On Wed, Feb 24, 2016 at 02:29:58PM -0700, Eric Blake wrote: >>> gcc 6.0 added an annoying warning: >>> >>> fdstream.c: In function 'virFDStreamWrite': >>> fdstream.c:390:29: error: logical 'or' of equal

Re: [libvirt] [PATCH] Revert "Error out on missing machine type in machine configs"

2016-02-25 Thread Cole Robinson
On 02/25/2016 08:50 AM, Ján Tomko wrote: > On Thu, Feb 25, 2016 at 07:45:17AM -0500, Cole Robinson wrote: >> On 02/25/2016 07:24 AM, Ján Tomko wrote: >>> Revert commit 55e6d8cd9eac7eb2aaa4d221585e9402cf7269d5. >>> >>> It unconditionally required a machine type for all machine types >>> even though

Re: [libvirt] [PATCH] build: work around gcc 6.0 warnings

2016-02-25 Thread Ján Tomko
On Thu, Feb 25, 2016 at 06:46:55AM -0700, Eric Blake wrote: > On 02/25/2016 02:37 AM, Peter Krempa wrote: > > On Thu, Feb 25, 2016 at 09:52:12 +0100, Andrea Bolognani wrote: > >> On Thu, 2016-02-25 at 09:22 +0100, Michal Privoznik wrote: > >>> I'm having some difficulties applying this: > >>> > >

Re: [libvirt] [PATCH] Revert "Error out on missing machine type in machine configs"

2016-02-25 Thread Ján Tomko
On Thu, Feb 25, 2016 at 07:45:17AM -0500, Cole Robinson wrote: > On 02/25/2016 07:24 AM, Ján Tomko wrote: > > Revert commit 55e6d8cd9eac7eb2aaa4d221585e9402cf7269d5. > > > > It unconditionally required a machine type for all machine types > > even though qemu is the only emulator using them. > >

Re: [libvirt] [PATCH] build: work around gcc 6.0 warnings

2016-02-25 Thread Eric Blake
On 02/25/2016 04:15 AM, Pavel Hrdina wrote: > On Wed, Feb 24, 2016 at 02:29:58PM -0700, Eric Blake wrote: >> gcc 6.0 added an annoying warning: >> >> fdstream.c: In function 'virFDStreamWrite': >> fdstream.c:390:29: error: logical 'or' of equal expressions >> [-Werror=logical-op] >> if

Re: [libvirt] [PATCH] build: work around gcc 6.0 warnings

2016-02-25 Thread Eric Blake
On 02/25/2016 02:37 AM, Peter Krempa wrote: > On Thu, Feb 25, 2016 at 09:52:12 +0100, Andrea Bolognani wrote: >> On Thu, 2016-02-25 at 09:22 +0100, Michal Privoznik wrote: >>> I'm having some difficulties applying this: >>> > > Well, simply the patch context is broken in the first hunk: > > The

Re: [libvirt] [PATCH] libxl: unref objects in error paths

2016-02-25 Thread Joao Martins
On 02/24/2016 10:55 PM, Jim Fehlig wrote: > libxlMakeNic opens a virConnect object and takes a reference on a > virNetwork object, but doesn't drop the references on all error > paths. Rework the function to follow the standard libvirt pattern > of using a local 'ret' variable to hold the

[libvirt] [PATCH 1/2] netdev: Use virNetDevIsVirtualFunction() properly

2016-02-25 Thread Andrea Bolognani
virNetDevIsVirtualFunction() returns 1 if the interface is a virtual function, 0 if it isn't and -1 on error. This means that, despite the name suggesting otherwise, using it as a predicate is not correct. Fix two callers that were doing so adding an explicit check on the return value. ---

[libvirt] [PATCH 2/2] hostdev: Remove temporary variable when checking for VF

2016-02-25 Thread Andrea Bolognani
The virHostdevIsVirtualFunction() was called exactly twice, and in both cases the return value was saved to a temporary variable before being checked. This would be okay if it improved readability, but in this case is pretty pointless. Get rid of the temporary variable and check the return value

Re: [libvirt] [PATCH] Revert "Error out on missing machine type in machine configs"

2016-02-25 Thread Cole Robinson
On 02/25/2016 07:24 AM, Ján Tomko wrote: > Revert commit 55e6d8cd9eac7eb2aaa4d221585e9402cf7269d5. > > It unconditionally required a machine type for all machine types > even though qemu is the only emulator using them. > > Reverting this re-introduces the crash when someone fiddles with >

Re: [libvirt] [PATCH] libxl: implement virDomainInterfaceStats

2016-02-25 Thread Joao Martins
On 02/24/2016 09:42 PM, Jim Fehlig wrote: > Joao Martins wrote: >> Introduce support for domainInterfaceStats API call for querying >> network interface statistics. Consequently it also enables the use of >> `virsh domifstat ` command plus seeing the >> interfaces names instead of "-" when

Re: [libvirt] [PATCH] Error out on missing machine type in machine configs

2016-02-25 Thread Ján Tomko
On Wed, Feb 24, 2016 at 02:08:41PM -0500, John Ferlan wrote: > > > On 02/11/2016 07:07 AM, Ján Tomko wrote: > > Commit f1a89a8 allowed parsing configs from /etc/libvirt > > without validating the emulator capabilities. > > > > Check for the presence of os->type.machine even if the > >

[libvirt] [PATCH] Revert "Error out on missing machine type in machine configs"

2016-02-25 Thread Ján Tomko
Revert commit 55e6d8cd9eac7eb2aaa4d221585e9402cf7269d5. It unconditionally required a machine type for all machine types even though qemu is the only emulator using them. Reverting this re-introduces the crash when someone fiddles with libvirt's machine configs with /etc/, but fixes persistent

Re: [libvirt] [PATCH] util: Avoid calling closedir(NULL)

2016-02-25 Thread Pavel Hrdina
On Thu, Feb 25, 2016 at 12:53:46PM +0100, Jiri Denemark wrote: > Signed-off-by: Jiri Denemark > --- > src/util/virnetdev.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) ACK -- libvir-list mailing list libvir-list@redhat.com

[libvirt] [PATCH] util: Avoid calling closedir(NULL)

2016-02-25 Thread Jiri Denemark
Signed-off-by: Jiri Denemark --- src/util/virnetdev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util/virnetdev.c b/src/util/virnetdev.c index ea95552..5c79c42 100644 --- a/src/util/virnetdev.c +++ b/src/util/virnetdev.c @@ -3104,63 +3104,63 @@

Re: [libvirt] [PATCH v2 0/2] Enable detection for zero writes

2016-02-25 Thread Peter Krempa
On Tue, Feb 23, 2016 at 15:56:23 +0100, Martin Kletzander wrote: > This is a second version with few things fixed. The main difference > is that now this series uses zeroes instead of zeros. The latter was > chosen at first just because there were more occurences in our > codebase, but the

Re: [libvirt] [PATCH] build: work around gcc 6.0 warnings

2016-02-25 Thread Pavel Hrdina
On Wed, Feb 24, 2016 at 02:29:58PM -0700, Eric Blake wrote: > gcc 6.0 added an annoying warning: > > fdstream.c: In function 'virFDStreamWrite': > fdstream.c:390:29: error: logical 'or' of equal expressions > [-Werror=logical-op] > if (errno == EAGAIN || errno == EWOULDBLOCK) { >

Re: [libvirt] libvirt 1.2.9.3 - test for vircgrouptest fails

2016-02-25 Thread Michal Privoznik
On 25.02.2016 07:25, Michal Privoznik wrote: > On 24.02.2016 21:36, Florian Hubold wrote: >> Hi, >> >> one of the seems to fail on our build system, vircgrouptest fails with >> Unexpected: nodeGetCPUCount() yields: -1 >> >> The test runs fine locally. >> Here are the contents from testsuite.log

Re: [libvirt] [PATCH] build: work around gcc 6.0 warnings

2016-02-25 Thread Peter Krempa
On Thu, Feb 25, 2016 at 09:52:12 +0100, Andrea Bolognani wrote: > On Thu, 2016-02-25 at 09:22 +0100, Michal Privoznik wrote: > > I'm having some difficulties applying this: > > > > > > Applying: build: work around gcc 6.0 warnings > > Using index info to reconstruct a base tree... > > error:

Re: [libvirt] [PATCH V2] Fix bug of attaching redirdev device

2016-02-25 Thread Osier Yang
On 2016年02月25日 16:18, Michal Privoznik wrote: On 22.02.2016 18:41, Michal Privoznik wrote: On 22.02.2016 17:44, Osier Yang wrote: RHBZ: https://bugzilla.redhat.com/show_bug.cgi?id=1298070 The corresponding chardev must be attached first, otherwise the the qemu command line won't be complete

Re: [libvirt] [PATCH] vircgroupmock: Mock access("/sys/devices/system/cpu/present")

2016-02-25 Thread Andrea Bolognani
On Thu, 2016-02-25 at 09:08 +0100, Michal Privoznik wrote: > There's been a report on the upstream list [1] describing we You forgot the link. Then again, I'm not sure this information is even useful to have in the commit message. > access /sys/devices/system/cpu/present directly on the host

Re: [libvirt] [PATCH] build: work around gcc 6.0 warnings

2016-02-25 Thread Andrea Bolognani
On Thu, 2016-02-25 at 09:22 +0100, Michal Privoznik wrote: > I'm having some difficulties applying this: > > > Applying: build: work around gcc 6.0 warnings > Using index info to reconstruct a base tree... > error: patch failed: src/fdstream.c:1 > error: src/fdstream.c: patch does not apply >

Re: [libvirt] [PATCH] build: work around gcc 6.0 warnings

2016-02-25 Thread Michal Privoznik
On 24.02.2016 22:29, Eric Blake wrote: > gcc 6.0 added an annoying warning: > > fdstream.c: In function 'virFDStreamWrite': > fdstream.c:390:29: error: logical 'or' of equal expressions > [-Werror=logical-op] > if (errno == EAGAIN || errno == EWOULDBLOCK) { >

Re: [libvirt] [PATCH V2] Fix bug of attaching redirdev device

2016-02-25 Thread Michal Privoznik
On 22.02.2016 18:41, Michal Privoznik wrote: > On 22.02.2016 17:44, Osier Yang wrote: >> RHBZ: https://bugzilla.redhat.com/show_bug.cgi?id=1298070 >> >> The corresponding chardev must be attached first, otherwise the >> the qemu command line won't be complete (missing the host part), >> --- >>

[libvirt] [PATCH] vircgroupmock: Mock access("/sys/devices/system/cpu/present")

2016-02-25 Thread Michal Privoznik
There's been a report on the upstream list [1] describing we access /sys/devices/system/cpu/present directly on the host from within our test suite. This may end up in unpredictable results as no all linux systems are required to have that file. Mock access to the file. libvirt.git/tests $ ../run