Re: [libvirt] [PATCH 1/4] cmdVolCreateAs: Rework to follow usual func pattern

2016-02-12 Thread Erik Skultety
On 12/02/16 15:22, Michal Privoznik wrote: > On 12.02.2016 14:17, Erik Skultety wrote: >> On 10/02/16 17:28, Michal Privoznik wrote: >>> The way we usually write functions is that we start the work and >>> if something goes bad we goto cleanup and roll back there. Or &

Re: [libvirt] [PATCH 4/4] storageVolCreateXMLFrom: Check if backend knows how to createVol

2016-02-12 Thread Erik Skultety
On 10/02/16 17:28, Michal Privoznik wrote: > It is highly unlikely that a backend will know how to create a > volume from a different volume (buildVolFrom) and not know how to > create an empty volume (createVol). But: > 1) we call the function without any prior check so if that's the > case we wou

Re: [libvirt] [PATCH v4 0/7] admin: Introduce server listing API

2016-02-17 Thread Erik Skultety
> > ACK series modulo 6/7 as I have some questions there. > > Michal > Adjusted the patches according to your notes and pushed, thanks. Erik -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list

[libvirt] [PATCH] syms: add forgotten virAdmConnectClass symbol

2016-02-17 Thread Erik Skultety
Although it currently doesn't cause any linking issues, the symbol should be exported correctly according to our conventions. --- Pushed under trivial rule. src/libvirt_admin_private.syms | 1 + 1 file changed, 1 insertion(+) diff --git a/src/libvirt_admin_private.syms b/src/libvirt_admin_privat

[libvirt] [PATCH] admin: Fix memory leak in remoteAdminConnectClose

