[libvirt] [PATCH 1/3] util: new function virNetDevOpenvswitchInterfaceGetMaster()

2018-07-01 Thread Laine Stump
This function retrieves the name of the OVS bridge that the given netdev is attached to. This separate function is necessary because OVS set the IFLA_MASTER attribute to "ovs-system" for all netdevs that are attached to an OVS bridge, so the standard method of retrieving the master can't be used.

[libvirt] [PATCH 3/3] network: properly check for taps that are connected to an OVS bridge

2018-07-01 Thread Laine Stump
When libvirtd is restarted, it checks that each guest tap device is still attached to the bridge device that the configuration info says it should be connected to. If not, the tap will be disconnected from [wherever it is] and connected to [wherever it should be]. The previous code that did this

[libvirt] [PATCH 0/3] fix bad error log on libvirtd restart when using OVS

2018-07-01 Thread Laine Stump
This BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1596176 and the log message of patch 3 explain the problem. Laine Stump (3): util: new function virNetDevOpenvswitchInterfaceGetMaster() util: add some debug log to virNetDevGetMaster network: properly check for taps that are

[libvirt] [PATCH 2/3] util: add some debug log to virNetDevGetMaster

2018-07-01 Thread Laine Stump
This makes it easier to see why libvirt has decided it must re-attach a tap device to its bridge. Signed-off-by: Laine Stump --- src/util/virnetdev.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/util/virnetdev.c b/src/util/virnetdev.c index b250af9e2c..c20022fbc9 100644 ---

[libvirt] [PATCH v3 30/35] util: arptable: use VIR_AUTOFREE instead of VIR_FREE for scalar types

2018-07-01 Thread Sukrit Bhatnagar
By making use of GNU C's cleanup attribute handled by the VIR_AUTOFREE macro for declaring scalar variables, majority of the VIR_FREE calls can be dropped, which in turn leads to getting rid of most of our cleanup sections. Signed-off-by: Sukrit Bhatnagar --- src/util/virarptable.c | 14

[libvirt] [PATCH v3 34/35] util: filecache: use VIR_AUTOFREE instead of VIR_FREE for scalar types

2018-07-01 Thread Sukrit Bhatnagar
By making use of GNU C's cleanup attribute handled by the VIR_AUTOFREE macro for declaring scalar variables, majority of the VIR_FREE calls can be dropped, which in turn leads to getting rid of most of our cleanup sections. Signed-off-by: Sukrit Bhatnagar --- src/util/virfilecache.c | 35

[libvirt] [PATCH v3 22/35] util: json: define cleanup function using VIR_DEFINE_AUTOPTR_FUNC

2018-07-01 Thread Sukrit Bhatnagar
Using the new VIR_DEFINE_AUTOPTR_FUNC macro defined in src/util/viralloc.h, define a new wrapper around an existing cleanup function which will be called when a variable declared with VIR_AUTOPTR macro goes out of scope. When a variable of type virJSONValuePtr is declared using VIR_AUTOPTR, the

[libvirt] [PATCH v3 25/35] util: json: use VIR_AUTOPTR for aggregate types

2018-07-01 Thread Sukrit Bhatnagar
By making use of GNU C's cleanup attribute handled by the VIR_AUTOPTR macro for declaring aggregate pointer variables, majority of the calls to *Free functions can be dropped, which in turn leads to getting rid of most of our cleanup sections. Signed-off-by: Sukrit Bhatnagar ---

[libvirt] [PATCH v3 32/35] util: fcp: use VIR_AUTOFREE instead of VIR_FREE for scalar types

2018-07-01 Thread Sukrit Bhatnagar
By making use of GNU C's cleanup attribute handled by the VIR_AUTOFREE macro for declaring scalar variables, majority of the VIR_FREE calls can be dropped, which in turn leads to getting rid of most of our cleanup sections. Signed-off-by: Sukrit Bhatnagar --- src/util/virfcp.c | 20

[libvirt] [PATCH v3 12/35] util: file: define cleanup function using VIR_DEFINE_AUTOPTR_FUNC

2018-07-01 Thread Sukrit Bhatnagar
Using the new VIR_DEFINE_AUTOPTR_FUNC macro defined in src/util/viralloc.h, define a new wrapper around an existing cleanup function which will be called when a variable declared with VIR_AUTOPTR macro goes out of scope. When a variable of type virFileWrapperFdPtr is declared using VIR_AUTOPTR,

[libvirt] [PATCH v3 19/35] util: auth: remove redundant include directive

2018-07-01 Thread Sukrit Bhatnagar
The include directive for viralloc.h is added in virauthconfig.h in a previous patch. Signed-off-by: Sukrit Bhatnagar --- src/util/virauth.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/util/virauth.c b/src/util/virauth.c index adb093e..c6a2ce7 100644 --- a/src/util/virauth.c +++

