Re: [libvirt] [RFC PATCH 19/19] qapi: Implement -compat deprecated-output=hide for events

2019-10-24 Thread Markus Armbruster
Daniel P. Berrangé writes: > On Thu, Oct 24, 2019 at 02:34:58PM +0200, Markus Armbruster wrote: >> This policy suppresses deprecated events, and thus permits "testing >> the future". > > One thing that occurs to me is that this is a fairly passive impact > on libvirt. eg it may well be not at

Re: [libvirt] [RFC PATCH 18/19] qapi: Include a warning in the response to a deprecated command

2019-10-24 Thread Markus Armbruster
Daniel P. Berrangé writes: > On Thu, Oct 24, 2019 at 02:34:57PM +0200, Markus Armbruster wrote: >> Looks like this >> >> ---> {"execute": "query-cpus"} >> <--- {"return": [...], "warnings": [{"class": "CommandNotFound", "desc": >> "command is deprecated"}]} >> >> Management

Re: [libvirt] [PATCH] internal: Use g_strcmp0 in STR(N)EQ_NULLABLE

2019-10-24 Thread Laine Stump
On 10/24/19 10:31 AM, Peter Krempa wrote: On Thu, Oct 24, 2019 at 16:22:09 +0200, Pavel Hrdina wrote: On Thu, Oct 24, 2019 at 04:12:00PM +0200, Peter Krempa wrote: Signed-off-by: Peter Krempa --- src/internal.h | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git

[libvirt] [PATCH] tests: domaincaps: Fix build when WITH_QEMU is disabled

2019-10-24 Thread Peter Krempa
doTestQemuInternal and doTestQemu are used only when WITH_QEMU is enabled. Signed-off-by: Peter Krempa --- tests/domaincapstest.c | 5 + 1 file changed, 5 insertions(+) Pushed as a fix for broken build. diff --git a/tests/domaincapstest.c b/tests/domaincapstest.c index

Re: [libvirt] [PATCH 03/19] util: buffer: Simplify escape buffer allocations

2019-10-24 Thread Ján Tomko
On Thu, Oct 24, 2019 at 03:56:21PM +0200, Peter Krempa wrote: Replace combinations of xalloc_oversized and VIR_ALLOC_N_QUIET by using g_malloc0_n which does the checking internally. This conversion is done with a semantic difference and slightly higher memory requirements as I've opted to

Re: [libvirt] [PATCH 66/75] tools: Use g_strdup_printf() instead of virAsprintf()

2019-10-24 Thread Daniel Henrique Barboza
On 10/22/19 10:58 AM, Michal Privoznik wrote: Signed-off-by: Michal Privoznik --- tools/virsh-completer-domain.c | 6 +++--- tools/virsh-completer-host.c | 10 +- tools/virsh-completer.c| 2 +- tools/virsh-domain-monitor.c | 18 +-

Re: [libvirt] [PATCH] internal: Use g_strcmp0 in STR(N)EQ_NULLABLE

2019-10-24 Thread Daniel P . Berrangé
On Thu, Oct 24, 2019 at 04:22:09PM +0200, Pavel Hrdina wrote: > On Thu, Oct 24, 2019 at 04:12:00PM +0200, Peter Krempa wrote: > > Signed-off-by: Peter Krempa > > --- > > src/internal.h | 6 ++ > > 1 file changed, 2 insertions(+), 4 deletions(-) > > > > diff --git a/src/internal.h

Re: [libvirt] [PATCH 39/75] conf: Use g_strdup_printf() instead of virAsprintf()