2016-02-18 Thread Erik Skultety
When virt-admin is run with valgrind, this kind of output can be obtained: HEAP SUMMARY: in use at exit: 134,589 bytes in 1,031 blocks total heap usage: 2,667 allocs, 1,636 frees, 496,755 bytes allocated 88 bytes in 1 blocks are definitely lost in loss record 82 of 128 at 0x4C2A9C7: calloc (

Re: [libvirt] [PATCH] admin: Fix memory leak in remoteAdminConnectClose

2016-02-18 Thread Erik Skultety
On 18/02/16 15:06, Erik Skultety wrote: > When virt-admin is run with valgrind, this kind of output can be obtained: > > HEAP SUMMARY: > in use at exit: 134,589 bytes in 1,031 blocks > total heap usage: 2,667 allocs, 1,636 frees, 496,755 bytes allocated > > 88

[libvirt] [PATCH v2] admin: Fix memory leak in remoteAdminConnectClose

2016-02-18 Thread Erik Skultety
When virt-admin is run with valgrind, this kind of output can be obtained: HEAP SUMMARY: in use at exit: 134,589 bytes in 1,031 blocks total heap usage: 2,667 allocs, 1,636 frees, 496,755 bytes allocated 88 bytes in 1 blocks are definitely lost in loss record 82 of 128 at 0x4C2A9C7: calloc (

Re: [libvirt] [PATCH v2] admin: Fix memory leak in remoteAdminConnectClose

2016-02-18 Thread Erik Skultety
On 18/02/16 17:24, Pavel Hrdina wrote: > On Thu, Feb 18, 2016 at 05:18:13PM +0100, Erik Skultety wrote: >> When virt-admin is run with valgrind, this kind of output can be obtained: >> >> HEAP SUMMARY: >> in use at exit: 134,589 bytes in 1,031 blocks >> tota

Re: [libvirt] [PATCH] adminDaemonListServers: Don't leak @srv_names array

2016-02-22 Thread Erik Skultety
On 22/02/16 08:57, Michal Privoznik wrote: > When getting a list of servers registered for a daemon, it's > returned as a dynamically allocated array filled in with pointers > to constant strings. Because the array is dynamic, it should be > freed when no longer needed (but not the strings!). Even

Re: [libvirt] [PATCH] virDomainDefFormatInternal: Drop useless check

2016-02-22 Thread Erik Skultety
On 22/02/16 08:57, Michal Privoznik wrote: > There's a check if a domain definition has any graphics card and > if so, we iterate over each one of them. This makes no sense, > because even if it has none we can still iterate over. > > Signed-off-by: Michal Privoznik > --- > src/conf/domain_conf.

[libvirt] [PATCH 04/10] util: Refactor thread creation by introducing virThreadPoolExpand

2016-02-29 Thread Erik Skultety
When either creating a threadpool, or creating a new thread to accomplish a job that had been placed into the jobqueue, every time thread-specific data need to be allocated, threadpool needs to be (re)-allocated and thread count indicators updated. Make the code clearer to read by compressing these

[libvirt] [PATCH 07/10] admin: Prepare admin protocol for future worker related procedures

2016-02-29 Thread Erik Skultety
Before any getter or setter methods can be introduced, first specify a set of public attributes/flags that these methods will be compatible with. --- include/libvirt/libvirt-admin.h | 61 + src/admin/admin_protocol.x | 3 ++ 2 files changed, 64 inserti

[libvirt] [PATCH 06/10] util: Add more getters to threadpool parameters

2016-02-29 Thread Erik Skultety
In order for the client to see all thread counts and limits, current total and free worker count getters need to be introduced. Client might also be interested in the job queue length, so provide a getter for that too. --- src/libvirt_private.syms | 3 +++ src/util/virthreadpool.c | 15 ++

[libvirt] [PATCH 02/10] admin: Enable usage of typed parameters

2016-02-29 Thread Erik Skultety
Make all relevant changes to admin protocol, in order to achieve $(subj) --- cfg.mk | 2 +- src/admin/admin_protocol.x | 24 src/admin_protocol-structs | 25 + 3 files changed, 50 insertions(+), 1 deletion(-) diff --git a/cfg.m

[libvirt] [PATCH 01/10] libvirt-host: Move virTypedParam* to libvirt-common

2016-02-29 Thread Erik Skultety
Commits 0472cef6, 9afc115f, 8cd1d546 exported typed params handlers internally, but a commit which would move the public definition from libvirt-host to libvirt-common was missing. --- include/libvirt/libvirt-common.h.in | 185 +++ include/libvirt/libvirt-host.h

[libvirt] [PATCH 10/10] virt-admin: Introduce srv-workertune command

2016-02-29 Thread Erik Skultety
Wire up the server threadpool tunable APIs to virt-admin client. --- tools/virt-admin.c | 132 + 1 file changed, 132 insertions(+) diff --git a/tools/virt-admin.c b/tools/virt-admin.c index 3c818a3..21be830 100644 --- a/tools/virt-admin.c +++ b/

[libvirt] [PATCH 00/10] Introduce worker tuning APIs

2016-02-29 Thread Erik Skultety
Erik Skultety (10): libvirt-host: Move virTypedParam* to libvirt-common admin: Enable usage of typed parameters admin: Introduce virAdmConnectServerLookupByName util: Refactor thread creation by introducing virThreadPoolExpand util: Report system error when virThreadCreateFull fails

[libvirt] [PATCH 03/10] admin: Introduce virAdmConnectServerLookupByName

2016-02-29 Thread Erik Skultety
manipulating a server requires a client-side server object reference. We cannot rely on client to call virAdmConnectListAllServers and further stored the result. Therefore offer a separate API to retrieve a specific server object for remote-side. --- daemon/admin.c | 26 ++

[libvirt] [PATCH 05/10] util: Report system error when virThreadCreateFull fails

2016-02-29 Thread Erik Skultety
Otherwise 'Unknown' error will be returned to client. --- po/POTFILES.in | 1 + src/util/virthreadpool.c | 1 + 2 files changed, 2 insertions(+) diff --git a/po/POTFILES.in b/po/POTFILES.in index 27980df..455b799 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -237,6 +237,7 @@ src/u

[libvirt] [PATCH 08/10] admin: Introduce virAdmServerGethreadPoolParameters

2016-02-29 Thread Erik Skultety
New API to retrieve current server workerpool specs. Since it uses typed parameters, more specs to retrieve can be further included in the pool of supported ones. --- daemon/admin.c | 60 +++ daemon/admin_server.c | 69

[libvirt] [PATCH 09/10] admin: Introduce virAdmServerSetThreadPoolParameters

2016-02-29 Thread Erik Skultety
Since threadpool increments the current number of threads according to current load, i.e. how many jobs are waiting in the queue. The count however, is constrained by max and min limits of workers. The logic of this new API works like this: 1) setting the minimum a) When the limit is in

Re: [libvirt] [PATCH] daemon: fixup refcounting in close callback handling

2016-03-03 Thread Erik Skultety
On 03/03/16 09:01, Nikolay Shirokovskiy wrote: > remoteDispatchConnectCloseCallbackRegister introduced in > f484310add53ebdc26a6fdcb88bc398750325b7e has problems. 8-10 symbols should be enough for most projects :) It refcounts > network client object and in case of NOOP driver operations > for c

Re: [libvirt] [PATCH] qemu: Check if domain is active in GetControlInfo

2016-03-03 Thread Erik Skultety
On 03/03/16 13:43, Jiri Denemark wrote: > Reporting status of a control connection makes no sense for an inactive > domain. > > https://bugzilla.redhat.com/show_bug.cgi?id=1281706 > > Signed-off-by: Jiri Denemark > --- > src/qemu/qemu_driver.c | 6 ++ > 1 file changed, 6 insertions(+) > >

Re: [libvirt] [PATCH] Use correct LDFLAGS for leaseshelper

2016-03-03 Thread Erik Skultety
On 01/03/16 16:00, Jiri Denemark wrote: > Signed-off-by: Jiri Denemark > --- > src/Makefile.am | 4 > 1 file changed, 4 insertions(+) > > diff --git a/src/Makefile.am b/src/Makefile.am > index a316b4d..d57d303 100644 > --- a/src/Makefile.am > +++ b/src/Makefile.am > @@ -2810,6 +2810,10 @@ l

