Re: [libvirt] Default USB controller model vs PCI address assignment

2018-02-13 Thread Laine Stump
On 02/13/2018 01:43 PM, Daniel P. Berrangé wrote: > GCC8 identified a critical flaw in the QEMU post-parse callback How does it differentiate between this and the myriad of other places that we are typecasting an int to an enum when writing a switch statement? Try this for examples:     grep

Re: [libvirt] [PATCHv2 1/1] include: function parameter names same in declaration

2018-02-13 Thread Christopher Venteicher
- Original Message - > From: "Bjoern Walk" > To: "Daniel P. Berrangé" > Cc: "Chris Venteicher" , libvir-list@redhat.com > Sent: Tuesday, February 13, 2018 5:03:40 AM > Subject: Re: [libvirt] [PATCHv2 1/1] include:

[libvirt] Default USB controller model vs PCI address assignment

2018-02-13 Thread Daniel P . Berrangé
GCC8 identified a critical flaw in the QEMU post-parse callback They switch() based on the virDomainControllDef 'model', carefully listing every single enum case. but no default statement. Unfortunately it is valid for "model" to have the valid "-1" which does not map to any enum constant.

Re: [libvirt] [PATCH v2 2/3] Fix more switch fallthrough identified by gcc8

2018-02-13 Thread Daniel P . Berrangé
On Tue, Feb 13, 2018 at 04:57:06PM +, Daniel P. Berrangé wrote: > GCC 8 became more fussy/clear about detecting switch > fallthroughs. First it doesn't like it if you have > a fallthrough attribute that is not before a case > statement. e.g. > >FOO: >BAR: >WIZZ: >

Re: [libvirt] [PATCH 3/6] conf: stop passing virConnectPtr into virDomainDiskTranslateSourcePool

2018-02-13 Thread Daniel P . Berrangé
On Tue, Feb 13, 2018 at 12:34:54PM -0500, John Ferlan wrote: > > > On 02/09/2018 12:24 PM, Daniel P. Berrangé wrote: > > Rather than expecting callers to pass a virConnectPtr into the > > virDomainDiskTranslateSourcePool() method, just acquire a connection > > to the storage driver when needed.

Re: [libvirt] [PATCH 5/6] qemu: stop passing in virConnectPtr for looking up networks

2018-02-13 Thread John Ferlan
On 02/09/2018 12:24 PM, Daniel P. Berrangé wrote: > When setting up graphics, we sometimes need to resolve networks, > requiring the caller to pass in a virConnectPtr, except sometimes they > pass in NULL. Use virGetConnectNetwork() to acquire the connection to > the network driver when it is

Re: [libvirt] [PATCH 3/6] conf: stop passing virConnectPtr into virDomainDiskTranslateSourcePool

2018-02-13 Thread John Ferlan
On 02/09/2018 12:24 PM, Daniel P. Berrangé wrote: > Rather than expecting callers to pass a virConnectPtr into the > virDomainDiskTranslateSourcePool() method, just acquire a connection > to the storage driver when needed. > > Signed-off-by: Daniel P. Berrangé > --- >

Re: [libvirt] [PATCH 4/6] qemu: don't pass virConnectPtr around for secrets

2018-02-13 Thread John Ferlan
On 02/09/2018 12:24 PM, Daniel P. Berrangé wrote: > During domain startup there are many places where we need to acquire > secrets. Currently code passes around a virConnectPtr, except in the > places where we pass in NULL. So there are a few codepaths where ability > to start guests using

[libvirt] [PATCH v2 2/3] Fix more switch fallthrough identified by gcc8

2018-02-13 Thread Daniel P . Berrangé
GCC 8 became more fussy/clear about detecting switch fallthroughs. First it doesn't like it if you have a fallthrough attribute that is not before a case statement. e.g. FOO: BAR: WIZZ: ATTRIBUTE_FALLTHROUGH; Is unacceptable as there's no final case statement, so while FOO & BAR

Re: [libvirt] [PATCH 2/6] qemu: stop passing virConnectPtr into qemuMonitorStartCPUs

2018-02-13 Thread John Ferlan
On 02/09/2018 12:24 PM, Daniel P. Berrangé wrote: > There is a long standing hack to pass a virConnectPtr into the > qemuMonitorStartCPUs method, so that when the text monitor prompts > for a disk password, we can lookup virSecretPtr objects. This causes > us to have to pass a virConnectPtr