2019-10-24 Thread Eric Blake
On 10/22/19 8:57 AM, Michal Privoznik wrote: Signed-off-by: Michal Privoznik --- +++ b/src/conf/domain_audit.c @@ -373,15 +373,15 @@ virDomainAuditHostdev(virDomainObjPtr vm, virDomainHostdevDefPtr hostdev, case VIR_DOMAIN_HOSTDEV_MODE_SUBSYS: switch

Re: [libvirt] [PATCH 75/75] Drop virVasprintf()

2019-10-24 Thread Daniel Henrique Barboza
On 10/22/19 10:58 AM, Michal Privoznik wrote: Now that function is no longer used, it can be dropped. Signed-off-by: Michal Privoznik --- docs/hacking.html.in | 5 - src/libvirt_private.syms | 1 - src/util/virstring.c | 21 - src/util/virstring.h

Re: [libvirt] [PATCH 74/75] Use g_strdup_vprintf() instead of virVasprintf() everywhere

2019-10-24 Thread Daniel Henrique Barboza
On 10/22/19 10:58 AM, Michal Privoznik wrote: Signed-off-by: Michal Privoznik --- src/libxl/libxl_logger.c | 2 +- src/qemu/qemu_domain.c| 4 ++-- src/util/viraudit.c | 2 +- src/util/vircommand.c | 4 ++-- src/util/virerror.c

Re: [libvirt] [PATCH 73/75] virstring: Make virVasprintf() return no value

2019-10-24 Thread Daniel Henrique Barboza
On 10/22/19 10:58 AM, Michal Privoznik wrote: Signed-off-by: Michal Privoznik --- src/util/virstring.c | 7 ++- src/util/virstring.h | 5 ++--- 2 files changed, 4 insertions(+), 8 deletions(-) Reviewed-by: Daniel Henrique Barboza -- libvir-list mailing list

Re: [libvirt] [PATCH 72/75] Drop virVasprintf() retval checking

2019-10-24 Thread Daniel Henrique Barboza
On 10/22/19 10:58 AM, Michal Privoznik wrote: These functions can't fail really. Drop checking of their retval then. Signed-off-by: Michal Privoznik --- src/libxl/libxl_logger.c | 3 +-- src/qemu/qemu_domain.c| 6 ++ src/util/viraudit.c | 3 +--

[libvirt] virsh blockresize syntax is inconsistent with vol-resize and somewhat dangerous

2019-10-24 Thread Tim Small
Hello, virsh has two commands which can be used to resize block devices - "blockresize" for volumes in use by and active guest, and "vol-resize" for volumes which are not in use. The vol-resize syntax allows to specify the size as a delta (increase or decrease vs. the current size), and also

Re: [libvirt] [PATCH 71/75] virstring: Drop virVasprintfQuiet()

2019-10-24 Thread Daniel Henrique Barboza
On 10/22/19 10:58 AM, Michal Privoznik wrote: This macro is no longer used and therefore can be dropped. Signed-off-by: Michal Privoznik --- src/util/virstring.h | 9 - 1 file changed, 9 deletions(-) Reviewed-by: Daniel Henrique Barboza diff --git a/src/util/virstring.h

Re: [libvirt] [PATCH 70/75] Rename virVasprintfQuiet() to virVasprintf()

2019-10-24 Thread Daniel Henrique Barboza
On 10/22/19 10:58 AM, Michal Privoznik wrote: There's no difference between virVasprintf() and virVasprintfQuiet(). Fix places where the latter is used to use the former. Signed-off-by: Michal Privoznik --- src/util/virerror.c | 4 ++-- src/util/virlog.c | 2 +- tests/eventtest.c |

Re: [libvirt] [PATCH 69/75] Drop virAsprintf()

2019-10-24 Thread Daniel Henrique Barboza
On 10/22/19 10:58 AM, Michal Privoznik wrote: Now that function is no longer used, it can be dropped. Signed-off-by: Michal Privoznik --- build-aux/syntax-check.mk | 10 +- docs/hacking.html.in| 8 m4/virt-compile-warnings.m4 | 2 --

Re: [libvirt] [PATCH 68/75] virpcimock: Make @fakerootdir static

2019-10-24 Thread Daniel Henrique Barboza
On 10/22/19 10:58 AM, Michal Privoznik wrote: Since we are not passing the @fakerootdir variable to any inline function anymore, we can make the variable static. Signed-off-by: Michal Privoznik --- Reviewed-by: Daniel Henrique Barboza tests/virpcimock.c | 6 +- 1 file changed,

Re: [libvirt] [PATCH 67/75] Use g_strdup_printf instead of virAsprintf everywhere

2019-10-24 Thread Daniel Henrique Barboza
On 10/22/19 10:58 AM, Michal Privoznik wrote: Signed-off-by: Michal Privoznik --- src/driver.c| 4 ++-- src/libvirt-admin.c | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) Reviewed-by: Daniel Henrique Barboza -- libvir-list mailing list libvir-list@redhat.com

Re: [libvirt] [PATCH 18/19] util: buffer: Remove virBufferCheckError

2019-10-24 Thread Ján Tomko
On Thu, Oct 24, 2019 at 03:56:36PM +0200, Peter Krempa wrote: The function now never returned an error so we can drop it fully. now does not return Signed-off-by: Peter Krempa --- src/bhyve/bhyve_command.c | 3 - src/bhyve/bhyve_driver.c | 5 -

Re: [libvirt] [PATCH 19/19] util: xml: Make virXMLFormatElement void

2019-10-24 Thread Ján Tomko
On Thu, Oct 24, 2019 at 03:56:37PM +0200, Peter Krempa wrote: Now that we don't have to deal with errors of virBuffer we can also make this function void. Signed-off-by: Peter Krempa --- src/conf/domain_conf.c | 112 +++-- src/qemu/qemu_domain.c | 24

Re: [libvirt] [PATCH 13/19] util: buffer: Properly URLencode strings

2019-10-24 Thread Ján Tomko
On Thu, Oct 24, 2019 at 03:56:31PM +0200, Peter Krempa wrote: According to rfc3986: Ah, it's been a while since I read that. 2.3. Unreserved Characters Characters that are allowed in a URI but do not have a reserved purpose are called unreserved. These include uppercase and lowercase

Re: [libvirt] [PATCH 65/75] tests: Use g_strdup_printf() instead of virAsprintf()

2019-10-24 Thread Daniel Henrique Barboza
On 10/22/19 10:58 AM, Michal Privoznik wrote: Signed-off-by: Michal Privoznik --- tests/bhyveargv2xmltest.c | 10 ++-- tests/bhyvexml2argvtest.c | 18 +++ tests/bhyvexml2xmltest.c| 10 ++-- tests/commandtest.c | 18

Re: [libvirt] [PATCH 12/12] tests/domaincaps: Use testQemuCapsIterate()