Re: [libvirt] [PATCH 11/21] admin: Don't use priority for admin APIs

2016-03-10 Thread Erik Skultety
On 10/03/16 05:54, Martin Kletzander wrote: > There are no priority workers as they dn't make sense for now. > s/dn't/don't > Signed-off-by: Martin Kletzander > --- > src/admin/admin_protocol.x | 1 - > 1 file changed, 1 deletion(-) > > diff --git a/src/admin/admin_protocol.x b/src/admin/admi

Re: [libvirt] [PATCH 02/21] admin: Check for flags properly

2016-03-10 Thread Erik Skultety
On 10/03/16 05:53, Martin Kletzander wrote: > Function virAdmConnectListServers() forgot to check for flags at all, > virAdmConnectOpen() on the other hand checked them but did no dispatch > the error. virCheckFlags() should be used only when there should be no > other thing done after erroring ou

Re: [libvirt] [PATCH 01/21] admin: Make virAdmServerFree() handle NULL gracefully

2016-03-10 Thread Erik Skultety
On 10/03/16 05:53, Martin Kletzander wrote: > We don't want to end up like with virDomainFree() and other, right? > > Signed-off-by: Martin Kletzander > --- > src/libvirt-admin.c | 4 > 1 file changed, 4 insertions(+) > > diff --git a/src/libvirt-admin.c b/src/libvirt-admin.c > index 36674

Re: [libvirt] [PATCH 05/21] virerror: Introduce new error type NO_SERVER

2016-03-10 Thread Erik Skultety
On 10/03/16 05:53, Martin Kletzander wrote: > This serves the same purpose as VIR_ERR_NO_xxx where xxx is any object > that API can be called upon. Only this partucular one is used for > daemon's servers. > s/partucular/particular/ > Signed-off-by: Martin Kletzander > --- > include/libvirt/vi

Re: [libvirt] [PATCH 22/21] virt-admin: Don't tell everyone needlessly we're connected

2016-03-10 Thread Erik Skultety
On 10/03/16 06:36, Martin Kletzander wrote: > There are cases when we don't want to tell the user we are connected. > That's for example when we first connect to the server without the > command 'connect' itself. That helps to clear out output of first > command, mainly when running non-interactiv

[libvirt] [PATCH 1/5] virlog: Change virLogDestination to virLogDestinationType

2016-03-16 Thread Erik Skultety
This will later utilize our VIR_ENUM_{DECL,IMPL} macros, so stay consistent with the rest of the library. Also, this includes adding an explicit sentinel _LAST to the enum. --- src/util/virlog.c | 6 +++--- src/util/virlog.h | 5 +++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a

[libvirt] [PATCH 5/5] tests: Add a new test for logging outputs parser

2016-03-16 Thread Erik Skultety
Now that the logging output parser has been refactored, add a test for its functionality. --- tests/virlogtest.c | 49 + 1 file changed, 45 insertions(+), 4 deletions(-) diff --git a/tests/virlogtest.c b/tests/virlogtest.c index 9e0ebb5..0471cc4 100

[libvirt] [PATCH 2/5] virlog: Introduce Type{To, From}String for virLogDestination

2016-03-16 Thread Erik Skultety
In order to refactor the ugly virLogParseOutputs method, this is a neat way of finding out whether the destination type (in the form of a string) user provided is a valid one. As a bonus, if it turns out it is valid, we get the actual enum which will later be passed to any of virLogAddOutput method

[libvirt] [PATCH 4/5] tests: Slightly tweak virlogtest

2016-03-16 Thread Erik Skultety
Add a generic DO_TEST_FULL macro, some PASS/FAIL macros to better visually distinguish tests that should fail and tests that should pass --- tests/virlogtest.c | 35 --- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/tests/virlogtest.c b/tests/virlo

[libvirt] [PATCH 0/5] virlog: Refactor parsing log outputs

2016-03-16 Thread Erik Skultety
Erik Skultety (5): virlog: Change virLogDestination to virLogDestinationType virlog: Introduce Type{To,From}String for virLogDestination virlog: Refactor virLogParseOutputs tests: Slightly tweak virlogtest tests: Add a new test for logging outputs parser po/POTFILES.in | 1 + src

[libvirt] [PATCH 3/5] virlog: Refactor virLogParseOutputs

2016-03-16 Thread Erik Skultety
The problem with the original virLogParseOutputs method was that the way it parsed the input, walking the string char by char and using absolute jumps depending on the virLogDestination type, was rather complicated to read. This patch utilizes virStringSplit method twice, first time to filter out a

[libvirt] [PATCH 0/3] virlog: Refactor logging filters parser

2016-03-18 Thread Erik Skultety
passed, even though it failed. Thus, this series also addresses this issue. Erik Skultety (3): tests: virlogtest: Fix testLogParseOutputs return value tests: Add new testcases to test parsing of log filters in virlogtest virlog: Refactor virLogParseFilters src/util/virlog.c | 95

[libvirt] [PATCH] virlog: Fix build breaker with "comparison between signed and unsigned"

