[libvirt] [RFC] Add API to change qemu agent response timeout

2019-10-03 Thread Jonathon Jongsma
Some layered products such as oVirt have requested a way to avoid being
blocked by guest agent commands when querying a loaded vm. For example,
many guest agent commands are polled periodically to monitor changes,
and rather than blocking the calling process, they'd prefer to simply
time out when an agent query is taking too long.

This patch adds a way for the user to specify a custom agent timeout
that is applied to all agent commands.

One special case to note here is the 'guest-sync' command. 'guest-sync'
is issued internally prior to calling any other command. (For example,
when libvirt wants to call 'guest-get-fsinfo', we first call
'guest-sync' and then call 'guest-get-fsinfo').

Previously, the 'guest-sync' command used a 5-second timeout
(VIR_DOMAIN_QEMU_AGENT_COMMAND_DEFAULT), whereas the actual command that
followed always blocked indefinitely
(VIR_DOMAIN_QEMU_AGENT_COMMAND_BLOCK). As part of this patch, if a
custom timeout is specified that is shorter than
5 seconds,  this new timeout also used for 'guest-sync'. If there is no
custom timeout or if the custom timeout is longer than 5 seconds, we
will continue to use the 5-second timeout.

See https://bugzilla.redhat.com/show_bug.cgi?id=1705426 for additional details.

Signed-off-by: Jonathon Jongsma 
---
 include/libvirt/libvirt-qemu.h |  2 +
 src/driver-hypervisor.h|  5 +++
 src/libvirt-qemu.c | 40 
 src/libvirt_qemu.syms  |  4 ++
 src/qemu/qemu_agent.c  | 69 +++---
 src/qemu/qemu_agent.h  |  3 ++
 src/qemu/qemu_driver.c | 24 
 src/qemu_protocol-structs  |  8 
 src/remote/qemu_protocol.x | 18 -
 src/remote/remote_driver.c |  1 +
 10 files changed, 143 insertions(+), 31 deletions(-)