[libvirt] [PATCH v2 3/3] Disable gcc8 -Wcast-function-type warnings from -Wextra

2018-02-13 Thread Daniel P . Berrangé
The -Wextra flag bundle gained a new warning -Wcast-function-type. This complains if you cast between two function prototypes where the number of parameters or their data types are not compatible. Unfortunately we need such "bad" function casts for our event callbacks. It is possible to silence

[libvirt] [PATCH v2 0/3] Fix compat with GCC8

2018-02-13 Thread Daniel P . Berrangé
In this second version I enable -Wswitch-enum to strongly validate all switches cover all enum cases. Daniel P. Berrangé (3): Turn on -Wswitch-enum and fix all problems it identifies Fix more switch fallthrough identified by gcc8 Disable gcc8 -Wcast-function-type warnings from -Wextra

[libvirt] [PATCH v2 1/3] Turn on -Wswitch-enum and fix all problems it identifies

2018-02-13 Thread Daniel P . Berrangé
As a general rule any time we switch() on something that is an enum, we want to have a case for every enum constant. The -Wswitch warning will report any switch where we've violated this rule, except if that switch has a default case. Unfortunately it is reasonable to want to list all enum

Re: [libvirt] Developing libvirt for virtual devices like virtual printers

2018-02-13 Thread Ján Tomko
On Thu, Feb 08, 2018 at 09:20:40AM +0530, Deepti S wrote: Hi, I have a couple of questions. - I am a new libvirt code developer. I have just cloned the repo and I am looking for a suitable debugger/IDE which will help me debug the code. - I work in developing and creating virtual printers

Re: [libvirt] [PATCH 1/6] conf: reimplement virDomainNetResolveActualType in terms of public API

2018-02-13 Thread John Ferlan
On 02/09/2018 12:24 PM, Daniel P. Berrangé wrote: > Now that we have the ability to easily open connections to secondary > drivers, eg network:///system, it is possible to reimplement the > virDomainNetResolveActualType method in terms of the public API. This > avoids the need to have the

Re: [libvirt] [PATCH 3/3] qemu: block: Remove misleading part of comment in qemuBlockStorageSourceBuildJSONSocketAddress

2018-02-13 Thread Ján Tomko
On Mon, Feb 12, 2018 at 04:21:00PM +0100, Peter Krempa wrote: The array indexes are formatted if the JSON->commandline translator is translating an array type. It does not at all depend on this function. Signed-off-by: Peter Krempa --- src/qemu/qemu_block.c | 5 - 1 file

Re: [libvirt] [PATCH 2/3] virstoragetest: Add test case for NBD over unix socket with new syntax

2018-02-13 Thread Ján Tomko
On Mon, Feb 12, 2018 at 04:20:59PM +0100, Peter Krempa wrote: Use the new syntax which uses the 'UnixSocket' type in qemu. Signed-off-by: Peter Krempa --- tests/virstoragetest.c | 9 + 1 file changed, 9 insertions(+) ACK Jan signature.asc Description: Digital

Re: [libvirt] [PATCH 1/3] storage: Fix formatting and parsing of qemu type 'UnixSocketAddress'

2018-02-13 Thread Ján Tomko
On Mon, Feb 12, 2018 at 04:20:58PM +0100, Peter Krempa wrote: The documentation for the JSON/qapi type 'UnixSocketAddress' states that the unix socket path field is named 'path'. We used 'socket' by mistake. Fix both the formatter and parser and test suite. Resolves:

Re: [libvirt] [PATCH v4 3/8] libxl: error out on not supported CPU mode, instead of silently ignoring

2018-02-13 Thread Jim Fehlig
On 02/08/2018 03:58 PM, Marek Marczykowski-Górecki wrote: This change make libvirt XML with plain element invalid for libxl, which affect not only upcoming CPUID support, but also NUMA. In fact, default mode 'custom' does not match what the driver actually does, so it was a bug. Adjust

Re: [libvirt] [PATCH libvirt] tests: run virshtest independent of current pwd

2018-02-13 Thread Bjoern Walk
John Ferlan [2018-02-13, 10:32AM -0500]: > > > On 02/08/2018 07:38 AM, Bjoern Walk wrote: > > virshtest execves the virsh binary. Make sure that it finds the binary's > > location independent of the current working directory by specifying the > > absolute path as determined