2016-03-18 Thread Erik Skultety
Refactor series 0b231195 worked with virLogDestination type which, depending on the compiler, might be (and probably will be) an unsigned data type. However, virEnumFromString may return -1 in case of an error. So, when enum happens to be unsigned, some compilers will naturally complain about foo:

Re: [libvirt] [PATCH 18/21] admin: Add virAdmConnectLookupServer

2016-03-18 Thread Erik Skultety
On 10/03/16 05:54, Martin Kletzander wrote: > It does not have a suffix ByName because there are no other means of > looking up the server and since the name is known, this should be the > preferred one. > > Signed-off-by: Martin Kletzander > --- > daemon/admin_server.c | 10 ++

Re: [libvirt] [PATCH 5/5] tests: Add a new test for logging outputs parser

2016-03-19 Thread Erik Skultety
On 16/03/16 13:05, Ján Tomko wrote: > On Wed, Mar 16, 2016 at 12:05:37PM +0100, Erik Skultety wrote: >> Now that the logging output parser has been refactored, add a test for its >> functionality. > > It would be nice to add the test before the refactor, if possible

[libvirt] [PATCH 3/3] virlog: Refactor virLogParseFilters

2016-03-19 Thread Erik Skultety
Patch 0b231195 refactored logging output parser to make it more readable. This patch does similar thing to logging filter parser. --- src/util/virlog.c | 95 +-- 1 file changed, 65 insertions(+), 30 deletions(-) diff --git a/src/util/virlog.c b/

[libvirt] [PATCH 2/3] tests: Add new testcases to test parsing of log filters in virlogtest

2016-03-19 Thread Erik Skultety
--- tests/virlogtest.c | 41 + 1 file changed, 41 insertions(+) diff --git a/tests/virlogtest.c b/tests/virlogtest.c index acb0b08..332b5e4 100644 --- a/tests/virlogtest.c +++ b/tests/virlogtest.c @@ -75,6 +75,37 @@ testLogParseOutputs(const void *opaque)

[libvirt] [PATCH 1/3] tests: virlogtest: Fix testLogParseOutputs return value

2016-03-19 Thread Erik Skultety
The test can return positive value even though it should have failed. It just returns the value parser returned, which should be flipped back to -1 if something went wrong or the result was unexpected, but it isn't. --- tests/virlogtest.c | 9 + 1 file changed, 5 insertions(+), 4 deletions

Re: [libvirt] [PATCH] qemu: Don't access uninitialized memory

2016-03-19 Thread Erik Skultety
On 16/03/16 10:48, Martin Kletzander wrote: > Very early ping, I know, but it's almost trivial and it fixes a crash > when running domxml-to-native. > > On Fri, Mar 11, 2016 at 02:25:16PM +0100, Martin Kletzander wrote: >> In qemuConnectDomainXMLToNative() we set up the monitor, but we never >> me

Re: [libvirt] [PATCH] admin_server: fix memory leak

2016-03-24 Thread Erik Skultety
On 24/03/16 10:52, Pavel Hrdina wrote: > If caller of adminConnectListServers() pass NULL instead of servers we > need to free the list we've received from virNetDaemonGetServers(). > Good catch. > Signed-off-by: Pavel Hrdina > --- > daemon/admin_server.c | 2 ++ > 1 file changed, 2 insertions

Re: [libvirt] [PATCH 0/3] virlog: Refactor logging filters parser

2016-03-24 Thread Erik Skultety
On 24/03/16 15:43, Michal Privoznik wrote: > On 18.03.2016 10:07, Erik Skultety wrote: >> This series continues where series 0b231195 left and refactors logging filter >> parser. Series 0b231195 also introduced a small bug where if a specific >> testcase passes, but shou

[libvirt] [PATCH v2 10/10] virt-admin: Introduce srv-workertune command

2016-03-29 Thread Erik Skultety
Wire up the server threadpool tunable APIs to virt-admin client. --- tools/virt-admin.c | 132 + 1 file changed, 132 insertions(+) diff --git a/tools/virt-admin.c b/tools/virt-admin.c index edb8690..dec1096 100644 --- a/tools/virt-admin.c +++ b/

[libvirt] [PATCH v2 03/10] admin: Enable usage of typed parameters

2016-03-29 Thread Erik Skultety
Make all relevant changes to admin protocol, in order to achieve $(subj) --- cfg.mk | 2 +- src/admin/admin_protocol.x | 24 src/admin_protocol-structs | 25 + 3 files changed, 50 insertions(+), 1 deletion(-) diff --git a/cfg.m

[libvirt] [PATCH v2 06/10] util: Add more getters to threadpool parameters

2016-03-29 Thread Erik Skultety
In order for the client to see all thread counts and limits, current total and free worker count getters need to be introduced. Client might also be interested in the job queue length, so provide a getter for that too. --- src/libvirt_private.syms | 3 +++ src/util/virthreadpool.c | 15 ++

[libvirt] [PATCH v2 07/10] admin: Prepare admin protocol for future worker related procedures