[libvirt] [PATCH v3 29/35] util: iohelper: use VIR_AUTOFREE instead of VIR_FREE for scalar types

2018-07-01 Thread Sukrit Bhatnagar
By making use of GNU C's cleanup attribute handled by the VIR_AUTOFREE macro for declaring scalar variables, majority of the VIR_FREE calls can be dropped, which in turn leads to getting rid of most of our cleanup sections. Signed-off-by: Sukrit Bhatnagar --- src/util/iohelper.c | 4 +--- 1

[libvirt] [PATCH v3 24/35] util: json: use VIR_AUTOFREE instead of VIR_FREE for scalar types

2018-07-01 Thread Sukrit Bhatnagar
By making use of GNU C's cleanup attribute handled by the VIR_AUTOFREE macro for declaring scalar variables, majority of the VIR_FREE calls can be dropped, which in turn leads to getting rid of most of our cleanup sections. Signed-off-by: Sukrit Bhatnagar --- src/util/virjson.c | 49

[libvirt] [PATCH v3 17/35] util: authconfig: remove redundant include directive

2018-07-01 Thread Sukrit Bhatnagar
The include directive for viralloc.h is added in virauthconfig.h in a previous patch. Signed-off-by: Sukrit Bhatnagar --- src/util/virauthconfig.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/util/virauthconfig.c b/src/util/virauthconfig.c index 91c9c0c..3487cc2 100644 ---

[libvirt] [PATCH v3 20/35] util: auth: use VIR_AUTOFREE instead of VIR_FREE for scalar types

2018-07-01 Thread Sukrit Bhatnagar
By making use of GNU C's cleanup attribute handled by the VIR_AUTOFREE macro for declaring scalar variables, majority of the VIR_FREE calls can be dropped, which in turn leads to getting rid of most of our cleanup sections. Signed-off-by: Sukrit Bhatnagar --- src/util/virauth.c | 45

[libvirt] [PATCH v3 35/35] util: identity: use VIR_AUTOFREE instead of VIR_FREE for scalar types

2018-07-01 Thread Sukrit Bhatnagar
By making use of GNU C's cleanup attribute handled by the VIR_AUTOFREE macro for declaring scalar variables, majority of the VIR_FREE calls can be dropped, which in turn leads to getting rid of most of our cleanup sections. Signed-off-by: Sukrit Bhatnagar --- src/util/viridentity.c | 52

[libvirt] [PATCH v3 21/35] util: auth: use VIR_AUTOPTR for aggregate types

2018-07-01 Thread Sukrit Bhatnagar
By making use of GNU C's cleanup attribute handled by the VIR_AUTOPTR macro for declaring aggregate pointer variables, majority of the calls to *Free functions can be dropped, which in turn leads to getting rid of most of our cleanup sections. Signed-off-by: Sukrit Bhatnagar ---

[libvirt] [PATCH v3 26/35] util: bitmap: define cleanup function using VIR_DEFINE_AUTOPTR_FUNC

2018-07-01 Thread Sukrit Bhatnagar
Using the new VIR_DEFINE_AUTOPTR_FUNC macro defined in src/util/viralloc.h, define a new wrapper around an existing cleanup function which will be called when a variable declared with VIR_AUTOPTR macro goes out of scope. When a variable of type virBitmapPtr is declared using VIR_AUTOPTR, the

[libvirt] [PATCH v3 33/35] util: eventpoll: use VIR_AUTOFREE instead of VIR_FREE for scalar types

2018-07-01 Thread Sukrit Bhatnagar
By making use of GNU C's cleanup attribute handled by the VIR_AUTOFREE macro for declaring scalar variables, majority of the VIR_FREE calls can be dropped, which in turn leads to getting rid of most of our cleanup sections. Signed-off-by: Sukrit Bhatnagar --- src/util/vireventpoll.c | 7 ++-

[libvirt] [PATCH v3 28/35] util: bitmap: use VIR_AUTOPTR for aggregate types

2018-07-01 Thread Sukrit Bhatnagar
By making use of GNU C's cleanup attribute handled by the VIR_AUTOPTR macro for declaring aggregate pointer variables, majority of the calls to *Free functions can be dropped, which in turn leads to getting rid of most of our cleanup sections. Signed-off-by: Sukrit Bhatnagar ---

[libvirt] [PATCH v3 27/35] util: bitmap: remove redundant include directive

2018-07-01 Thread Sukrit Bhatnagar
The include directive for viralloc.h is added in virbitmap.h in a previous patch. Signed-off-by: Sukrit Bhatnagar --- src/util/virbitmap.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/util/virbitmap.c b/src/util/virbitmap.c index 0cc5292..ef18dad 100644 --- a/src/util/virbitmap.c +++