2019-10-24 Thread Andrea Bolognani
On Thu, 2019-10-24 at 16:37 +0200, Jiri Denemark wrote: > On Wed, Oct 23, 2019 at 12:43:02 +0200, Andrea Bolognani wrote: > > +/* > > + * Run "tests/qemucapsprobe /path/to/qemu/binary >foo.replies" > > + * to generate updated or new *.replies data files. > > + * > > + * If you

Re: [libvirt] [PATCH 61/75] vbox: Use g_strdup_printf() instead of virAsprintf()

2019-10-24 Thread Daniel Henrique Barboza
On 10/22/19 10:58 AM, Michal Privoznik wrote: Signed-off-by: Michal Privoznik --- src/vbox/vbox_MSCOMGlue.c | 4 ++-- src/vbox/vbox_XPCOMCGlue.c| 2 +- src/vbox/vbox_common.c| 30 +++--- src/vbox/vbox_network.c | 10 +-

Re: [libvirt] [PATCH 12/19] util: virbuffer: Remove @dynamic from virBufferGetIndent

2019-10-24 Thread Ján Tomko
On Thu, Oct 24, 2019 at 03:56:30PM +0200, Peter Krempa wrote: After the conversion of all callers that would pass true as @dynamic to a different function we can remove the unused argument now. Additionally modify the return type to 'size_t' as indentation can't be negative and remove checks

Re: [libvirt] [PATCH 05/19] util: alloc: drop xalloc_oversized macro

2019-10-24 Thread Ján Tomko
On Thu, Oct 24, 2019 at 03:56:23PM +0200, Peter Krempa wrote: We'we now got rid of all the uses. s/we/ve/ Signed-off-by: Peter Krempa --- src/util/viralloc.h | 19 --- 1 file changed, 19 deletions(-) Reviewed-by: Ján Tomko Jano signature.asc Description: PGP signature

Re: [libvirt] [PATCH 12/12] tests/domaincaps: Use testQemuCapsIterate()

2019-10-24 Thread Jiri Denemark
On Wed, Oct 23, 2019 at 12:43:02 +0200, Andrea Bolognani wrote: > Now that the only data we need for fully testing a QEMU binary is > the (version, arch) combo, we can stop providing that information > ourselves and instead rely on testQemuCapsIterate() automatically > picking up new input files

Re: [libvirt] [PATCH 06/19] util: buffer: Don't treat missing truncation in virBufferTrim as usage error

2019-10-24 Thread Ján Tomko
On Thu, Oct 24, 2019 at 03:56:24PM +0200, Peter Krempa wrote: Usage errors in the virBuffer are hard to track anyways. Just trim noting if the user requests the trimming string to be used without providing it. The change in the test proves that it's a noop now. no-op Signed-off-by: Peter

Re: [libvirt] [PATCH 15/19] util: buffer: Reimplement virBuffer internals using glib's GString

2019-10-24 Thread Ján Tomko
On Thu, Oct 24, 2019 at 03:56:33PM +0200, Peter Krempa wrote: GString is surprisingly similar to what libvirt was doing painstaikingly painstakingly Imagine a pancake, but much more convoluted. manually. Yet it doesn't support the automatic indentation features we use for XML so we rather

Re: [libvirt] [PATCH 17/19] util: buffer: Remove virBufferError

2019-10-24 Thread Ján Tomko
On Thu, Oct 24, 2019 at 03:56:35PM +0200, Peter Krempa wrote: The function now never returned an error so we can drop it fully. now does not return an error Signed-off-by: Peter Krempa --- src/conf/domain_conf.c | 2 -- src/libvirt_private.syms | 1 -

Re: [libvirt] [PATCH] internal: Use g_strcmp0 in STR(N)EQ_NULLABLE

2019-10-24 Thread Pavel Hrdina
On Thu, Oct 24, 2019 at 03:29:27PM +0100, Daniel P. Berrangé wrote: > On Thu, Oct 24, 2019 at 04:22:09PM +0200, Pavel Hrdina wrote: > > On Thu, Oct 24, 2019 at 04:12:00PM +0200, Peter Krempa wrote: > > > Signed-off-by: Peter Krempa > > > --- > > > src/internal.h | 6 ++ > > > 1 file changed,

Re: [libvirt] [PATCH 16/19] util: buffer: Remove error handling internals

2019-10-24 Thread Ján Tomko
On Thu, Oct 24, 2019 at 03:56:34PM +0200, Peter Krempa wrote: Now that there are no errors reported and tracked in virBuffer, remove all the internals which were used to track them. Signed-off-by: Peter Krempa --- src/util/virbuffer.c | 78 ++--

Re: [libvirt] [PATCH 62/75] vmware: Use g_strdup_printf() instead of virAsprintf()

2019-10-24 Thread Daniel Henrique Barboza
On 10/22/19 10:58 AM, Michal Privoznik wrote: Signed-off-by: Michal Privoznik --- src/vmware/vmware_conf.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) Reviewed-by: Daniel Henrique Barboza -- libvir-list mailing list libvir-list@redhat.com

Re: [libvirt] [PATCH] internal: Use g_strcmp0 in STR(N)EQ_NULLABLE

2019-10-24 Thread Peter Krempa
On Thu, Oct 24, 2019 at 16:22:09 +0200, Pavel Hrdina wrote: > On Thu, Oct 24, 2019 at 04:12:00PM +0200, Peter Krempa wrote: > > Signed-off-by: Peter Krempa > > --- > > src/internal.h | 6 ++ > > 1 file changed, 2 insertions(+), 4 deletions(-) > > > > diff --git a/src/internal.h

Re: [libvirt] [PATCH 64/75] vz: Use g_strdup_printf() instead of virAsprintf()

2019-10-24 Thread Daniel Henrique Barboza
On 10/22/19 10:58 AM, Michal Privoznik wrote: Signed-off-by: Michal Privoznik --- src/vz/vz_driver.c | 2 +- src/vz/vz_sdk.c| 32 +++- 2 files changed, 16 insertions(+), 18 deletions(-) Reviewed-by: Daniel Henrique Barboza -- libvir-list mailing

Re: [libvirt] [PATCH 09/19] tests: virbuffer: Remove unused test data struct

2019-10-24 Thread Ján Tomko
On Thu, Oct 24, 2019 at 03:56:27PM +0200, Peter Krempa wrote: The DO_TEST macro initializes 'struct testInfo' but it's not used by any of the tests. Remove it. Signed-off-by: Peter Krempa --- tests/virbuftest.c | 19 +++ 1 file changed, 7 insertions(+), 12 deletions(-)

Re: [libvirt] [PATCH 04/19] virsh: Reimplement _vshCalloc using g_malloc0_n

2019-10-24 Thread Ján Tomko
On Thu, Oct 24, 2019 at 03:56:22PM +0200, Peter Krempa wrote: Drop the dead code by using glib's allocator. Signed-off-by: Peter Krempa --- tools/vsh.c | 12 ++-- tools/vsh.h | 5 + 2 files changed, 3 insertions(+), 14 deletions(-) Reviewed-by: Ján Tomko Jano signature.asc

Re: [libvirt] [PATCH 10/19] util: buffer: Split getting of effective indent out of virBufferGetIndent

2019-10-24 Thread Ján Tomko
On Thu, Oct 24, 2019 at 03:56:28PM +0200, Peter Krempa wrote: The function basically does two very distinct things depending on a bool. As a first step of conversion split out the case when @dynamic is true and implement it as a new function and convert all callers. Signed-off-by: Peter Krempa

Re: [libvirt] [PATCH 63/75] vmx: Use g_strdup_printf() instead of virAsprintf()

2019-10-24 Thread Daniel Henrique Barboza
On 10/22/19 10:58 AM, Michal Privoznik wrote: Signed-off-by: Michal Privoznik --- src/vmx/vmx.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) Reviewed-by: Daniel Henrique Barboza -- libvir-list mailing list libvir-list@redhat.com

Re: [libvirt] [PATCH 07/19] util: buffer: Simplify handling of indent overflows

2019-10-24 Thread Ján Tomko
On Thu, Oct 24, 2019 at 03:56:25PM +0200, Peter Krempa wrote: Rather than setting usage error truncate the indentation level. Having the output string misformated is way more useful to figure out where the error lies rather than reporting an error after a giant formatter function. In

Re: [libvirt] [PATCH 11/19] util: sysinfo: Use virXMLFormatElement and infrastructure in virSysinfoFormat

2019-10-24 Thread Ján Tomko
On Thu, Oct 24, 2019 at 03:56:29PM +0200, Peter Krempa wrote: It basically implements almost the same thing, so we can replace it with existing helpers with a few tweaks. Signed-off-by: Peter Krempa --- src/util/virsysinfo.c | 26 ++ 1 file changed, 10 insertions(+), 16

Re: [libvirt] [PATCH 14/19] util: buffer: Encode URIs with upper case hex characters

2019-10-24 Thread Ján Tomko
On Thu, Oct 24, 2019 at 03:56:32PM +0200, Peter Krempa wrote: rfc3986 uses uppercase characters so switch to using them as well. Signed-off-by: Peter Krempa --- src/util/virbuffer.c | 2 +- tests/viruritest.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) Reviewed-by: Ján Tomko

Re: [libvirt] [PATCH] internal: Use g_strcmp0 in STR(N)EQ_NULLABLE

2019-10-24 Thread Pavel Hrdina
On Thu, Oct 24, 2019 at 04:12:00PM +0200, Peter Krempa wrote: > Signed-off-by: Peter Krempa > --- > src/internal.h | 6 ++ > 1 file changed, 2 insertions(+), 4 deletions(-) > > diff --git a/src/internal.h b/src/internal.h > index 5b0a2335f5..0ff9f496ac 100644 > --- a/src/internal.h > +++

Re: [libvirt] [PATCH 02/19] util: buffer: Use 'cleanup' as label name in virBufferAddBuffer

2019-10-24 Thread Ján Tomko
On Thu, Oct 24, 2019 at 03:56:20PM +0200, Peter Krempa wrote: Signed-off-by: Peter Krempa --- src/util/virbuffer.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) Reviewed-by: Ján Tomko Jano signature.asc Description: PGP signature -- libvir-list mailing list

Re: [libvirt] [PATCH 60/75] util: Use g_strdup_printf() instead of virAsprintf()

2019-10-24 Thread Daniel Henrique Barboza
On 10/22/19 10:58 AM, Michal Privoznik wrote: Signed-off-by: Michal Privoznik --- src/util/viraudit.c | 2 +- src/util/virauth.c | 10 ++--- src/util/virauthconfig.c| 6 +-- src/util/vircgroup.c| 22 +-- src/util/vircgroupv1.c

Re: [libvirt] [PATCH 01/19] util: buffer: Simplify convoluted condition

2019-10-24 Thread Ján Tomko
On Thu, Oct 24, 2019 at 03:56:19PM +0200, Peter Krempa wrote: Spare a few more lines rather than having a condition with a nested ternary. Signed-off-by: Peter Krempa --- src/util/virbuffer.c | 16 1 file changed, 12 insertions(+), 4 deletions(-) Reviewed-by: Ján Tomko

Re: [libvirt] [PATCH] internal: Use g_strcmp0 in STR(N)EQ_NULLABLE

2019-10-24 Thread Ján Tomko
On Thu, Oct 24, 2019 at 04:12:00PM +0200, Peter Krempa wrote: Signed-off-by: Peter Krempa --- src/internal.h | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) Reviewed-by: Ján Tomko Jano signature.asc Description: PGP signature -- libvir-list mailing list libvir-list@redhat.com

Re: [libvirt] [RFC PATCH 19/19] qapi: Implement -compat deprecated-output=hide for events

2019-10-24 Thread Daniel P . Berrangé
On Thu, Oct 24, 2019 at 02:34:58PM +0200, Markus Armbruster wrote: > This policy suppresses deprecated events, and thus permits "testing > the future". One thing that occurs to me is that this is a fairly passive impact on libvirt. eg it may well be not at all obvious if libvirt is behaving in a

Re: [libvirt] [PATCH 01/19] util: buffer: Simplify convoluted condition

2019-10-24 Thread Jonathon Jongsma
On Thu, 2019-10-24 at 15:56 +0200, Peter Krempa wrote: > Spare a few more lines rather than having a condition with a nested > ternary. > > Signed-off-by: Peter Krempa > --- > src/util/virbuffer.c | 16 > 1 file changed, 12 insertions(+), 4 deletions(-) > > diff --git

[libvirt] [PATCH] internal: Use g_strcmp0 in STR(N)EQ_NULLABLE

2019-10-24 Thread Peter Krempa
Signed-off-by: Peter Krempa --- src/internal.h | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/internal.h b/src/internal.h index 5b0a2335f5..0ff9f496ac 100644 --- a/src/internal.h +++ b/src/internal.h @@ -86,10 +86,8 @@ #define STRCASEPREFIX(a, b) (c_strncasecmp(a,

Re: [libvirt] [RFC PATCH 18/19] qapi: Include a warning in the response to a deprecated command

2019-10-24 Thread Daniel P . Berrangé
On Thu, Oct 24, 2019 at 02:34:57PM +0200, Markus Armbruster wrote: > Looks like this > > ---> {"execute": "query-cpus"} > <--- {"return": [...], "warnings": [{"class": "CommandNotFound", "desc": > "command is deprecated"}]} > > Management applications may want to log such warnings. > >

Re: [libvirt] [PATCH 59/75] test: Use g_strdup_printf() instead of virAsprintf()

2019-10-24 Thread Daniel Henrique Barboza
On 10/22/19 10:58 AM, Michal Privoznik wrote: Signed-off-by: Michal Privoznik --- src/test/test_driver.c | 26 +- 1 file changed, 13 insertions(+), 13 deletions(-) Reviewed-by: Daniel Henrique Barboza -- libvir-list mailing list libvir-list@redhat.com

Re: [libvirt] [PATCH 58/75] storage: Use g_strdup_printf() instead of virAsprintf()

2019-10-24 Thread Daniel Henrique Barboza
On 10/22/19 10:58 AM, Michal Privoznik wrote: Signed-off-by: Michal Privoznik --- src/storage/storage_backend_disk.c | 4 +- src/storage/storage_backend_gluster.c | 8 ++-- src/storage/storage_backend_iscsi.c| 16 +++ src/storage/storage_backend_iscsi_direct.c

[libvirt] [PATCH 18/19] util: buffer: Remove virBufferCheckError

2019-10-24 Thread Peter Krempa
The function now never returned an error so we can drop it fully. Signed-off-by: Peter Krempa --- src/bhyve/bhyve_command.c | 3 - src/bhyve/bhyve_driver.c | 5 - src/conf/capabilities.c | 16 --- src/conf/checkpoint_conf.c

[libvirt] [PATCH 17/19] util: buffer: Remove virBufferError

2019-10-24 Thread Peter Krempa
The function now never returned an error so we can drop it fully. Signed-off-by: Peter Krempa --- src/conf/domain_conf.c | 2 -- src/libvirt_private.syms | 1 - src/nwfilter/nwfilter_gentech_driver.c | 4 src/nwfilter/nwfilter_learnipaddr.c| 5 -

[libvirt] [PATCH 19/19] util: xml: Make virXMLFormatElement void

2019-10-24 Thread Peter Krempa
Now that we don't have to deal with errors of virBuffer we can also make this function void. Signed-off-by: Peter Krempa --- src/conf/domain_conf.c | 112 +++-- src/qemu/qemu_domain.c | 24 - src/util/virsysinfo.c | 5 +- src/util/virxml.c |

[libvirt] [PATCH 14/19] util: buffer: Encode URIs with upper case hex characters

2019-10-24 Thread Peter Krempa
rfc3986 uses uppercase characters so switch to using them as well. Signed-off-by: Peter Krempa --- src/util/virbuffer.c | 2 +- tests/viruritest.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/util/virbuffer.c b/src/util/virbuffer.c index bde118a248..2256bd5de5

[libvirt] [PATCH 10/19] util: buffer: Split getting of effective indent out of virBufferGetIndent

2019-10-24 Thread Peter Krempa
The function basically does two very distinct things depending on a bool. As a first step of conversion split out the case when @dynamic is true and implement it as a new function and convert all callers. Signed-off-by: Peter Krempa --- src/libvirt_private.syms | 1 + src/util/virbuffer.c

[libvirt] [PATCH 09/19] tests: virbuffer: Remove unused test data struct

2019-10-24 Thread Peter Krempa
The DO_TEST macro initializes 'struct testInfo' but it's not used by any of the tests. Remove it. Signed-off-by: Peter Krempa --- tests/virbuftest.c | 19 +++ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/tests/virbuftest.c b/tests/virbuftest.c index

[libvirt] [PATCH 13/19] util: buffer: Properly URLencode strings

2019-10-24 Thread Peter Krempa
According to rfc3986: 2.3. Unreserved Characters Characters that are allowed in a URI but do not have a reserved purpose are called unreserved. These include uppercase and lowercase letters, decimal digits, hyphen, period, underscore, and tilde. unreserved = ALPHA / DIGIT /

[libvirt] [PATCH 04/19] virsh: Reimplement _vshCalloc using g_malloc0_n

2019-10-24 Thread Peter Krempa
Drop the dead code by using glib's allocator. Signed-off-by: Peter Krempa --- tools/vsh.c | 12 ++-- tools/vsh.h | 5 + 2 files changed, 3 insertions(+), 14 deletions(-) diff --git a/tools/vsh.c b/tools/vsh.c index 3f8b7f2186..58ee94b52f 100644 --- a/tools/vsh.c +++ b/tools/vsh.c

[libvirt] [PATCH 06/19] util: buffer: Don't treat missing truncation in virBufferTrim as usage error

2019-10-24 Thread Peter Krempa
Usage errors in the virBuffer are hard to track anyways. Just trim noting if the user requests the trimming string to be used without providing it. The change in the test proves that it's a noop now. Signed-off-by: Peter Krempa --- src/util/virbuffer.c | 6 +- tests/virbuftest.c | 7

[libvirt] [PATCH 07/19] util: buffer: Simplify handling of indent overflows

2019-10-24 Thread Peter Krempa
Rather than setting usage error truncate the indentation level. Having the output string misformated is way more useful to figure out where the error lies rather than reporting an error after a giant formatter function. In testBufAutoIndent we now validate that the indentation is truncated and

[libvirt] [PATCH 12/19] util: virbuffer: Remove @dynamic from virBufferGetIndent

2019-10-24 Thread Peter Krempa
After the conversion of all callers that would pass true as @dynamic to a different function we can remove the unused argument now. Additionally modify the return type to 'size_t' as indentation can't be negative and remove checks whether @buf is passed as it's caller's duty to do so.

[libvirt] [PATCH 16/19] util: buffer: Remove error handling internals

2019-10-24 Thread Peter Krempa
Now that there are no errors reported and tracked in virBuffer, remove all the internals which were used to track them. Signed-off-by: Peter Krempa --- src/util/virbuffer.c | 78 ++-- src/util/virbuffer.h | 13 +++- 2 files changed, 14 insertions(+),

[libvirt] [PATCH 05/19] util: alloc: drop xalloc_oversized macro

2019-10-24 Thread Peter Krempa
We'we now got rid of all the uses. Signed-off-by: Peter Krempa --- src/util/viralloc.h | 19 --- 1 file changed, 19 deletions(-) diff --git a/src/util/viralloc.h b/src/util/viralloc.h index d7862d6127..e6ad9984b7 100644 --- a/src/util/viralloc.h +++ b/src/util/viralloc.h @@

[libvirt] [PATCH 11/19] util: sysinfo: Use virXMLFormatElement and infrastructure in virSysinfoFormat

2019-10-24 Thread Peter Krempa
It basically implements almost the same thing, so we can replace it with existing helpers with a few tweaks. Signed-off-by: Peter Krempa --- src/util/virsysinfo.c | 26 ++ 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/src/util/virsysinfo.c

[libvirt] [PATCH 15/19] util: buffer: Reimplement virBuffer internals using glib's GString

2019-10-24 Thread Peter Krempa
GString is surprisingly similar to what libvirt was doing painstaikingly manually. Yet it doesn't support the automatic indentation features we use for XML so we rather keep those in form of virBuffer using GString internally. Signed-off-by: Peter Krempa --- src/util/virbuffer.c | 205

[libvirt] [PATCH 08/19] tests: virbuffer: Drop 'infinite loop' tests

2019-10-24 Thread Peter Krempa
The tests are deeply based on internals of virBuffer which will be replaced in an upcoming patch with glib's GString. Remove the tests. Signed-off-by: Peter Krempa --- tests/virbuftest.c | 41 - 1 file changed, 41 deletions(-) diff --git

[libvirt] [PATCH 03/19] util: buffer: Simplify escape buffer allocations

2019-10-24 Thread Peter Krempa
Replace combinations of xalloc_oversized and VIR_ALLOC_N_QUIET by using g_malloc0_n which does the checking internally. This conversion is done with a semantic difference and slightly higher memory requirements as I've opted to allocate one chunk more than necessary rather than trying to

[libvirt] [PATCH 00/19] util: buffer: Use glib's GString internally

2019-10-24 Thread Peter Krempa
Converting to glib's helpers allows us to greatly simplify the error handling from virBuffer. Peter Krempa (19): util: buffer: Simplify convoluted condition util: buffer: Use 'cleanup' as label name in virBufferAddBuffer util: buffer: Simplify escape buffer allocations virsh: Reimplement

[libvirt] [PATCH 02/19] util: buffer: Use 'cleanup' as label name in virBufferAddBuffer

2019-10-24 Thread Peter Krempa
Signed-off-by: Peter Krempa --- src/util/virbuffer.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/util/virbuffer.c b/src/util/virbuffer.c index a58481430a..a2b5aa8508 100644 --- a/src/util/virbuffer.c +++ b/src/util/virbuffer.c @@ -201,22 +201,22 @@

[libvirt] [PATCH 01/19] util: buffer: Simplify convoluted condition

2019-10-24 Thread Peter Krempa
Spare a few more lines rather than having a condition with a nested ternary. Signed-off-by: Peter Krempa --- src/util/virbuffer.c | 16 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/util/virbuffer.c b/src/util/virbuffer.c index 04c8fd7291..a58481430a 100644

[libvirt] [dbus PATCH] meson: fix construction of data directories

2019-10-24 Thread Pavel Hrdina
We need to use prefix for all directories and there is no need to check if the user provided path starts with '/' as that is done automatically by the join_paths() function or '/' operator. Signed-off-by: Pavel Hrdina --- meson.build | 38 +++--- 1 file changed,

Re: [libvirt] [PATCH 57/75] security: Use g_strdup_printf() instead of virAsprintf()

2019-10-24 Thread Daniel Henrique Barboza
On 10/22/19 10:58 AM, Michal Privoznik wrote: Signed-off-by: Michal Privoznik --- src/security/security_apparmor.c | 22 +- src/security/security_dac.c | 20 src/security/security_selinux.c | 40

Re: [libvirt] [PATCH 55/75] rpc: Use g_strdup_printf() instead of virAsprintf()

2019-10-24 Thread Daniel Henrique Barboza
On 10/22/19 10:57 AM, Michal Privoznik wrote: Signed-off-by: Michal Privoznik --- src/rpc/virnetclient.c| 12 ++-- src/rpc/virnetlibsshsession.c | 8 src/rpc/virnetsocket.c| 2 +- src/rpc/virnetsshsession.c| 11 ++-

Re: [libvirt] [libvirt-dbus][PATCH v3 2/2] Implement snapshots APIs

2019-10-24 Thread Pavel Hrdina
On Wed, Oct 23, 2019 at 01:11:46PM +0200, Simon Kobyda wrote: > Signed-off-by: Simon Kobyda > --- > data/org.libvirt.Domain.xml | 26 > data/org.libvirt.DomainSnapshot.xml | 34 + > src/domain.c| 154 ++ > src/domainsnapshot.c

Re: [libvirt] [PATCH 56/75] secret: Use g_strdup_printf() instead of virAsprintf()

2019-10-24 Thread Daniel Henrique Barboza
On 10/22/19 10:58 AM, Michal Privoznik wrote: Signed-off-by: Michal Privoznik --- src/secret/secret_driver.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) Reviewed-by: Daniel Henrique Barboza -- libvir-list mailing list libvir-list@redhat.com

Re: [libvirt] [PATCH 54/75] remote: Use g_strdup_printf() instead of virAsprintf()

2019-10-24 Thread Daniel Henrique Barboza
On 10/22/19 10:57 AM, Michal Privoznik wrote: Signed-off-by: Michal Privoznik --- src/remote/remote_daemon.c | 28 ++-- src/remote/remote_daemon_config.c | 2 +- src/remote/remote_daemon_dispatch.c | 14 +++--- src/remote/remote_driver.c

Re: [libvirt] [libvirt-dbus][PATCH v3 1/2] Introduce Domain Snapshot Interface

2019-10-24 Thread Pavel Hrdina
On Wed, Oct 23, 2019 at 01:11:45PM +0200, Simon Kobyda wrote: > Signed-off-by: Simon Kobyda > --- > data/org.libvirt.DomainSnapshot.xml | 7 +++ > src/connect.c | 6 +++ > src/connect.h | 1 + > src/domainsnapshot.c| 75

Re: [libvirt] [PATCH 53/75] qemu: Use g_strdup_printf() instead of virAsprintf()

2019-10-24 Thread Daniel Henrique Barboza
On 10/22/19 10:57 AM, Michal Privoznik wrote: Signed-off-by: Michal Privoznik --- src/qemu/qemu_agent.c| 6 +-- src/qemu/qemu_alias.c| 88 +++ src/qemu/qemu_block.c| 30 +-- src/qemu/qemu_blockjob.c | 8

Re: [libvirt] [PATCH 52/75] phyp: Use g_strdup_printf() instead of virAsprintf()

2019-10-24 Thread Daniel Henrique Barboza
On 10/22/19 10:57 AM, Michal Privoznik wrote: Signed-off-by: Michal Privoznik --- src/phyp/phyp_driver.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) Reviewed-by: Daniel Henrique Barboza -- libvir-list mailing list libvir-list@redhat.com

Re: [libvirt] [PATCH 51/75] openvz: Use g_strdup_printf() instead of virAsprintf()

2019-10-24 Thread Daniel Henrique Barboza
On 10/22/19 10:57 AM, Michal Privoznik wrote: Signed-off-by: Michal Privoznik --- src/openvz/openvz_conf.c | 12 ++-- src/openvz/openvz_driver.c | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) Reviewed-by: Daniel Henrique Barboza -- libvir-list mailing list

Re: [libvirt] [PATCH 50/75] nwfilter: Use g_strdup_printf() instead of virAsprintf()

2019-10-24 Thread Daniel Henrique Barboza
On 10/22/19 10:57 AM, Michal Privoznik wrote: Signed-off-by: Michal Privoznik --- src/nwfilter/nwfilter_dhcpsnoop.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) Reviewed-by: Daniel Henrique Barboza -- libvir-list mailing list libvir-list@redhat.com

Re: [libvirt] [PATCH 49/75] node_device: Use g_strdup_printf() instead of virAsprintf()

2019-10-24 Thread Daniel Henrique Barboza
On 10/22/19 10:57 AM, Michal Privoznik wrote: Signed-off-by: Michal Privoznik --- src/node_device/node_device_driver.c | 2 +- src/node_device/node_device_hal.c| 4 ++-- src/node_device/node_device_udev.c | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-)

[libvirt] [PATCH v3 12/20] src: admin: generate source files into build directory

2019-10-24 Thread Pavel Hrdina
Signed-off-by: Pavel Hrdina Reviewed-by: Ján Tomko --- Notes: Changes in v2: - remove entries from .gitignore - modify generated_files for sc_po_check as well .gitignore| 2 -- build-aux/syntax-check.mk | 1 - po/POTFILES.in| 3 ++-

Re: [libvirt] [PATCH 47/75] lxc: Use g_strdup_printf() instead of virAsprintf()

2019-10-24 Thread Daniel Henrique Barboza
On 10/22/19 10:57 AM, Michal Privoznik wrote: Signed-off-by: Michal Privoznik --- src/lxc/lxc_container.c | 41 +-- src/lxc/lxc_controller.c | 46 src/lxc/lxc_driver.c | 8 +++ src/lxc/lxc_fuse.c |

[libvirt] [PATCH v3 20/20] tools: stop distributing generated source files

2019-10-24 Thread Pavel Hrdina
Signed-off-by: Pavel Hrdina Reviewed-by: Ján Tomko --- tools/Makefile.am | 1 - 1 file changed, 1 deletion(-) diff --git a/tools/Makefile.am b/tools/Makefile.am index 68320c7246..1a541a3984 100644 --- a/tools/Makefile.am +++ b/tools/Makefile.am @@ -84,7 +84,6 @@ EXTRA_DIST = \

[libvirt] [PATCH v3 17/20] src: lxc: generate source files into build directory

2019-10-24 Thread Pavel Hrdina
Signed-off-by: Pavel Hrdina Reviewed-by: Ján Tomko --- Notes: Changes in v2: - remove entries from .gitignore - modify generated_files for sc_po_check as well .gitignore| 2 -- build-aux/syntax-check.mk | 1 - src/lxc/Makefile.inc.am | 4 ++-- 3 files

Re: [libvirt] [PATCH 48/75] network: Use g_strdup_printf() instead of virAsprintf()

2019-10-24 Thread Daniel Henrique Barboza
On 10/22/19 10:57 AM, Michal Privoznik wrote: Signed-off-by: Michal Privoznik --- src/network/bridge_driver.c | 58 ++--- src/network/leaseshelper.c | 4 +-- 2 files changed, 31 insertions(+), 31 deletions(-) diff --git a/src/network/bridge_driver.c

[libvirt] [PATCH v3 19/20] src: stop distributing generated source files

2019-10-24 Thread Pavel Hrdina
Signed-off-by: Pavel Hrdina Reviewed-by: Ján Tomko --- src/Makefile.am | 6 +++--- src/access/Makefile.inc.am | 3 ++- src/admin/Makefile.inc.am | 13 +++-- src/bhyve/Makefile.inc.am | 1 + src/esx/Makefile.inc.am | 4 +---

[libvirt] [PATCH v3 18/20] src: remote: generate source files into build directory

2019-10-24 Thread Pavel Hrdina
Signed-off-by: Pavel Hrdina Reviewed-by: Ján Tomko --- Notes: Changes in v2: - remove entries from .gitignore - modify generated_files for sc_po_check as well .gitignore | 2 -- build-aux/syntax-check.mk | 2 -- po/POTFILES.in | 4 ++--

[libvirt] [PATCH v3 15/20] src: locking: generate source files into build directory

2019-10-24 Thread Pavel Hrdina
Signed-off-by: Pavel Hrdina Reviewed-by: Ján Tomko --- Notes: Changes in v2: - remove entries from .gitignore - modify generated_files for sc_po_check as well .gitignore | 1 - build-aux/syntax-check.mk | 2 +- src/locking/Makefile.inc.am | 2 +- 3 files

[libvirt] [PATCH v3 16/20] src: logging: generate source files into build directory

2019-10-24 Thread Pavel Hrdina
Signed-off-by: Pavel Hrdina Reviewed-by: Ján Tomko --- Notes: Changes in v2: - remove entries from .gitignore - modify generated_files for sc_po_check as well .gitignore | 1 - build-aux/syntax-check.mk | 2 +- src/logging/Makefile.inc.am | 2 +- 3 files

[libvirt] [PATCH v3 11/20] src: access: generate source files into build directory

2019-10-24 Thread Pavel Hrdina
Signed-off-by: Pavel Hrdina Reviewed-by: Ján Tomko --- Notes: Changes in v2: - remove entries from .gitignore .gitignore | 7 --- po/POTFILES.in | 3 +++ src/access/Makefile.inc.am | 14 +++--- src/admin/Makefile.inc.am

[libvirt] [PATCH v3 07/20] po: rewrite the way how we generate files

2019-10-24 Thread Pavel Hrdina
There was no need to handle files for translation from build directory but that will change with following patches where we will stop generating source files into source directory. In order to have them included for translation we have to prefix each file with SRCDIR or BUILDDIR. Signed-off-by:

[libvirt] [PATCH v3 14/20] src: hyperv: generate source files into build directory

2019-10-24 Thread Pavel Hrdina
Signed-off-by: Pavel Hrdina Reviewed-by: Ján Tomko --- Notes: Changes in v2: - remove entries from .gitignore .gitignore | 1 - src/hyperv/Makefile.inc.am | 5 +++-- src/hyperv/hyperv_wmi_generator.py | 11 +-- 3 files changed, 8

[libvirt] [PATCH v3 04/20] syntax-check.mk: cleanup sc_po_check dependencies

2019-10-24 Thread Pavel Hrdina
Introduce new rule 'generated-sources' as a helper for PO files check to make sure that all generated files are prepared and to not duplicate the list on different places. This will be used as a dependency for sc_po_check rule instead of duplicated list of generated files. Signed-off-by: Pavel

[libvirt] [PATCH v3 00/20] cleanup current build system

2019-10-24 Thread Pavel Hrdina
As preparation to switch to Meson there are some things that needs be cleaned up to make the conversion easier. The important thing in Meson is that there is a strict separation

[libvirt] [PATCH v3 03/20] syntax-check.mk: fix sc_po_check rule

2019-10-24 Thread Pavel Hrdina
Commit <22d8e27ccd5faf48ee2bf288a1b9059aa7ffd28b> introduced our syntax-check.mk file based on gnulib rules. However, the rule was completely ignored as we don't have POTFILES.in file. Signed-off-by: Pavel Hrdina --- Notes: New in v2. build-aux/syntax-check.mk | 2 +- po/POTFILES

  1   2   >