2016-03-29 Thread Erik Skultety
Before any getter or setter methods can be introduced, first specify a set of public attributes/flags that these methods will be compatible with. --- include/libvirt/libvirt-admin.h | 60 + src/admin/admin_protocol.x | 3 +++ 2 files changed, 63 insert

[libvirt] [PATCH v2 08/10] admin: Introduce virAdmServerGethreadPoolParameters

2016-03-29 Thread Erik Skultety
New API to retrieve current server workerpool specs. Since it uses typed parameters, more specs to retrieve can be further included in the pool of supported ones. --- daemon/admin.c | 59 +++ daemon/admin_server.c | 69

[libvirt] [PATCH v2 09/10] admin: Introduce virAdmServerSetThreadPoolParameters

2016-03-29 Thread Erik Skultety
Since threadpool increments the current number of threads according to current load, i.e. how many jobs are waiting in the queue. The count however, is constrained by max and min limits of workers. The logic of this new API works like this: 1) setting the minimum a) When the limit is in

[libvirt] [PATCH v2 00/10] Introduce worker tuning APIs

2016-03-29 Thread Erik Skultety
base conflicts and overall changes since the original v1 po/POTFILES.in (patch 1/10) had to be updated Erik Skultety (10): po: Fix record ordering in POTFILES.in libvirt-host: Move virTypedParam* to libvirt-common admin: Enable usage of typed parameters util: Refactor thread creat

[libvirt] [PATCH v2 02/10] libvirt-host: Move virTypedParam* to libvirt-common

2016-03-29 Thread Erik Skultety
Commits 0472cef6, 9afc115f, 8cd1d546 exported typed params handlers internally, but a commit which would move the public definition from libvirt-host to libvirt-common was missing. --- include/libvirt/libvirt-common.h.in | 185 +++ include/libvirt/libvirt-host.h

[libvirt] [PATCH v2 01/10] po: Fix record ordering in POTFILES.in

2016-03-29 Thread Erik Skultety
Commit a474371f broke ordering of the records. Now if a file required for translation is missing, syntax-check (po-check) will fail and suggest a patch to add the missing file. However, if the ordering is broken, the patch will be understandably inapplicable (cleanly), since the diff isn't against

[libvirt] [PATCH v2 04/10] util: Refactor thread creation by introducing virThreadPoolExpand

2016-03-29 Thread Erik Skultety
When either creating a threadpool, or creating a new thread to accomplish a job that had been placed into the jobqueue, every time thread-specific data need to be allocated, threadpool needs to be (re)-allocated and thread count indicators updated. Make the code clearer to read by compressing these

[libvirt] [PATCH v2 05/10] util: Report system error when virThreadCreateFull fails

2016-03-29 Thread Erik Skultety
Otherwise 'Unknown' error will be returned to client. --- po/POTFILES.in | 1 + src/util/virthreadpool.c | 1 + 2 files changed, 2 insertions(+) diff --git a/po/POTFILES.in b/po/POTFILES.in index 3ffd524..dabc581 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -237,6 +237,7 @@ src/u

Re: [libvirt] [PATCH 00/10] Introduce worker tuning APIs

2016-03-29 Thread Erik Skultety
> I wanted to review this, but got a lot of rebase conflicts. Can you > rebase and resend please? > > Michal > Rebased and resent as v2, since I had to drop one patch and add a new one. Erik -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list

[libvirt] [PATCH 08/38] daemon: Replace virLogParseOutputs with virLogSetOutputs in callers

2016-03-31 Thread Erik Skultety
Since virLogParseOutputs is going to be stripped from 'output defining' logic, replace all relevant occurrences with virLogSetOutputs to make the change transparent to all original callers (daemons mostly). --- daemon/libvirtd.c | 6 +++--- src/locking/lock_daemon.c | 6 +++--- src/logging

[libvirt] [PATCH 05/38] virlog: Export virLogFilterPtr through header

2016-03-31 Thread Erik Skultety
As with outputs, some methods declared through a header file need to know the datatype because of their arguments. --- src/util/virlog.c | 2 -- src/util/virlog.h | 3 +++ 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/util/virlog.c b/src/util/virlog.c index 0be1701..b893365 10

[libvirt] [PATCH 14/38] virlog: Rename virLogDefineFilter to virLogFilterNew

2016-03-31 Thread Erik Skultety
Same as for outputs, prepare for the fact, that defining is going to be done for the whole set of filters, rather than defining each filter individually. --- src/libvirt_private.syms | 2 +- src/util/virlog.c| 10 +- src/util/virlog.h| 6 +++--- 3 files changed, 9 inserti

[libvirt] [PATCH 24/38] virlog: Make use of virLogOutputExists

2016-03-31 Thread Erik Skultety
Start using the method that was introduced and described by commit 29d0068b. --- src/util/virlog.c | 83 ++- 1 file changed, 58 insertions(+), 25 deletions(-) diff --git a/src/util/virlog.c b/src/util/virlog.c index 204372f..62533b1 100644 --- a

[libvirt] [PATCH 03/38] virlog: Convert virLogFilters to a list of pointers to filters