[libvirt] [PATCH v3 23/35] util: json: remove redundant include directive

2018-07-01 Thread Sukrit Bhatnagar
The include directive for viralloc.h is added in virjson.h in a previous patch. Signed-off-by: Sukrit Bhatnagar --- src/util/virjson.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/util/virjson.c b/src/util/virjson.c index 0559d40..92f3994 100644 --- a/src/util/virjson.c +++

[libvirt] [PATCH v3 31/35] util: audit: use VIR_AUTOFREE instead of VIR_FREE for scalar types

2018-07-01 Thread Sukrit Bhatnagar
By making use of GNU C's cleanup attribute handled by the VIR_AUTOFREE macro for declaring scalar variables, majority of the VIR_FREE calls can be dropped, which in turn leads to getting rid of most of our cleanup sections. Signed-off-by: Sukrit Bhatnagar --- src/util/viraudit.c | 3 +-- 1 file

[libvirt] [PATCH v3 13/35] util: file: remove redundant include directive

2018-07-01 Thread Sukrit Bhatnagar
The include directive for viralloc.h is added in virfile.h in a previous patch. Signed-off-by: Sukrit Bhatnagar --- src/util/virfile.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/util/virfile.c b/src/util/virfile.c index 378d03e..2690e2d 100644 --- a/src/util/virfile.c +++

[libvirt] [PATCH v3 18/35] util: authconfig: use VIR_AUTOFREE instead of VIR_FREE for scalar types

2018-07-01 Thread Sukrit Bhatnagar
By making use of GNU C's cleanup attribute handled by the VIR_AUTOFREE macro for declaring scalar variables, majority of the VIR_FREE calls can be dropped, which in turn leads to getting rid of most of our cleanup sections. Signed-off-by: Sukrit Bhatnagar --- src/util/virauthconfig.c | 34

[libvirt] [PATCH v3 06/35] util: string: introduce typedef for string

2018-07-01 Thread Sukrit Bhatnagar
Alias virString to (char *) so that the new cleanup macros can be used for a list of strings (char **). Signed-off-by: Sukrit Bhatnagar --- src/util/virstring.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/util/virstring.h b/src/util/virstring.h index 607ae66..ac930fd 100644 ---

[libvirt] [PATCH v3 03/35] cfg.mk: correct spacing between type and asterisk in VIR_AUTOFREE

2018-07-01 Thread Sukrit Bhatnagar
Add rule to ensure that there is exactly one blank space between the type name and the asterisk when passed as the argument to the VIR_AUTOFREE macro. Signed-off-by: Sukrit Bhatnagar --- cfg.mk | 9 + 1 file changed, 9 insertions(+) diff --git a/cfg.mk b/cfg.mk index 196d1b2..d9e90d5

[libvirt] [PATCH v3 10/35] util: command: use VIR_AUTOFREE instead of VIR_FREE for scalar types

2018-07-01 Thread Sukrit Bhatnagar
By making use of GNU C's cleanup attribute handled by the VIR_AUTOFREE macro for declaring scalar variables, majority of the VIR_FREE calls can be dropped, which in turn leads to getting rid of most of our cleanup sections. Signed-off-by: Sukrit Bhatnagar --- src/util/vircommand.c | 40

[libvirt] [PATCH v3 11/35] util: command: use VIR_AUTOPTR for aggregate types

2018-07-01 Thread Sukrit Bhatnagar
By making use of GNU C's cleanup attribute handled by the VIR_AUTOPTR macro for declaring aggregate pointer variables, majority of the calls to *Free functions can be dropped, which in turn leads to getting rid of most of our cleanup sections. Signed-off-by: Sukrit Bhatnagar ---

[libvirt] [PATCH v3 07/35] util: string: define cleanup function using VIR_DEFINE_AUTOPTR_FUNC

2018-07-01 Thread Sukrit Bhatnagar
Using the new VIR_DEFINE_AUTOPTR_FUNC macro defined in src/util/viralloc.h, define a new wrapper around an existing cleanup function which will be called when a variable declared with VIR_AUTOPTR macro goes out of scope. When a list of strings (virString *) is declared using VIR_AUTOPTR, the

[libvirt] [PATCH v3 04/35] cfg.mk: single variable declaration per line when using cleanup macro

2018-07-01 Thread Sukrit Bhatnagar
Add rule to ensure that each variable declaration made using a cleanup macro is in its own separate line. Sometimes a variable might be initialized from a value returned by a macro or a function, which may take on more than one parameter, thereby introducing a comma, which might be mistaken for

[libvirt] [PATCH v3 09/35] util: command: remove redundant include directive