diff --git a/include/libvirt/libvirt-qemu.h b/include/libvirt/libvirt-qemu.h
index 891617443f..8d3cc776e9 100644
--- a/include/libvirt/libvirt-qemu.h
+++ b/include/libvirt/libvirt-qemu.h
@@ -53,6 +53,8 @@ typedef enum {
 char *virDomainQemuAgentCommand(virDomainPtr domain, const char *cmd,
 int timeout, unsigned int flags);
 
+int virDomainQemuAgentSetTimeout(virDomainPtr domain, int timeout);
+
 /**
  * virConnectDomainQemuMonitorEventCallback:
  * @conn: the connection pointer
diff --git a/src/driver-hypervisor.h b/src/driver-hypervisor.h
index 015b2cd01c..2f17bff844 100644
--- a/src/driver-hypervisor.h
+++ b/src/driver-hypervisor.h
@@ -1372,6 +1372,10 @@ typedef int
 int *nparams,
 unsigned int flags);
 
+typedef int
+(*virDrvDomainQemuAgentSetTimeout)(virDomainPtr domain,
+   int timeout);
+
 typedef struct _virHypervisorDriver virHypervisorDriver;
 typedef virHypervisorDriver *virHypervisorDriverPtr;
 
@@ -1632,4 +1636,5 @@ struct _virHypervisorDriver {
 virDrvDomainCheckpointGetParent domainCheckpointGetParent;
 virDrvDomainCheckpointDelete domainCheckpointDelete;
 virDrvDomainGetGuestInfo domainGetGuestInfo;
+virDrvDomainQemuAgentSetTimeout domainQemuAgentSetTimeout;
 };
diff --git a/src/libvirt-qemu.c b/src/libvirt-qemu.c
index 1afb5fe529..73f119cb23 100644
--- a/src/libvirt-qemu.c
+++ b/src/libvirt-qemu.c
@@ -216,6 +216,46 @@ virDomainQemuAgentCommand(virDomainPtr domain,
 return NULL;
 }
 
+/**
+ * virDomainQemuAgentSetTimeout:
+ * @domain: a domain object
+ * @timeout: timeout in seconds
+ *
+ * Set how long to wait for a response from qemu agent commands. By default,
+ * agent commands block forever waiting for a response.
+ *
+ * @timeout must be -2, -1, 0 or positive.
+ * VIR_DOMAIN_QEMU_AGENT_COMMAND_BLOCK(-2): meaning to block forever waiting 
for
+ * a result.
+ * VIR_DOMAIN_QEMU_AGENT_COMMAND_DEFAULT(-1): use default timeout value.
+ * VIR_DOMAIN_QEMU_AGENT_COMMAND_NOWAIT(0): does not wait.
+ * positive value: wait for @timeout seconds
+ *
+ * Returns 0 on success, -1 on failure
+ */
+int
+virDomainQemuAgentSetTimeout(virDomainPtr domain,
+ int timeout)
+{
+virConnectPtr conn;
+
+virResetLastError();
+
+virCheckDomainReturn(domain, -1);
+conn = domain->conn;
+
+if (conn->driver->domainQemuAgentSetTimeout) {
+if (conn->driver->domainQemuAgentSetTimeout(domain, timeout) < 0)
+goto error;
+return 0;
+}
+
+virReportUnsupportedError();
+
+ error:
+virDispatchError(conn);
+return -1;
+}
 
 /**
  * virConnectDomainQemuMonitorEventRegister:
diff --git a/src/libvirt_qemu.syms b/src/libvirt_qemu.syms
index 3a297e3a2b..348caea72e 100644
--- a/src/libvirt_qemu.syms
+++ b/src/libvirt_qemu.syms
@@ -30,3 +30,7 @@ LIBVIRT_QEMU_1.2.3 {
 virConnectDomainQemuMonitorEventDeregister;
 virConnectDomainQemuMonitorEventRegister;
 } LIBVIRT_QEMU_0.10.0;
+LIBVIRT_QEMU_5.8.0 {
+global:
+virDomainQemuAgentSetTimeout;
+} LIBVIRT_QEMU_1.2.3;
diff --git a/src/qemu/qemu_agent.c 

[libvirt] Availability of libvirt 5.8.0 Release Candidate 2

2019-10-03 Thread Daniel Veillard
 It's now tagged in git, I have pushed RC2 signed tarball and source rpm
to the usual place at:

  https://libvirt.org/sources/

Passes in my minimal testing and https://ci.centos.org/view/libvirt/
CI is fully green, so things looks good on my side !
That said you should not trust me and do your own testing to make sure :-)

If things looks good I will push the final release over the w.e., probably
on Saturady, in the mean time, please give it a try,

  thanks,

Daniel

-- 
Daniel Veillard  | Red Hat Developers Tools http://developer.redhat.com/
veill...@redhat.com  | libxml Gnome XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | virtualization library  http://libvirt.org/

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [libvirt] [PATCH] qemu: capabilities: Fill in bochs-display info

2019-10-03 Thread Daniel Henrique Barboza



On 10/3/19 10:28 AM, Fabiano Fidêncio wrote:

086c19d69 added bochs-display capability but didn't fill in the info for
domain capabilities.

Signed-off-by: Fabiano Fidêncio 
---


Reviewed-by: Daniel Henrique Barboza 


  src/qemu/qemu_capabilities.c | 2 ++
  tests/domaincapsschemadata/qemu_3.1.0.x86_64.xml | 1 +
  tests/domaincapsschemadata/qemu_4.0.0.x86_64.xml | 1 +
  tests/domaincapsschemadata/qemu_4.1.0.x86_64.xml | 1 +
  tests/domaincapsschemadata/qemu_4.2.0.x86_64.xml | 1 +
  5 files changed, 6 insertions(+)

diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index 3b50576a2b..d0b789bbea 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -5357,6 +5357,8 @@ virQEMUCapsFillDomainDeviceVideoCaps(virQEMUCapsPtr 
qemuCaps,
  VIR_DOMAIN_CAPS_ENUM_SET(dev->modelType, VIR_DOMAIN_VIDEO_TYPE_QXL);
  if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VIRTIO_GPU))
  VIR_DOMAIN_CAPS_ENUM_SET(dev->modelType, 
VIR_DOMAIN_VIDEO_TYPE_VIRTIO);
+if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_BOCHS_DISPLAY))
+VIR_DOMAIN_CAPS_ENUM_SET(dev->modelType, VIR_DOMAIN_VIDEO_TYPE_BOCHS);
  
  return 0;

  }
diff --git a/tests/domaincapsschemadata/qemu_3.1.0.x86_64.xml 
b/tests/domaincapsschemadata/qemu_3.1.0.x86_64.xml
index 402848442f..059403cebc 100644
--- a/tests/domaincapsschemadata/qemu_3.1.0.x86_64.xml
+++ b/tests/domaincapsschemadata/qemu_3.1.0.x86_64.xml
@@ -127,6 +127,7 @@
  vmvga
  qxl
  virtio
+bochs

  
  
diff --git a/tests/domaincapsschemadata/qemu_4.0.0.x86_64.xml 
b/tests/domaincapsschemadata/qemu_4.0.0.x86_64.xml
index 1ffd5e3cc0..eb24b9a604 100644
--- a/tests/domaincapsschemadata/qemu_4.0.0.x86_64.xml
+++ b/tests/domaincapsschemadata/qemu_4.0.0.x86_64.xml
@@ -127,6 +127,7 @@
  vmvga
  qxl
  virtio
+bochs

  
  
diff --git a/tests/domaincapsschemadata/qemu_4.1.0.x86_64.xml 
b/tests/domaincapsschemadata/qemu_4.1.0.x86_64.xml
index 79b41ef6da..f5685d2068 100644
--- a/tests/domaincapsschemadata/qemu_4.1.0.x86_64.xml
+++ b/tests/domaincapsschemadata/qemu_4.1.0.x86_64.xml
@@ -131,6 +131,7 @@
  vmvga
  qxl
  virtio
+bochs

  
  
diff --git a/tests/domaincapsschemadata/qemu_4.2.0.x86_64.xml 
b/tests/domaincapsschemadata/qemu_4.2.0.x86_64.xml
index 6bdeb20479..5bd376bb2e 100644
--- a/tests/domaincapsschemadata/qemu_4.2.0.x86_64.xml
+++ b/tests/domaincapsschemadata/qemu_4.2.0.x86_64.xml
@@ -131,6 +131,7 @@
  vmvga
  qxl
  virtio
+bochs

  
  


--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [PATCH] virsh: fixed handling of targetless disks (e.g. empty CDROM) in 'domblkinfo' cmd

2019-10-03 Thread Ján Tomko

On Thu, Oct 03, 2019 at 02:45:36PM +0200, Pavel Mores wrote:

On Thu, Oct 03, 2019 at 01:09:55PM +0200, Pavel Mores wrote:

On Thu, Oct 03, 2019 at 11:54:44AM +0200, Ján Tomko wrote:
> On Wed, Oct 02, 2019 at 04:21:52PM +0200, Pavel Mores wrote:
> > On Wed, Oct 02, 2019 at 08:34:10AM -0300, Daniel Henrique Barboza wrote:
> > >
> > >
> > > On 10/1/19 11:45 AM, Pavel Mores wrote:
> > > > virDomainGetBlockInfo() returns error if called on a disk with no target
> > > > (a targetless disk might be a removable media drive with no media in it,
> > > > for instance an empty CDROM drive).
> > > >
> > > > So far this caused the virsh domblkinfo --all command to abort and 
ignore
> > > > any remaining (not yet displayed) disk devices.  This patch fixes it by
> > > > ignoring virDomainGetBlockInfo() errors for CDROM and floppy drives,
> > > > similar to how it's done for network drives.
> > > >
> > > > https://bugzilla.redhat.com/show_bug.cgi?id=1619625
> > > >
> > > > Signed-off-by: Pavel Mores 
> > > > ---
> > > >   tools/virsh-domain-monitor.c | 11 +++
> > > >   1 file changed, 11 insertions(+)
> > > >
> > > > diff --git a/tools/virsh-domain-monitor.c b/tools/virsh-domain-monitor.c
> > > > index 0e2c4191d7..0f495c1a3f 100644
> > > > --- a/tools/virsh-domain-monitor.c
> > > > +++ b/tools/virsh-domain-monitor.c
> > > > @@ -473,6 +473,7 @@ cmdDomblkinfo(vshControl *ctl, const vshCmd *cmd)
> > > >   char *cap = NULL;
> > > >   char *alloc = NULL;
> > > >   char *phy = NULL;
> > > > +char *device_type = NULL;
> > >
> > > I believe you need to use VIR_AUTO(char *) here. Even considering that
> > > the macro will be deprecated in the near future for glib stuff, by using
> > > VIR_AUTO here:
> > >
> > > - you'll make it easier to introduce the glib replacement, since
> > > s/VIR_AUTO/ is a trivial change;
> > >
> > > - you won't be adding more VIR_FREE() on top of existing cases that will
> > > need to be addressed in the future.
> >
> > Was that the consensus from the migration debate?  If so I'm happy to fix my
> > patch.
>
> IIUC the consensus was that we will switch to g_auto eventually,
> but it's a simple string replace that will be dealt with by whoever
> pushes the patch.
>
> Also, if you go with any of the two approaches I suggested (ignoring all
> errors or using the XPathBoolean), you don't need to introduce a new
> allocated variable

Cool, so if there aren't any objections, I'll implement the XPathBoolean
variant and submit v2.


As it turns out, the thing with the virDomainGetBlockInfo() call is that even
if it fails, it does initialise the virDomainBlockInfo structure enough to be
displayed in the table (even if just as a target name and dashes).


The https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainBlockInfo
only contains numbers, not the target name.

The target name is output by the 'vshTableRowAppend' command.



It follows apparently that if we go the virXPathBoolean() way and skip the
virDomainGetBlockInfo() call, we can't show the sourceless device at all, we
can't even indicate that it exists.

Is that acceptable?  Or is there another way to fill in virDomainBlockInfo?



cmdDomblkinfoGet happily handles a virDomainBlockInfo with all zeroes,
so as long as info is reset to zeroes on every loop iteration, it's okay
to execute the rest of the loop even if we did not call virDomainGetBlockInfo

Jano


Thanks,

pvl



signature.asc
Description: PGP signature
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [PATCH 01/11] bhyve: stop using private gnulib _getopt_internal_r func

2019-10-03 Thread Ján Tomko

On Thu, Oct 03, 2019 at 02:53:08PM +0100, Daniel P. Berrangé wrote:

The _getopt_internal_r func is not intended for public use, it is an
internal function shared between the gnulib getopt and argp modules.

Signed-off-by: Daniel P. Berrangé 
---
src/bhyve/bhyve_parse_command.c | 88 +
1 file changed, 46 insertions(+), 42 deletions(-)

diff --git a/src/bhyve/bhyve_parse_command.c b/src/bhyve/bhyve_parse_command.c
index 7d460e9824..0bfe17c08c 100644
--- a/src/bhyve/bhyve_parse_command.c
+++ b/src/bhyve/bhyve_parse_command.c
@@ -23,7 +23,6 @@

#include 
#include 
-#include 

#include "bhyve_capabilities.h"
#include "bhyve_command.h"
@@ -633,6 +632,14 @@ bhyveParseBhyvePCIArg(virDomainDefPtr def,
return -1;
}

+#define CONSUME_ARG(var) \
+if ((opti + 1) == argc) { \
+virReportError(VIR_ERR_INVALID_ARG, "Missing argument for '%s'", \
+   argv[opti]); \


src/bhyve/bhyve_parse_command.c:637:virReportError(VIR_ERR_INVALID_ARG, 
"Missing argument for '%s'", \
maint.mk: found unmarked diagnostic(s)


+goto error; \
+} \
+var = argv[++opti]
+
/*
 * Parse the /usr/sbin/bhyve command line.
 */
@@ -815,12 +825,7 @@ bhyveParseBhyveLoadCommandLine(virDomainDefPtr def,
def->os.bootloaderArgs = virStringListJoin((const char**) [1], " 
");
}

-if (argc != parser->optind) {
-virReportError(VIR_ERR_OPERATION_FAILED, "%s",
-   _("Failed to parse arguments for bhyveload command"));
-goto error;
-}
-
+fprintf(stderr, "Ok %s  %s %d\n", def->name, argv[argc], argc);


Debugging leftovers


if (def->name == NULL) {
if (VIR_STRDUP(def->name, argv[argc]) < 0)
goto error;


Reviewed-by: Ján Tomko 

Jano


signature.asc
Description: PGP signature
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [PATCH 11/11] build: drop the pthread gnulib module

2019-10-03 Thread Ján Tomko

On Thu, Oct 03, 2019 at 02:53:18PM +0100, Daniel P. Berrangé wrote:

This was fixing a problem with old versions of mingw which had a
pthread.h that polluted the namespace with random symbols. This is no
longer relevant on our mingw platform targets.

Signed-off-by: Daniel P. Berrangé 
---
bootstrap.conf | 1 -
1 file changed, 1 deletion(-)


Reviewed-by: Ján Tomko 

Jano


signature.asc
Description: PGP signature
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [PATCH 10/11] build: drop the perror gnulib module

2019-10-03 Thread Ján Tomko

On Thu, Oct 03, 2019 at 02:53:17PM +0100, Daniel P. Berrangé wrote:

This fixes a problem on mingw where it doesn't know how to report
certain errnos defined by POSIX, but not used on Windows. These are
not a real problem for libvirt.

Signed-off-by: Daniel P. Berrangé 
---
bootstrap.conf | 1 -
1 file changed, 1 deletion(-)



Reviewed-by: Ján Tomko 

Jano


signature.asc
Description: PGP signature
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [PATCH 02/11] build: drop the getopt-posix gnulib module

2019-10-03 Thread Daniel P . Berrangé
On Thu, Oct 03, 2019 at 05:12:52PM +0200, Ján Tomko wrote:
> On Thu, Oct 03, 2019 at 02:53:09PM +0100, Daniel P. Berrangé wrote:
> > The getopt-posix module fixes a problem with optind being incorrectly
> > set after a failed option parse. This is not something that matters to
> > libvirt code.
> > 
> 
> This module was introduced by:
> 
> commit b436a8ae5ccb04f8cf893d882d52ab5efc713307
>gnulib: add getopt module
> 
> for the patches implementing command line parsing for the bhyve
> driver. So you can also remove the gl_REPLACE_GETOPT_ALWAYS definition
> in m4/virt-driver-bhyve.m4 and delete gnulib/lib/getopt.c from
> POTFILES.in.

POTFILES.in was renamed to POTFILES which I've updated here.

> 
> > Signed-off-by: Daniel P. Berrangé 
> > ---
> > bootstrap.conf | 1 -
> > po/POTFILES| 1 -
> > 2 files changed, 2 deletions(-)
> > 
> 
> Reviewed-by: Ján Tomko 
> 
> Jano



Regards,
Daniel
-- 
|: https://berrange.com  -o-https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o-https://fstop138.berrange.com :|
|: https://entangle-photo.org-o-https://www.instagram.com/dberrange :|

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [PATCH 07/11] build: drop the usleep gnulib module

2019-10-03 Thread Daniel P . Berrangé
On Thu, Oct 03, 2019 at 05:34:50PM +0200, Ján Tomko wrote:
> On Thu, Oct 03, 2019 at 02:53:14PM +0100, Daniel P. Berrangé wrote:
> > The usleep function was missing on older mingw versions, but we can rely
> > on it existing everywhere these days.
> > 
> 
> Per https://www.gnu.org/software/gnulib/manual/html_node/usleep.html#usleep
> usleep only works up to one second on mingw.
> 
> However from 'git grep usleep' it seems that the virsh usage is the only
> one possibly relevant to Windows.

Doh, I totally misread that note.

> Is there any benefit of using usleep for values that are multiples of
> 1000?

Just nice to have consistency.

I'll move this patch into my glib series, as I can do a straight
s/usleep/g_usleep/, as that calls to Sleep() on Win32 to avoid
the problem, albeit with only millisecond precision but that's
fine.

Regards,
Daniel
-- 
|: https://berrange.com  -o-https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o-https://fstop138.berrange.com :|
|: https://entangle-photo.org-o-https://www.instagram.com/dberrange :|

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [PATCH 09/11] build: drop the gitlog-to-changelog gnulib module

2019-10-03 Thread Ján Tomko

On Thu, Oct 03, 2019 at 02:53:16PM +0100, Daniel P. Berrangé wrote:

The use of this script was discontinued when we stopped providing a full
ChangeLog in the dist with:

 commit ce97c33a795dec053f1e85c65ecd924b8c6ec4ba
 Author: Andrea Bolognani 
 Date:   Mon Apr 1 17:33:03 2019 +0200

   maint: Stop generating ChangeLog from git

Signed-off-by: Daniel P. Berrangé 
---
Makefile.am| 1 -
bootstrap.conf | 1 -
2 files changed, 2 deletions(-)



Reviewed-by: Ján Tomko 

Jano


signature.asc
Description: PGP signature
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [PATCH 08/11] build: drop the stdarg gnulib module

2019-10-03 Thread Ján Tomko

On Thu, Oct 03, 2019 at 02:53:15PM +0100, Daniel P. Berrangé wrote:

gnulib fixes a portability problem on AIX which is a platform we have
never targetted.

Signed-off-by: Daniel P. Berrangé 
---
bootstrap.conf | 1 -
1 file changed, 1 deletion(-)



Reviewed-by: Ján Tomko 

Jano


signature.asc
Description: PGP signature
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [PATCH 07/11] build: drop the usleep gnulib module

2019-10-03 Thread Ján Tomko

On Thu, Oct 03, 2019 at 02:53:14PM +0100, Daniel P. Berrangé wrote:

The usleep function was missing on older mingw versions, but we can rely
on it existing everywhere these days.



Per https://www.gnu.org/software/gnulib/manual/html_node/usleep.html#usleep
usleep only works up to one second on mingw.

However from 'git grep usleep' it seems that the virsh usage is the only
one possibly relevant to Windows.

Is there any benefit of using usleep for values that are multiples of
1000?


Signed-off-by: Daniel P. Berrangé 
---
bootstrap.conf | 1 -
1 file changed, 1 deletion(-)



Reviewed-by: Ján Tomko 

Jano


signature.asc
Description: PGP signature
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [PATCH 05/11] util: drop the stpcpy gnulib module

2019-10-03 Thread Ján Tomko

On Thu, Oct 03, 2019 at 02:53:12PM +0100, Daniel P. Berrangé wrote:

stpcpy returns a pointer to the end of the string just copied
which in theory makes it easier to then copy another string
after it. We only use stpcpy in one place though and that
is trivially rewritten to avoid stpcpy with no less in code


s/less/loss/


clarity or efficiency.

Signed-off-by: Daniel P. Berrangé 
---
bootstrap.conf  | 1 -
src/util/virerror.c | 5 +++--
2 files changed, 3 insertions(+), 3 deletions(-)



Reviewed-by: Ján Tomko 

Jano


signature.asc
Description: PGP signature
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [PATCH 06/11] Revert "build: use autobuild module to make build logs nicer"

2019-10-03 Thread Ján Tomko

On Thu, Oct 03, 2019 at 02:53:13PM +0100, Daniel P. Berrangé wrote:

This reverts commit 83aca30f1e8be524780a60b9dd8a14ec5f9de878.

While the motivation of the original commit is fine, we are intending to
drop autoconf in favour of meson, and similarly wish to drop use of
gnulib. Removing this feature is part of that conversion work.

Signed-off-by: Daniel P. Berrangé 
---
bootstrap.conf | 1 -
configure.ac   | 6 --
2 files changed, 7 deletions(-)



Reviewed-by: Ján Tomko 

Jano


signature.asc
Description: PGP signature
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [PATCH 04/11] build: drop the mktempd gnulib module

2019-10-03 Thread Ján Tomko

On Thu, Oct 03, 2019 at 02:53:11PM +0100, Daniel P. Berrangé wrote:

The mktempd module in gnulib provides an equivalent to 'mktemp -d' on
platforms which lack this shell command. All platforms on which libvirt
runs the affected tests have 'mktemp -d' support, so the gnulib module
is not required.

Signed-off-by: Daniel P. Berrangé 
---
bootstrap.conf| 1 -
tests/test-lib.sh | 3 +--
2 files changed, 1 insertion(+), 3 deletions(-)



Reviewed-by: Ján Tomko 

Jano


signature.asc
Description: PGP signature
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [PATCH 03/11] build: drop the inet_pton gnulib module

2019-10-03 Thread Ján Tomko

On Thu, Oct 03, 2019 at 02:53:10PM +0100, Daniel P. Berrangé wrote:

All use of this function was purged a long time ago in favour
of getaddrinfo

 commit a8ae7d19f4ace62ff3f364c628cbc16baa9b080c
 Author: Daniel P. Berrange 
 Date:   Thu Oct 21 11:13:05 2010 +0100

   Remove all use of inet_pton and inet_ntop

Signed-off-by: Daniel P. Berrangé 
---
bootstrap.conf | 1 -
1 file changed, 1 deletion(-)



Reviewed-by: Ján Tomko 

Jano


signature.asc
Description: PGP signature
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [PATCH 02/11] build: drop the getopt-posix gnulib module

2019-10-03 Thread Ján Tomko

On Thu, Oct 03, 2019 at 02:53:09PM +0100, Daniel P. Berrangé wrote:

The getopt-posix module fixes a problem with optind being incorrectly
set after a failed option parse. This is not something that matters to
libvirt code.



This module was introduced by:

commit b436a8ae5ccb04f8cf893d882d52ab5efc713307
   gnulib: add getopt module

for the patches implementing command line parsing for the bhyve
driver. So you can also remove the gl_REPLACE_GETOPT_ALWAYS definition
in m4/virt-driver-bhyve.m4 and delete gnulib/lib/getopt.c from
POTFILES.in.


Signed-off-by: Daniel P. Berrangé 
---
bootstrap.conf | 1 -
po/POTFILES| 1 -
2 files changed, 2 deletions(-)



Reviewed-by: Ján Tomko 

Jano


signature.asc
Description: PGP signature
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [RFC] cpu_map: Remove pconfig from Icelake-Server CPU model

2019-10-03 Thread Jiri Denemark
On Tue, Oct 01, 2019 at 11:20:42 +0200, Paolo Bonzini wrote:
> On 30/09/19 18:16, Jiri Denemark wrote:
> > On Mon, Sep 30, 2019 at 17:16:27 +0200, Paolo Bonzini wrote:
> >> On 30/09/19 16:31, Hu, Robert wrote:
>  This might be a problem if there are plans to eventually make KVM support
>  pconfig, though.  Paolo, Robert, are there plans to support pconfig in 
>  KVM in the
>  future?
> >>> [Robert Hoo] 
> >>> Thanks Eduardo for efforts in resolving this issue, introduced from my 
> >>> Icelake CPU
> >>> model patch.
> >>> I've no idea about PCONFIG's detail and plan. Let me sync with Huang, Kai 
> >>> and answer
> >>> you soon.
> >>
> >> It's really, really unlikely.  It's possible that some future processor
> >> overloads PCONFIG in such a way that it will become virtualizable, but
> >> not IceLake.
> > 
> > I guess, the likelihood of this happening would be similar to
> > reintroducing other features, such as osxsave or ospke, right?
> 
> No, haveing osxsave and ospke was a mistake in the first place (they are
> not CPU features at all; they are more like a special way to let
> unprivileged programs read some bits of CR4).  For pconfig, it's just
> very unlikely.
> 
> >> Would it make sense for libvirt to treat absent CPU flags as "default
> >> off" during migration, so that it can leave out the flag in the command
> >> line if it's off?  If it's on, libvirt would pass pconfig=on as usual.
> >> This is a variant of [2], but more generally applicable:
> >>
> >>> [2] However starting a domain with Icelake-Server so that it can be
> >>> migrated or saved/restored on QEMU in 3.1.1 and 4.0.0 would be
> >>> impossible. This can be solved by a different hack, which would drop
> >>> pconfig=off from QEMU command line.
> > 
> > The domain XML does not contain a complete list of all CPU features.
> > Features which are implicitly included in a CPU model are not listed in
> > the XML. Count in the differences in libvirt's vs QEMU's definitions of
> > a particular CPU model and you can see feat=off cannot be mechanically
> > dropped from the command line as the CPU model itself could turn it on
> > by default and thus feat=off is not redundant.
> 
> I think I wasn't very clear, I meant "unsupported by QEMU" when I said
> "absent".  Libvirt on the destination knows that from
> query-cpu-model-expansion, so it can leave off pconfig if it is not
> supported by the destination QEMU.

Oh yeah, we should do this (and I plan to do so), but it won't really
help us in this case. Although it could potentially save us some work in
case we end up in a similar situation.

Jirka

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [libvirt] [PATCH 16/22] qemu: Store typename from query-cpu-definitions in qemuCaps

2019-10-03 Thread Jiri Denemark
On Thu, Oct 03, 2019 at 16:27:23 +0200, Peter Krempa wrote:
> On Thu, Oct 03, 2019 at 16:00:34 +0200, Jiri Denemark wrote:
> > We need to create a mapping between CPU model names and their
> > corresponding QOM types.
> > 
> > Signed-off-by: Jiri Denemark 
> > ---
> >  src/qemu/qemu_capabilities.c  |4 +
> >  src/qemu/qemu_monitor.c   |2 +
> >  src/qemu/qemu_monitor.h   |1 +
> >  src/qemu/qemu_monitor_json.c  |4 +
> >  .../caps_2.10.0.aarch64.xml   |  126 +-
> >  .../caps_2.10.0.ppc64.xml | 1734 
> >  .../caps_2.10.0.s390x.xml |  264 +--
> >  .../caps_2.10.0.x86_64.xml|  132 +-
> >  .../caps_2.11.0.s390x.xml |  264 +--
> >  .../caps_2.11.0.x86_64.xml|  136 +-
> >  .../caps_2.12.0.aarch64.xml   |  136 +-
> >  .../caps_2.12.0.ppc64.xml | 1750 -
> >  .../caps_2.12.0.s390x.xml |  264 +--
> >  .../caps_2.12.0.x86_64.xml|  180 +-
> >  .../qemucapabilitiesdata/caps_2.9.0.ppc64.xml | 1734 
> >  .../qemucapabilitiesdata/caps_2.9.0.s390x.xml |  256 +--
> >  .../caps_2.9.0.x86_64.xml |  128 +-
> >  .../qemucapabilitiesdata/caps_3.0.0.ppc64.xml | 1750 -
> >  .../qemucapabilitiesdata/caps_3.0.0.s390x.xml |  272 +--
> >  .../caps_3.0.0.x86_64.xml |  184 +-
> >  .../qemucapabilitiesdata/caps_3.1.0.ppc64.xml | 1750 -
> >  .../caps_3.1.0.x86_64.xml |  196 +-
> >  .../caps_4.0.0.aarch64.xml|  148 +-
> >  .../qemucapabilitiesdata/caps_4.0.0.ppc64.xml | 1750 -
> >  .../qemucapabilitiesdata/caps_4.0.0.s390x.xml |  284 +--
> >  .../caps_4.0.0.x86_64.xml |  196 +-
> >  .../caps_4.1.0.x86_64.xml |  400 ++--
> >  .../caps_4.2.0.x86_64.xml |  400 ++--
> >  28 files changed, 7228 insertions(+), 7217 deletions(-)
> 
> [...]
> 
> > diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c
> > index c2a2f6eee6..c0cd195496 100644
> > --- a/src/qemu/qemu_monitor_json.c
> > +++ b/src/qemu/qemu_monitor_json.c
> > @@ -5571,6 +5571,10 @@ qemuMonitorJSONGetCPUDefinitions(qemuMonitorPtr mon,
> >  if (VIR_STRDUP(cpu->name, tmp) < 0)
> >  return -1;
> >  
> > +if ((tmp = virJSONValueObjectGetString(child, "typename")) &&
> 
> Should we copy the string only if it's not an empty string?

Definitely, I didn't notice QEMU reported empty typenames for some CPU
models.

Jirka

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [libvirt] [PATCH 16/22] qemu: Store typename from query-cpu-definitions in qemuCaps

2019-10-03 Thread Peter Krempa
On Thu, Oct 03, 2019 at 16:00:34 +0200, Jiri Denemark wrote:
> We need to create a mapping between CPU model names and their
> corresponding QOM types.
> 
> Signed-off-by: Jiri Denemark 
> ---
>  src/qemu/qemu_capabilities.c  |4 +
>  src/qemu/qemu_monitor.c   |2 +
>  src/qemu/qemu_monitor.h   |1 +
>  src/qemu/qemu_monitor_json.c  |4 +
>  .../caps_2.10.0.aarch64.xml   |  126 +-
>  .../caps_2.10.0.ppc64.xml | 1734 
>  .../caps_2.10.0.s390x.xml |  264 +--
>  .../caps_2.10.0.x86_64.xml|  132 +-
>  .../caps_2.11.0.s390x.xml |  264 +--
>  .../caps_2.11.0.x86_64.xml|  136 +-
>  .../caps_2.12.0.aarch64.xml   |  136 +-
>  .../caps_2.12.0.ppc64.xml | 1750 -
>  .../caps_2.12.0.s390x.xml |  264 +--
>  .../caps_2.12.0.x86_64.xml|  180 +-
>  .../qemucapabilitiesdata/caps_2.9.0.ppc64.xml | 1734 
>  .../qemucapabilitiesdata/caps_2.9.0.s390x.xml |  256 +--
>  .../caps_2.9.0.x86_64.xml |  128 +-
>  .../qemucapabilitiesdata/caps_3.0.0.ppc64.xml | 1750 -
>  .../qemucapabilitiesdata/caps_3.0.0.s390x.xml |  272 +--
>  .../caps_3.0.0.x86_64.xml |  184 +-
>  .../qemucapabilitiesdata/caps_3.1.0.ppc64.xml | 1750 -
>  .../caps_3.1.0.x86_64.xml |  196 +-
>  .../caps_4.0.0.aarch64.xml|  148 +-
>  .../qemucapabilitiesdata/caps_4.0.0.ppc64.xml | 1750 -
>  .../qemucapabilitiesdata/caps_4.0.0.s390x.xml |  284 +--
>  .../caps_4.0.0.x86_64.xml |  196 +-
>  .../caps_4.1.0.x86_64.xml |  400 ++--
>  .../caps_4.2.0.x86_64.xml |  400 ++--
>  28 files changed, 7228 insertions(+), 7217 deletions(-)

[...]

> diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c
> index c2a2f6eee6..c0cd195496 100644
> --- a/src/qemu/qemu_monitor_json.c
> +++ b/src/qemu/qemu_monitor_json.c
> @@ -5571,6 +5571,10 @@ qemuMonitorJSONGetCPUDefinitions(qemuMonitorPtr mon,
>  if (VIR_STRDUP(cpu->name, tmp) < 0)
>  return -1;
>  
> +if ((tmp = virJSONValueObjectGetString(child, "typename")) &&

Should we copy the string only if it's not an empty string?

> +VIR_STRDUP(cpu->type, tmp) < 0)
> +return -1;
> +
>  if (virJSONValueObjectHasKey(child, "unavailable-features")) {
>  virJSONValuePtr blockers;
>  size_t j;


> diff --git a/tests/qemucapabilitiesdata/caps_2.10.0.ppc64.xml 
> b/tests/qemucapabilitiesdata/caps_2.10.0.ppc64.xml
> index 162fb1f035..523b8abd11 100644
> --- a/tests/qemucapabilitiesdata/caps_2.10.0.ppc64.xml
> +++ b/tests/qemucapabilitiesdata/caps_2.10.0.ppc64.xml
> @@ -143,873 +143,873 @@
>42900805
> (v2.10.0)
>ppc64
> -  

[...]

> +  
> +  
> +  
> +  

So that these are also not emtpy? I can't imagine this being useful
information.

> +  
> +  
> +  
> +  
> +  

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


[libvirt] [PATCH 06/22] qemu: Use VIR_AUTOPTR in qemuMonitorJSONGetCPUDefinitions

2019-10-03 Thread Jiri Denemark
Signed-off-by: Jiri Denemark 
---
 src/qemu/qemu_monitor_json.c | 6 ++
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c
index aa6074bc02..720cd78a23 100644
--- a/src/qemu/qemu_monitor_json.c
+++ b/src/qemu/qemu_monitor_json.c
@@ -5527,8 +5527,8 @@ qemuMonitorJSONGetCPUDefinitions(qemuMonitorPtr mon,
  qemuMonitorCPUDefInfoPtr **cpus)
 {
 int ret = -1;
-virJSONValuePtr cmd;
-virJSONValuePtr reply = NULL;
+VIR_AUTOPTR(virJSONValue) cmd = NULL;
+VIR_AUTOPTR(virJSONValue) reply = NULL;
 virJSONValuePtr data;
 qemuMonitorCPUDefInfoPtr *cpulist = NULL;
 size_t n = 0;
@@ -5630,8 +5630,6 @@ qemuMonitorJSONGetCPUDefinitions(qemuMonitorPtr mon,
 qemuMonitorCPUDefInfoFree(cpulist[i]);
 VIR_FREE(cpulist);
 }
-virJSONValueFree(cmd);
-virJSONValueFree(reply);
 return ret;
 }
 
-- 
2.23.0

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


[libvirt] [PATCH 00/22] qemu: Store default CPU in domain XML

2019-10-03 Thread Jiri Denemark
When starting a domain without a CPU model specified in the domain XML,
QEMU will choose a default one. Which is fine unless the domain gets
migrated to another host because libvirt doesn't perform any CPU ABI
checks and the virtual CPU provided by QEMU on the destination host can
differ from the one on the source host.

With QEMU 4.2.0 we can probe for the default CPU model used by QEMU for
a particular machine type and store it in the domain XML. This way the
chosen CPU model is more visible to users and libvirt will make sure
the guest will see the exact same CPU after migration.

https://bugzilla.redhat.com/show_bug.cgi?id=1598151
https://bugzilla.redhat.com/show_bug.cgi?id=1598162

Jiri Denemark (22):
  conf: Use VIR_AUTO* in virDomainCapsCPUModelsAdd
  conf: Drop nameLen parameter from virDomainCapsCPUModelsAdd
  qemu: Copy CPU models in virQEMUCapsGetCPUDefinitions
  qemu: Filter models in virQEMUCapsGetCPUDefinitions
  qemu: Use virQEMUCapsGetCPUDefinitions more
  qemu: Use VIR_AUTOPTR in qemuMonitorJSONGetCPUDefinitions
  qemu: Introduce qemuMonitorCPUDefs struct
  qemu: Flatten qemuMonitorCPUDefs.cpus
  build: Export virStringListCopy internal API
  qemu: Add qemuMonitorCPUDefsCopy
  qemu: Use VIR_AUTOFREE in virQEMUCapsLoadCPUModels
  qemu: Introduce virQEMUCapsCPUDefsToModels
  qemu: Switch qemuCaps to use qemuMonitorCPUDefs
  conf: Drop unused virDomainCapsCPUModelsFilter
  conf: Drop virDomainCapsCPUModelsAddSteal
  qemu: Store typename from query-cpu-definitions in qemuCaps
  qemu: Probe for default CPU types
  qemu: Introduce virQEMUCapsGetMachineDefaultCPU
  qemu: Drop unused virQEMUCapsGetDefaultMachine
  qemu: Use VIR_AUTOUNREF in qemuDomainDefPostParse
  conf: Define VIR_AUTOPTR for virCPUDef
  qemu: Store default CPU in domain XML

 src/conf/cpu_conf.h   |1 +
 src/conf/domain_capabilities.c|   86 +-
 src/conf/domain_capabilities.h|8 -
 src/libvirt_private.syms  |3 +-
 src/qemu/qemu_capabilities.c  |  324 +--
 src/qemu/qemu_capabilities.h  |8 +-
 src/qemu/qemu_domain.c|   79 +-
 src/qemu/qemu_driver.c|4 +-
 src/qemu/qemu_monitor.c   |   74 +-
 src/qemu/qemu_monitor.h   |   18 +-
 src/qemu/qemu_monitor_json.c  |   81 +-
 src/qemu/qemu_monitor_json.h  |2 +-
 src/qemu/qemu_process.c   |7 +-
 tests/cputest.c   |7 +-
 .../caps_2.10.0.aarch64.xml   |  126 +-
 .../caps_2.10.0.ppc64.xml | 1734 
 .../caps_2.10.0.s390x.xml |  264 +--
 .../caps_2.10.0.x86_64.xml|  132 +-
 .../caps_2.11.0.s390x.xml |  264 +--
 .../caps_2.11.0.x86_64.xml|  136 +-
 .../caps_2.12.0.aarch64.xml   |  136 +-
 .../caps_2.12.0.ppc64.xml | 1750 -
 .../caps_2.12.0.s390x.xml |  264 +--
 .../caps_2.12.0.x86_64.xml|  180 +-
 .../qemucapabilitiesdata/caps_2.9.0.ppc64.xml | 1734 
 .../qemucapabilitiesdata/caps_2.9.0.s390x.xml |  256 +--
 .../caps_2.9.0.x86_64.xml |  128 +-
 .../qemucapabilitiesdata/caps_3.0.0.ppc64.xml | 1750 -
 .../qemucapabilitiesdata/caps_3.0.0.s390x.xml |  272 +--
 .../caps_3.0.0.x86_64.xml |  184 +-
 .../qemucapabilitiesdata/caps_3.1.0.ppc64.xml | 1750 -
 .../caps_3.1.0.x86_64.xml |  196 +-
 .../caps_4.0.0.aarch64.xml|  148 +-
 .../qemucapabilitiesdata/caps_4.0.0.ppc64.xml | 1750 -
 .../qemucapabilitiesdata/caps_4.0.0.s390x.xml |  284 +--
 .../caps_4.0.0.x86_64.xml |  196 +-
 .../caps_4.1.0.x86_64.xml |  400 ++--
 .../caps_4.2.0.x86_64.xml |  492 ++---
 tests/qemumonitorjsontest.c   |   38 +-
 .../disk-cache.x86_64-latest.args |1 +
 .../disk-cdrom-network.x86_64-latest.args |1 +
 .../disk-cdrom-tray.x86_64-latest.args|1 +
 .../disk-copy_on_read.x86_64-latest.args  |1 +
 .../disk-detect-zeroes.x86_64-latest.args |1 +
 .../disk-floppy-q35-2_11.x86_64-latest.args   |1 +
 .../disk-floppy-q35-2_9.x86_64-latest.args|1 +
 .../os-firmware-bios.x86_64-latest.args   |1 +
 ...os-firmware-efi-secboot.x86_64-latest.args |1 +
 .../os-firmware-efi.x86_64-latest.args|1 +
 .../tpm-emulator-tpm2-enc.x86_64-latest.args  |1 +
 .../tpm-emulator-tpm2.x86_64-latest.args  |1 +
 .../tpm-emulator.x86_64-latest.args   |1 +
 .../tseg-explicit-size.x86_64-latest.args |1 +
 .../vhost-vsock-auto.x86_64-latest.args   |1 +
 .../vhost-vsock.x86_64-latest.args|1 

[libvirt] [PATCH 08/22] qemu: Flatten qemuMonitorCPUDefs.cpus

2019-10-03 Thread Jiri Denemark
Let's store qemuMonitorCPUDefInfo directly in the array of CPUs in
qemuMonitorCPUDefs rather then using an array of pointers.

Signed-off-by: Jiri Denemark 
---
 src/qemu/qemu_capabilities.c | 8 
 src/qemu/qemu_monitor.c  | 5 ++---
 src/qemu/qemu_monitor.h  | 2 +-
 src/qemu/qemu_monitor_json.c | 7 +--
 tests/qemumonitorjsontest.c  | 8 
 5 files changed, 12 insertions(+), 18 deletions(-)

diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index b06e89a9c5..74920901b3 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -2460,13 +2460,13 @@ virQEMUCapsFetchCPUDefinitions(qemuMonitorPtr mon)
 for (i = 0; i < defs->ncpus; i++) {
 virDomainCapsCPUUsable usable = VIR_DOMCAPS_CPU_USABLE_UNKNOWN;
 
-if (defs->cpus[i]->usable == VIR_TRISTATE_BOOL_YES)
+if (defs->cpus[i].usable == VIR_TRISTATE_BOOL_YES)
 usable = VIR_DOMCAPS_CPU_USABLE_YES;
-else if (defs->cpus[i]->usable == VIR_TRISTATE_BOOL_NO)
+else if (defs->cpus[i].usable == VIR_TRISTATE_BOOL_NO)
 usable = VIR_DOMCAPS_CPU_USABLE_NO;
 
-if (virDomainCapsCPUModelsAddSteal(models, >cpus[i]->name, 
usable,
-   >cpus[i]->blockers) < 0)
+if (virDomainCapsCPUModelsAddSteal(models, >cpus[i].name, usable,
+   >cpus[i].blockers) < 0)
 goto error;
 }
 
diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c
index 62248f3362..4442ef6cca 100644
--- a/src/qemu/qemu_monitor.c
+++ b/src/qemu/qemu_monitor.c
@@ -3540,9 +3540,8 @@ qemuMonitorCPUDefsFree(qemuMonitorCPUDefsPtr defs)
 return;
 
 for (i = 0; i < defs->ncpus; i++) {
-virStringListFree(defs->cpus[i]->blockers);
-VIR_FREE(defs->cpus[i]->name);
-VIR_FREE(defs->cpus[i]);
+virStringListFree(defs->cpus[i].blockers);
+VIR_FREE(defs->cpus[i].name);
 }
 
 VIR_FREE(defs->cpus);
diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h
index d59bafbeda..7d35c97860 100644
--- a/src/qemu/qemu_monitor.h
+++ b/src/qemu/qemu_monitor.h
@@ -1105,7 +1105,7 @@ typedef struct _qemuMonitorCPUDefs qemuMonitorCPUDefs;
 typedef qemuMonitorCPUDefs *qemuMonitorCPUDefsPtr;
 struct _qemuMonitorCPUDefs {
 size_t ncpus;
-qemuMonitorCPUDefInfoPtr *cpus;
+qemuMonitorCPUDefInfoPtr cpus;
 };
 
 int qemuMonitorGetCPUDefinitions(qemuMonitorPtr mon,
diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c
index 02bbefdc12..c2a2f6eee6 100644
--- a/src/qemu/qemu_monitor_json.c
+++ b/src/qemu/qemu_monitor_json.c
@@ -5560,12 +5560,7 @@ qemuMonitorJSONGetCPUDefinitions(qemuMonitorPtr mon,
 for (i = 0; i < defs->ncpus; i++) {
 virJSONValuePtr child = virJSONValueArrayGet(data, i);
 const char *tmp;
-qemuMonitorCPUDefInfoPtr cpu;
-
-if (VIR_ALLOC(cpu) < 0)
-return -1;
-
-defs->cpus[i] = cpu;
+qemuMonitorCPUDefInfoPtr cpu = defs->cpus + i;
 
 if (!(tmp = virJSONValueObjectGetString(child, "name"))) {
 virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
diff --git a/tests/qemumonitorjsontest.c b/tests/qemumonitorjsontest.c
index 14d0a4e22f..3413dee701 100644
--- a/tests/qemumonitorjsontest.c
+++ b/tests/qemumonitorjsontest.c
@@ -463,16 +463,16 @@ testQemuMonitorJSONGetCPUDefinitions(const void *opaque)
 
 #define CHECK_FULL(i, wantname, Usable) \
 do { \
-if (STRNEQ(defs->cpus[i]->name, (wantname))) { \
+if (STRNEQ(defs->cpus[i].name, (wantname))) { \
 virReportError(VIR_ERR_INTERNAL_ERROR, \
"name %s is not %s", \
-   defs->cpus[i]->name, (wantname)); \
+   defs->cpus[i].name, (wantname)); \
 return -1; \
 } \
-if (defs->cpus[i]->usable != (Usable)) { \
+if (defs->cpus[i].usable != (Usable)) { \
 virReportError(VIR_ERR_INTERNAL_ERROR, \
"%s: expecting usable flag %d, got %d", \
-   defs->cpus[i]->name, Usable, 
defs->cpus[i]->usable); \
+   defs->cpus[i].name, Usable, defs->cpus[i].usable); \
 return -1; \
 } \
 } while (0)
-- 
2.23.0

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


[libvirt] [PATCH 05/22] qemu: Use virQEMUCapsGetCPUDefinitions more

2019-10-03 Thread Jiri Denemark
Signed-off-by: Jiri Denemark 
---
 src/qemu/qemu_capabilities.c | 21 +++--
 1 file changed, 7 insertions(+), 14 deletions(-)

diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index dac3d3b633..255ae8e665 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -5256,24 +5256,17 @@ virQEMUCapsFillDomainCPUCaps(virCapsPtr caps,
 
 if (virQEMUCapsIsCPUModeSupported(qemuCaps, caps, domCaps->virttype,
   VIR_CPU_MODE_CUSTOM)) {
-virDomainCapsCPUModelsPtr filtered = NULL;
-char **models = NULL;
 const char *blacklist[] = { "host", NULL };
+VIR_AUTOSTRINGLIST models = NULL;
 
 if (virCPUGetModels(domCaps->arch, ) >= 0) {
-virDomainCapsCPUModelsPtr cpus;
-
-if (domCaps->virttype == VIR_DOMAIN_VIRT_KVM)
-cpus = qemuCaps->kvmCPUModels;
-else
-cpus = qemuCaps->tcgCPUModels;
-
-filtered = virDomainCapsCPUModelsFilter(cpus,
-(const char **)models,
-blacklist);
-virStringListFree(models);
+domCaps->cpu.custom = virQEMUCapsGetCPUDefinitions(qemuCaps,
+   
domCaps->virttype,
+   (const char 
**)models,
+   blacklist);
+} else {
+domCaps->cpu.custom = NULL;
 }
-domCaps->cpu.custom = filtered;
 }
 
 return 0;
-- 
2.23.0

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


[libvirt] [PATCH 02/22] conf: Drop nameLen parameter from virDomainCapsCPUModelsAdd

2019-10-03 Thread Jiri Denemark
All callers use nameLen == -1 anyway.

Signed-off-by: Jiri Denemark 
---
 src/conf/domain_capabilities.c | 7 +++
 src/conf/domain_capabilities.h | 1 -
 src/qemu/qemu_capabilities.c   | 2 +-
 tests/cputest.c| 4 ++--
 4 files changed, 6 insertions(+), 8 deletions(-)

diff --git a/src/conf/domain_capabilities.c b/src/conf/domain_capabilities.c
index 37e767d5c9..fa0b9dfc71 100644
--- a/src/conf/domain_capabilities.c
+++ b/src/conf/domain_capabilities.c
@@ -171,7 +171,7 @@ virDomainCapsCPUModelsCopy(virDomainCapsCPUModelsPtr old)
 
 for (i = 0; i < old->nmodels; i++) {
 if (virDomainCapsCPUModelsAdd(cpuModels,
-  old->models[i].name, -1,
+  old->models[i].name,
   old->models[i].usable,
   old->models[i].blockers) < 0)
 goto error;
@@ -204,7 +204,7 @@ virDomainCapsCPUModelsFilter(virDomainCapsCPUModelsPtr old,
 continue;
 
 if (virDomainCapsCPUModelsAdd(cpuModels,
-  old->models[i].name, -1,
+  old->models[i].name,
   old->models[i].usable,
   old->models[i].blockers) < 0)
 goto error;
@@ -242,14 +242,13 @@ virDomainCapsCPUModelsAddSteal(virDomainCapsCPUModelsPtr 
cpuModels,
 int
 virDomainCapsCPUModelsAdd(virDomainCapsCPUModelsPtr cpuModels,
   const char *name,
-  ssize_t nameLen,
   virDomainCapsCPUUsable usable,
   char **blockers)
 {
 VIR_AUTOFREE(char *) nameCopy = NULL;
 VIR_AUTOSTRINGLIST blockersCopy = NULL;
 
-if (VIR_STRNDUP(nameCopy, name, nameLen) < 0)
+if (VIR_STRDUP(nameCopy, name) < 0)
 return -1;
 
 if (virStringListCopy(, (const char **)blockers) < 0)
diff --git a/src/conf/domain_capabilities.h b/src/conf/domain_capabilities.h
index 4756af38e9..7ff2181eda 100644
--- a/src/conf/domain_capabilities.h
+++ b/src/conf/domain_capabilities.h
@@ -201,7 +201,6 @@ int 
virDomainCapsCPUModelsAddSteal(virDomainCapsCPUModelsPtr cpuModels,
char ***blockers);
 int virDomainCapsCPUModelsAdd(virDomainCapsCPUModelsPtr cpuModels,
   const char *name,
-  ssize_t nameLen,
   virDomainCapsCPUUsable usable,
   char **blockers);
 virDomainCapsCPUModelPtr
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index 3b50576a2b..806d102efd 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -1871,7 +1871,7 @@ virQEMUCapsAddCPUDefinitions(virQEMUCapsPtr qemuCaps,
 }
 
 for (i = 0; i < count; i++) {
-if (virDomainCapsCPUModelsAdd(cpus, name[i], -1, usable, NULL) < 0)
+if (virDomainCapsCPUModelsAdd(cpus, name[i], usable, NULL) < 0)
 return -1;
 }
 
diff --git a/tests/cputest.c b/tests/cputest.c
index 7037bcc8bd..403d23b961 100644
--- a/tests/cputest.c
+++ b/tests/cputest.c
@@ -854,7 +854,7 @@ cpuTestUpdateLive(const void *arg)
 usable = hvModel->usable;
 }
 
-if (virDomainCapsCPUModelsAdd(models, expected->model, -1,
+if (virDomainCapsCPUModelsAdd(models, expected->model,
   usable, blockers) < 0)
 goto cleanup;
 
@@ -964,7 +964,7 @@ cpuTestInitModels(const char **list)
 return NULL;
 
 for (model = list; *model; model++) {
-if (virDomainCapsCPUModelsAdd(cpus, *model, -1,
+if (virDomainCapsCPUModelsAdd(cpus, *model,
   VIR_DOMCAPS_CPU_USABLE_UNKNOWN, NULL) < 
0)
 goto error;
 }
-- 
2.23.0

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


[libvirt] [PATCH 01/22] conf: Use VIR_AUTO* in virDomainCapsCPUModelsAdd

2019-10-03 Thread Jiri Denemark
Signed-off-by: Jiri Denemark 
---
 src/conf/domain_capabilities.c | 15 +--
 1 file changed, 5 insertions(+), 10 deletions(-)

diff --git a/src/conf/domain_capabilities.c b/src/conf/domain_capabilities.c
index 1000d8b969..37e767d5c9 100644
--- a/src/conf/domain_capabilities.c
+++ b/src/conf/domain_capabilities.c
@@ -246,25 +246,20 @@ virDomainCapsCPUModelsAdd(virDomainCapsCPUModelsPtr 
cpuModels,
   virDomainCapsCPUUsable usable,
   char **blockers)
 {
-char *nameCopy = NULL;
-char **blockersCopy = NULL;
+VIR_AUTOFREE(char *) nameCopy = NULL;
+VIR_AUTOSTRINGLIST blockersCopy = NULL;
 
 if (VIR_STRNDUP(nameCopy, name, nameLen) < 0)
-goto error;
+return -1;
 
 if (virStringListCopy(, (const char **)blockers) < 0)
-goto error;
+return -1;
 
 if (virDomainCapsCPUModelsAddSteal(cpuModels, ,
usable, ) < 0)
-goto error;
+return -1;
 
 return 0;
-
- error:
-VIR_FREE(nameCopy);
-virStringListFree(blockersCopy);
-return -1;
 }
 
 
-- 
2.23.0

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


[libvirt] [PATCH 20/22] qemu: Use VIR_AUTOUNREF in qemuDomainDefPostParse

2019-10-03 Thread Jiri Denemark
Signed-off-by: Jiri Denemark 
---
 src/qemu/qemu_domain.c | 28 
 1 file changed, 12 insertions(+), 16 deletions(-)

diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index b4175a846e..1d7772ee01 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -4619,55 +4619,51 @@ qemuDomainDefPostParse(virDomainDefPtr def,
void *parseOpaque)
 {
 virQEMUDriverPtr driver = opaque;
-virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver);
+VIR_AUTOUNREF(virQEMUDriverConfigPtr) cfg = virQEMUDriverGetConfig(driver);
 /* Note that qemuCaps may be NULL when this function is called. This
  * function shall not fail in that case. It will be re-run on VM startup
  * with the capabilities populated. */
 virQEMUCapsPtr qemuCaps = parseOpaque;
-int ret = -1;
 
 if (def->os.bootloader || def->os.bootloaderArgs) {
 virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("bootloader is not supported by QEMU"));
-goto cleanup;
+return -1;
 }
 
 if (!def->os.machine) {
 virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("missing machine type"));
-goto cleanup;
+return -1;
 }
 
 if (qemuDomainNVRAMPathGenerate(cfg, def) < 0)
-goto cleanup;
+return -1;
 
 if (qemuDomainDefAddDefaultDevices(def, qemuCaps) < 0)
-goto cleanup;
+return -1;
 
 if (qemuCanonicalizeMachine(def, qemuCaps) < 0)
-goto cleanup;
+return -1;
 
 qemuDomainDefEnableDefaultFeatures(def, qemuCaps);
 
 if (qemuDomainRecheckInternalPaths(def, cfg, parseFlags) < 0)
-goto cleanup;
+return -1;
 
 if (qemuSecurityVerify(driver->securityManager, def) < 0)
-goto cleanup;
+return -1;
 
 if (qemuDomainDefVcpusPostParse(def) < 0)
-goto cleanup;
+return -1;
 
 if (qemuDomainDefCPUPostParse(def) < 0)
-goto cleanup;
+return -1;
 
 if (qemuDomainDefTsegPostParse(def, qemuCaps) < 0)
-goto cleanup;
+return -1;
 
-ret = 0;
- cleanup:
-virObjectUnref(cfg);
-return ret;
+return 0;
 }
 
 
-- 
2.23.0

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


[libvirt] [PATCH 15/22] conf: Drop virDomainCapsCPUModelsAddSteal

2019-10-03 Thread Jiri Denemark
Both virDomainCapsCPUModelsAdd and virDomainCapsCPUModelsAddSteal are so
simple we can just squash the code in a single function.

Signed-off-by: Jiri Denemark 
---
 src/conf/domain_capabilities.c | 33 ++---
 src/conf/domain_capabilities.h |  4 
 src/libvirt_private.syms   |  1 -
 3 files changed, 10 insertions(+), 28 deletions(-)

diff --git a/src/conf/domain_capabilities.c b/src/conf/domain_capabilities.c
index e3bed42e59..8536fa7bfa 100644
--- a/src/conf/domain_capabilities.c
+++ b/src/conf/domain_capabilities.c
@@ -185,27 +185,6 @@ virDomainCapsCPUModelsCopy(virDomainCapsCPUModelsPtr old)
 }
 
 
-int
-virDomainCapsCPUModelsAddSteal(virDomainCapsCPUModelsPtr cpuModels,
-   char **name,
-   virDomainCapsCPUUsable usable,
-   char ***blockers)
-{
-if (VIR_RESIZE_N(cpuModels->models, cpuModels->nmodels_max,
- cpuModels->nmodels, 1) < 0)
-return -1;
-
-cpuModels->models[cpuModels->nmodels].usable = usable;
-VIR_STEAL_PTR(cpuModels->models[cpuModels->nmodels].name, *name);
-
-if (blockers)
-VIR_STEAL_PTR(cpuModels->models[cpuModels->nmodels].blockers, 
*blockers);
-
-cpuModels->nmodels++;
-return 0;
-}
-
-
 int
 virDomainCapsCPUModelsAdd(virDomainCapsCPUModelsPtr cpuModels,
   const char *name,
@@ -214,6 +193,7 @@ virDomainCapsCPUModelsAdd(virDomainCapsCPUModelsPtr 
cpuModels,
 {
 VIR_AUTOFREE(char *) nameCopy = NULL;
 VIR_AUTOSTRINGLIST blockersCopy = NULL;
+virDomainCapsCPUModelPtr cpu;
 
 if (VIR_STRDUP(nameCopy, name) < 0)
 return -1;
@@ -221,10 +201,17 @@ virDomainCapsCPUModelsAdd(virDomainCapsCPUModelsPtr 
cpuModels,
 if (virStringListCopy(, (const char **)blockers) < 0)
 return -1;
 
-if (virDomainCapsCPUModelsAddSteal(cpuModels, ,
-   usable, ) < 0)
+if (VIR_RESIZE_N(cpuModels->models, cpuModels->nmodels_max,
+ cpuModels->nmodels, 1) < 0)
 return -1;
 
+cpu = cpuModels->models + cpuModels->nmodels;
+cpuModels->nmodels++;
+
+cpu->usable = usable;
+VIR_STEAL_PTR(cpu->name, nameCopy);
+VIR_STEAL_PTR(cpu->blockers, blockersCopy);
+
 return 0;
 }
 
diff --git a/src/conf/domain_capabilities.h b/src/conf/domain_capabilities.h
index ad5b22ca9a..ed47a81772 100644
--- a/src/conf/domain_capabilities.h
+++ b/src/conf/domain_capabilities.h
@@ -192,10 +192,6 @@ virDomainCapsPtr virDomainCapsNew(const char *path,
 
 virDomainCapsCPUModelsPtr virDomainCapsCPUModelsNew(size_t nmodels);
 virDomainCapsCPUModelsPtr virDomainCapsCPUModelsCopy(virDomainCapsCPUModelsPtr 
old);
-int virDomainCapsCPUModelsAddSteal(virDomainCapsCPUModelsPtr cpuModels,
-   char **name,
-   virDomainCapsCPUUsable usable,
-   char ***blockers);
 int virDomainCapsCPUModelsAdd(virDomainCapsCPUModelsPtr cpuModels,
   const char *name,
   virDomainCapsCPUUsable usable,
diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
index 6069a3efd4..4b28ee4b28 100644
--- a/src/libvirt_private.syms
+++ b/src/libvirt_private.syms
@@ -190,7 +190,6 @@ virDomainAuditVcpu;
 
 # conf/domain_capabilities.h
 virDomainCapsCPUModelsAdd;
-virDomainCapsCPUModelsAddSteal;
 virDomainCapsCPUModelsCopy;
 virDomainCapsCPUModelsGet;
 virDomainCapsCPUModelsNew;
-- 
2.23.0

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


[libvirt] [PATCH 22/22] qemu: Store default CPU in domain XML

2019-10-03 Thread Jiri Denemark
When starting a domain without a CPU model specified in the domain XML,
QEMU will choose a default one. Which is fine unless the domain gets
migrated to another host because libvirt doesn't perform any CPU ABI
checks and the virtual CPU provided by QEMU on the destination host can
differ from the one on the source host.

With QEMU 4.2.0 we can probe for the default CPU model used by QEMU for
a particular machine type and store it in the domain XML. This way the
chosen CPU model is more visible to users and libvirt will make sure
the guest will see the exact same CPU after migration.

https://bugzilla.redhat.com/show_bug.cgi?id=1598151
https://bugzilla.redhat.com/show_bug.cgi?id=1598162

Signed-off-by: Jiri Denemark 
---
 src/qemu/qemu_domain.c| 51 +++
 .../disk-cache.x86_64-latest.args |  1 +
 .../disk-cdrom-network.x86_64-latest.args |  1 +
 .../disk-cdrom-tray.x86_64-latest.args|  1 +
 .../disk-copy_on_read.x86_64-latest.args  |  1 +
 .../disk-detect-zeroes.x86_64-latest.args |  1 +
 .../disk-floppy-q35-2_11.x86_64-latest.args   |  1 +
 .../disk-floppy-q35-2_9.x86_64-latest.args|  1 +
 .../os-firmware-bios.x86_64-latest.args   |  1 +
 ...os-firmware-efi-secboot.x86_64-latest.args |  1 +
 .../os-firmware-efi.x86_64-latest.args|  1 +
 .../tpm-emulator-tpm2-enc.x86_64-latest.args  |  1 +
 .../tpm-emulator-tpm2.x86_64-latest.args  |  1 +
 .../tpm-emulator.x86_64-latest.args   |  1 +
 .../tseg-explicit-size.x86_64-latest.args |  1 +
 .../vhost-vsock-auto.x86_64-latest.args   |  1 +
 .../vhost-vsock.x86_64-latest.args|  1 +
 .../os-firmware-bios.x86_64-latest.xml|  3 ++
 .../os-firmware-efi-secboot.x86_64-latest.xml |  3 ++
 .../os-firmware-efi.x86_64-latest.xml |  3 ++
 .../tpm-emulator-tpm2-enc.x86_64-latest.xml   |  3 ++
 .../tpm-emulator-tpm2.x86_64-latest.xml   |  3 ++
 .../tpm-emulator.x86_64-latest.xml|  3 ++
 .../tpm-passthrough-crb.x86_64-latest.xml |  3 ++
 .../tpm-passthrough.x86_64-latest.xml |  3 ++
 25 files changed, 91 insertions(+)

diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index 1d7772ee01..1d10490059 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -4472,6 +4472,54 @@ qemuDomainDefVcpusPostParse(virDomainDefPtr def)
 }
 
 
+static int
+qemuDomainDefSetDefaultCPU(virDomainDefPtr def,
+   virQEMUCapsPtr qemuCaps)
+{
+VIR_AUTOPTR(virCPUDef) newCPU = NULL;
+virCPUDefPtr cpu = def->cpu;
+const char *model;
+
+if (cpu &&
+(cpu->mode != VIR_CPU_MODE_CUSTOM ||
+ cpu->model))
+return 0;
+
+model = virQEMUCapsGetMachineDefaultCPU(qemuCaps, def->os.machine, 
def->virtType);
+if (!model) {
+VIR_DEBUG("Unknown default CPU model for domain '%s'", def->name);
+return 0;
+}
+
+VIR_DEBUG("Setting default CPU model for domain '%s' to %s",
+  def->name, model);
+
+if (!cpu) {
+if (VIR_ALLOC(newCPU) < 0)
+return -1;
+cpu = newCPU;
+}
+
+/* We need to turn off all CPU checks when the domain is started because
+ * the default CPU (e.g., qemu64) may not be runnable on any host. QEMU
+ * will just disable the unavailable features and we will update the CPU
+ * definition accordingly and set check to FULL when starting the domain. 
*/
+cpu->type = VIR_CPU_TYPE_GUEST;
+cpu->mode = VIR_CPU_MODE_CUSTOM;
+cpu->match = VIR_CPU_MATCH_EXACT;
+cpu->check = VIR_CPU_CHECK_NONE;
+cpu->fallback = VIR_CPU_FALLBACK_FORBID;
+
+if (VIR_STRDUP(cpu->model, model) < 0)
+return -1;
+
+if (newCPU)
+VIR_STEAL_PTR(def->cpu, newCPU);
+
+return 0;
+}
+
+
 static int
 qemuDomainDefCPUPostParse(virDomainDefPtr def)
 {
@@ -4646,6 +4694,9 @@ qemuDomainDefPostParse(virDomainDefPtr def,
 if (qemuCanonicalizeMachine(def, qemuCaps) < 0)
 return -1;
 
+if (qemuDomainDefSetDefaultCPU(def, qemuCaps) < 0)
+return -1;
+
 qemuDomainDefEnableDefaultFeatures(def, qemuCaps);
 
 if (qemuDomainRecheckInternalPaths(def, cfg, parseFlags) < 0)
diff --git a/tests/qemuxml2argvdata/disk-cache.x86_64-latest.args 
b/tests/qemuxml2argvdata/disk-cache.x86_64-latest.args
index 7ea6d5b4d5..01d3b9d490 100644
--- a/tests/qemuxml2argvdata/disk-cache.x86_64-latest.args
+++ b/tests/qemuxml2argvdata/disk-cache.x86_64-latest.args
@@ -13,6 +13,7 @@ QEMU_AUDIO_DRV=none \
 -object secret,id=masterKey0,format=raw,\
 file=/tmp/lib/domain--1-QEMUGuest1/master-key.aes \
 -machine pc-i440fx-2.6,accel=tcg,usb=off,dump-guest-core=off \
+-cpu qemu64 \
 -m 214 \
 -overcommit mem-lock=off \
 -smp 1,sockets=1,cores=1,threads=1 \
diff --git a/tests/qemuxml2argvdata/disk-cdrom-network.x86_64-latest.args 
b/tests/qemuxml2argvdata/disk-cdrom-network.x86_64-latest.args
index cf711c0a3f..e0d2eb049d 100644
--- 

[libvirt] [PATCH 21/22] conf: Define VIR_AUTOPTR for virCPUDef

2019-10-03 Thread Jiri Denemark
Signed-off-by: Jiri Denemark 
---
 src/conf/cpu_conf.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/conf/cpu_conf.h b/src/conf/cpu_conf.h
index 19ce816ec2..f26f29d9fc 100644
--- a/src/conf/cpu_conf.h
+++ b/src/conf/cpu_conf.h
@@ -151,6 +151,7 @@ virCPUDefFreeModel(virCPUDefPtr def);
 
 void
 virCPUDefFree(virCPUDefPtr def);
+VIR_DEFINE_AUTOPTR_FUNC(virCPUDef, virCPUDefFree);
 
 int ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2)
 virCPUDefCopyModel(virCPUDefPtr dst,
-- 
2.23.0

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


[libvirt] [PATCH 17/22] qemu: Probe for default CPU types

2019-10-03 Thread Jiri Denemark
QEMU 4.2.0 will report default CPU types used by each machine type and
we will want to start using it.

Signed-off-by: Jiri Denemark 
---
 src/qemu/qemu_capabilities.c  | 15 ++-
 src/qemu/qemu_monitor.c   |  1 +
 src/qemu/qemu_monitor.h   |  1 +
 src/qemu/qemu_monitor_json.c  | 12 +++
 .../caps_4.2.0.x86_64.xml | 92 +--
 5 files changed, 73 insertions(+), 48 deletions(-)

diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index 24ef623458..802d3f7e1a 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -552,6 +552,7 @@ struct virQEMUCapsMachineType {
 unsigned int maxCpus;
 bool hotplugCpus;
 bool qemuDefault;
+char *defaultCPU;
 };
 
 typedef struct _virQEMUCapsHostCPUData virQEMUCapsHostCPUData;
@@ -1630,7 +1631,8 @@ virQEMUCapsPtr virQEMUCapsNewCopy(virQEMUCapsPtr qemuCaps)
 ret->nmachineTypes = qemuCaps->nmachineTypes;
 for (i = 0; i < qemuCaps->nmachineTypes; i++) {
 if (VIR_STRDUP(ret->machineTypes[i].name, 
qemuCaps->machineTypes[i].name) < 0 ||
-VIR_STRDUP(ret->machineTypes[i].alias, 
qemuCaps->machineTypes[i].alias) < 0)
+VIR_STRDUP(ret->machineTypes[i].alias, 
qemuCaps->machineTypes[i].alias) < 0 ||
+VIR_STRDUP(ret->machineTypes[i].defaultCPU, 
qemuCaps->machineTypes[i].defaultCPU) < 0)
 goto error;
 ret->machineTypes[i].maxCpus = qemuCaps->machineTypes[i].maxCpus;
 ret->machineTypes[i].hotplugCpus = 
qemuCaps->machineTypes[i].hotplugCpus;
@@ -1665,6 +1667,7 @@ void virQEMUCapsDispose(void *obj)
 for (i = 0; i < qemuCaps->nmachineTypes; i++) {
 VIR_FREE(qemuCaps->machineTypes[i].name);
 VIR_FREE(qemuCaps->machineTypes[i].alias);
+VIR_FREE(qemuCaps->machineTypes[i].defaultCPU);
 }
 VIR_FREE(qemuCaps->machineTypes);
 
@@ -2398,7 +2401,8 @@ virQEMUCapsProbeQMPMachineTypes(virQEMUCapsPtr qemuCaps,
 mach = &(qemuCaps->machineTypes[qemuCaps->nmachineTypes++]);
 
 if (VIR_STRDUP(mach->alias, machines[i]->alias) < 0 ||
-VIR_STRDUP(mach->name, machines[i]->name) < 0)
+VIR_STRDUP(mach->name, machines[i]->name) < 0 ||
+VIR_STRDUP(mach->defaultCPU, machines[i]->defaultCPU) < 0)
 goto cleanup;
 
 mach->maxCpus = machines[i]->maxCpus;
@@ -3775,6 +3779,8 @@ virQEMUCapsLoadCache(virArch hostArch,
 if (STREQ_NULLABLE(str, "yes"))
 qemuCaps->machineTypes[i].qemuDefault = true;
 VIR_FREE(str);
+
+qemuCaps->machineTypes[i].defaultCPU = virXMLPropString(nodes[i], 
"defaultCPU");
 }
 }
 VIR_FREE(nodes);
@@ -4049,6 +4055,11 @@ virQEMUCapsFormatCache(virQEMUCapsPtr qemuCaps)
   qemuCaps->machineTypes[i].maxCpus);
 if (qemuCaps->machineTypes[i].qemuDefault)
 virBufferAddLit(, " default='yes'");
+
+if (qemuCaps->machineTypes[i].defaultCPU)
+virBufferEscapeString(, " defaultCPU='%s'",
+  qemuCaps->machineTypes[i].defaultCPU);
+
 virBufferAddLit(, "/>\n");
 }
 
diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c
index 3bc97b8142..08ce5db2a1 100644
--- a/src/qemu/qemu_monitor.c
+++ b/src/qemu/qemu_monitor.c
@@ -3515,6 +3515,7 @@ qemuMonitorMachineInfoFree(qemuMonitorMachineInfoPtr 
machine)
 return;
 VIR_FREE(machine->name);
 VIR_FREE(machine->alias);
+VIR_FREE(machine->defaultCPU);
 VIR_FREE(machine);
 }
 
diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h
index 416bbb1cba..e82c9f2ba4 100644
--- a/src/qemu/qemu_monitor.h
+++ b/src/qemu/qemu_monitor.h
@@ -1085,6 +1085,7 @@ struct _qemuMonitorMachineInfo {
 char *alias;
 unsigned int maxCpus;
 bool hotplugCpus;
+char *defaultCPU;
 };
 
 int qemuMonitorGetMachines(qemuMonitorPtr mon,
diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c
index c0cd195496..008e9a0600 100644
--- a/src/qemu/qemu_monitor_json.c
+++ b/src/qemu/qemu_monitor_json.c
@@ -5504,6 +5504,18 @@ int qemuMonitorJSONGetMachines(qemuMonitorPtr mon,
 
 ignore_value(virJSONValueObjectGetBoolean(child, "hotpluggable-cpus",
   >hotplugCpus));
+
+if (virJSONValueObjectHasKey(child, "default-cpu-type")) {
+if (!(tmp = virJSONValueObjectGetString(child, 
"default-cpu-type"))) {
+virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+   _("query-machines reply has malformed "
+ "'default-cpu-type' data"));
+goto cleanup;
+}
+
+if (VIR_STRDUP(info->defaultCPU, tmp) < 0)
+goto cleanup;
+}
 }
 
 ret = n;
diff --git a/tests/qemucapabilitiesdata/caps_4.2.0.x86_64.xml 

[libvirt] [PATCH 14/22] conf: Drop unused virDomainCapsCPUModelsFilter

2019-10-03 Thread Jiri Denemark
Signed-off-by: Jiri Denemark 
---
 src/conf/domain_capabilities.c | 33 -
 src/conf/domain_capabilities.h |  3 ---
 src/libvirt_private.syms   |  1 -
 3 files changed, 37 deletions(-)

diff --git a/src/conf/domain_capabilities.c b/src/conf/domain_capabilities.c
index fa0b9dfc71..e3bed42e59 100644
--- a/src/conf/domain_capabilities.c
+++ b/src/conf/domain_capabilities.c
@@ -185,39 +185,6 @@ virDomainCapsCPUModelsCopy(virDomainCapsCPUModelsPtr old)
 }
 
 
-virDomainCapsCPUModelsPtr
-virDomainCapsCPUModelsFilter(virDomainCapsCPUModelsPtr old,
- const char **models,
- const char **blacklist)
-{
-virDomainCapsCPUModelsPtr cpuModels;
-size_t i;
-
-if (!(cpuModels = virDomainCapsCPUModelsNew(0)))
-return NULL;
-
-for (i = 0; i < old->nmodels; i++) {
-if (models && !virStringListHasString(models, old->models[i].name))
-continue;
-
-if (blacklist && virStringListHasString(blacklist, 
old->models[i].name))
-continue;
-
-if (virDomainCapsCPUModelsAdd(cpuModels,
-  old->models[i].name,
-  old->models[i].usable,
-  old->models[i].blockers) < 0)
-goto error;
-}
-
-return cpuModels;
-
- error:
-virObjectUnref(cpuModels);
-return NULL;
-}
-
-
 int
 virDomainCapsCPUModelsAddSteal(virDomainCapsCPUModelsPtr cpuModels,
char **name,
diff --git a/src/conf/domain_capabilities.h b/src/conf/domain_capabilities.h
index 7ff2181eda..ad5b22ca9a 100644
--- a/src/conf/domain_capabilities.h
+++ b/src/conf/domain_capabilities.h
@@ -192,9 +192,6 @@ virDomainCapsPtr virDomainCapsNew(const char *path,
 
 virDomainCapsCPUModelsPtr virDomainCapsCPUModelsNew(size_t nmodels);
 virDomainCapsCPUModelsPtr virDomainCapsCPUModelsCopy(virDomainCapsCPUModelsPtr 
old);
-virDomainCapsCPUModelsPtr 
virDomainCapsCPUModelsFilter(virDomainCapsCPUModelsPtr old,
-   const char **models,
-   const char **blacklist);
 int virDomainCapsCPUModelsAddSteal(virDomainCapsCPUModelsPtr cpuModels,
char **name,
virDomainCapsCPUUsable usable,
diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
index b8e118db0d..6069a3efd4 100644
--- a/src/libvirt_private.syms
+++ b/src/libvirt_private.syms
@@ -192,7 +192,6 @@ virDomainAuditVcpu;
 virDomainCapsCPUModelsAdd;
 virDomainCapsCPUModelsAddSteal;
 virDomainCapsCPUModelsCopy;
-virDomainCapsCPUModelsFilter;
 virDomainCapsCPUModelsGet;
 virDomainCapsCPUModelsNew;
 virDomainCapsCPUUsableTypeFromString;
-- 
2.23.0

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


[libvirt] [PATCH 13/22] qemu: Switch qemuCaps to use qemuMonitorCPUDefs

2019-10-03 Thread Jiri Denemark
We will need to keep some QEMU-specific data for each CPU model
supported by a QEMU binary. Instead of complicating the generic
virDomainCapsCPUModelsPtr, we can just directly store
qemuMonitorCPUDefsPtr returned by the capabilities probing code.

Signed-off-by: Jiri Denemark 
---
 src/qemu/qemu_capabilities.c | 110 +--
 1 file changed, 52 insertions(+), 58 deletions(-)

diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index 56b0e31c68..94d9cc3e32 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -603,8 +603,8 @@ struct _virQEMUCaps {
 virArch arch;
 
 virHashTablePtr domCapsCache;
-virDomainCapsCPUModelsPtr kvmCPUModels;
-virDomainCapsCPUModelsPtr tcgCPUModels;
+qemuMonitorCPUDefsPtr kvmCPUModels;
+qemuMonitorCPUDefsPtr tcgCPUModels;
 
 size_t nmachineTypes;
 struct virQEMUCapsMachineType *machineTypes;
@@ -1617,17 +1617,9 @@ virQEMUCapsPtr virQEMUCapsNewCopy(virQEMUCapsPtr 
qemuCaps)
 
 ret->arch = qemuCaps->arch;
 
-if (qemuCaps->kvmCPUModels) {
-ret->kvmCPUModels = virDomainCapsCPUModelsCopy(qemuCaps->kvmCPUModels);
-if (!ret->kvmCPUModels)
-goto error;
-}
-
-if (qemuCaps->tcgCPUModels) {
-ret->tcgCPUModels = virDomainCapsCPUModelsCopy(qemuCaps->tcgCPUModels);
-if (!ret->tcgCPUModels)
-goto error;
-}
+if (qemuMonitorCPUDefsCopy(>kvmCPUModels, qemuCaps->kvmCPUModels) < 0 
||
+qemuMonitorCPUDefsCopy(>tcgCPUModels, qemuCaps->tcgCPUModels) < 0)
+goto error;
 
 if (virQEMUCapsHostCPUDataCopy(>kvmCPU, >kvmCPU) < 0 ||
 virQEMUCapsHostCPUDataCopy(>tcgCPU, >tcgCPU) < 0)
@@ -1853,25 +1845,36 @@ virQEMUCapsAddCPUDefinitions(virQEMUCapsPtr qemuCaps,
  virDomainCapsCPUUsable usable)
 {
 size_t i;
-virDomainCapsCPUModelsPtr cpus = NULL;
+size_t start;
+qemuMonitorCPUDefsPtr defs = NULL;
 
 if (type == VIR_DOMAIN_VIRT_KVM && qemuCaps->kvmCPUModels)
-cpus = qemuCaps->kvmCPUModels;
+defs = qemuCaps->kvmCPUModels;
 else if (type == VIR_DOMAIN_VIRT_QEMU && qemuCaps->tcgCPUModels)
-cpus = qemuCaps->tcgCPUModels;
+defs = qemuCaps->tcgCPUModels;
 
-if (!cpus) {
-if (!(cpus = virDomainCapsCPUModelsNew(count)))
+if (defs) {
+start = defs->ncpus;
+
+if (VIR_EXPAND_N(defs->cpus, defs->ncpus, count) < 0)
+return -1;
+} else {
+start = 0;
+
+if (!(defs = qemuMonitorCPUDefsNew(count)))
 return -1;
 
 if (type == VIR_DOMAIN_VIRT_KVM)
-qemuCaps->kvmCPUModels = cpus;
+qemuCaps->kvmCPUModels = defs;
 else
-qemuCaps->tcgCPUModels = cpus;
+qemuCaps->tcgCPUModels = defs;
 }
 
 for (i = 0; i < count; i++) {
-if (virDomainCapsCPUModelsAdd(cpus, name[i], usable, NULL) < 0)
+qemuMonitorCPUDefInfoPtr cpu = defs->cpus + start + i;
+
+cpu->usable = usable;
+if (VIR_STRDUP(cpu->name, name[i]) < 0)
 return -1;
 }
 
@@ -1923,20 +1926,14 @@ virQEMUCapsGetCPUDefinitions(virQEMUCapsPtr qemuCaps,
  const char **modelWhitelist,
  const char **modelBlacklist)
 {
-virDomainCapsCPUModelsPtr cpuModels;
+qemuMonitorCPUDefsPtr defs;
 
 if (type == VIR_DOMAIN_VIRT_KVM)
-cpuModels = qemuCaps->kvmCPUModels;
+defs = qemuCaps->kvmCPUModels;
 else
-cpuModels = qemuCaps->tcgCPUModels;
+defs = qemuCaps->tcgCPUModels;
 
-if (!cpuModels)
-return NULL;
-
-if (modelWhitelist || modelBlacklist)
-return virDomainCapsCPUModelsFilter(cpuModels, modelWhitelist, 
modelBlacklist);
-
-return virDomainCapsCPUModelsCopy(cpuModels);
+return virQEMUCapsCPUDefsToModels(defs, modelWhitelist, modelBlacklist);
 }
 
 
@@ -1996,7 +1993,7 @@ virQEMUCapsIsCPUModeSupported(virQEMUCapsPtr qemuCaps,
   virDomainVirtType type,
   virCPUMode mode)
 {
-virDomainCapsCPUModelsPtr cpus;
+qemuMonitorCPUDefsPtr cpus;
 
 switch (mode) {
 case VIR_CPU_MODE_HOST_PASSTHROUGH:
@@ -2012,7 +2009,7 @@ virQEMUCapsIsCPUModeSupported(virQEMUCapsPtr qemuCaps,
 cpus = qemuCaps->kvmCPUModels;
 else
 cpus = qemuCaps->tcgCPUModels;
-return cpus && cpus->nmodels > 0;
+return cpus && cpus->ncpus > 0;
 
 case VIR_CPU_MODE_LAST:
 break;
@@ -2499,18 +2496,18 @@ virQEMUCapsProbeQMPCPUDefinitions(virQEMUCapsPtr 
qemuCaps,
   qemuMonitorPtr mon,
   bool tcg)
 {
-virDomainCapsCPUModelsPtr models = NULL;
+VIR_AUTOPTR(qemuMonitorCPUDefs) defs = NULL;
 
 if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_QUERY_CPU_DEFINITIONS))
 return 0;
 
-if (!(models = 

[libvirt] [PATCH 11/22] qemu: Use VIR_AUTOFREE in virQEMUCapsLoadCPUModels

2019-10-03 Thread Jiri Denemark
Signed-off-by: Jiri Denemark 
---
 src/qemu/qemu_capabilities.c | 58 +++-
 1 file changed, 24 insertions(+), 34 deletions(-)

diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index 74920901b3..52a2594bf3 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -3423,15 +3423,10 @@ virQEMUCapsLoadCPUModels(virQEMUCapsPtr qemuCaps,
  virDomainVirtType type)
 {
 virDomainCapsCPUModelsPtr cpus = NULL;
-xmlNodePtr *nodes = NULL;
-char *str = NULL;
+VIR_AUTOFREE(xmlNodePtr *) nodes = NULL;
 size_t i;
 int n;
-int ret = -1;
 xmlNodePtr node;
-xmlNodePtr *blockerNodes = NULL;
-char **blockers = NULL;
-int nblockers;
 
 if (type == VIR_DOMAIN_VIRT_KVM)
 n = virXPathNodeSet("./cpu[@type='kvm']", ctxt, );
@@ -3441,16 +3436,14 @@ virQEMUCapsLoadCPUModels(virQEMUCapsPtr qemuCaps,
 if (n < 0) {
 virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("failed to parse qemu capabilities cpus"));
-goto cleanup;
+return -1;
 }
 
-if (n == 0) {
-ret = 0;
-goto cleanup;
-}
+if (n == 0)
+return 0;
 
 if (!(cpus = virDomainCapsCPUModelsNew(n)))
-goto cleanup;
+return -1;
 
 if (type == VIR_DOMAIN_VIRT_KVM)
 qemuCaps->kvmCPUModels = cpus;
@@ -3459,19 +3452,24 @@ virQEMUCapsLoadCPUModels(virQEMUCapsPtr qemuCaps,
 
 for (i = 0; i < n; i++) {
 int usable = VIR_DOMCAPS_CPU_USABLE_UNKNOWN;
-
-if ((str = virXMLPropString(nodes[i], "usable")) &&
-(usable = virDomainCapsCPUUsableTypeFromString(str)) < 0) {
+VIR_AUTOFREE(char *) strUsable = NULL;
+VIR_AUTOFREE(char *) name = NULL;
+VIR_AUTOFREE(xmlNodePtr *) blockerNodes = NULL;
+VIR_AUTOSTRINGLIST blockers = NULL;
+int nblockers;
+
+if ((strUsable = virXMLPropString(nodes[i], "usable")) &&
+(usable = virDomainCapsCPUUsableTypeFromString(strUsable)) < 0) {
 virReportError(VIR_ERR_INTERNAL_ERROR,
-   _("unknown value '%s' in attribute 'usable'"), str);
-goto cleanup;
+   _("unknown value '%s' in attribute 'usable'"),
+   strUsable);
+return -1;
 }
-VIR_FREE(str);
 
-if (!(str = virXMLPropString(nodes[i], "name"))) {
+if (!(name = virXMLPropString(nodes[i], "name"))) {
 virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("missing cpu name in QEMU capabilities cache"));
-goto cleanup;
+return -1;
 }
 
 node = ctxt->node;
@@ -3482,38 +3480,30 @@ virQEMUCapsLoadCPUModels(virQEMUCapsPtr qemuCaps,
 if (nblockers < 0) {
 virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("failed to parse CPU blockers in QEMU 
capabilities"));
-goto cleanup;
+return -1;
 }
 
 if (nblockers > 0) {
 size_t j;
 
 if (VIR_ALLOC_N(blockers, nblockers + 1) < 0)
-goto cleanup;
+return -1;
 
 for (j = 0; j < nblockers; j++) {
 if (!(blockers[j] = virXMLPropString(blockerNodes[j], 
"name"))) {
 virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("missing blocker name in QEMU "
  "capabilities cache"));
-goto cleanup;
+return -1;
 }
 }
-VIR_FREE(blockerNodes);
 }
 
-if (virDomainCapsCPUModelsAddSteal(cpus, , usable, ) < 0)
-goto cleanup;
+if (virDomainCapsCPUModelsAddSteal(cpus, , usable, ) < 0)
+return -1;
 }
 
-ret = 0;
-
- cleanup:
-VIR_FREE(nodes);
-VIR_FREE(str);
-VIR_FREE(blockerNodes);
-virStringListFree(blockers);
-return ret;
+return 0;
 }
 
 
-- 
2.23.0

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


[libvirt] [PATCH 04/22] qemu: Filter models in virQEMUCapsGetCPUDefinitions

2019-10-03 Thread Jiri Denemark
Some callers of virQEMUCapsGetCPUDefinitions will need to filter the
returned list of CPU models. Let's add the filtering parameters directly
to virQEMUCapsGetCPUDefinitions to avoid copying the CPU models list
twice.

Signed-off-by: Jiri Denemark 
---
 src/qemu/qemu_capabilities.c | 11 ---
 src/qemu/qemu_capabilities.h |  4 +++-
 src/qemu/qemu_driver.c   |  2 +-
 src/qemu/qemu_process.c  |  2 +-
 tests/cputest.c  |  2 +-
 5 files changed, 14 insertions(+), 7 deletions(-)

diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index 705e3a87b0..dac3d3b633 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -1881,7 +1881,9 @@ virQEMUCapsAddCPUDefinitions(virQEMUCapsPtr qemuCaps,
 
 virDomainCapsCPUModelsPtr
 virQEMUCapsGetCPUDefinitions(virQEMUCapsPtr qemuCaps,
- virDomainVirtType type)
+ virDomainVirtType type,
+ const char **modelWhitelist,
+ const char **modelBlacklist)
 {
 virDomainCapsCPUModelsPtr cpuModels;
 
@@ -1893,6 +1895,9 @@ virQEMUCapsGetCPUDefinitions(virQEMUCapsPtr qemuCaps,
 if (!cpuModels)
 return NULL;
 
+if (modelWhitelist || modelBlacklist)
+return virDomainCapsCPUModelsFilter(cpuModels, modelWhitelist, 
modelBlacklist);
+
 return virDomainCapsCPUModelsCopy(cpuModels);
 }
 
@@ -3101,7 +3106,7 @@ virQEMUCapsInitCPUModelX86(virQEMUCapsPtr qemuCaps,
 if (!(data = virQEMUCapsGetCPUModelX86Data(qemuCaps, model, migratable)))
 goto cleanup;
 
-cpuModels = virQEMUCapsGetCPUDefinitions(qemuCaps, type);
+cpuModels = virQEMUCapsGetCPUDefinitions(qemuCaps, type, NULL, NULL);
 
 if (cpuDecode(cpu, data, cpuModels) < 0)
 goto cleanup;
@@ -3190,7 +3195,7 @@ virQEMUCapsInitHostCPUModel(virQEMUCapsPtr qemuCaps,
 
 VIR_DEBUG("No host CPU model info from QEMU; probing host CPU 
directly");
 
-cpuModels = virQEMUCapsGetCPUDefinitions(qemuCaps, type);
+cpuModels = virQEMUCapsGetCPUDefinitions(qemuCaps, type, NULL, NULL);
 hostCPU = virQEMUCapsProbeHostCPU(hostArch, cpuModels);
 
 if (!hostCPU ||
diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h
index 5e990ce01e..f1510f3a7b 100644
--- a/src/qemu/qemu_capabilities.h
+++ b/src/qemu/qemu_capabilities.h
@@ -564,7 +564,9 @@ int virQEMUCapsAddCPUDefinitions(virQEMUCapsPtr qemuCaps,
  size_t count,
  virDomainCapsCPUUsable usable);
 virDomainCapsCPUModelsPtr virQEMUCapsGetCPUDefinitions(virQEMUCapsPtr qemuCaps,
-   virDomainVirtType type);
+   virDomainVirtType type,
+   const char 
**modelWhitelist,
+   const char 
**modelBlacklist);
 virDomainCapsCPUModelsPtr virQEMUCapsFetchCPUDefinitions(qemuMonitorPtr mon);
 
 typedef enum {
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 9e681a22b3..265e10b466 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -13780,7 +13780,7 @@ qemuConnectBaselineHypervisorCPU(virConnectPtr conn,
 if (!qemuCaps)
 goto cleanup;
 
-if (!(cpuModels = virQEMUCapsGetCPUDefinitions(qemuCaps, virttype)) ||
+if (!(cpuModels = virQEMUCapsGetCPUDefinitions(qemuCaps, virttype, NULL, 
NULL)) ||
 cpuModels->nmodels == 0) {
 virReportError(VIR_ERR_OPERATION_UNSUPPORTED,
_("QEMU '%s' does not support any CPU models for "
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index 9405bdc3f9..50f6df9dbd 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -6147,7 +6147,7 @@ qemuProcessUpdateGuestCPU(virDomainDefPtr def,
  
VIR_QEMU_CAPS_HOST_CPU_MIGRATABLE)) < 0)
 return -1;
 
-cpuModels = virQEMUCapsGetCPUDefinitions(qemuCaps, def->virtType);
+cpuModels = virQEMUCapsGetCPUDefinitions(qemuCaps, def->virtType, 
NULL, NULL);
 
 if (virCPUTranslate(def->os.arch, def->cpu, cpuModels) < 0)
 return -1;
diff --git a/tests/cputest.c b/tests/cputest.c
index 40b843dd8f..a7cac82d84 100644
--- a/tests/cputest.c
+++ b/tests/cputest.c
@@ -541,7 +541,7 @@ cpuTestGetCPUModels(const struct data *data,
 if (!(qemuCaps = cpuTestMakeQEMUCaps(data)))
 return -1;
 
-*models = virQEMUCapsGetCPUDefinitions(qemuCaps, VIR_DOMAIN_VIRT_KVM);
+*models = virQEMUCapsGetCPUDefinitions(qemuCaps, VIR_DOMAIN_VIRT_KVM, 
NULL, NULL);
 
 virObjectUnref(qemuCaps);
 
-- 
2.23.0

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


[libvirt] [PATCH 07/22] qemu: Introduce qemuMonitorCPUDefs struct

2019-10-03 Thread Jiri Denemark
It is a container for a CPU models list (qemuMonitorCPUDefInfo) and a
number of elements in this list.

Signed-off-by: Jiri Denemark 
---
 src/qemu/qemu_capabilities.c | 24 ++--
 src/qemu/qemu_monitor.c  | 39 +++--
 src/qemu/qemu_monitor.h  | 14 +++--
 src/qemu/qemu_monitor_json.c | 56 ++--
 src/qemu/qemu_monitor_json.h |  2 +-
 tests/qemumonitorjsontest.c  | 38 +---
 6 files changed, 89 insertions(+), 84 deletions(-)

diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index 255ae8e665..b06e89a9c5 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -2447,40 +2447,34 @@ virQEMUCapsProbeQMPMachineProps(virQEMUCapsPtr qemuCaps,
 virDomainCapsCPUModelsPtr
 virQEMUCapsFetchCPUDefinitions(qemuMonitorPtr mon)
 {
+VIR_AUTOPTR(qemuMonitorCPUDefs) defs = NULL;
 virDomainCapsCPUModelsPtr models = NULL;
-qemuMonitorCPUDefInfoPtr *cpus = NULL;
-int ncpus = 0;
 size_t i;
 
-if ((ncpus = qemuMonitorGetCPUDefinitions(mon, )) < 0)
+if (qemuMonitorGetCPUDefinitions(mon, ) < 0)
 return NULL;
 
-if (!(models = virDomainCapsCPUModelsNew(ncpus)))
+if (!(models = virDomainCapsCPUModelsNew(defs->ncpus)))
 goto error;
 
-for (i = 0; i < ncpus; i++) {
+for (i = 0; i < defs->ncpus; i++) {
 virDomainCapsCPUUsable usable = VIR_DOMCAPS_CPU_USABLE_UNKNOWN;
 
-if (cpus[i]->usable == VIR_TRISTATE_BOOL_YES)
+if (defs->cpus[i]->usable == VIR_TRISTATE_BOOL_YES)
 usable = VIR_DOMCAPS_CPU_USABLE_YES;
-else if (cpus[i]->usable == VIR_TRISTATE_BOOL_NO)
+else if (defs->cpus[i]->usable == VIR_TRISTATE_BOOL_NO)
 usable = VIR_DOMCAPS_CPU_USABLE_NO;
 
-if (virDomainCapsCPUModelsAddSteal(models, [i]->name, usable,
-   [i]->blockers) < 0)
+if (virDomainCapsCPUModelsAddSteal(models, >cpus[i]->name, 
usable,
+   >cpus[i]->blockers) < 0)
 goto error;
 }
 
- cleanup:
-for (i = 0; i < ncpus; i++)
-qemuMonitorCPUDefInfoFree(cpus[i]);
-VIR_FREE(cpus);
 return models;
 
  error:
 virObjectUnref(models);
-models = NULL;
-goto cleanup;
+return NULL;
 }
 
 
diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c
index 2d46f5cfa7..62248f3362 100644
--- a/src/qemu/qemu_monitor.c
+++ b/src/qemu/qemu_monitor.c
@@ -3521,25 +3521,48 @@ qemuMonitorMachineInfoFree(qemuMonitorMachineInfoPtr 
machine)
 
 int
 qemuMonitorGetCPUDefinitions(qemuMonitorPtr mon,
- qemuMonitorCPUDefInfoPtr **cpus)
+ qemuMonitorCPUDefsPtr *cpuDefs)
 {
-VIR_DEBUG("cpus=%p", cpus);
+VIR_DEBUG("cpuDefs=%p", cpuDefs);
 
 QEMU_CHECK_MONITOR(mon);
 
-return qemuMonitorJSONGetCPUDefinitions(mon, cpus);
+return qemuMonitorJSONGetCPUDefinitions(mon, cpuDefs);
 }
 
 
 void
-qemuMonitorCPUDefInfoFree(qemuMonitorCPUDefInfoPtr cpu)
+qemuMonitorCPUDefsFree(qemuMonitorCPUDefsPtr defs)
 {
-if (!cpu)
+size_t i;
+
+if (!defs)
 return;
 
-virStringListFree(cpu->blockers);
-VIR_FREE(cpu->name);
-VIR_FREE(cpu);
+for (i = 0; i < defs->ncpus; i++) {
+virStringListFree(defs->cpus[i]->blockers);
+VIR_FREE(defs->cpus[i]->name);
+VIR_FREE(defs->cpus[i]);
+}
+
+VIR_FREE(defs->cpus);
+VIR_FREE(defs);
+}
+
+
+qemuMonitorCPUDefsPtr
+qemuMonitorCPUDefsNew(size_t count)
+{
+VIR_AUTOPTR(qemuMonitorCPUDefs) defs = NULL;
+
+if (VIR_ALLOC(defs) < 0)
+return NULL;
+
+if (count > 0 && VIR_ALLOC_N(defs->cpus, count) < 0)
+return NULL;
+
+defs->ncpus = count;
+VIR_RETURN_PTR(defs);
 }
 
 
diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h
index b42bdfbea8..d59bafbeda 100644
--- a/src/qemu/qemu_monitor.h
+++ b/src/qemu/qemu_monitor.h
@@ -1101,9 +1101,19 @@ struct _qemuMonitorCPUDefInfo {
 char **blockers; /* NULL-terminated string list */
 };
 
+typedef struct _qemuMonitorCPUDefs qemuMonitorCPUDefs;
+typedef qemuMonitorCPUDefs *qemuMonitorCPUDefsPtr;
+struct _qemuMonitorCPUDefs {
+size_t ncpus;
+qemuMonitorCPUDefInfoPtr *cpus;
+};
+
 int qemuMonitorGetCPUDefinitions(qemuMonitorPtr mon,
- qemuMonitorCPUDefInfoPtr **cpus);
-void qemuMonitorCPUDefInfoFree(qemuMonitorCPUDefInfoPtr cpu);
+ qemuMonitorCPUDefsPtr *cpuDefs);
+qemuMonitorCPUDefsPtr qemuMonitorCPUDefsNew(size_t count);
+void qemuMonitorCPUDefsFree(qemuMonitorCPUDefsPtr defs);
+VIR_DEFINE_AUTOPTR_FUNC(qemuMonitorCPUDefs, qemuMonitorCPUDefsFree);
+
 
 typedef enum {
 QEMU_MONITOR_CPU_PROPERTY_BOOLEAN,
diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c
index 720cd78a23..02bbefdc12 100644
--- a/src/qemu/qemu_monitor_json.c
+++ b/src/qemu/qemu_monitor_json.c
@@ -5524,60 

[libvirt] [PATCH 10/22] qemu: Add qemuMonitorCPUDefsCopy

2019-10-03 Thread Jiri Denemark
Signed-off-by: Jiri Denemark 
---
 src/qemu/qemu_monitor.c | 33 +
 src/qemu/qemu_monitor.h |  2 ++
 2 files changed, 35 insertions(+)

diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c
index 4442ef6cca..ebd7eaa1a9 100644
--- a/src/qemu/qemu_monitor.c
+++ b/src/qemu/qemu_monitor.c
@@ -3565,6 +3565,39 @@ qemuMonitorCPUDefsNew(size_t count)
 }
 
 
+int
+qemuMonitorCPUDefsCopy(qemuMonitorCPUDefsPtr *dst,
+   qemuMonitorCPUDefsPtr src)
+{
+VIR_AUTOPTR(qemuMonitorCPUDefs) defs = NULL;
+size_t i;
+
+if (!src) {
+*dst = NULL;
+return 0;
+}
+
+if (!(defs = qemuMonitorCPUDefsNew(src->ncpus)))
+return -1;
+
+defs->ncpus = src->ncpus;
+for (i = 0; i < src->ncpus; i++) {
+qemuMonitorCPUDefInfoPtr cpuDst = defs->cpus + i;
+qemuMonitorCPUDefInfoPtr cpuSrc = src->cpus + i;
+
+cpuDst->usable = cpuSrc->usable;
+
+if (VIR_STRDUP(cpuDst->name, cpuSrc->name) < 0 ||
+virStringListCopy(>blockers,
+  (const char **)cpuSrc->blockers) < 0)
+return -1;
+}
+
+VIR_STEAL_PTR(*dst, defs);
+return 0;
+}
+
+
 int
 qemuMonitorGetCPUModelExpansion(qemuMonitorPtr mon,
 qemuMonitorCPUModelExpansionType type,
diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h
index 7d35c97860..0b6d4848a0 100644
--- a/src/qemu/qemu_monitor.h
+++ b/src/qemu/qemu_monitor.h
@@ -,6 +,8 @@ struct _qemuMonitorCPUDefs {
 int qemuMonitorGetCPUDefinitions(qemuMonitorPtr mon,
  qemuMonitorCPUDefsPtr *cpuDefs);
 qemuMonitorCPUDefsPtr qemuMonitorCPUDefsNew(size_t count);
+int qemuMonitorCPUDefsCopy(qemuMonitorCPUDefsPtr *dst,
+   qemuMonitorCPUDefsPtr src);
 void qemuMonitorCPUDefsFree(qemuMonitorCPUDefsPtr defs);
 VIR_DEFINE_AUTOPTR_FUNC(qemuMonitorCPUDefs, qemuMonitorCPUDefsFree);
 
-- 
2.23.0

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


[libvirt] [PATCH 09/22] build: Export virStringListCopy internal API

2019-10-03 Thread Jiri Denemark
Signed-off-by: Jiri Denemark 
---
 src/libvirt_private.syms | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
index 7b681fac64..b8e118db0d 100644
--- a/src/libvirt_private.syms
+++ b/src/libvirt_private.syms
@@ -3078,6 +3078,7 @@ virStringIsEmpty;
 virStringIsPrintable;
 virStringListAdd;
 virStringListAutoFree;
+virStringListCopy;
 virStringListFree;
 virStringListFreeCount;
 virStringListGetFirstWithPrefix;
-- 
2.23.0

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


[libvirt] [PATCH 12/22] qemu: Introduce virQEMUCapsCPUDefsToModels

2019-10-03 Thread Jiri Denemark
The function translates qemuMonitorCPUDefsPtr (used by QEMU caps probing
code) into virDomainCapsCPUModelsPtr used by domain capabilities.

Signed-off-by: Jiri Denemark 
---
 src/qemu/qemu_capabilities.c | 62 +++-
 1 file changed, 39 insertions(+), 23 deletions(-)

diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index 52a2594bf3..56b0e31c68 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -1879,6 +1879,44 @@ virQEMUCapsAddCPUDefinitions(virQEMUCapsPtr qemuCaps,
 }
 
 
+static virDomainCapsCPUModelsPtr
+virQEMUCapsCPUDefsToModels(qemuMonitorCPUDefsPtr defs,
+   const char **modelWhitelist,
+   const char **modelBlacklist)
+{
+VIR_AUTOUNREF(virDomainCapsCPUModelsPtr) cpuModels = NULL;
+size_t i;
+
+if (!defs)
+return NULL;
+
+if (!(cpuModels = virDomainCapsCPUModelsNew(defs->ncpus)))
+return NULL;
+
+for (i = 0; i < defs->ncpus; i++) {
+qemuMonitorCPUDefInfoPtr cpu = defs->cpus + i;
+virDomainCapsCPUUsable usable = VIR_DOMCAPS_CPU_USABLE_UNKNOWN;
+
+if (modelWhitelist && !virStringListHasString(modelWhitelist, 
cpu->name))
+continue;
+
+if (modelBlacklist && virStringListHasString(modelBlacklist, 
cpu->name))
+continue;
+
+if (cpu->usable == VIR_TRISTATE_BOOL_YES)
+usable = VIR_DOMCAPS_CPU_USABLE_YES;
+else if (cpu->usable == VIR_TRISTATE_BOOL_NO)
+usable = VIR_DOMCAPS_CPU_USABLE_NO;
+
+if (virDomainCapsCPUModelsAdd(cpuModels, cpu->name,
+  usable, cpu->blockers) < 0)
+return NULL;
+}
+
+VIR_RETURN_PTR(cpuModels);
+}
+
+
 virDomainCapsCPUModelsPtr
 virQEMUCapsGetCPUDefinitions(virQEMUCapsPtr qemuCaps,
  virDomainVirtType type,
@@ -2448,33 +2486,11 @@ virDomainCapsCPUModelsPtr
 virQEMUCapsFetchCPUDefinitions(qemuMonitorPtr mon)
 {
 VIR_AUTOPTR(qemuMonitorCPUDefs) defs = NULL;
-virDomainCapsCPUModelsPtr models = NULL;
-size_t i;
 
 if (qemuMonitorGetCPUDefinitions(mon, ) < 0)
 return NULL;
 
-if (!(models = virDomainCapsCPUModelsNew(defs->ncpus)))
-goto error;
-
-for (i = 0; i < defs->ncpus; i++) {
-virDomainCapsCPUUsable usable = VIR_DOMCAPS_CPU_USABLE_UNKNOWN;
-
-if (defs->cpus[i].usable == VIR_TRISTATE_BOOL_YES)
-usable = VIR_DOMCAPS_CPU_USABLE_YES;
-else if (defs->cpus[i].usable == VIR_TRISTATE_BOOL_NO)
-usable = VIR_DOMCAPS_CPU_USABLE_NO;
-
-if (virDomainCapsCPUModelsAddSteal(models, >cpus[i].name, usable,
-   >cpus[i].blockers) < 0)
-goto error;
-}
-
-return models;
-
- error:
-virObjectUnref(models);
-return NULL;
+return virQEMUCapsCPUDefsToModels(defs, NULL, NULL);
 }
 
 
-- 
2.23.0

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


[libvirt] [PATCH 19/22] qemu: Drop unused virQEMUCapsGetDefaultMachine

2019-10-03 Thread Jiri Denemark
Signed-off-by: Jiri Denemark 
---
 src/qemu/qemu_capabilities.c | 12 
 src/qemu/qemu_capabilities.h |  1 -
 2 files changed, 13 deletions(-)

diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index 9d5eaf0c1a..51de44260d 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -2125,18 +2125,6 @@ const char 
*virQEMUCapsGetCanonicalMachine(virQEMUCapsPtr qemuCaps,
 return name;
 }
 
-const char *
-virQEMUCapsGetDefaultMachine(virQEMUCapsPtr qemuCaps)
-{
-size_t i;
-
-for (i = 0; i < qemuCaps->nmachineTypes; i++) {
-if (qemuCaps->machineTypes[i].qemuDefault)
-return qemuCaps->machineTypes[i].name;
-}
-
-return NULL;
-}
 
 int virQEMUCapsGetMachineMaxCpus(virQEMUCapsPtr qemuCaps,
  const char *name)
diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h
index beed927f06..335b43639d 100644
--- a/src/qemu/qemu_capabilities.h
+++ b/src/qemu/qemu_capabilities.h
@@ -594,7 +594,6 @@ bool virQEMUCapsIsCPUModeSupported(virQEMUCapsPtr qemuCaps,
virCPUMode mode);
 const char *virQEMUCapsGetCanonicalMachine(virQEMUCapsPtr qemuCaps,
const char *name);
-const char *virQEMUCapsGetDefaultMachine(virQEMUCapsPtr qemuCaps);
 int virQEMUCapsGetMachineMaxCpus(virQEMUCapsPtr qemuCaps,
  const char *name);
 bool virQEMUCapsGetMachineHotplugCpus(virQEMUCapsPtr qemuCaps,
-- 
2.23.0

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


[libvirt] [PATCH 18/22] qemu: Introduce virQEMUCapsGetMachineDefaultCPU

2019-10-03 Thread Jiri Denemark
Signed-off-by: Jiri Denemark 
---
 src/qemu/qemu_capabilities.c | 36 
 src/qemu/qemu_capabilities.h |  3 +++
 2 files changed, 39 insertions(+)

diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index 802d3f7e1a..9d5eaf0c1a 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -2171,6 +2171,42 @@ bool virQEMUCapsGetMachineHotplugCpus(virQEMUCapsPtr 
qemuCaps,
 }
 
 
+const char *
+virQEMUCapsGetMachineDefaultCPU(virQEMUCapsPtr qemuCaps,
+const char *name,
+virDomainVirtType type)
+{
+qemuMonitorCPUDefsPtr defs;
+const char *cpuType = NULL;
+size_t i;
+
+if (type == VIR_DOMAIN_VIRT_KVM)
+defs = qemuCaps->kvmCPUModels;
+else
+defs = qemuCaps->tcgCPUModels;
+
+if (!name || !defs)
+return NULL;
+
+for (i = 0; i < qemuCaps->nmachineTypes; i++) {
+if (STREQ(qemuCaps->machineTypes[i].name, name)) {
+cpuType = qemuCaps->machineTypes[i].defaultCPU;
+break;
+}
+}
+
+if (!cpuType)
+return NULL;
+
+for (i = 0; i < defs->ncpus; i++) {
+if (STREQ(defs->cpus[i].type, cpuType))
+return defs->cpus[i].name;
+}
+
+return NULL;
+}
+
+
 /**
  * virQEMUCapsSetGICCapabilities:
  * @qemuCaps: QEMU capabilities
diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h
index f1510f3a7b..beed927f06 100644
--- a/src/qemu/qemu_capabilities.h
+++ b/src/qemu/qemu_capabilities.h
@@ -599,6 +599,9 @@ int virQEMUCapsGetMachineMaxCpus(virQEMUCapsPtr qemuCaps,
  const char *name);
 bool virQEMUCapsGetMachineHotplugCpus(virQEMUCapsPtr qemuCaps,
   const char *name);
+const char *virQEMUCapsGetMachineDefaultCPU(virQEMUCapsPtr qemuCaps,
+const char *name,
+virDomainVirtType type);
 int virQEMUCapsGetMachineTypesCaps(virQEMUCapsPtr qemuCaps,
size_t *nmachines,
virCapsGuestMachinePtr **machines);
-- 
2.23.0

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


[libvirt] [PATCH 03/22] qemu: Copy CPU models in virQEMUCapsGetCPUDefinitions

2019-10-03 Thread Jiri Denemark
Rather than returning a direct pointer the list stored in qemuCaps the
function now creates a new copy of the CPU models list.

The main purpose of this seemingly useless change is to update callers
to free the result returned by virQEMUCapsGetCPUDefinitions because the
internals of this function will change significantly in the following
patches.

Signed-off-by: Jiri Denemark 
---
 src/qemu/qemu_capabilities.c | 23 ++-
 src/qemu/qemu_driver.c   |  2 +-
 src/qemu/qemu_process.c  |  7 +--
 tests/cputest.c  |  1 -
 4 files changed, 24 insertions(+), 9 deletions(-)

diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index 806d102efd..705e3a87b0 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -1883,10 +1883,17 @@ virDomainCapsCPUModelsPtr
 virQEMUCapsGetCPUDefinitions(virQEMUCapsPtr qemuCaps,
  virDomainVirtType type)
 {
+virDomainCapsCPUModelsPtr cpuModels;
+
 if (type == VIR_DOMAIN_VIRT_KVM)
-return qemuCaps->kvmCPUModels;
+cpuModels = qemuCaps->kvmCPUModels;
 else
-return qemuCaps->tcgCPUModels;
+cpuModels = qemuCaps->tcgCPUModels;
+
+if (!cpuModels)
+return NULL;
+
+return virDomainCapsCPUModelsCopy(cpuModels);
 }
 
 
@@ -3084,6 +3091,7 @@ virQEMUCapsInitCPUModelX86(virQEMUCapsPtr qemuCaps,
virCPUDefPtr cpu,
bool migratable)
 {
+VIR_AUTOUNREF(virDomainCapsCPUModelsPtr) cpuModels = NULL;
 virCPUDataPtr data = NULL;
 int ret = -1;
 
@@ -3093,7 +3101,9 @@ virQEMUCapsInitCPUModelX86(virQEMUCapsPtr qemuCaps,
 if (!(data = virQEMUCapsGetCPUModelX86Data(qemuCaps, model, migratable)))
 goto cleanup;
 
-if (cpuDecode(cpu, data, virQEMUCapsGetCPUDefinitions(qemuCaps, type)) < 0)
+cpuModels = virQEMUCapsGetCPUDefinitions(qemuCaps, type);
+
+if (cpuDecode(cpu, data, cpuModels) < 0)
 goto cleanup;
 
 ret = 0;
@@ -3176,10 +3186,13 @@ virQEMUCapsInitHostCPUModel(virQEMUCapsPtr qemuCaps,
 if ((rc = virQEMUCapsInitCPUModel(qemuCaps, type, cpu, false)) < 0) {
 goto error;
 } else if (rc == 1) {
+VIR_AUTOUNREF(virDomainCapsCPUModelsPtr) cpuModels = NULL;
+
 VIR_DEBUG("No host CPU model info from QEMU; probing host CPU 
directly");
 
-hostCPU = virQEMUCapsProbeHostCPU(hostArch,
-  
virQEMUCapsGetCPUDefinitions(qemuCaps, type));
+cpuModels = virQEMUCapsGetCPUDefinitions(qemuCaps, type);
+hostCPU = virQEMUCapsProbeHostCPU(hostArch, cpuModels);
+
 if (!hostCPU ||
 virCPUDefCopyModelFilter(cpu, hostCPU, true,
  virQEMUCapsCPUFilterFeatures,
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 95fe844c34..9e681a22b3 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -13754,7 +13754,7 @@ qemuConnectBaselineHypervisorCPU(virConnectPtr conn,
 virQEMUCapsPtr qemuCaps = NULL;
 virArch arch;
 virDomainVirtType virttype;
-virDomainCapsCPUModelsPtr cpuModels;
+VIR_AUTOUNREF(virDomainCapsCPUModelsPtr) cpuModels = NULL;
 bool migratable;
 virCPUDefPtr cpu = NULL;
 char *cpustr = NULL;
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index a50cd54393..9405bdc3f9 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -6133,6 +6133,8 @@ qemuProcessUpdateGuestCPU(virDomainDefPtr def,
 
 /* nothing to update for host-passthrough */
 if (def->cpu->mode != VIR_CPU_MODE_HOST_PASSTHROUGH) {
+VIR_AUTOUNREF(virDomainCapsCPUModelsPtr) cpuModels = NULL;
+
 if (def->cpu->check == VIR_CPU_CHECK_PARTIAL &&
 virCPUCompare(caps->host.arch,
   virQEMUCapsGetHostModel(qemuCaps, def->virtType,
@@ -6145,8 +6147,9 @@ qemuProcessUpdateGuestCPU(virDomainDefPtr def,
  
VIR_QEMU_CAPS_HOST_CPU_MIGRATABLE)) < 0)
 return -1;
 
-if (virCPUTranslate(def->os.arch, def->cpu,
-virQEMUCapsGetCPUDefinitions(qemuCaps, 
def->virtType)) < 0)
+cpuModels = virQEMUCapsGetCPUDefinitions(qemuCaps, def->virtType);
+
+if (virCPUTranslate(def->os.arch, def->cpu, cpuModels) < 0)
 return -1;
 
 def->cpu->fallback = VIR_CPU_FALLBACK_FORBID;
diff --git a/tests/cputest.c b/tests/cputest.c
index 403d23b961..40b843dd8f 100644
--- a/tests/cputest.c
+++ b/tests/cputest.c
@@ -542,7 +542,6 @@ cpuTestGetCPUModels(const struct data *data,
 return -1;
 
 *models = virQEMUCapsGetCPUDefinitions(qemuCaps, VIR_DOMAIN_VIRT_KVM);
-virObjectRef(*models);
 
 virObjectUnref(qemuCaps);
 
-- 
2.23.0

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


[libvirt] [PATCH 08/11] build: drop the stdarg gnulib module

2019-10-03 Thread Daniel P . Berrangé
gnulib fixes a portability problem on AIX which is a platform we have
never targetted.

Signed-off-by: Daniel P. Berrangé 
---
 bootstrap.conf | 1 -
 1 file changed, 1 deletion(-)

diff --git a/bootstrap.conf b/bootstrap.conf
index 022f564134..257782a7b9 100644
--- a/bootstrap.conf
+++ b/bootstrap.conf
@@ -94,7 +94,6 @@ sigpipe
 snprintf
 socket
 stat-time
-stdarg
 strchrnul
 strdup-posix
 strndup
-- 
2.21.0

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

[libvirt] [PATCH 10/11] build: drop the perror gnulib module

2019-10-03 Thread Daniel P . Berrangé
This fixes a problem on mingw where it doesn't know how to report
certain errnos defined by POSIX, but not used on Windows. These are
not a real problem for libvirt.

Signed-off-by: Daniel P. Berrangé 
---
 bootstrap.conf | 1 -
 1 file changed, 1 deletion(-)

diff --git a/bootstrap.conf b/bootstrap.conf
index 617d9acb76..1f1c33f998 100644
--- a/bootstrap.conf
+++ b/bootstrap.conf
@@ -74,7 +74,6 @@ netdb
 nonblocking
 openpty
 passfd
-perror
 physmem
 pipe-posix
 pipe2
-- 
2.21.0

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [jenkins-ci PATCH 00/17] Meson, more meson!

2019-10-03 Thread Andrea Bolognani
On Tue, 2019-10-01 at 16:28 +0200, Fabiano Fidêncio wrote:
>   guests: CentOS7 provides python3
>   guests: Install EPEL on CentOS7
>   guests: Map python36-* CentOS7 packages
>   mappings: Mark the OSes where meson is not supported
>   guests: Add meson to the base project
>   mappings: Add ninja
>   guests: Add ninja to the base project
>   Deal with ninja x ninja-build bin names
>   guests: Keep base project's packages sorted

I'm going to push these patches (2-10) right away with the changes I
suggested squashed in, since they're not controversial and strictly
improve on the current situation.

-- 
Andrea Bolognani / Red Hat / Virtualization

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

[libvirt] [PATCH 11/11] build: drop the pthread gnulib module

2019-10-03 Thread Daniel P . Berrangé
This was fixing a problem with old versions of mingw which had a
pthread.h that polluted the namespace with random symbols. This is no
longer relevant on our mingw platform targets.

Signed-off-by: Daniel P. Berrangé 
---
 bootstrap.conf | 1 -
 1 file changed, 1 deletion(-)

diff --git a/bootstrap.conf b/bootstrap.conf
index 1f1c33f998..6120873397 100644
--- a/bootstrap.conf
+++ b/bootstrap.conf
@@ -79,7 +79,6 @@ pipe-posix
 pipe2
 poll
 posix-shell
-pthread
 pthread_sigmask
 recv
 regex
-- 
2.21.0

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

[libvirt] [PATCH 09/11] build: drop the gitlog-to-changelog gnulib module

2019-10-03 Thread Daniel P . Berrangé
The use of this script was discontinued when we stopped providing a full
ChangeLog in the dist with:

  commit ce97c33a795dec053f1e85c65ecd924b8c6ec4ba
  Author: Andrea Bolognani 
  Date:   Mon Apr 1 17:33:03 2019 +0200

maint: Stop generating ChangeLog from git

Signed-off-by: Daniel P. Berrangé 
---
 Makefile.am| 1 -
 bootstrap.conf | 1 -
 2 files changed, 2 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 711f365504..2cc4b91f9c 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -43,7 +43,6 @@ EXTRA_DIST = \
   AUTHORS.in \
   build-aux/augeas-gentest.pl \
   build-aux/check-spacing.pl \
-  build-aux/gitlog-to-changelog \
   build-aux/header-ifdef.pl \
   build-aux/minimize-po.pl \
   build-aux/mock-noinline.pl \
diff --git a/bootstrap.conf b/bootstrap.conf
index 257782a7b9..617d9acb76 100644
--- a/bootstrap.conf
+++ b/bootstrap.conf
@@ -54,7 +54,6 @@ getpass
 getpeername
 getsockname
 gettimeofday
-gitlog-to-changelog
 gnumakefile
 ignore-value
 intprops
-- 
2.21.0

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

[libvirt] [PATCH 07/11] build: drop the usleep gnulib module

2019-10-03 Thread Daniel P . Berrangé
The usleep function was missing on older mingw versions, but we can rely
on it existing everywhere these days.

Signed-off-by: Daniel P. Berrangé 
---
 bootstrap.conf | 1 -
 1 file changed, 1 deletion(-)

diff --git a/bootstrap.conf b/bootstrap.conf
index 09dcf78007..022f564134 100644
--- a/bootstrap.conf
+++ b/bootstrap.conf
@@ -112,7 +112,6 @@ ttyname_r
 uname
 unsetenv
 useless-if-before-free
-usleep
 vasprintf
 verify
 vc-list-files
-- 
2.21.0

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

[libvirt] [PATCH 03/11] build: drop the inet_pton gnulib module

2019-10-03 Thread Daniel P . Berrangé
All use of this function was purged a long time ago in favour
of getaddrinfo

  commit a8ae7d19f4ace62ff3f364c628cbc16baa9b080c
  Author: Daniel P. Berrange 
  Date:   Thu Oct 21 11:13:05 2010 +0100

Remove all use of inet_pton and inet_ntop

Signed-off-by: Daniel P. Berrangé 
---
 bootstrap.conf | 1 -
 1 file changed, 1 deletion(-)

diff --git a/bootstrap.conf b/bootstrap.conf
index 22f6153f3c..1fa0a38389 100644
--- a/bootstrap.conf
+++ b/bootstrap.conf
@@ -58,7 +58,6 @@ gettimeofday
 gitlog-to-changelog
 gnumakefile
 ignore-value
-inet_pton
 intprops
 ioctl
 isatty
-- 
2.21.0

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

[libvirt] [PATCH 02/11] build: drop the getopt-posix gnulib module

2019-10-03 Thread Daniel P . Berrangé
The getopt-posix module fixes a problem with optind being incorrectly
set after a failed option parse. This is not something that matters to
libvirt code.

Signed-off-by: Daniel P. Berrangé 
---
 bootstrap.conf | 1 -
 po/POTFILES| 1 -
 2 files changed, 2 deletions(-)

diff --git a/bootstrap.conf b/bootstrap.conf
index 4f944a9c23..22f6153f3c 100644
--- a/bootstrap.conf
+++ b/bootstrap.conf
@@ -51,7 +51,6 @@ fsync
 getaddrinfo
 getcwd-lgpl
 gethostname
-getopt-posix
 getpass
 getpeername
 getsockname
diff --git a/po/POTFILES b/po/POTFILES
index 35fc26c4b9..9385fc4e15 100644
--- a/po/POTFILES
+++ b/po/POTFILES
@@ -1,5 +1,4 @@
 gnulib/lib/gai_strerror.c
-gnulib/lib/getopt.c
 gnulib/lib/regcomp.c
 src/access/viraccessdriverpolkit.c
 src/access/viraccessmanager.c
-- 
2.21.0

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

[libvirt] [PATCH 06/11] Revert "build: use autobuild module to make build logs nicer"

2019-10-03 Thread Daniel P . Berrangé
This reverts commit 83aca30f1e8be524780a60b9dd8a14ec5f9de878.

While the motivation of the original commit is fine, we are intending to
drop autoconf in favour of meson, and similarly wish to drop use of
gnulib. Removing this feature is part of that conversion work.

Signed-off-by: Daniel P. Berrangé 
---
 bootstrap.conf | 1 -
 configure.ac   | 6 --
 2 files changed, 7 deletions(-)

diff --git a/bootstrap.conf b/bootstrap.conf
index 9ca1e6ddd7..09dcf78007 100644
--- a/bootstrap.conf
+++ b/bootstrap.conf
@@ -20,7 +20,6 @@
 gnulib_modules='
 accept
 areadlink
-autobuild
 base64
 bind
 bitrotate
diff --git a/configure.ac b/configure.ac
index af8cbcdfd8..ea4cd89733 100644
--- a/configure.ac
+++ b/configure.ac
@@ -123,12 +123,6 @@ AC_PROG_CC
 AC_PROG_INSTALL
 AC_PROG_CPP
 
-dnl Setting AB_VERSION makes the 'autobuild' lines of configure output
-dnl slightly more useful
-if test -d $srcdir/.git && git --version >/dev/null 2>&1 ; then
-  AB_VERSION=`cd $srcdir && git describe --match 'v[[0-9]]*' 2>/dev/null`
-fi
-
 dnl autoconf 2.70 adds a --runstatedir option so that downstreams
 dnl can point to /run instead of the historic /var/run, but
 dnl autoconf hasn't had a release since 2012.
-- 
2.21.0

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

[libvirt] [PATCH 05/11] util: drop the stpcpy gnulib module

2019-10-03 Thread Daniel P . Berrangé
stpcpy returns a pointer to the end of the string just copied
which in theory makes it easier to then copy another string
after it. We only use stpcpy in one place though and that
is trivially rewritten to avoid stpcpy with no less in code
clarity or efficiency.

Signed-off-by: Daniel P. Berrangé 
---
 bootstrap.conf  | 1 -
 src/util/virerror.c | 5 +++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/bootstrap.conf b/bootstrap.conf
index 9964231bb7..9ca1e6ddd7 100644
--- a/bootstrap.conf
+++ b/bootstrap.conf
@@ -96,7 +96,6 @@ snprintf
 socket
 stat-time
 stdarg
-stpcpy
 strchrnul
 strdup-posix
 strndup
diff --git a/src/util/virerror.c b/src/util/virerror.c
index 77f76a9abf..3bb9d1d32c 100644
--- a/src/util/virerror.c
+++ b/src/util/virerror.c
@@ -1367,8 +1367,9 @@ void virReportSystemErrorFull(int domcode,
 
 size_t len = strlen(errnoDetail);
 if (0 <= n && n + 2 + len < sizeof(msgDetailBuf)) {
-  char *p = msgDetailBuf + n;
-  stpcpy(stpcpy(p, ": "), errnoDetail);
+  strcpy(msgDetailBuf + n, ": ");
+  n += 2;
+  strcpy(msgDetailBuf + n, errnoDetail);
   msgDetail = msgDetailBuf;
 }
 }
-- 
2.21.0

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

[libvirt] [PATCH 01/11] bhyve: stop using private gnulib _getopt_internal_r func

2019-10-03 Thread Daniel P . Berrangé
The _getopt_internal_r func is not intended for public use, it is an
internal function shared between the gnulib getopt and argp modules.

Signed-off-by: Daniel P. Berrangé 
---
 src/bhyve/bhyve_parse_command.c | 88 +
 1 file changed, 46 insertions(+), 42 deletions(-)

diff --git a/src/bhyve/bhyve_parse_command.c b/src/bhyve/bhyve_parse_command.c
index 7d460e9824..0bfe17c08c 100644
--- a/src/bhyve/bhyve_parse_command.c
+++ b/src/bhyve/bhyve_parse_command.c
@@ -23,7 +23,6 @@
 
 #include 
 #include 
-#include 
 
 #include "bhyve_capabilities.h"
 #include "bhyve_command.h"
@@ -633,6 +632,14 @@ bhyveParseBhyvePCIArg(virDomainDefPtr def,
 return -1;
 }
 
+#define CONSUME_ARG(var) \
+if ((opti + 1) == argc) { \
+virReportError(VIR_ERR_INVALID_ARG, "Missing argument for '%s'", \
+   argv[opti]); \
+goto error; \
+} \
+var = argv[++opti]
+
 /*
  * Parse the /usr/sbin/bhyve command line.
  */
@@ -642,28 +649,24 @@ bhyveParseBhyveCommandLine(virDomainDefPtr def,
unsigned caps,
int argc, char **argv)
 {
-int c;
-const char optstr[] = "abehuwxACHIPSWYp:g:c:s:m:l:U:";
 int vcpus = 1;
 size_t memory = 0;
 unsigned nahcidisks = 0;
 unsigned nvirtiodisks = 0;
-struct _getopt_data *parser;
-
-if (!argv)
-goto error;
+size_t opti;
+const char *arg;
 
-if (VIR_ALLOC(parser) < 0)
-goto error;
+for (opti = 1; opti < argc; opti++) {
+if (argv[opti][0] != '-')
+break;
 
-while ((c = _getopt_internal_r(argc, argv, optstr,
-NULL, NULL, 0, parser, 0)) != -1) {
-switch (c) {
+switch (argv[opti][1]) {
 case 'A':
 def->features[VIR_DOMAIN_FEATURE_ACPI] = VIR_TRISTATE_SWITCH_ON;
 break;
 case 'c':
-if (virStrToLong_i(parser->optarg, NULL, 10, ) < 0) {
+CONSUME_ARG(arg);
+if (virStrToLong_i(arg, NULL, 10, ) < 0) {
 virReportError(VIR_ERR_OPERATION_FAILED, "%s",
_("Failed to parse number of vCPUs"));
 goto error;
@@ -674,20 +677,23 @@ bhyveParseBhyveCommandLine(virDomainDefPtr def,
 goto error;
 break;
 case 'l':
-if (bhyveParseBhyveLPCArg(def, caps, parser->optarg))
+CONSUME_ARG(arg);
+if (bhyveParseBhyveLPCArg(def, caps, arg))
 goto error;
 break;
 case 's':
+CONSUME_ARG(arg);
 if (bhyveParseBhyvePCIArg(def,
   xmlopt,
   caps,
   ,
   ,
-  parser->optarg))
+  arg))
 goto error;
 break;
 case 'm':
-if (bhyveParseMemsize(parser->optarg, )) {
+CONSUME_ARG(arg);
+if (bhyveParseMemsize(arg, )) {
 virReportError(VIR_ERR_OPERATION_FAILED, "%s",
_("Failed to parse memory"));
 goto error;
@@ -709,19 +715,23 @@ bhyveParseBhyveCommandLine(virDomainDefPtr def,
 def->clock.offset = VIR_DOMAIN_CLOCK_OFFSET_UTC;
 break;
 case 'U':
-if (virUUIDParse(parser->optarg, def->uuid) < 0) {
+CONSUME_ARG(arg);
+if (virUUIDParse(arg, def->uuid) < 0) {
 virReportError(VIR_ERR_INTERNAL_ERROR,
-   _("Cannot parse UUID '%s'"), parser->optarg);
+   _("Cannot parse UUID '%s'"), arg);
 goto error;
 }
 break;
 case 'S':
 def->mem.locked = true;
 break;
+case 'p':
+case 'g':
+CONSUME_ARG(arg);
 }
 }
 
-if (argc != parser->optind) {
+if (argc != opti) {
 virReportError(VIR_ERR_OPERATION_FAILED, "%s",
_("Failed to parse arguments for bhyve command"));
 goto error;
@@ -738,11 +748,9 @@ bhyveParseBhyveCommandLine(virDomainDefPtr def,
 goto error;
 }
 
-VIR_FREE(parser);
 return 0;
 
  error:
-VIR_FREE(parser);
 return -1;
 }
 
@@ -753,42 +761,38 @@ static int
 bhyveParseBhyveLoadCommandLine(virDomainDefPtr def,
int argc, char **argv)
 {
-int c;
 /* bhyveload called with default arguments when only -m and -d are given.
  * Store this in a bit field and check if only those two options are given
  * later */
 unsigned arguments = 0;
 size_t memory = 0;
-struct _getopt_data *parser;
 size_t i = 0;
 int ret = -1;
+size_t opti;
+const char *arg;
 
-const char optstr[] = "CSc:d:e:h:l:m:";
-
-if (!argv)
-

[libvirt] [PATCH 04/11] build: drop the mktempd gnulib module

2019-10-03 Thread Daniel P . Berrangé
The mktempd module in gnulib provides an equivalent to 'mktemp -d' on
platforms which lack this shell command. All platforms on which libvirt
runs the affected tests have 'mktemp -d' support, so the gnulib module
is not required.

Signed-off-by: Daniel P. Berrangé 
---
 bootstrap.conf| 1 -
 tests/test-lib.sh | 3 +--
 2 files changed, 1 insertion(+), 3 deletions(-)

diff --git a/bootstrap.conf b/bootstrap.conf
index 1fa0a38389..9964231bb7 100644
--- a/bootstrap.conf
+++ b/bootstrap.conf
@@ -71,7 +71,6 @@ mgetgroups
 mkdtemp
 mkostemp
 mkostemps
-mktempd
 net_if
 netdb
 nonblocking
diff --git a/tests/test-lib.sh b/tests/test-lib.sh
index ef5a47b565..c19005a371 100644
--- a/tests/test-lib.sh
+++ b/tests/test-lib.sh
@@ -256,8 +256,7 @@ fi
 # a partition, or to undo any other global state changes.
 cleanup_() { :; }
 
-mktempd="$abs_top_srcdir/build-aux/mktempd"
-t_=$("$SHELL" "$mktempd" "$test_dir_" lv-$this_test.XX) \
+t_=$("mktemp" "-d" "$test_dir_/lv-$this_test.XX") \
 || error_ "failed to create temporary directory in $test_dir_"
 
 # Run each test from within a temporary sub-directory named after the
-- 
2.21.0

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

[libvirt] [PATCH 00/11] build: eliminate many redundant/obsolete gnulib modules

2019-10-03 Thread Daniel P . Berrangé
The modues in this series are either obsolete (problems now fixed), or
redundant (fixing problems we never cared about - hello AIX
portability), or trivially replaced.

Daniel P. Berrangé (11):
  bhyve: stop using private gnulib _getopt_internal_r func
  build: drop the getopt-posix gnulib module
  build: drop the inet_pton gnulib module
  build: drop the mktempd gnulib module
  util: drop the stpcpy gnulib module
  Revert "build: use autobuild module to make build logs nicer"
  build: drop the usleep gnulib module
  build: drop the stdarg gnulib module
  build: drop the gitlog-to-changelog gnulib module
  build: drop the perror gnulib module
  build: drop the pthread gnulib module

 Makefile.am |  1 -
 bootstrap.conf  | 10 
 configure.ac|  6 ---
 po/POTFILES |  1 -
 src/bhyve/bhyve_parse_command.c | 88 +
 src/util/virerror.c |  5 +-
 tests/test-lib.sh   |  3 +-
 7 files changed, 50 insertions(+), 64 deletions(-)

-- 
2.21.0

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

[libvirt] [PATCH] qemu: capabilities: Fill in bochs-display info

2019-10-03 Thread Fabiano Fidêncio
086c19d69 added bochs-display capability but didn't fill in the info for
domain capabilities.

Signed-off-by: Fabiano Fidêncio 
---
 src/qemu/qemu_capabilities.c | 2 ++
 tests/domaincapsschemadata/qemu_3.1.0.x86_64.xml | 1 +
 tests/domaincapsschemadata/qemu_4.0.0.x86_64.xml | 1 +
 tests/domaincapsschemadata/qemu_4.1.0.x86_64.xml | 1 +
 tests/domaincapsschemadata/qemu_4.2.0.x86_64.xml | 1 +
 5 files changed, 6 insertions(+)

diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index 3b50576a2b..d0b789bbea 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -5357,6 +5357,8 @@ virQEMUCapsFillDomainDeviceVideoCaps(virQEMUCapsPtr 
qemuCaps,
 VIR_DOMAIN_CAPS_ENUM_SET(dev->modelType, VIR_DOMAIN_VIDEO_TYPE_QXL);
 if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VIRTIO_GPU))
 VIR_DOMAIN_CAPS_ENUM_SET(dev->modelType, VIR_DOMAIN_VIDEO_TYPE_VIRTIO);
+if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_BOCHS_DISPLAY))
+VIR_DOMAIN_CAPS_ENUM_SET(dev->modelType, VIR_DOMAIN_VIDEO_TYPE_BOCHS);
 
 return 0;
 }
diff --git a/tests/domaincapsschemadata/qemu_3.1.0.x86_64.xml 
b/tests/domaincapsschemadata/qemu_3.1.0.x86_64.xml
index 402848442f..059403cebc 100644
--- a/tests/domaincapsschemadata/qemu_3.1.0.x86_64.xml
+++ b/tests/domaincapsschemadata/qemu_3.1.0.x86_64.xml
@@ -127,6 +127,7 @@
 vmvga
 qxl
 virtio
+bochs
   
 
 
diff --git a/tests/domaincapsschemadata/qemu_4.0.0.x86_64.xml 
b/tests/domaincapsschemadata/qemu_4.0.0.x86_64.xml
index 1ffd5e3cc0..eb24b9a604 100644
--- a/tests/domaincapsschemadata/qemu_4.0.0.x86_64.xml
+++ b/tests/domaincapsschemadata/qemu_4.0.0.x86_64.xml
@@ -127,6 +127,7 @@
 vmvga
 qxl
 virtio
+bochs
   
 
 
diff --git a/tests/domaincapsschemadata/qemu_4.1.0.x86_64.xml 
b/tests/domaincapsschemadata/qemu_4.1.0.x86_64.xml
index 79b41ef6da..f5685d2068 100644
--- a/tests/domaincapsschemadata/qemu_4.1.0.x86_64.xml
+++ b/tests/domaincapsschemadata/qemu_4.1.0.x86_64.xml
@@ -131,6 +131,7 @@
 vmvga
 qxl
 virtio
+bochs
   
 
 
diff --git a/tests/domaincapsschemadata/qemu_4.2.0.x86_64.xml 
b/tests/domaincapsschemadata/qemu_4.2.0.x86_64.xml
index 6bdeb20479..5bd376bb2e 100644
--- a/tests/domaincapsschemadata/qemu_4.2.0.x86_64.xml
+++ b/tests/domaincapsschemadata/qemu_4.2.0.x86_64.xml
@@ -131,6 +131,7 @@
 vmvga
 qxl
 virtio
+bochs
   
 
 
-- 
2.23.0

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [jenkins-ci PATCH 17/17] Switch libvirt-dbus builds to meson

2019-10-03 Thread Andrea Bolognani
On Tue, 2019-10-01 at 16:28 +0200, Fabiano Fidêncio wrote:
> +++ b/guests/playbooks/build/projects/libvirt-dbus.yml
> +- include: '{{ playbook_base }}/jobs/meson-check-job.yml'
>vars:
>  # CentOS 7 doesn't include Python 3, while the versions of flake8
>  # and pyflakes currently available on FreeBSD (3.5.0 and 2.0.0
>  # respectively) are not compatible
> +# Python 3 version in Ubuntu 16.04 is too old

The part of the comment talking about CentOS 7 is clearly no longer
accurate, so we either need to enable this job on the target or leave
it disabled but update the comment to point out the current reason we
need to do so.

> +++ b/jenkins/projects/libvirt-dbus.yaml
> +  - meson-check-job:
>parent_jobs: 'libvirt-dbus-build'
># CentOS 7 doesn't include Python 3, while the versions of flake8
># and pyflakes currently available on FreeBSD (3.5.0 and 2.0.0

The comments has not been updated here.

I know that mentioning Ubuntu is technically not necessary here
because we don't (yet) have any Ubuntu builder in our CentOS CI
environment, but despite that I prefer keeping everything, even the
comments, in sync between the Ansible and Jenkins parts.

With the comment fixed and propagated to the Jenkins part,

  Reviewed-by: Andrea Bolognani 

-- 
Andrea Bolognani / Red Hat / Virtualization

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [jenkins-ci PATCH 16/17] osinfo-db: Build again on all machines

2019-10-03 Thread Andrea Bolognani
On Tue, 2019-10-01 at 16:28 +0200, Fabiano Fidêncio wrote:
> As now we've the needed packages for building and testing osinfo-db
> on all systems supported by libvirt-jenkins-ci, let's just build
> osinfo-db everywhere.
> 
> Signed-off-by: Fabiano Fidêncio 
> ---
>  guests/playbooks/build/projects/osinfo-db.yml | 14 +-
>  jenkins/projects/osinfo-db.yaml   | 10 +-
>  2 files changed, 2 insertions(+), 22 deletions(-)

Here you need to add osinfo-db back to the various

  guests/host_vars/*/main.yml

because they have been, correctly, removed in the meantime.

> +++ b/jenkins/projects/osinfo-db.yaml
> @@ -13,15 +13,7 @@
>  $MAKE install OSINFO_DB_TARGET="--system"
>- generic-check-job:
>parent_jobs: 'osinfo-db-build'
> -  # osinfo-db tests are Python 3 only, so they can't be ran on 
> CentOS 7;
> -  machines:
> -- libvirt-debian-9
> -- libvirt-debian-10
> -- libvirt-fedora-29
> -- libvirt-fedora-30
> -- libvirt-fedora-rawhide
> -- libvirt-freebsd-11
> -- libvirt-freebsd-12
> +  machines: '{{ all_machines }}'

Once again the syntax for the Jenkins part is wrong.

Moreover, you're only changing the list of machines for the check
job, but you should change the one in the top level instead, because
now we can both build and check everywhere; notably, trying to do
the latter without doing the former will certainly not work :)

One last point: in the case of osinfo-db, which doesn't use Meson as
its build system, we should now be able to build RPMs on all
RPM-based operating systems.

With all of the above addressed,

  Reviewed-by: Andrea Bolognani 

Your series is missing one more patch after this one, which does the
same as the last few patches but for virt-manager.

I think the test suite still can't work on CentOS 7 because it uses
python3-libxml2 which is not present there - maybe it should be
ported to python3-lxml? - but we should be able to at least build on
that target, and other targets that got their virt-manager jobs
disabled only on account of not having libosinfo can now have them
fully restored.

-- 
Andrea Bolognani / Red Hat / Virtualization

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

[libvirt] [PATCH v2] dirty-bitmaps: remove deprecated autoload parameter

2019-10-03 Thread John Snow
This parameter has been deprecated since 2.12.0 and is eligible for
removal. Remove this parameter as it is actually completely ignored;
let's not give false hope.

Signed-off-by: John Snow 
Reviewed-by: Eric Blake 
Reviewed-by: Vladimir Sementsov-Ogievskiy 
---
V2: Change 2.12.0 -> 4.2.0 in removed section.
Adjust phrasing to match.

 qemu-deprecated.texi | 20 +++-
 qapi/block-core.json |  6 +-
 blockdev.c   |  6 --
 3 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/qemu-deprecated.texi b/qemu-deprecated.texi
index 01245e0b1c..d60246d5d6 100644
--- a/qemu-deprecated.texi
+++ b/qemu-deprecated.texi
@@ -149,11 +149,6 @@ QEMU 4.1 has three options, please migrate to one of these 
three:
 
 @section QEMU Machine Protocol (QMP) commands
 
-@subsection block-dirty-bitmap-add "autoload" parameter (since 2.12.0)
-
-"autoload" parameter is now ignored. All bitmaps are automatically loaded
-from qcow2 images.
-
 @subsection query-block result field dirty-bitmaps[i].status (since 4.0)
 
 The ``status'' field of the ``BlockDirtyInfo'' structure, returned by
@@ -356,3 +351,18 @@ existing CPU models.  Management software that needs 
runnability
 guarantees must resolve the CPU model aliases using te
 ``alias-of'' field returned by the ``query-cpu-definitions'' QMP
 command.
+
+
+@node Recently removed features
+@appendix Recently removed features
+
+What follows is a record of recently removed, formerly deprecated
+features that serves as a record for users who have encountered
+trouble after a recent upgrade.
+
+@section QEMU Machine Protocol (QMP) commands
+
+@subsection block-dirty-bitmap-add "autoload" parameter (since 2.12.0)
+
+"autoload" parameter is now ignored. All bitmaps are automatically loaded
+from qcow2 images.
diff --git a/qapi/block-core.json b/qapi/block-core.json
index e6edd641f1..e4975ece4a 100644
--- a/qapi/block-core.json
+++ b/qapi/block-core.json
@@ -1987,10 +1987,6 @@
 #  Qcow2 disks support persistent bitmaps. Default is false for
 #  block-dirty-bitmap-add. (Since: 2.10)
 #
-# @autoload: ignored and deprecated since 2.12.
-#Currently, all dirty tracking bitmaps are loaded from Qcow2 on
-#open.
-#
 # @disabled: the bitmap is created in the disabled state, which means that
 #it will not track drive changes. The bitmap may be enabled with
 #block-dirty-bitmap-enable. Default is false. (Since: 4.0)
@@ -1999,7 +1995,7 @@
 ##
 { 'struct': 'BlockDirtyBitmapAdd',
   'data': { 'node': 'str', 'name': 'str', '*granularity': 'uint32',
-'*persistent': 'bool', '*autoload': 'bool', '*disabled': 'bool' } }
+'*persistent': 'bool', '*disabled': 'bool' } }
 
 ##
 # @BlockDirtyBitmapMergeSource:
diff --git a/blockdev.c b/blockdev.c
index fbef6845c8..93804da840 100644
--- a/blockdev.c
+++ b/blockdev.c
@@ -1966,7 +1966,6 @@ static void block_dirty_bitmap_add_prepare(BlkActionState 
*common,
 qmp_block_dirty_bitmap_add(action->node, action->name,
action->has_granularity, action->granularity,
action->has_persistent, action->persistent,
-   action->has_autoload, action->autoload,
action->has_disabled, action->disabled,
_err);
 
@@ -2858,7 +2857,6 @@ out:
 void qmp_block_dirty_bitmap_add(const char *node, const char *name,
 bool has_granularity, uint32_t granularity,
 bool has_persistent, bool persistent,
-bool has_autoload, bool autoload,
 bool has_disabled, bool disabled,
 Error **errp)
 {
@@ -2890,10 +2888,6 @@ void qmp_block_dirty_bitmap_add(const char *node, const 
char *name,
 persistent = false;
 }
 
-if (has_autoload) {
-warn_report("Autoload option is deprecated and its value is ignored");
-}
-
 if (!has_disabled) {
 disabled = false;
 }
-- 
2.21.0

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


[libvirt] [PATCH v3] dirty-bitmaps: remove deprecated autoload parameter

2019-10-03 Thread John Snow
This parameter has been deprecated since 2.12.0 and is eligible for
removal. Remove this parameter as it is actually completely ignored;
let's not give false hope.

Signed-off-by: John Snow 
Reviewed-by: Eric Blake 
Reviewed-by: Vladimir Sementsov-Ogievskiy 
---
V2: Change 2.12.0 -> 4.2.0 in removed section.
Adjust phrasing to match.

 qemu-deprecated.texi | 20 +++-
 qapi/block-core.json |  6 +-
 blockdev.c   |  6 --
 3 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/qemu-deprecated.texi b/qemu-deprecated.texi
index 01245e0b1c..7239e0959d 100644
--- a/qemu-deprecated.texi
+++ b/qemu-deprecated.texi
@@ -149,11 +149,6 @@ QEMU 4.1 has three options, please migrate to one of these 
three:
 
 @section QEMU Machine Protocol (QMP) commands
 
-@subsection block-dirty-bitmap-add "autoload" parameter (since 2.12.0)
-
-"autoload" parameter is now ignored. All bitmaps are automatically loaded
-from qcow2 images.
-
 @subsection query-block result field dirty-bitmaps[i].status (since 4.0)
 
 The ``status'' field of the ``BlockDirtyInfo'' structure, returned by
@@ -356,3 +351,18 @@ existing CPU models.  Management software that needs 
runnability
 guarantees must resolve the CPU model aliases using te
 ``alias-of'' field returned by the ``query-cpu-definitions'' QMP
 command.
+
+
+@node Recently removed features
+@appendix Recently removed features
+
+What follows is a record of recently removed, formerly deprecated
+features that serves as a record for users who have encountered
+trouble after a recent upgrade.
+
+@section QEMU Machine Protocol (QMP) commands
+
+@subsection block-dirty-bitmap-add "autoload" parameter (since 4.2.0)
+
+The "autoload" parameter has been ignored since 2.12.0. All bitmaps
+are automatically loaded from qcow2 images.
diff --git a/qapi/block-core.json b/qapi/block-core.json
index e6edd641f1..e4975ece4a 100644
--- a/qapi/block-core.json
+++ b/qapi/block-core.json
@@ -1987,10 +1987,6 @@
 #  Qcow2 disks support persistent bitmaps. Default is false for
 #  block-dirty-bitmap-add. (Since: 2.10)
 #
-# @autoload: ignored and deprecated since 2.12.
-#Currently, all dirty tracking bitmaps are loaded from Qcow2 on
-#open.
-#
 # @disabled: the bitmap is created in the disabled state, which means that
 #it will not track drive changes. The bitmap may be enabled with
 #block-dirty-bitmap-enable. Default is false. (Since: 4.0)
@@ -1999,7 +1995,7 @@
 ##
 { 'struct': 'BlockDirtyBitmapAdd',
   'data': { 'node': 'str', 'name': 'str', '*granularity': 'uint32',
-'*persistent': 'bool', '*autoload': 'bool', '*disabled': 'bool' } }
+'*persistent': 'bool', '*disabled': 'bool' } }
 
 ##
 # @BlockDirtyBitmapMergeSource:
diff --git a/blockdev.c b/blockdev.c
index fbef6845c8..93804da840 100644
--- a/blockdev.c
+++ b/blockdev.c
@@ -1966,7 +1966,6 @@ static void block_dirty_bitmap_add_prepare(BlkActionState 
*common,
 qmp_block_dirty_bitmap_add(action->node, action->name,
action->has_granularity, action->granularity,
action->has_persistent, action->persistent,
-   action->has_autoload, action->autoload,
action->has_disabled, action->disabled,
_err);
 
@@ -2858,7 +2857,6 @@ out:
 void qmp_block_dirty_bitmap_add(const char *node, const char *name,
 bool has_granularity, uint32_t granularity,
 bool has_persistent, bool persistent,
-bool has_autoload, bool autoload,
 bool has_disabled, bool disabled,
 Error **errp)
 {
@@ -2890,10 +2888,6 @@ void qmp_block_dirty_bitmap_add(const char *node, const 
char *name,
 persistent = false;
 }
 
-if (has_autoload) {
-warn_report("Autoload option is deprecated and its value is ignored");
-}
-
 if (!has_disabled) {
 disabled = false;
 }
-- 
2.21.0

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [libvirt] [PATCH v2] dirty-bitmaps: remove deprecated autoload parameter

2019-10-03 Thread John Snow



On 10/2/19 7:22 PM, John Snow wrote:
> This parameter has been deprecated since 2.12.0 and is eligible for
> removal. Remove this parameter as it is actually completely ignored;
> let's not give false hope.
> 
> Signed-off-by: John Snow 
> Reviewed-by: Eric Blake 
> Reviewed-by: Vladimir Sementsov-Ogievskiy 

bah, NACK; I didn't commit the changes I made.

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [libvirt] [PATCH] virsh: fixed handling of targetless disks (e.g. empty CDROM) in 'domblkinfo' cmd

2019-10-03 Thread Pavel Mores
On Thu, Oct 03, 2019 at 01:09:55PM +0200, Pavel Mores wrote:
> On Thu, Oct 03, 2019 at 11:54:44AM +0200, Ján Tomko wrote:
> > On Wed, Oct 02, 2019 at 04:21:52PM +0200, Pavel Mores wrote:
> > > On Wed, Oct 02, 2019 at 08:34:10AM -0300, Daniel Henrique Barboza wrote:
> > > > 
> > > > 
> > > > On 10/1/19 11:45 AM, Pavel Mores wrote:
> > > > > virDomainGetBlockInfo() returns error if called on a disk with no 
> > > > > target
> > > > > (a targetless disk might be a removable media drive with no media in 
> > > > > it,
> > > > > for instance an empty CDROM drive).
> > > > >
> > > > > So far this caused the virsh domblkinfo --all command to abort and 
> > > > > ignore
> > > > > any remaining (not yet displayed) disk devices.  This patch fixes it 
> > > > > by
> > > > > ignoring virDomainGetBlockInfo() errors for CDROM and floppy drives,
> > > > > similar to how it's done for network drives.
> > > > >
> > > > > https://bugzilla.redhat.com/show_bug.cgi?id=1619625
> > > > >
> > > > > Signed-off-by: Pavel Mores 
> > > > > ---
> > > > >   tools/virsh-domain-monitor.c | 11 +++
> > > > >   1 file changed, 11 insertions(+)
> > > > >
> > > > > diff --git a/tools/virsh-domain-monitor.c 
> > > > > b/tools/virsh-domain-monitor.c
> > > > > index 0e2c4191d7..0f495c1a3f 100644
> > > > > --- a/tools/virsh-domain-monitor.c
> > > > > +++ b/tools/virsh-domain-monitor.c
> > > > > @@ -473,6 +473,7 @@ cmdDomblkinfo(vshControl *ctl, const vshCmd *cmd)
> > > > >   char *cap = NULL;
> > > > >   char *alloc = NULL;
> > > > >   char *phy = NULL;
> > > > > +char *device_type = NULL;
> > > > 
> > > > I believe you need to use VIR_AUTO(char *) here. Even considering that
> > > > the macro will be deprecated in the near future for glib stuff, by using
> > > > VIR_AUTO here:
> > > > 
> > > > - you'll make it easier to introduce the glib replacement, since
> > > > s/VIR_AUTO/ is a trivial change;
> > > > 
> > > > - you won't be adding more VIR_FREE() on top of existing cases that will
> > > > need to be addressed in the future.
> > > 
> > > Was that the consensus from the migration debate?  If so I'm happy to fix 
> > > my
> > > patch.
> > 
> > IIUC the consensus was that we will switch to g_auto eventually,
> > but it's a simple string replace that will be dealt with by whoever
> > pushes the patch.
> > 
> > Also, if you go with any of the two approaches I suggested (ignoring all
> > errors or using the XPathBoolean), you don't need to introduce a new
> > allocated variable
> 
> Cool, so if there aren't any objections, I'll implement the XPathBoolean
> variant and submit v2.

As it turns out, the thing with the virDomainGetBlockInfo() call is that even
if it fails, it does initialise the virDomainBlockInfo structure enough to be
displayed in the table (even if just as a target name and dashes).

It follows apparently that if we go the virXPathBoolean() way and skip the
virDomainGetBlockInfo() call, we can't show the sourceless device at all, we
can't even indicate that it exists.

Is that acceptable?  Or is there another way to fill in virDomainBlockInfo?

Thanks,

pvl

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [libvirt] [jenkins-ci PATCH 15/17] libosinfo: Build again on all machines

2019-10-03 Thread Andrea Bolognani
On Tue, 2019-10-01 at 16:28 +0200, Fabiano Fidêncio wrote:
> As now we've the needed packages for building and testing libosinfo
> on all systems supported by libvirt-jenkins-ci, let's just build
> libosinfo everywhere.
> 
> RPM build is still not possible in CentOS7 as it doesn't have the
> needed RPM macros for Meson.
> 
> Signed-off-by: Fabiano Fidêncio 
> ---
>  guests/host_vars/libvirt-centos-7/main.yml|  1 +
>  guests/host_vars/libvirt-debian-9/main.yml|  1 +
>  guests/host_vars/libvirt-ubuntu-16/main.yml   |  1 +
>  guests/host_vars/libvirt-ubuntu-18/main.yml   |  1 +
>  guests/playbooks/build/projects/libosinfo.yml | 12 +---
>  jenkins/projects/libosinfo.yaml   |  8 +---
>  6 files changed, 6 insertions(+), 18 deletions(-)

The same comments about merge conflicts and lack of comments made
for the previous patch apply to this one as well.

Additionally, the order in which you're restoring these jobs is
arguably wrong: it should be osinfo-db-tools, osinfo-db and then
libosinfo, not osinfo-db-tools, libosinfo and then osinfo-db. Easy
enough to shuffle them around :)

> +++ b/jenkins/projects/libosinfo.yaml
> @@ -3,13 +3,7 @@
>  name: libosinfo
>  # libosinfo depends on meson 0.49.0, which is not available on
>  # CentOS 7, Debian 9, Ubuntu 18;
> -machines:
> -  - libvirt-debian-10
> -  - libvirt-fedora-29
> -  - libvirt-fedora-30
> -  - libvirt-fedora-rawhide
> -  - libvirt-freebsd-11
> -  - libvirt-freebsd-12
> +machines: '{{ all_machines }}'

You forgot to remove the comment here, and also once again got the
Jenkins syntax wrong.

With the issues highlighted above fixed,

  Reviewed-by: Andrea Bolognani 

-- 
Andrea Bolognani / Red Hat / Virtualization

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [PATCH] virsh: fixed handling of targetless disks (e.g. empty CDROM) in 'domblkinfo' cmd

2019-10-03 Thread Pavel Mores
On Thu, Oct 03, 2019 at 11:54:44AM +0200, Ján Tomko wrote:
> On Wed, Oct 02, 2019 at 04:21:52PM +0200, Pavel Mores wrote:
> > On Wed, Oct 02, 2019 at 08:34:10AM -0300, Daniel Henrique Barboza wrote:
> > > 
> > > 
> > > On 10/1/19 11:45 AM, Pavel Mores wrote:
> > > > virDomainGetBlockInfo() returns error if called on a disk with no target
> > > > (a targetless disk might be a removable media drive with no media in it,
> > > > for instance an empty CDROM drive).
> > > >
> > > > So far this caused the virsh domblkinfo --all command to abort and 
> > > > ignore
> > > > any remaining (not yet displayed) disk devices.  This patch fixes it by
> > > > ignoring virDomainGetBlockInfo() errors for CDROM and floppy drives,
> > > > similar to how it's done for network drives.
> > > >
> > > > https://bugzilla.redhat.com/show_bug.cgi?id=1619625
> > > >
> > > > Signed-off-by: Pavel Mores 
> > > > ---
> > > >   tools/virsh-domain-monitor.c | 11 +++
> > > >   1 file changed, 11 insertions(+)
> > > >
> > > > diff --git a/tools/virsh-domain-monitor.c b/tools/virsh-domain-monitor.c
> > > > index 0e2c4191d7..0f495c1a3f 100644
> > > > --- a/tools/virsh-domain-monitor.c
> > > > +++ b/tools/virsh-domain-monitor.c
> > > > @@ -473,6 +473,7 @@ cmdDomblkinfo(vshControl *ctl, const vshCmd *cmd)
> > > >   char *cap = NULL;
> > > >   char *alloc = NULL;
> > > >   char *phy = NULL;
> > > > +char *device_type = NULL;
> > > 
> > > I believe you need to use VIR_AUTO(char *) here. Even considering that
> > > the macro will be deprecated in the near future for glib stuff, by using
> > > VIR_AUTO here:
> > > 
> > > - you'll make it easier to introduce the glib replacement, since
> > > s/VIR_AUTO/ is a trivial change;
> > > 
> > > - you won't be adding more VIR_FREE() on top of existing cases that will
> > > need to be addressed in the future.
> > 
> > Was that the consensus from the migration debate?  If so I'm happy to fix my
> > patch.
> 
> IIUC the consensus was that we will switch to g_auto eventually,
> but it's a simple string replace that will be dealt with by whoever
> pushes the patch.
> 
> Also, if you go with any of the two approaches I suggested (ignoring all
> errors or using the XPathBoolean), you don't need to introduce a new
> allocated variable

Cool, so if there aren't any objections, I'll implement the XPathBoolean
variant and submit v2.

pvl

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [libvirt] [jenkins-ci PATCH 14/17] osinfo-db-tools: Build again on all machines

2019-10-03 Thread Andrea Bolognani
On Tue, 2019-10-01 at 16:28 +0200, Fabiano Fidêncio wrote:
> As now we've the needed packages for building and testing
> osinfo-db-tools on all systems supported by libvirt-jenkins-ci, let's
> just build osinfo-db-tools everywhere.
> 
> RPM build is still not possible in CentOS7 as it doesn't have the
> needed RPM macros for Meson.

I think it would be a good idea to document this fact right in the
corresponding file with a comment, same as we've done with other
cases where we had to exclude a specific target platform from a
build job for one reason or another.

> +++ b/guests/host_vars/libvirt-centos-7/main.yml
> @@ -8,6 +8,7 @@ projects:
>- libvirt-perl
>- libvirt-python
>- osinfo-db
> +  - osinfo-db-tools
>- virt-viewer

This (and the similar changes made to other files) will conflict with
recent fixes I've pushed, but addressing that is trivial.

> +++ b/jenkins/projects/osinfo-db-tools.yaml
> @@ -1,15 +1,7 @@
>  ---
>  - project:
>  name: osinfo-db-tools
> -# osinfo-db-tools requires meson 0.49.0, which is not available on
> -# CentOS 7 and Debian 9;
> -machines:
> -  - libvirt-debian-10
> -  - libvirt-fedora-29
> -  - libvirt-fedora-30
> -  - libvirt-fedora-rawhide
> -  - libvirt-freebsd-11
> -  - libvirt-freebsd-12
> +machines: '{{ all_machines }}'

For the Jenkins part you need to use

  machines: '{all_machines}'

or it won't work.

With that fixed and a comment about RPM macros added,

  Reviewed-by: Andrea Bolognani 

-- 
Andrea Bolognani / Red Hat / Virtualization

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

[libvirt] [PATCH 0/4] build: take full ownership of syntax-check from gnulib

2019-10-03 Thread Daniel P . Berrangé
Our syntax-check rule relies in various files imported during the gnulib
bootstrap process. As we switch to meson & try to eliminate gnulib, we
need to take ownership of syntax-check.

This patch series follows the approach taken for libosinfo & other
projects wrt syntax-check rules, but goes a step further and eliminates
alot of baggage we don't care about & merges all logic into one file.

Daniel P. Berrangé (4):
  build: import gnulib's syntax-check make rules
  build: remove all logic unrelated to syntax-check
  build: delete all syntax check rules we're skipping
  build: merge all syntax-check logic into one file

 Makefile.am |7 +-
 bootstrap.conf  |4 -
 cfg.mk => build-aux/syntax-check.mk | 1141 +--
 build-aux/useless-if-before-free|  226 ++
 build-aux/vc-list-files |  113 +++
 5 files changed, 1411 insertions(+), 80 deletions(-)
 rename cfg.mk => build-aux/syntax-check.mk (52%)
 create mode 100755 build-aux/useless-if-before-free
 create mode 100755 build-aux/vc-list-files

-- 
2.21.0

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

[libvirt] [PATCH 4/4] build: merge all syntax-check logic into one file

2019-10-03 Thread Daniel P . Berrangé
The gnulib syntax-check rules are spread across GNUmakefile, cfg.mk and
maint.mk. This made sense when we were getting two of the files from the
gnulib submodule. Now that we own all files though, we can merge them
into one.

Signed-off-by: Daniel P. Berrangé 
---
 Makefile.am   |6 +-
 build-aux/GNUmakefile |  109 ---
 build-aux/maint.mk| 1036 
 build-aux/{cfg.mk => syntax-check.mk} | 1079 -
 4 files changed, 1056 insertions(+), 1174 deletions(-)
 delete mode 100644 build-aux/GNUmakefile
 delete mode 100644 build-aux/maint.mk
 rename build-aux/{cfg.mk => syntax-check.mk} (53%)

diff --git a/Makefile.am b/Makefile.am
index 2a28d53591..4896bee718 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -41,15 +41,13 @@ EXTRA_DIST = \
   README.md \
   AUTHORS.in \
   build-aux/augeas-gentest.pl \
-  build-aux/cfg.mk \
   build-aux/check-spacing.pl \
   build-aux/gitlog-to-changelog \
-  build-aux/GNUmakefile \
   build-aux/header-ifdef.pl \
-  build-aux/maint.mk \
   build-aux/minimize-po.pl \
   build-aux/mock-noinline.pl \
   build-aux/prohibit-duplicate-header.pl \
+  build-aux/syntax-check.mk \
   build-aux/useless-if-before-free \
   build-aux/vc-list-files \
   ci/Makefile \
@@ -87,7 +85,7 @@ srpm: clean
@(unset CDPATH ; $(MAKE) dist && rpmbuild -ts $(distdir).tar.xz)
 
 syntax-check:
-   @make -C $(srcdir)/build-aux syntax-check \
+   @make -C $(srcdir)/build-aux -f syntax-check.mk syntax-check \
abs_top_builddir=$(abs_top_builddir) \
FLAKE8=$(FLAKE8)
 
diff --git a/build-aux/GNUmakefile b/build-aux/GNUmakefile
deleted file mode 100644
index 63ab845f1b..00
--- a/build-aux/GNUmakefile
+++ /dev/null
@@ -1,109 +0,0 @@
-# Having a separate GNUmakefile lets me `include' the dynamically
-# generated rules created via cfg.mk (package-local configuration)
-# as well as maint.mk (generic maintainer rules).
-# This makefile is used only if you run GNU Make.
-# It is necessary if you want to build targets usually of interest
-# only to the maintainer.
-
-# Copyright (C) 2001, 2003, 2006-2011 Free Software Foundation, Inc.
-
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program.  If not, see .
-
-# Systems where /bin/sh is not the default shell need this.  The $(shell)
-# command below won't work with e.g. stock DOS/Windows shells.
-ifeq ($(wildcard /bin/s[h]),/bin/sh)
-SHELL = /bin/sh
-else
-# will be used only with the next shell-test line, then overwritten
-# by a configured-in value
-SHELL = sh
-endif
-
-srcdir = ..
-top_srcdir = ..
-abs_top_srcdir = $(shell pwd)/..
-
-# Make tar archive easier to reproduce.
-export TAR_OPTIONS = --owner=0 --group=0 --numeric-owner
-
-# Allow the user to add to this in the Makefile.
-ALL_RECURSIVE_TARGETS =
-
-# Some projects override e.g., _autoreconf here.
-
-# Allow cfg.mk to override these.
-_build-aux ?= build-aux
-_autoreconf ?= autoreconf -v
-
--include $(srcdir)/$(_build-aux)/cfg.mk
-include $(srcdir)/$(_build-aux)/maint.mk
-
-# Ensure that $(VERSION) is up to date for dist-related targets, but not
-# for others: rerunning autoreconf and recompiling everything isn't cheap.
-_have-git-version-gen := \
-  $(shell test -f $(srcdir)/$(_build-aux)/git-version-gen && echo yes)
-ifeq ($(_have-git-version-gen)0,yes$(MAKELEVEL))
-  _is-dist-target ?= $(filter-out %clean, \
-$(filter maintainer-% dist% alpha beta stable,$(MAKECMDGOALS)))
-  _is-install-target ?= $(filter-out %check, $(filter 
install%,$(MAKECMDGOALS)))
-  ifneq (,$(_is-dist-target)$(_is-install-target))
-_curr-ver := $(shell cd $(srcdir)  \
-   && $(_build-aux)/git-version-gen\
- .tarball-version  \
- $(git-version-gen-tag-sed-script))
-ifneq ($(_curr-ver),$(VERSION))
-  ifeq ($(_curr-ver),UNKNOWN)
-$(info WARNING: unable to verify if $(VERSION) is the correct version)
-  else
-ifneq (,$(_is-install-target))
-  # GNU Coding Standards state that 'make install' should not cause
-  # recompilation after 'make all'.  But as long as changing the 
version
-  # string alters config.h, the cost of having 'make all' always have 
an
-  # up-to-date version is prohibitive.  So, as a compromise, we merely
-  # 

[libvirt] [PATCH 2/4] build: remove all logic unrelated to syntax-check

2019-10-03 Thread Daniel P . Berrangé
The standard maint.mk from gnulib provides alot more than just the
'syntax-check' target. This can all be purged to give a more minimal
file.

Signed-off-by: Daniel P. Berrangé 
---
 build-aux/cfg.mk   |  10 -
 build-aux/maint.mk | 473 -
 2 files changed, 483 deletions(-)

diff --git a/build-aux/cfg.mk b/build-aux/cfg.mk
index 728370a84c..97cd4e1b70 100644
--- a/build-aux/cfg.mk
+++ b/build-aux/cfg.mk
@@ -16,16 +16,6 @@
 # along with this program.  If not, see
 # .
 
-# Use alpha.gnu.org for alpha and beta releases.
-# Use ftp.gnu.org for major releases.
-gnu_ftp_host-alpha = alpha.gnu.org
-gnu_ftp_host-beta = alpha.gnu.org
-gnu_ftp_host-major = ftp.gnu.org
-gnu_rel_host = $(gnu_ftp_host-$(RELEASE_TYPE))
-
-url_dir_list = \
-  ftp://$(gnu_rel_host)/gnu/coreutils
-
 # We use .gnulib, not gnulib.
 gnulib_dir = $(srcdir)/.gnulib
 
diff --git a/build-aux/maint.mk b/build-aux/maint.mk
index e570e45462..9467815711 100644
--- a/build-aux/maint.mk
+++ b/build-aux/maint.mk
@@ -37,26 +37,6 @@ _sp = $(_empty) $(_empty)
 # If S1 == S2, return S1, otherwise the empty string.
 _equal = $(and $(findstring $(1),$(2)),$(findstring $(2),$(1)))
 
-# member-check,VARIABLE,VALID-VALUES
-# --
-# Check that $(VARIABLE) is in the space-separated list of VALID-VALUES, and
-# return it.  Die otherwise.
-member-check = \
-  $(strip  \
-$(if $($(1)),  \
-  $(if $(findstring $(_sp),$($(1))),   \
-  $(error invalid $(1): '$($(1))', expected $(2)), \
-  $(or $(findstring $(_sp)$($(1))$(_sp),$(_sp)$(2)$(_sp)), \
-$(error invalid $(1): '$($(1))', expected $(2, \
-  $(error $(1) undefined)))
-
-# Do not save the original name or timestamp in the .tar.gz file.
-# Use --rsyncable if available.
-gzip_rsyncable := \
-  $(shell gzip --help 2>/dev/null|$(GREP) rsyncable >/dev/null \
-&& printf %s --rsyncable)
-GZIP_ENV = '--no-name --best $(gzip_rsyncable)'
-
 GIT = git
 VC = $(GIT)
 
@@ -95,62 +75,10 @@ VC_LIST_EXCEPT = \
| $(GREP) -Ev -e '($(VC_LIST_ALWAYS_EXCLUDE_REGEX)|$(_sc_excl))' \
$(_prepend_srcdir_prefix)
 
-ifeq ($(origin prev_version_file), undefined)
-  prev_version_file = $(srcdir)/.prev-version
-endif
-
-PREV_VERSION := $(shell cat $(prev_version_file) 2>/dev/null)
-VERSION_REGEXP = $(subst .,\.,$(VERSION))
-PREV_VERSION_REGEXP = $(subst .,\.,$(PREV_VERSION))
-
-ifeq ($(VC),$(GIT))
-  this-vc-tag = v$(VERSION)
-  this-vc-tag-regexp = v$(VERSION_REGEXP)
-else
-  tag-package = $(shell echo "$(PACKAGE)" | tr '[:lower:]' '[:upper:]')
-  tag-this-version = $(subst .,_,$(VERSION))
-  this-vc-tag = $(tag-package)-$(tag-this-version)
-  this-vc-tag-regexp = $(this-vc-tag)
-endif
-my_distdir = $(PACKAGE)-$(VERSION)
-
-# Old releases are stored here.
-release_archive_dir ?= ../release
-
-# If RELEASE_TYPE is undefined, but RELEASE is, use its second word.
-# But overwrite VERSION.
-ifdef RELEASE
-  VERSION := $(word 1, $(RELEASE))
-  RELEASE_TYPE ?= $(word 2, $(RELEASE))
-endif
-
-# Validate and return $(RELEASE_TYPE), or die.
-RELEASE_TYPES = alpha beta stable
-release-type = $(call member-check,RELEASE_TYPE,$(RELEASE_TYPES))
-
-# Override gnu_rel_host and url_dir_list in cfg.mk if these are not right.
-# Use alpha.gnu.org for alpha and beta releases.
-# Use ftp.gnu.org for stable releases.
-gnu_ftp_host-alpha = alpha.gnu.org
-gnu_ftp_host-beta = alpha.gnu.org
-gnu_ftp_host-stable = ftp.gnu.org
-gnu_rel_host ?= $(gnu_ftp_host-$(release-type))
-
-url_dir_list ?= $(if $(call _equal,$(gnu_rel_host),ftp.gnu.org),   \
- https://ftpmirror.gnu.org/$(PACKAGE), \
- https://$(gnu_rel_host)/gnu/$(PACKAGE))
-
 # Override this in cfg.mk if you are using a different format in your
 # NEWS file.
 today = $(shell date +%Y-%m-%d)
 
-# Select which lines of NEWS are searched for $(news-check-regexp).
-# This is a sed line number spec.  The default says that we search
-# lines 1..10 of NEWS for $(news-check-regexp).
-# If you want to search only line 3 or only lines 20-22, use "3" or "20,22".
-news-check-lines-spec ?= 1,10
-news-check-regexp ?= '^\*.* $(VERSION_REGEXP) \($(today)\)'
-
 # Prevent programs like 'sort' from considering distinct strings to be equal.
 # Doing it here saves us from having to set LC_ALL elsewhere in this file.
 export LC_ALL = C
@@ -1181,15 +1109,6 @@ sc_makefile_at_at_check:
$$($(VC_LIST_EXCEPT) | $(GREP) -E 
'(^|/)(Makefile\.am|[^/]+\.mk)$$') \
  && { echo '$(ME): use $$(...), not @...@' 1>&2; exit 1; } || :
 
-news-check: NEWS
-   $(AM_V_GEN)if $(SED) -n $(news-check-lines-spec)p $<\
-   | $(GREP) -E $(news-check-regexp) >/dev/null; then  \

[libvirt] [PATCH 3/4] build: delete all syntax check rules we're skipping

2019-10-03 Thread Daniel P . Berrangé
If we've marked rules as skipped, there's no sense keeping them in the
maint.mk file.

Signed-off-by: Daniel P. Berrangé 
---
 build-aux/cfg.mk   |  38 ---
 build-aux/maint.mk | 245 -
 2 files changed, 283 deletions(-)

diff --git a/build-aux/cfg.mk b/build-aux/cfg.mk
index 97cd4e1b70..fab5fb85ea 100644
--- a/build-aux/cfg.mk
+++ b/build-aux/cfg.mk
@@ -31,44 +31,6 @@ generated_files = \
 # We haven't converted all scripts to using gnulib's init.sh yet.
 _test_script_regex = \<\(init\|test-lib\)\.sh\>
 
-# Tests not to run as part of "make distcheck".
-local-checks-to-skip = \
-  changelog-check \
-  makefile-check \
-  makefile_path_separator_check \
-  patch-check \
-  sc_GPL_version \
-  sc_always_defined_macros \
-  sc_cast_of_alloca_return_value \
-  sc_cross_check_PATH_usage_in_tests \
-  sc_dd_max_sym_length \
-  sc_error_exit_success \
-  sc_file_system \
-  sc_immutable_NEWS \
-  sc_makefile_path_separator_check \
-  sc_obsolete_symbols \
-  sc_prohibit_S_IS_definition \
-  sc_prohibit_atoi_atof \
-  sc_prohibit_gnu_make_extensions \
-  sc_prohibit_hash_without_use \
-  sc_prohibit_jm_in_m4 \
-  sc_prohibit_quote_without_use \
-  sc_prohibit_quotearg_without_use \
-  sc_prohibit_stat_st_blocks \
-  sc_prohibit_undesirable_word_seq \
-  sc_root_tests \
-  sc_space_tab \
-  sc_sun_os_names \
-  sc_system_h_headers \
-  sc_texinfo_acronym \
-  sc_tight_scope \
-  sc_two_space_separator_in_usage \
-  sc_error_message_uppercase \
-  sc_program_name \
-  sc_require_test_exit_idiom \
-  sc_makefile_check \
-  sc_useless_cpp_parens
-
 # Most developers don't run 'make distcheck'.  We want the official
 # dist to be secure, but don't want to penalize other developers
 # using a distro that has not yet picked up the automake fix.
diff --git a/build-aux/maint.mk b/build-aux/maint.mk
index 9467815711..45ef6f03c2 100644
--- a/build-aux/maint.mk
+++ b/build-aux/maint.mk
@@ -285,24 +285,6 @@ sc_cast_of_x_alloc_return_value:
halt="don't cast x*alloc return value"  \
  $(_sc_search_regexp)
 
-sc_cast_of_alloca_return_value:
-   @prohibit='\*\) *alloca\>'  \
-   halt="don't cast alloca return value"   \
- $(_sc_search_regexp)
-
-sc_space_tab:
-   @prohibit='[ ]  '   \
-   halt='found SPACE-TAB sequence; remove the SPACE'   \
- $(_sc_search_regexp)
-
-# Don't use *scanf or the old ato* functions in "real" code.
-# They provide no error checking mechanism.
-# Instead, use strto* functions.
-sc_prohibit_atoi_atof:
-   @prohibit='\<([fs]?scanf|ato([filq]|ll)) *\('   
\
-   halt='do not use *scan''f, ato''f, ato''i, ato''l, ato''ll or ato''q'   
\
- $(_sc_search_regexp)
-
 # Use STREQ rather than comparing strcmp == 0, or != 0.
 sp_ = strcmp *\(.+\)
 sc_prohibit_strcmp:
@@ -335,51 +317,6 @@ sc_prohibit_magic_number_exit:
halt='use EXIT_* values rather than magic number'   \
  $(_sc_search_regexp)
 
-# Check that we don't use $< in non-implicit Makefile rules.
-#
-# To find the Makefiles, trace AC_CONFIG_FILES.  Using VC_LIST would
-# miss the Makefiles that are not under VC control (e.g., symlinks
-# installed for gettext).  "Parsing" (recursive) uses of SUBDIRS seems
-# too delicate.
-#
-# Use GNU Make's --print-data-base to normalize the rules into some
-# easy to parse format: they are separated by two \n.  Look for the
-# "section" about non-pattern rules (marked with "# Files") inside
-# which there are still the POSIX Make like implicit rules (".c.o").
-sc_prohibit_gnu_make_extensions_awk_ = \
-  BEGIN {  \
-  RS = "\n\n"; \
-  in_rules = 0;\
-  }\
-  /^\# Files/ {
\
-  in_rules = 1;\
-  }\
-  /\$$/dev/null 2>&1; then   \
- (cd $(srcdir) && autoconf --trace AC_CONFIG_FILES:'$$1') |\
-   tr ' ' '\n' |   \
-   $(SED) -ne '/Makefile/{s/\.in$$//;p;}' |\
-   while read m; do\
- $(MAKE) -qp -f $$m .DUMMY-TARGET 2>/dev/null |\
-   $(AWK) -v file=$$m -e '$($@_awk_)' || exit 1;   \
-   done;   \
-   fi
-
-# Using EXIT_SUCCESS as the first argument to error is misleading,
-# since when that parameter is 0, error does 

[libvirt] [PATCH 1/4] build: import gnulib's syntax-check make rules

2019-10-03 Thread Daniel P . Berrangé
We're going to be eliminating autotools and gnulib, but we still wish to
have the 'make syntax-check' functionality.

This imports the minimal set of gnulib files required to keep this
working. The GNUmakefile and maint.mk files had a few tweaks to enable
them to work independently of automake generated Makefiles.

Signed-off-by: Daniel P. Berrangé 
---
 Makefile.am  |9 +-
 bootstrap.conf   |4 -
 build-aux/GNUmakefile|  109 ++
 cfg.mk => build-aux/cfg.mk   |   56 +-
 build-aux/maint.mk   | 1754 ++
 build-aux/useless-if-before-free |  226 
 build-aux/vc-list-files  |  113 ++
 7 files changed, 2243 insertions(+), 28 deletions(-)
 create mode 100644 build-aux/GNUmakefile
 rename cfg.mk => build-aux/cfg.mk (95%)
 create mode 100644 build-aux/maint.mk
 create mode 100755 build-aux/useless-if-before-free
 create mode 100755 build-aux/vc-list-files

diff --git a/Makefile.am b/Makefile.am
index 711f365504..2a28d53591 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -37,14 +37,16 @@ EXTRA_DIST = \
   libvirt-admin.pc.in \
   Makefile.nonreentrant \
   autogen.sh \
-  cfg.mk \
   run.in \
   README.md \
   AUTHORS.in \
   build-aux/augeas-gentest.pl \
+  build-aux/cfg.mk \
   build-aux/check-spacing.pl \
   build-aux/gitlog-to-changelog \
+  build-aux/GNUmakefile \
   build-aux/header-ifdef.pl \
+  build-aux/maint.mk \
   build-aux/minimize-po.pl \
   build-aux/mock-noinline.pl \
   build-aux/prohibit-duplicate-header.pl \
@@ -84,6 +86,11 @@ rpm: clean
 srpm: clean
@(unset CDPATH ; $(MAKE) dist && rpmbuild -ts $(distdir).tar.xz)
 
+syntax-check:
+   @make -C $(srcdir)/build-aux syntax-check \
+   abs_top_builddir=$(abs_top_builddir) \
+   FLAKE8=$(FLAKE8)
+
 check-local: all tests
 
 check-access: all
diff --git a/bootstrap.conf b/bootstrap.conf
index 4f944a9c23..54b8ada297 100644
--- a/bootstrap.conf
+++ b/bootstrap.conf
@@ -57,7 +57,6 @@ getpeername
 getsockname
 gettimeofday
 gitlog-to-changelog
-gnumakefile
 ignore-value
 inet_pton
 intprops
@@ -67,7 +66,6 @@ largefile
 ldexp
 listen
 localeconv
-maintainer-makefile
 manywarnings
 mgetgroups
 mkdtemp
@@ -116,11 +114,9 @@ timegm
 ttyname_r
 uname
 unsetenv
-useless-if-before-free
 usleep
 vasprintf
 verify
-vc-list-files
 vsnprintf
 waitpid
 warnings
diff --git a/build-aux/GNUmakefile b/build-aux/GNUmakefile
new file mode 100644
index 00..63ab845f1b
--- /dev/null
+++ b/build-aux/GNUmakefile
@@ -0,0 +1,109 @@
+# Having a separate GNUmakefile lets me `include' the dynamically
+# generated rules created via cfg.mk (package-local configuration)
+# as well as maint.mk (generic maintainer rules).
+# This makefile is used only if you run GNU Make.
+# It is necessary if you want to build targets usually of interest
+# only to the maintainer.
+
+# Copyright (C) 2001, 2003, 2006-2011 Free Software Foundation, Inc.
+
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see .
+
+# Systems where /bin/sh is not the default shell need this.  The $(shell)
+# command below won't work with e.g. stock DOS/Windows shells.
+ifeq ($(wildcard /bin/s[h]),/bin/sh)
+SHELL = /bin/sh
+else
+# will be used only with the next shell-test line, then overwritten
+# by a configured-in value
+SHELL = sh
+endif
+
+srcdir = ..
+top_srcdir = ..
+abs_top_srcdir = $(shell pwd)/..
+
+# Make tar archive easier to reproduce.
+export TAR_OPTIONS = --owner=0 --group=0 --numeric-owner
+
+# Allow the user to add to this in the Makefile.
+ALL_RECURSIVE_TARGETS =
+
+# Some projects override e.g., _autoreconf here.
+
+# Allow cfg.mk to override these.
+_build-aux ?= build-aux
+_autoreconf ?= autoreconf -v
+
+-include $(srcdir)/$(_build-aux)/cfg.mk
+include $(srcdir)/$(_build-aux)/maint.mk
+
+# Ensure that $(VERSION) is up to date for dist-related targets, but not
+# for others: rerunning autoreconf and recompiling everything isn't cheap.
+_have-git-version-gen := \
+  $(shell test -f $(srcdir)/$(_build-aux)/git-version-gen && echo yes)
+ifeq ($(_have-git-version-gen)0,yes$(MAKELEVEL))
+  _is-dist-target ?= $(filter-out %clean, \
+$(filter maintainer-% dist% alpha beta stable,$(MAKECMDGOALS)))
+  _is-install-target ?= $(filter-out %check, $(filter 
install%,$(MAKECMDGOALS)))
+  ifneq (,$(_is-dist-target)$(_is-install-target))
+_curr-ver := $(shell cd $(srcdir)  

Re: [libvirt] [jenkins-ci PATCH 13/17] guests: Install meson via pip

2019-10-03 Thread Andrea Bolognani
On Tue, 2019-10-01 at 16:28 +0200, Fabiano Fidêncio wrote:
> +++ b/guests/lcitool
> +pip_install = []
> +pip_mappings = {
> +"meson" : "meson==0.49.0",
> +}

This makes me think that perhaps we should have this information
encoded in the mapping, eg.

  meson:
default: meson
CentOS7: pip3(meson==0.49.0)

Of course then we'd be in the business of parsing that, which would
not be too bad in Python but probably a fair amount of pain in the
Ansible playbook...

Maybe a reasonable compromise would be to have something like

  pip_mappings:
meson:
  default: meson==0.49.0

in addition to the existing mappings, and that use that information
as a fallback when a regular mapping is not available. Easier to
parse, even though it's less explicit about what's going on behind
the scenes, especially if you're only looking at the regular mapping.
On the other hand, it would avoid hardcoding the Meson installation
command in the Ansible playbook, which you're doing right now and is
a bit unsavory.

What do you think about the latter approach? It seems like it would
be fairly easy to implement and, while far from perfect, a slight
step up from what you currently have.

[...]
> +if pip_install:
> +varmap["pip_install"] = " ".join(sorted(pip_install))
> +sys.stdout.write(textwrap.dedent("""
> +RUN pip3 install {pip_install}
> +""").format(**varmap))

It would be nice if we got the pip packages aligned nicely in the
output, same as the native packages, but that's not a blocker :)

> +++ b/guests/playbooks/update/tasks/packages.yml
> +- name: '{{ project }}: Install meson from pip'
> +  command: pip3 install meson==0.49.0
> +  args:
> +creates: /usr/local/bin/meson
> +  when:
> +- temp["meson"] is defined
> +- temp["meson"] == None

Ansible has a pip module[1] which we should probably use for this;
on the other hand, from a quick look at the documentation I'm a bit
unclear on the implications when it comes to the version of pip that
would be invoked on each platform, so we can leave it be for now and
switch in a follow-up patch.


Incidentally, now that we are installing Python 3 on CentOS 7, we
should be able to set

  ansible_python_interpreter: /usr/bin/python3

in its host_vars. I haven't made sure that would actually work, but
it certainly would be nice to run everything on Python 3.


[1] https://docs.ansible.com/ansible/latest/modules/pip_module.html
-- 
Andrea Bolognani / Red Hat / Virtualization

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [jenkins-ci PATCH 12/17] guests: Add pip to the base project

2019-10-03 Thread Andrea Bolognani
On Tue, 2019-10-01 at 16:28 +0200, Fabiano Fidêncio wrote:
> +++ b/guests/vars/projects/base.yml
> @@ -24,6 +24,7 @@ packages:
>- ninja
>- patch
>- perl
> +  - pip

With this changed to 'python3-pip' as per the comments on the
previous patch,

  Reviewed-by: Andrea Bolognani 

-- 
Andrea Bolognani / Red Hat / Virtualization

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [jenkins-ci PATCH 09/17] Deal with ninja x ninja-build bin names

2019-10-03 Thread Andrea Bolognani
On Tue, 2019-10-01 at 16:28 +0200, Fabiano Fidêncio wrote:
> +++ b/guests/playbooks/update/tasks/paths.yml
> +# Prefer ninja-build, fall back to ninja
> +- name: 'Export paths'
> +  set_fact:
> +ninja: '{{ commands["ninja-build"] }}'
> +  when:
> +- commands["ninja-build"] != ''
> +
> +- name: 'Export paths'
> +  set_fact:
> +ninja: '{{ commands["ninja"] }}'
> +  when:
> +- ninja is undefined

Ninja can be invoked as 'ninja' on all target platforms except for
CentOS 7, and as 'ninja-build' on all RPM-based platforms, so we
should invert this logic and prefer 'ninja' to 'ninja-build'.

With that changed,

  Reviewed-by: Andrea Bolognani 

-- 
Andrea Bolognani / Red Hat / Virtualization

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [jenkins-ci PATCH 11/17] mappings: Add python3-pip

2019-10-03 Thread Andrea Bolognani
On Tue, 2019-10-01 at 16:28 +0200, Fabiano Fidêncio wrote:
> +++ b/guests/vars/mappings.yml
> +  pip:
> +CentOS7: python3-pip
> +Debian9: python3-pip
> +Ubuntu: python3-pip

Let's call the mapping 'python3-pip' to avoid any possible confusion.

I'd also list Ubuntu16 and Ubuntu18 separately, with the expectation
that Ubuntu 20.04 will include a suitable version of Meson and thus
will not need to install it from pip.

With the above changed,

  Reviewed-by: Andrea Bolognani 

-- 
Andrea Bolognani / Red Hat / Virtualization

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [jenkins-ci PATCH 10/17] guests: Keep base project's packages sorted

2019-10-03 Thread Andrea Bolognani
On Tue, 2019-10-01 at 16:28 +0200, Fabiano Fidêncio wrote:
> Signed-off-by: Fabiano Fidêncio 
> ---
>  guests/vars/projects/base.yml | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Andrea Bolognani 

-- 
Andrea Bolognani / Red Hat / Virtualization

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [jenkins-ci PATCH 08/17] guests: Add ninja to the base project

2019-10-03 Thread Andrea Bolognani
On Tue, 2019-10-01 at 16:28 +0200, Fabiano Fidêncio wrote:
> signed-off-by: Fabiano Fidêncio 
> ---
>  guests/vars/projects/base.yml | 1 +
>  1 file changed, 1 insertion(+)

Reviewed-by: Andrea Bolognani 

-- 
Andrea Bolognani / Red Hat / Virtualization

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [virttools-planet PATCH v2] Add Stefano Garzarella to Planet virttools

2019-10-03 Thread Daniel P . Berrangé
On Thu, Oct 03, 2019 at 11:43:05AM +0200, Stefano Garzarella wrote:
> Signed-off-by: Stefano Garzarella 
> ---
> v2:
> - add the binary diff of the image
> ---
>  updater/virt-tools/config.ini  |   6 ++
>  updater/virt-tools/images/sgarzare.png | Bin 0 -> 17713 bytes
>  2 files changed, 6 insertions(+)
>  create mode 100644 updater/virt-tools/images/sgarzare.png

Thanks, I've pushed this. Your feed should appear within an hour.


Regards,
Daniel
-- 
|: https://berrange.com  -o-https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o-https://fstop138.berrange.com :|
|: https://entangle-photo.org-o-https://www.instagram.com/dberrange :|

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [libvirt] [jenkins-ci PATCH 07/17] mappings: Add ninja

2019-10-03 Thread Andrea Bolognani
On Tue, 2019-10-01 at 16:28 +0200, Fabiano Fidêncio wrote:
> +++ b/guests/vars/mappings.yml
> @@ -455,6 +455,10 @@ mappings:
> +  ninja:
> +   default: ninja-build
> +   FreeBSD: ninja

Doing this would be a good idea regardless, since we invoke ninja
directly.

Reviewed-by: Andrea Bolognani 

-- 
Andrea Bolognani / Red Hat / Virtualization

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [PATCH] virsh: fixed handling of targetless disks (e.g. empty CDROM) in 'domblkinfo' cmd

2019-10-03 Thread Ján Tomko

On Wed, Oct 02, 2019 at 04:21:52PM +0200, Pavel Mores wrote:

On Wed, Oct 02, 2019 at 08:34:10AM -0300, Daniel Henrique Barboza wrote:



On 10/1/19 11:45 AM, Pavel Mores wrote:
> virDomainGetBlockInfo() returns error if called on a disk with no target
> (a targetless disk might be a removable media drive with no media in it,
> for instance an empty CDROM drive).
>
> So far this caused the virsh domblkinfo --all command to abort and ignore
> any remaining (not yet displayed) disk devices.  This patch fixes it by
> ignoring virDomainGetBlockInfo() errors for CDROM and floppy drives,
> similar to how it's done for network drives.
>
> https://bugzilla.redhat.com/show_bug.cgi?id=1619625
>
> Signed-off-by: Pavel Mores 
> ---
>   tools/virsh-domain-monitor.c | 11 +++
>   1 file changed, 11 insertions(+)
>
> diff --git a/tools/virsh-domain-monitor.c b/tools/virsh-domain-monitor.c
> index 0e2c4191d7..0f495c1a3f 100644
> --- a/tools/virsh-domain-monitor.c
> +++ b/tools/virsh-domain-monitor.c
> @@ -473,6 +473,7 @@ cmdDomblkinfo(vshControl *ctl, const vshCmd *cmd)
>   char *cap = NULL;
>   char *alloc = NULL;
>   char *phy = NULL;
> +char *device_type = NULL;

I believe you need to use VIR_AUTO(char *) here. Even considering that
the macro will be deprecated in the near future for glib stuff, by using
VIR_AUTO here:

- you'll make it easier to introduce the glib replacement, since
s/VIR_AUTO/ is a trivial change;

- you won't be adding more VIR_FREE() on top of existing cases that will
need to be addressed in the future.


Was that the consensus from the migration debate?  If so I'm happy to fix my
patch.


IIUC the consensus was that we will switch to g_auto eventually,
but it's a simple string replace that will be dealt with by whoever
pushes the patch.

Also, if you go with any of the two approaches I suggested (ignoring all
errors or using the XPathBoolean), you don't need to introduce a new
allocated variable

Jano



pvl



signature.asc
Description: PGP signature
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

[libvirt] [virttools-planet PATCH v2] Add Stefano Garzarella to Planet virttools

2019-10-03 Thread Stefano Garzarella
Signed-off-by: Stefano Garzarella 
---
v2:
- add the binary diff of the image
---
 updater/virt-tools/config.ini  |   6 ++
 updater/virt-tools/images/sgarzare.png | Bin 0 -> 17713 bytes
 2 files changed, 6 insertions(+)
 create mode 100644 updater/virt-tools/images/sgarzare.png

diff --git a/updater/virt-tools/config.ini b/updater/virt-tools/config.ini
index 3845f25..6b4b5ec 100644
--- a/updater/virt-tools/config.ini
+++ b/updater/virt-tools/config.ini
@@ -188,3 +188,9 @@ name = Yoni Bettan
 face = ybettan.png
 facewidth = 52
 faceheight = 80
+
+[https://stefano-garzarella.github.io/posts/index.xml]
+name = Stefano Garzarella
+face = sgarzare.png
+facewidth = 89
+faceheight = 96
diff --git a/updater/virt-tools/images/sgarzare.png 
b/updater/virt-tools/images/sgarzare.png
new file mode 100644
index 
..bf53f8a5f0ddc7cb5e7c877a37e9c58507b0a117
GIT binary patch
literal 17713
zcmV)MK)An)yZmwqd|_!)>(MjfN#z
zV^bz6iKJL$v8H?L-n!G7_ndR)8p03f6j_&|1UPYkvvcLj+!3)NVnxRHZT!8h2SE7j
z@Bo0!jKF}OzW@LXFP!~@r@wUMmmdGnjr_}}A^v>iAO7CIR|bATo9k&31pe$>82|wg
z@r6g+Tw-Em{M_>yKQAsZ0006o03$E}em3G?6bOIe6n{~s>k;pqx0Xnv6!6PdTcx_s~5%XHZYb#uvhCj0feO_RGK|KCD
zX1c!WtSzrj&2Ev*4#VjIqG0d6u_Ofu@p;4G=N9r8Y|X#8oIk)1;d+UIQXx#_>)
zkj(hG)x@9u|GP%V)Gt~?FUyr;v75LiA5CA-Q>uujv7oXNo|0e#`e;=m%zOU_W
z?X4H-NM;!d{JTMfzceC#=>)v_j4xV5lK92=VFtVwm_M%}{{Kn`eC-;5egl`FQ`Hxz`VB?v%zK~n@^|BGw$c_o>FZdCmF
z6oQ*T#+!uzNd%vH_lX9UXiL)PRivt<-QRlN2Q}e$Jh)y~%kt9U?)X8DEr}5dZ|cfh!gI
zoCdw~qAQ(u9AsVwz$|>vNKQ(L^mDC|uLUN&-cW!M5cspR7tO)U0Dy>}ef;?Ze9=Go
zbGsCIr;L?V8!T7Bc1zYHAqrxL{U-PM*1dGMz`neASVCljOze|PB8o;r%Fp}f&$BE8
zm>!Eu27}o?geef+B(~24RnCraGs4|Y>|Iobm-nT}?D$nCBAyKiB!^%JGXHcw;66u)Xg)D}Zz?kzUODi~vB!sj^Of@V@-sU&$Z*5FS1wZ^yW?>16+c$>KlD#~QBXy7@6Ob?ZooClsWG2t5Zg6vAd||r^#>ZkX
zLj(j+0G1Jn$K;024zU+ll%{C=B?a8oCw1uwwCr25EeRuEP#b`O#Z4%^;D(>=M8E(Z
zfbeIgL13uLdUuXJZr*I>vlUs$3n4ad?1
zw)F-&3_hTuSj`#`QqIECC<@`y1W8
zxLJ3)zN=~K%ZHCPPfw-?hheI;#_LV=Ivta7;d(dxmw#mcr+?m6r9cFMH#;sfA|fCn
zqGv$}2<$xya_q_VU;fTt*)PAf9*li&+OF3cRT8n1*S=`-Rr~lyvdf7^Ni0>Q*j0VC
znw8=>E^zzIR5k0F3r7-aXPy@rwA}h`WGoA}hT?ru|4EA@8E1;ju=!Mq#O5
z|K9)Bz54-@CqQ6N0E8%o1k-_M=bQur0LLt)@XmW?^4>YCncw-7@4WxY7go@)w?U)?
z31hMAtSOpuds(kPjl-!@7}XEbggk-kCSm8K(tVXTi|=L`3jEESkNP|a48Z=}}
z(^D1$RM9<=4r0zH{8Y+cEDpc{5TF1Mz?t(YyNKDDzRl}=n>SZyYt!QGyVwtZbg%lq%68
z|CvD{B7pP0+-&=8BLm_4vM;WLil@Uls$)2N)I5Bzav1KtY_@h34b$UcoMj9^KmdT=
z)030%zxh4*{*PSWBN75KdnE|HP%1$7wm0l8kp%ZyLFWuffk4Q>t?f+(!x2e0`tJAk
zzwul5_h%9io3dRkJ0oNinYQTKuBlt(Zn?{c;d(l9N$Ptuv6YbGpdY;DdcyVhV)1>7
zz0|9=%S|^9-_+=hAVCb0gdh?E5Rr(O;rb7mJ^L`p*tY5WKl!!<*SR#+LPJ+q
z_2#l(Kkdq8h<8J{G)K#)tLxE2E%LUn5JNo~62X4AArk@@p
zslpxDwad5VdLfJDRW_LmBH@u7K2ci6hJ
z-|Y)ZW6)u@t={vS@w%Rkf;gnRUFY)l*|uJL_fZyqg)!xZs)cu0BP$e>qDQ%T@{Aqq
z@6AF@1D(Jis;YXk%$K`Hbv{Uv$=;sU;b=IuQm?ifu2+C6)rpDaVzu7klJ$Ua}*
zQCEw9^#|@R|5^|M5Fs)%dk%!wIwS<>Gg>49>#FxlB?m4<
z?jryz%+8>-m*D-=2aSxn*}lt$2x`&=Ah%B+>AoKN!_goGA)N6@)I|L}FvAqe&_|)S
z((k%0pS4N58Q0HitAcd0?foa0kJsx@-+A*JxAZ%fN2ch-<45>E{vV1YG9n@pdFQ1T
zQIHU`?F!r1*9l6H0PEQ?3$Vs1DUcaSFd!nb_t#r3BDC8wnT|%!%Ct*_}Q7
zWOsfMt4xQYUVXH~WvJ6Ei7%JM<<-MiUm6{z<2E{?i9pJ)@&`g*O{1~J4a-TzwE
zrR!C_UMytV&*tYtb)s=t^~X}IAD~~v!DUuP9;t0x>oH|KG7Se81)BBg76dHoEAI({D1gg$anxjQW6Suj#Q|EP%!q*#
z1?NZ#L_|RX>DncP5(J1yAcb@O^F=SPugfYP#IJq-2luD@mrqX~{qT<@x>w%*+AMNs
z`AOY;2t15~*NH>hj{9
z!Iy{VN3nF(dA;fRVn-i+Dx^S0DI_=$Dw0~Fho)FM*8n^3JPCn_0*NHE144n$k{2Ev
zlIPx|5C|Ta0MRouJLvi@$LYgQ?_B-lqqEb#ejWyL2%Cu@!G-)t|^cx+4(3pt3k
zvG{|gV)Xk7$%a4J)z2JcwL6?p;BZ}4L@qrz2r0JC$9)%A#B46*G|fiYNXBDOs_mSk
z4&|=coj-fBx;Xh{FdE!?8`=eZc+96*=naW&2PQ+#aG^3ZPsUJPp|xRK!cA@
zKZ*X|PbM4^f@en_R1gXoIMdeE23+f{2VjBZy%#{p9y|jxGY}B~AP_PlFnA}V@D>;m
zyeC9(-dV#}h5NJbJ~CHqb0_)g;;)B?=RkhsSN{+fFcI6W}+_7Lmhrm*98-HU3Gat#`F>6h%PL
z_U;pFYoQto^UH-UO2bv`tq$UNc;HmHisPNq>1%ghA8UE}OgSotw+AweMn)?ULvkP+
z6c?-f$;l=gAI!!h0rslCXl>o}hq-~v-R^_)Vzs(px6;`(&~X-N9Z#>I`=oTG$@A^*
ztyvgFarUGh3o=d7wKba-z_WMWJ3+{f*)t%irNlHNN+
z^6W_pcGrC+4-D)*8_XK*$Y{t)`@RBWJiEFtH^r*lt~RU9`D%T-+8v#D*+pTS5`6Ey17>y(5!thl
zg1tvX0F*?)UJ}twLD3t~cXQQkqpVc^t+*(!)UP)$QPFQy`XEx`;HFr9EB9Ams6cWhlI;ja`cQ
z7hYOyE?>KSFVOPw^6WG(j6*QuAR6g7S$Tvo)Pu1L0?QEjB5c=Jn~S{Ic3p9pW&;_W
zTwYZ@|7w?{%Ul8jGGD(@_?xyV0g^z$fDA%Pgqz+w3A%1uAcGQ8APVn@2#LVoU>JPU
z%qXrKAR!)|z_jsR3Cf!Eidbog4kp^Rn!&
zlHo)~v)0Q^@i2~XG9K4Ecl!KnalVs_y!*n-U%Yec*2U%W`N>%)Bq8g*Ra9HTd{ww0
ziqhBuI3Zu1AB=_fSLJDA!S=7*xqG~Km);vbc=l9Te~k)R>#kd%ghbvWGNSj+({=yM
zdEp%(5+Qj8Vn76j)GZOdc5h4Q3^-ttP=UGy7|#g%^$)Ng$hT<4IVse
z^J)BW|B#R6qAJ>piwKt4d|v8NF-!9}_2k!=dX_hf6Nk0(Y*Ul(1uDK4Hg`TBJ!
zbqGMKO@6-G89nqQpsTxf@!T(catos|ciVh%?m?T5lKq5j0!~Rl=3+FDaT}WD@Sg>tLRKUW!K#;n;
zOp0JYG(eom;1=)!@FC#@5s1L^tB#l|z`=MrhG4%fY#Il54x=QtXD6<_=o`bQ7nCn5
zK@W!$pQuGyQc>m0osnUdq%j)bSCwphCgzn-Wj5N|mAi|R^OBUB=
zFfGpVZnJcRccW0^P|0u*1)+dl58wXDw?933;^oNXb=YWj-m@2YjmH9!AjJqso;xX?
zpnuQv->{dLkeaN@^tZ-UFbJ!dfS#>OJ}SSBnO}bp)tQ5sBbEKll;V}
zIC4_gVOX))^j+!KQGIp0iC1~v$~cLodAcY*yvz&7Zyf0`p6uUJanyQ~8mEFb#9UAp
zWo|N|$;1WxO1f?j>miZ1l!?e
zd2xESrT|h$!YI6kn7o$+gi?@T^k>XJVEZT5Tmb^Gb*vDH0g1gclC+Z2c`t-yCMl(N
zo`|eEJIAzKi;I*#8F*$zIe|)4Lxh(JgT0@_gX+D;Qnn^+Qb~

Re: [libvirt] [virttools-planet PATCH] Add Stefano Garzarella to Planet virttools

2019-10-03 Thread Stefano Garzarella
On Thu, Oct 03, 2019 at 11:25:32AM +0200, Stefano Garzarella wrote:
> On Thu, Oct 03, 2019 at 10:20:26AM +0100, Daniel P. Berrangé wrote:
> > On Thu, Oct 03, 2019 at 11:10:02AM +0200, Stefano Garzarella wrote:
> > > Signed-off-by: Stefano Garzarella 
> > > ---
> > >  updater/virt-tools/config.ini  |   6 ++
> > >  updater/virt-tools/images/sgarzare.png | Bin 0 -> 17713 bytes
> > >  2 files changed, 6 insertions(+)
> > >  create mode 100644 updater/virt-tools/images/sgarzare.png
> > > 
> > > diff --git a/updater/virt-tools/config.ini b/updater/virt-tools/config.ini
> > > index 3845f25..6b4b5ec 100644
> > > --- a/updater/virt-tools/config.ini
> > > +++ b/updater/virt-tools/config.ini
> > > @@ -188,3 +188,9 @@ name = Yoni Bettan
> > >  face = ybettan.png
> > >  facewidth = 52
> > >  faceheight = 80
> > > +
> > > +[https://stefano-garzarella.github.io/posts/index.xml]
> > > +name = Stefano Garzarella
> > > +face = sgarzare.png
> > > +facewidth = 89
> > > +faceheight = 96
> > > diff --git a/updater/virt-tools/images/sgarzare.png 
> > > b/updater/virt-tools/images/sgarzare.png
> > > new file mode 100644
> > > index 000..bf53f8a
> > > Binary files /dev/null and b/updater/virt-tools/images/sgarzare.png differ
> > 
> > You need to actually include the diff.
> 
> Ooo... very sorry!
> 
> > 
> > I'm curious how you sent this, as I thought git send-email / git-publish
> > just "do the right thing" in this respect ?
> 
> I used git-publish, I'll try to figure out what happened and I'll send a
> v2 with the diff.

There is an issue in git-publish and '--no-binary' is always passed to git
format-patch, I'll send a PR to Stefan.

I'm sending a v2 with the binary diff.

Sorry again!

Cheers,
Stefano

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [libvirt] [virttools-planet PATCH] Add Stefano Garzarella to Planet virttools

2019-10-03 Thread Stefano Garzarella
On Thu, Oct 03, 2019 at 10:20:26AM +0100, Daniel P. Berrangé wrote:
> On Thu, Oct 03, 2019 at 11:10:02AM +0200, Stefano Garzarella wrote:
> > Signed-off-by: Stefano Garzarella 
> > ---
> >  updater/virt-tools/config.ini  |   6 ++
> >  updater/virt-tools/images/sgarzare.png | Bin 0 -> 17713 bytes
> >  2 files changed, 6 insertions(+)
> >  create mode 100644 updater/virt-tools/images/sgarzare.png
> > 
> > diff --git a/updater/virt-tools/config.ini b/updater/virt-tools/config.ini
> > index 3845f25..6b4b5ec 100644
> > --- a/updater/virt-tools/config.ini
> > +++ b/updater/virt-tools/config.ini
> > @@ -188,3 +188,9 @@ name = Yoni Bettan
> >  face = ybettan.png
> >  facewidth = 52
> >  faceheight = 80
> > +
> > +[https://stefano-garzarella.github.io/posts/index.xml]
> > +name = Stefano Garzarella
> > +face = sgarzare.png
> > +facewidth = 89
> > +faceheight = 96
> > diff --git a/updater/virt-tools/images/sgarzare.png 
> > b/updater/virt-tools/images/sgarzare.png
> > new file mode 100644
> > index 000..bf53f8a
> > Binary files /dev/null and b/updater/virt-tools/images/sgarzare.png differ
> 
> You need to actually include the diff.

Ooo... very sorry!

> 
> I'm curious how you sent this, as I thought git send-email / git-publish
> just "do the right thing" in this respect ?

I used git-publish, I'll try to figure out what happened and I'll send a
v2 with the diff.

Thanks,
Stefano

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [libvirt] [virttools-planet PATCH] Add Stefano Garzarella to Planet virttools

2019-10-03 Thread Daniel P . Berrangé
On Thu, Oct 03, 2019 at 11:10:02AM +0200, Stefano Garzarella wrote:
> Signed-off-by: Stefano Garzarella 
> ---
>  updater/virt-tools/config.ini  |   6 ++
>  updater/virt-tools/images/sgarzare.png | Bin 0 -> 17713 bytes
>  2 files changed, 6 insertions(+)
>  create mode 100644 updater/virt-tools/images/sgarzare.png
> 
> diff --git a/updater/virt-tools/config.ini b/updater/virt-tools/config.ini
> index 3845f25..6b4b5ec 100644
> --- a/updater/virt-tools/config.ini
> +++ b/updater/virt-tools/config.ini
> @@ -188,3 +188,9 @@ name = Yoni Bettan
>  face = ybettan.png
>  facewidth = 52
>  faceheight = 80
> +
> +[https://stefano-garzarella.github.io/posts/index.xml]
> +name = Stefano Garzarella
> +face = sgarzare.png
> +facewidth = 89
> +faceheight = 96
> diff --git a/updater/virt-tools/images/sgarzare.png 
> b/updater/virt-tools/images/sgarzare.png
> new file mode 100644
> index 000..bf53f8a
> Binary files /dev/null and b/updater/virt-tools/images/sgarzare.png differ

You need to actually include the diff.

I'm curious how you sent this, as I thought git send-email / git-publish
just "do the right thing" in this respect ?

Regards,
Daniel
-- 
|: https://berrange.com  -o-https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o-https://fstop138.berrange.com :|
|: https://entangle-photo.org-o-https://www.instagram.com/dberrange :|

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


[libvirt] [virttools-planet PATCH] Add Stefano Garzarella to Planet virttools

2019-10-03 Thread Stefano Garzarella
Signed-off-by: Stefano Garzarella 
---
 updater/virt-tools/config.ini  |   6 ++
 updater/virt-tools/images/sgarzare.png | Bin 0 -> 17713 bytes
 2 files changed, 6 insertions(+)
 create mode 100644 updater/virt-tools/images/sgarzare.png

diff --git a/updater/virt-tools/config.ini b/updater/virt-tools/config.ini
index 3845f25..6b4b5ec 100644
--- a/updater/virt-tools/config.ini
+++ b/updater/virt-tools/config.ini
@@ -188,3 +188,9 @@ name = Yoni Bettan
 face = ybettan.png
 facewidth = 52
 faceheight = 80
+
+[https://stefano-garzarella.github.io/posts/index.xml]
+name = Stefano Garzarella
+face = sgarzare.png
+facewidth = 89
+faceheight = 96
diff --git a/updater/virt-tools/images/sgarzare.png 
b/updater/virt-tools/images/sgarzare.png
new file mode 100644
index 000..bf53f8a
Binary files /dev/null and b/updater/virt-tools/images/sgarzare.png differ
-- 
2.21.0

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [libvirt] [jenkins-ci PATCH 06/17] guests: Add meson to the base project

2019-10-03 Thread Andrea Bolognani
On Tue, 2019-10-01 at 16:28 +0200, Fabiano Fidêncio wrote:
> Together with this change, let's also remove meson as a dependency from
> the projects which are already depending on it.
> 
> Signed-off-by: Fabiano Fidêncio 
> ---
>  guests/vars/projects/base.yml| 1 +
>  guests/vars/projects/libosinfo+mingw32.yml   | 1 -
>  guests/vars/projects/libosinfo+mingw64.yml   | 1 -
>  guests/vars/projects/libosinfo.yml   | 1 -
>  guests/vars/projects/osinfo-db-tools+mingw32.yml | 1 -
>  guests/vars/projects/osinfo-db-tools+mingw64.yml | 1 -
>  guests/vars/projects/osinfo-db-tools.yml | 1 -
>  7 files changed, 1 insertion(+), 6 deletions(-)

Reviewed-by: Andrea Bolognani 

-- 
Andrea Bolognani / Red Hat / Virtualization

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [jenkins-ci PATCH 05/17] mappings: Mark the OSes where meson is not supported

2019-10-03 Thread Andrea Bolognani
On Tue, 2019-10-01 at 16:28 +0200, Fabiano Fidêncio wrote:
> +++ b/guests/vars/mappings.yml
> @@ -450,6 +450,10 @@ mappings:
>  
>meson:
>  default: meson
> +CentOS7:
> +Debian9:
> +Ubuntu16:
> +Ubuntu18:

Mh, the original mapping means that we have already installed the old
Meson from distro packages on Debian and Ubuntu... I'll make sure to
clean up the guests by uninstalling it, just so that there's a single
Meson binary per builder.

  Reviewed-by: Andrea Bolognani 

-- 
Andrea Bolognani / Red Hat / Virtualization

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [jenkins-ci PATCH 04/17] guests: Map python36-* CentOS7 packages

2019-10-03 Thread Andrea Bolognani
On Tue, 2019-10-01 at 16:28 +0200, Fabiano Fidêncio wrote:
> +++ b/guests/vars/mappings.yml
> @@ -814,11 +814,12 @@ mappings:
>python3-devel:
>  deb: python3-dev
>  pkg: python3
> +CentOS7: python36-devel
>  Fedora: python3-devel

These are out of order: CentOS7 is more specific than Fedora, so it
should go after it.

  Reviewed-by: Andrea Bolognani 

with that changed.


Also note that I'm reviewing all of this by only looking at the
patches while tests are running in the background, so there's a
chance I might come back and add comments to any of the patches at
a later time O:-)

-- 
Andrea Bolognani / Red Hat / Virtualization

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list