2016-03-31 Thread Erik Skultety
Same as with outputs; since the operations will be further divided into smaller tasks, creating a filter will become a separate operation that will return a reference to a newly created filter. --- src/util/virlog.c | 41 +++-- 1 file changed, 23 insertions(+),

[libvirt] [PATCH 04/38] virlog: Export virLogOutputPtr through header

2016-03-31 Thread Erik Skultety
It needs to be exported, since some caller might (for some reason) want to create a logging output without calling the parser which does this. Also, some methods will use virLogOutputPtr as data type for one of its arguments. --- src/util/virlog.c | 2 -- src/util/virlog.h | 3 +++ 2 files changed

[libvirt] [PATCH 09/38] daemon: Replace virLogParseFilters with virLogSetFilters in callers

2016-03-31 Thread Erik Skultety
Similar to outputs, parser should do parsing only, thus the 'define' logic is going to be stripped from virLogParseFilters. Make this change transparent to all callers by using virLogSetFilters which has already been introduced earlier in this series. --- daemon/libvirtd.c | 2 +- src/lock

[libvirt] [PATCH 00/38] Introduce APIs to change daemon's logging settings

2016-03-31 Thread Erik Skultety
ch an output shall continue to exist. All outputs that need to continue to exist are prevented from closing when being destroyed-deallocated. On the other hand, all outputs that do not exist in the new set of outputs shall be closed correctly. Erik Skultety (38): virlog: Return void instead of i

[libvirt] [PATCH 10/38] virlog: Introduce virLogDefineOutputs

2016-03-31 Thread Erik Skultety
Prepare a method that only defines a set of outputs. It takes a list of outputs, preferably created by virLogParseOutputs. The original set of outputs is reset and replaced by the new user-provided set of outputs. --- src/libvirt_private.syms | 1 + src/util/virlog.c| 25 +

[libvirt] [PATCH 13/38] virlog: Rename virLogDefineOutput to virLogOutputNew

2016-03-31 Thread Erik Skultety
Preparation for the fact, that opposite to the original define method that took an already existing global set of outputs and appended/defined a new output, virLogOutputNew only creates a new output, but caller is responsible for appending the output to a list and managing the list itself. --- src

[libvirt] [PATCH 06/38] virlog: Introduce virLogSetFilters

2016-03-31 Thread Erik Skultety
This method will eventually replace the existing virLogParseFilters which currently does both parsing and defining. However, each method should do one thing only, so will the current virLogParseFilters method will be split into parsing and defining, only to be swallowed by the entry-point API virLo

[libvirt] [PATCH 02/38] virlog: Convert virLogOutputs to a list of pointers to outputs

2016-03-31 Thread Erik Skultety
Right now, we define outputs one after another. However, the correct flow should be to define a set of outputs as a whole unit. Therefore each output should be first created, placed into an array/list and the list will be defined. Output creation should be a separate operation, so an output will be

[libvirt] [PATCH 19/38] virlog: Make virLogReset methods use of virLog(Output|Filter)ListFree

2016-03-31 Thread Erik Skultety
Now that methods to free logging related lists were introduced, put them to a use. --- src/util/virlog.c | 15 --- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/src/util/virlog.c b/src/util/virlog.c index a1f5872..7e0936c 100644 --- a/src/util/virlog.c +++ b/src/util/v

[libvirt] [PATCH 31/38] admin: Introduce virAdmConnectGetLoggingLevel

2016-03-31 Thread Erik Skultety
Enable libvirt users to query for the current logging level setting. --- daemon/admin.c | 8 include/libvirt/libvirt-admin.h | 1 + src/admin/admin_protocol.x | 15 ++- src/admin_protocol-structs | 7 +++ src/libvirt-admin.c | 33 +

[libvirt] [PATCH 11/38] virlog: Introduce virLogDefineFilters

2016-03-31 Thread Erik Skultety
Prepare a method that only defines a set of filters. It takes a list of filters, preferably created by virLogParseFilters. The original set of filters is reset and replaced by the new user-provided set of filters. --- src/libvirt_private.syms | 1 + src/util/virlog.c| 25 +

[libvirt] [PATCH 23/38] virlog: Introduce virLogOutputExists

2016-03-31 Thread Erik Skultety
Outputs are a little bit trickier than filters, because if user wants to change the set of outputs that is currently defined for a different set that may contain outputs that do already exist in the current set, opening a file descriptor for that output would only work for files, but not for syslog

[libvirt] [PATCH 01/38] virlog: Return void instead of int in virLogReset methods

2016-03-31 Thread Erik Skultety
In this particular case, reset is meant as clearing the whole list of outputs/filters, not resetting it to a predefined default setting. Looking at it from that perspective, returning the number of records removed doesn't help the caller in any way (not that any of the callers would actually check

[libvirt] [PATCH 32/38] admin: Introduce virAdmConnectGetLoggingFilters

2016-03-31 Thread Erik Skultety
Enable libvirt users to query logging filter settings. --- daemon/admin.c | 45 + include/libvirt/libvirt-admin.h | 4 src/admin/admin_protocol.x | 16 ++- src/admin/admin_remote.c| 43 +