Re: [libvirt] [PATCH libvirt] tests: run virshtest independent of current pwd

2018-02-13 Thread John Ferlan
On 02/08/2018 07:38 AM, Bjoern Walk wrote: > virshtest execves the virsh binary. Make sure that it finds the binary's > location independent of the current working directory by specifying the > absolute path as determined by the build environment. > > Reviewed-by: Marc Hartmayer

Re: [libvirt] [RFC] virSysinfo: Introduce SMBIOS type 3 support

2018-02-13 Thread John Ferlan
On 02/08/2018 02:05 AM, Zhuangyanying wrote: > From: Zhuang Yanying > > Some applications inside VM need to access SMBIOS Chassis Asset Tag, > which should be emulated. It has already been realized in qemu, > > SMBIOS: Build aggregate smbios tables and entry

Re: [libvirt] [PATCH 09/11] conf: Improve IOAPIC feature handling

2018-02-13 Thread Andrea Bolognani
On Tue, 2018-02-13 at 09:34 -0500, John Ferlan wrote: > On 02/13/2018 08:46 AM, Andrea Bolognani wrote: > > [...] Should I > > send out a v2, or should I just go ahead and push the series given > > the minor nature of the adjustments? > > I see no need for a v2 since the adjustments were

Re: [libvirt] [PATCH 09/11] conf: Improve IOAPIC feature handling

2018-02-13 Thread John Ferlan
On 02/13/2018 08:46 AM, Andrea Bolognani wrote: > On Tue, 2018-02-13 at 07:22 -0500, John Ferlan wrote: >>> Another approach, which didn't make it to the list for some reason, >>> was to end the comment with >>> >>> [...] and so on. See virDomainDefFeaturesCheckABIStability() for >>> more

Re: [libvirt] [PATCH 09/11] conf: Improve IOAPIC feature handling

2018-02-13 Thread Andrea Bolognani
On Tue, 2018-02-13 at 07:22 -0500, John Ferlan wrote: > > Another approach, which didn't make it to the list for some reason, > > was to end the comment with > > > > [...] and so on. See virDomainDefFeaturesCheckABIStability() for > > more details. > > > > That seems like a better way to

Re: [libvirt] [PATCH] Fix build with GCC 8 new warnings

2018-02-13 Thread Andrea Bolognani
On Tue, 2018-02-13 at 12:21 +, Daniel P. Berrangé wrote: > @@ -175,9 +175,9 @@ qemuDomainAsyncJobPhaseToString(qemuDomainAsyncJob job, > case QEMU_ASYNC_JOB_NONE: > case QEMU_ASYNC_JOB_LAST: > ATTRIBUTE_FALLTHROUGH; > +default: > +return "none"; > } > - > -

Re: [libvirt] [PATCH] Fix build with GCC 8 new warnings

2018-02-13 Thread Daniel P . Berrangé
On Tue, Feb 13, 2018 at 01:58:44PM +0100, Jiri Denemark wrote: > On Tue, Feb 13, 2018 at 12:21:11 +, Daniel P. Berrangé wrote: > > GCC 8 added a -Wcast-function-type warning to -Wextra by > > default. This complains if you try to explicitly cast > > one function signature to another function

Re: [libvirt] [PATCH] qemu: Check for down limit of SLIRP prefix too

2018-02-13 Thread John Ferlan
On 02/06/2018 05:59 AM, Michal Privoznik wrote: > https://bugzilla.redhat.com/show_bug.cgi?id=1515533 > > We're already checking if IPv4 prefix isn't too long. But we are > not checking if it isn't too short. QEMU supports prefixes longer > than 4 (including). I haven't find anything similar

Re: [libvirt] [PATCH] Fix build with GCC 8 new warnings

2018-02-13 Thread Jiri Denemark
On Tue, Feb 13, 2018 at 12:21:11 +, Daniel P. Berrangé wrote: > GCC 8 added a -Wcast-function-type warning to -Wextra by > default. This complains if you try to explicitly cast > one function signature to another function signature > with incompatible args. This is something we do many > times

Re: [libvirt] [PATCH 09/11] conf: Improve IOAPIC feature handling