2018-07-01 Thread Sukrit Bhatnagar
The include directive for viralloc.h is added in vircommand.h in a previous patch. Signed-off-by: Sukrit Bhatnagar --- src/util/vircommand.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/util/vircommand.c b/src/util/vircommand.c index 6dab105..8681e7b 100644 --- a/src/util/vircommand.c

[libvirt] [PATCH v3 05/35] cfg.mk: no trailing semicolon at line invoking VIR_DEFINE_* cleanup macro

2018-07-01 Thread Sukrit Bhatnagar
Add rule to ensure that there is no semicolon at the end of the line where a VIR_DEFINE_* cleanup macro is invoked. Signed-off-by: Sukrit Bhatnagar --- cfg.mk | 9 + 1 file changed, 9 insertions(+) diff --git a/cfg.mk b/cfg.mk index 7949fc8..d292005 100644 --- a/cfg.mk +++ b/cfg.mk @@

[libvirt] [PATCH v3 08/35] util: command: define cleanup function using VIR_DEFINE_AUTOPTR_FUNC

2018-07-01 Thread Sukrit Bhatnagar
Using the new VIR_DEFINE_AUTOPTR_FUNC macro defined in src/util/viralloc.h, define a new wrapper around an existing cleanup function which will be called when a variable declared with VIR_AUTOPTR macro goes out of scope. When a variable of type virCommandPtr is declared using VIR_AUTOPTR, the

[libvirt] [PATCH v3 16/35] util: authconfig: define cleanup function using VIR_DEFINE_AUTOPTR_FUNC

2018-07-01 Thread Sukrit Bhatnagar
Using the new VIR_DEFINE_AUTOPTR_FUNC macro defined in src/util/viralloc.h, define a new wrapper around an existing cleanup function which will be called when a variable declared with VIR_AUTOPTR macro goes out of scope. When a variable of type virAuthConfigPtr is declared using VIR_AUTOPTR, the

[libvirt] [PATCH v3 00/35] use GNU C's cleanup attribute in src/util (batch I)

2018-07-01 Thread Sukrit Bhatnagar
This series of patches first introduces a new set of macros which help in using GNU C's __attribute__((cleanup)) in the code. Then a few syntax-check rules are added which help in ensuring correct usage of the newly introduced cleanup macros. Then the patches modify a few files in src/util to

[libvirt] [PATCH v3 15/35] util: file: use VIR_AUTOPTR for aggregate types

2018-07-01 Thread Sukrit Bhatnagar
By making use of GNU C's cleanup attribute handled by the VIR_AUTOPTR macro for declaring aggregate pointer variables, majority of the calls to *Free functions can be dropped, which in turn leads to getting rid of most of our cleanup sections. Signed-off-by: Sukrit Bhatnagar ---

[libvirt] [PATCH v3 02/35] cfg.mk: variable initialization when declared with cleanup macro

2018-07-01 Thread Sukrit Bhatnagar
A variable, which is never assigned a value in the function, might get passed into the cleanup function which may or may not raise any errors. To maintain the correct usage, the variable must be initialized, either with a value or with NULL. This syntax-check rule takes care of that.

[libvirt] [PATCH v3 14/35] util: file: use VIR_AUTOFREE instead of VIR_FREE for scalar types

2018-07-01 Thread Sukrit Bhatnagar
By making use of GNU C's cleanup attribute handled by the VIR_AUTOFREE macro for declaring scalar variables, majority of the VIR_FREE calls can be dropped, which in turn leads to getting rid of most of our cleanup sections. Signed-off-by: Sukrit Bhatnagar --- src/util/virfile.c | 310

[libvirt] [PATCH v3 01/35] util: alloc: add macros for implementing automatic cleanup functionality

2018-07-01 Thread Sukrit Bhatnagar
New macros are introduced which help in adding GNU C's cleanup attribute to variable declarations. Variables declared with these macros will have their allocated memory freed automatically when they go out of scope. Signed-off-by: Sukrit Bhatnagar --- src/util/viralloc.h | 44

Re: [libvirt] [PATCH v2 2/2] lxc: Rearrange order in lxcDomainUpdateDeviceFlags

2018-07-01 Thread Michal Prívozník
On 06/30/2018 04:51 PM, John Ferlan wrote: > Although commit e3497f3f noted that the LIVE option doesn't > matter and removed the call to virDomainDefCompatibleDevice, > it didn't go quite far enough and change the order of the checks > and rework the code to just handle the config change causing

Re: [libvirt] [PATCH v2 0/2] Rearrange order in lxcDomainUpdateDeviceFlags

2018-07-01 Thread Michal Prívozník
On 06/30/2018 04:51 PM, John Ferlan wrote: > v1: https://www.redhat.com/archives/libvir-list/2018-June/msg01706.html > > Changes since v1, > > - Insert patch 1 to remove the FORCE flag from the possible/allowed > list of flags - it was only useful for live anyway > > - Continue to rearrange