[libvirt] [PATCH 16/38] virlog: Introduce virLogOutputListFree

2016-03-31 Thread Erik Skultety
This is just a convenience method for discarding a list of outputs instead of using a 'for' loop everywhere. It is safe to pass -1 as the number of elements in the list as well as passing NULL as list reference. --- src/libvirt_private.syms | 1 + src/util/virlog.c| 20 +++

[libvirt] [PATCH 18/38] virlog: Introduce virLogFilterListFree

2016-03-31 Thread Erik Skultety
This is just a convenience method for discarding a list of filters instead of using a 'for' loop everywhere. It is safe to pass -1 as the number of elements in the list as well as passing NULL as list reference. --- src/util/virlog.c | 20 src/util/virlog.h | 1 + 2 files cha

[libvirt] [PATCH 20/38] virlog: Split output parsing and output defining to separate operations

2016-03-31 Thread Erik Skultety
Everything has been prepared to successfully split parsing and defining logic to separate operations. --- src/util/virlog.c | 160 + src/util/virlog.h | 15 +++-- tests/testutils.c | 19 ++- tests/virlogtest.c | 5 +- 4 files changed,

[libvirt] [PATCH 12/38] virlog: Rename virLogAddOutputTo to virLogNewOutput

2016-03-31 Thread Erik Skultety
This is merely a cosmetic change to clearly state that we won't be adding a new output to the existing global set of outputs, instead we're always creating a completely new output that needs to be later placed into a list. --- src/util/virlog.c | 16 1 file changed, 8 insertions(+

[libvirt] [PATCH 36/38] admin: Introduce virAdmConnectSetLoggingOutputs

2016-03-31 Thread Erik Skultety
Enable libvirt users to modify daemon's logging output settings from outside. --- daemon/admin.c | 10 ++ include/libvirt/libvirt-admin.h | 4 src/admin/admin_protocol.x | 12 +++- src/admin_protocol-structs | 5 + src/libvirt-admin.c

[libvirt] [PATCH 28/38] virlog: Make virLogSetDefaultPriority trigger source update as well

2016-03-31 Thread Erik Skultety
The source update is only triggered when a logging filter gets changed (by incrementing virLogSerial counter), but if we also want to enable remote global priority tuning, any change to priority needs to trigger the source update as well. --- src/util/virlog.c | 1 + 1 file changed, 1 insertion(+)

[libvirt] [PATCH 37/38] admin: Export logging level constants via libvirt-admin.h

2016-03-31 Thread Erik Skultety
We should encourage libvirt users to use our own constants when modifying logging level, instead of their own values. --- include/libvirt/libvirt-admin.h | 15 +++ src/util/virlog.h | 10 -- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/include/

[libvirt] [PATCH 27/38] virlog: Rename virLogFiltersSerial to virLogSerial

2016-03-31 Thread Erik Skultety
Global priority can be changed from outside as well. So far, updating priority is filter driven, meaning that source priority can only be changed when filters change. To assure, users can change the global priority from outside, make the serial more generic, so that any change to priority would tri

[libvirt] [PATCH 15/38] virlog: Introduce virLogOutputFree

2016-03-31 Thread Erik Skultety
Add a complementary method to virLogOutputNew. --- src/libvirt_private.syms | 1 + src/util/virlog.c| 21 - src/util/virlog.h| 1 + 3 files changed, 18 insertions(+), 5 deletions(-) diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index fac361

[libvirt] [PATCH 30/38] virlog: Acquire virLogAPILock in each setter API

2016-03-31 Thread Erik Skultety
Now that a lock to serialize setters has been introduced, make use of it and lock every log setting API. --- src/util/virlog.c | 8 1 file changed, 8 insertions(+) diff --git a/src/util/virlog.c b/src/util/virlog.c index 6aa9c91..240d6e3 100644 --- a/src/util/virlog.c +++ b/src/util/virl

[libvirt] [PATCH 26/38] virlog: Swap the new copy of outputs with the global existing one

2016-03-31 Thread Erik Skultety
Actually perform the swap between the active set of outputs and the user-provided copy. Deallocation ensures that no file descriptors that should not have been closed are not closed and all descriptors that should be closed are closed properly. --- src/util/virlog.c | 11 +-- 1 file change

[libvirt] [PATCH 17/38] virlog: Introduce virLogFilterFree

2016-03-31 Thread Erik Skultety
Complementary method to virLogFilterNew. --- src/util/virlog.c | 10 ++ src/util/virlog.h | 1 + 2 files changed, 11 insertions(+) diff --git a/src/util/virlog.c b/src/util/virlog.c index 5da1af7..36fecda 100644 --- a/src/util/virlog.c +++ b/src/util/virlog.c @@ -1620,3 +1620,13 @@ virLo

[libvirt] [PATCH 07/38] virlog: Introduce virLogSetOutputs

2016-03-31 Thread Erik Skultety
This API is the entry point to output modification of the logger. Currently, everything is done by virLogParseOutputs which should do parsing only and a separate method which will do the definition part should be added. --- src/libvirt_private.syms | 1 + src/util/virlog.c| 23 +++

[libvirt] [PATCH 21/38] virlog: Split filter parsing and filter defining to separate operations

2016-03-31 Thread Erik Skultety
Everything has been prepared to successfully split parsing and defining logic to separate operations. --- src/libvirt_private.syms | 1 + src/util/virlog.c| 100 +++ src/util/virlog.h| 8 ++-- tests/virlogtest.c | 7 ++-- 4 fi

[libvirt] [PATCH 22/38] virlog: Split parsing and setting priority

2016-03-31 Thread Erik Skultety
Handling of outputs and filters has been changed in a way that splits parsing and defining. Do the same thing for logging priority as well, this however, doesn't need much of a preparation. --- src/util/virlog.c | 21 + tests/eventtest.c | 3 ++- 2 files changed, 11 insertions

[libvirt] [PATCH 25/38] virlog: Take a special care of syslog when setting new set of log outputs

2016-03-31 Thread Erik Skultety
Now that we're in the critical section, closelog and openlog need to be issued if the user setting changed, which is something that cannot be done beforehand, since syslog keeps its file descriptor private. --- src/util/virlog.c | 13 + 1 file changed, 13 insertions(+) diff --git a/sr

[libvirt] [PATCH 35/38] admin: Introduce virAdmConnectSetLoggingFilters

2016-03-31 Thread Erik Skultety
Enable libvirt users to modify logging filters of a daemon from outside. --- daemon/admin.c | 10 ++ include/libvirt/libvirt-admin.h | 4 src/admin/admin_protocol.x | 12 +++- src/admin_protocol-structs | 5 + src/libvirt-admin.c |

[libvirt] [PATCH 34/38] admin: Introduce virAdmConnectSetLoggingLevel

2016-03-31 Thread Erik Skultety
Enable libvirt users to set logging level of a daemon from outside. --- daemon/admin.c | 10 ++ include/libvirt/libvirt-admin.h | 4 src/admin/admin_protocol.x | 12 +++- src/admin_protocol-structs | 5 + src/libvirt-admin.c | 35 ++

[libvirt] [PATCH 33/38] admin: Introduce virAdmConnectGetLoggingOutputs

2016-03-31 Thread Erik Skultety
Enable libvirt users to query logging output settings. --- daemon/admin.c | 42 include/libvirt/libvirt-admin.h | 5 + src/admin/admin_protocol.x | 16 ++- src/admin/admin_remote.c| 43 +

[libvirt] [PATCH 38/38] virt-admin: Wire-up the logging APIs

2016-03-31 Thread Erik Skultety
Finally, now that all APIs have been introduced, wire them up to virt-admin and introduce dmn-log-info and dmn-log-define commands. --- tools/virt-admin.c | 208 + 1 file changed, 208 insertions(+) diff --git a/tools/virt-admin.c b/tools/virt-ad

[libvirt] [PATCH 29/38] virlog: Introduce an API mutex that serializes all setters

2016-03-31 Thread Erik Skultety
If the API isn't closed, a situation with 2 setters where one is about to define a set of outputs and the other is already defining a new one, may occur. By resetting all outputs, all file descriptors are closed. However, the other setter may still have a dangling reference to a file descriptor whi

Re: [libvirt] [PATCH 31/38] admin: Introduce virAdmConnectGetLoggingLevel

2016-04-01 Thread Erik Skultety
On 31/03/16 20:16, Daniel P. Berrange wrote: > On Thu, Mar 31, 2016 at 07:49:04PM +0200, Erik Skultety wrote: >> Enable libvirt users to query for the current logging level setting. > > I'm not really convinced we need to expose this via the API, > as the 'log_lev

Re: [libvirt] [PATCH 29/38] virlog: Introduce an API mutex that serializes all setters

2016-04-01 Thread Erik Skultety
On 31/03/16 20:13, Daniel P. Berrange wrote: > On Thu, Mar 31, 2016 at 07:49:02PM +0200, Erik Skultety wrote: >> If the API isn't closed, a situation with 2 setters where one is about to >> define a set of outputs and the other is already defining a new one, may >>

[libvirt] [PATCH 0/3] Fix adding PCI bridge controller to extend default PCI bus

2015-01-15 Thread Erik Skultety
Erik Skultety (3): qemu: Tweak auto adding PCI bridge controller when extending default PCI bus qemu: qemuDomainAssignPCIAddresses fix dead code qemu: Add XML test for too many PCI devices on default PCI bus src/qemu/qemu_command.c | 26 ++- tests

[libvirt] [PATCH 1/3] qemu: Tweak auto adding PCI bridge controller when extending default PCI bus

2015-01-15 Thread Erik Skultety
In case we find out, there are more PCI devices to be connected than there are available slots on the default PCI bus, we automatically add a new bus and a related PCI bridge controller as well. As there are no free slots left on the default PCI bus, PCI bridge controller gets a free slot on a newl

<    1   2   3   4   5   6   7   8   9   10   >