2018-02-13 Thread John Ferlan
On 02/13/2018 04:40 AM, Andrea Bolognani wrote: > On Mon, 2018-02-12 at 16:59 -0500, John Ferlan wrote: >>> @@ -19224,14 +19224,13 @@ virDomainDefParseXML(xmlDocPtr xml, >>> tmp = virXMLPropString(nodes[i], "driver"); >>> if (tmp) { >>> int value =

[libvirt] [PATCH] Fix build with GCC 8 new warnings

2018-02-13 Thread Daniel P . Berrangé
GCC 8 added a -Wcast-function-type warning to -Wextra by default. This complains if you try to explicitly cast one function signature to another function signature with incompatible args. This is something we do many times in libvirt especially with event callbacks. The hack to silence the warning

Re: [libvirt] [PATCHv2 1/1] include: function parameter names same in declaration

2018-02-13 Thread Bjoern Walk
Daniel P. Berrangé [2018-02-13, 09:47AM +]: > On Mon, Feb 12, 2018 at 03:24:03PM -0600, Chris Venteicher wrote: > > Headers use same function parameter names as definition code. > > > > In some cases in libvirt-domain and libvirt-network an established > > naming pattern

Re: [libvirt] [PATCHv2 1/1] include: function parameter names same in declaration

2018-02-13 Thread Daniel P . Berrangé
On Mon, Feb 12, 2018 at 03:24:03PM -0600, Chris Venteicher wrote: > Headers use same function parameter names as definition code. > > In some cases in libvirt-domain and libvirt-network an established > naming pattern in the header files was more consistent and informative > in which case the

Re: [libvirt] [PATCH 1/1] includes: function parameter names same in headers

2018-02-13 Thread Daniel P . Berrangé
On Mon, Feb 12, 2018 at 06:35:45PM +, Daniel P. Berrangé wrote: > On Mon, Feb 12, 2018 at 12:20:55PM -0600, Chris Venteicher wrote: > > Headers use same function parameter names as definition code. > > --- > > include/libvirt/libvirt-domain.h| 26 +- > >

Re: [libvirt] [PATCH 09/11] conf: Improve IOAPIC feature handling

2018-02-13 Thread Andrea Bolognani
On Mon, 2018-02-12 at 16:59 -0500, John Ferlan wrote: > > @@ -19224,14 +19224,13 @@ virDomainDefParseXML(xmlDocPtr xml, > > tmp = virXMLPropString(nodes[i], "driver"); > > if (tmp) { > > int value = virDomainIOAPICTypeFromString(tmp); > > -

Re: [libvirt] [PATCH 08/11] qemu: Fix GIC behavior for the default case

2018-02-13 Thread Andrea Bolognani
On Mon, 2018-02-12 at 16:05 -0500, John Ferlan wrote: > > qemuDomainDefEnableDefaultFeatures(virDomainDefPtr def, > > virQEMUCapsPtr qemuCaps) > > { > > -virGICVersion version; > > - > > -/* The virt machine type always uses GIC: if the relevant

Re: [libvirt] [PATCH 05/11] conf: Validate VIR_DOMAIN_FEATURE_CAPABILITIES properly

2018-02-13 Thread Andrea Bolognani
On Mon, 2018-02-12 at 15:18 -0500, John Ferlan wrote: > > +case VIR_DOMAIN_FEATURE_CAPABILITIES: > > +if (src->features[i] != dst->features[i]) { > > +virReportError(VIR_ERR_CONFIG_UNSUPPORTED, > > + _("State of feature '%s:%s'

Re: [libvirt] [PATCH 03/11] qemu: Move GIC checks to qemuDomainDefValidateFeatures()

2018-02-13 Thread Andrea Bolognani
On Mon, 2018-02-12 at 14:59 -0500, John Ferlan wrote: > > @@ -3252,6 +3252,16 @@ qemuDomainDefValidateFeatures(const virDomainDef > > *def) > > } > > break; > > > > +case VIR_DOMAIN_FEATURE_GIC: > > +if (def->features[i] == VIR_TRISTATE_SWITCH_ON &&

Re: [libvirt] [PATCH python 1/1] Set hints for virPyDictToTypedParams

2018-02-13 Thread Edgar Kaziakhmedov
ping On 02/07/2018 05:49 PM, Edgar Kaziakhmedov wrote: Predefine hints for all parameters possible to avoid wrong type convert. Signed-off-by: Edgar Kaziakhmedov --- libvirt-override.c | 128 +++-- 1 file