Add VM Generation ID device XML schema, parse, format, and documentation.
Signed-off-by: John Ferlan
---
docs/formatdomain.html.in | 54 ++
docs/schemas/domaincommon.rng | 21 ++
src/conf/domain_conf.c| 112
Introduce a new domain device "vmgenid". This device will be
used to provide a unique identifier for certain guest execution
operations such as start after snapshot, start from backup,
failover in disaster recovery, and start after import, copy,
clone.
Signed-off-by: John Ferlan
Could be a v1, but figured I'd get feedback first - I have a "working
example" for QEMU (supported since 2.9.0), but it's not quite ready
to be fully posted. Currently only needed for windows guests, but
there is some work upstream (somewhere) to make a Linux implementation.
Still have to work
On Tue, 2018-03-20 at 13:08 +0100, Christian Ehrhardt wrote:
> nvdimm memory is backed by a path on the host. This currently works
> only via
> hotplug where the AppArmor label is created via the domain label
> callbacks.
>
> This adds the virt-aa-helper support for nvdimm memory devices to
>
On Tue, 2018-03-20 at 13:08 +0100, Christian Ehrhardt wrote:
> Input devices can passthrough an event device. This currently works
> only via
> hotplug where the AppArmor label is created via the domain label
> callbacks.
>
> This adds the virt-aa-helper support for passthrough input devices to
>
On Tue, 2018-03-20 at 13:08 +0100, Christian Ehrhardt wrote:
> d8116b5a "security: Introduce functions for input device hot(un)plug"
> implemented the code (Set|Restore)InputLabel for several security
> modules,
> this patch adds an AppArmor implementation for it as well.
>
> That fixes
On Tue, 2018-03-20 at 13:08 +0100, Christian Ehrhardt wrote:
> Recent changes have made implementing this mandatory to hot add any
> memory.
> Implementing this in apparmor fixes this as well as allows hot-add of
> nvdimm
> tpye memory with an nvdimmPath set generating a AppArmor rule for
> that
>
Hi,
I was in the irc #virt@OFTC last days and kashyap gave me a lot of
helping. His wiki page
https://wiki.libvirt.org/page/Live-disk-backup-with-active-blockcommit
was very cool and I found some enhancements while testing. I would
write this enhancements to the wiki page and would ask you
On 03/20/2018 02:13 PM, Andrea Bolognani wrote:
> On Tue, 2018-03-20 at 13:54 -0400, Laine Stump wrote:
>> On 03/20/2018 01:00 PM, Daniel P. Berrangé wrote:
>>> Macros in RPMs are expanded before line continuations, so when we write
>>>
>>>%systemd_preun foo \
>>> bar
>>>
>>>
On Tue, 2018-03-20 at 13:54 -0400, Laine Stump wrote:
> On 03/20/2018 01:00 PM, Daniel P. Berrangé wrote:
> > Macros in RPMs are expanded before line continuations, so when we write
> >
> >%systemd_preun foo \
> > bar
> >
> > What happens is that it expands to
> >
> >
On 03/20/2018 01:00 PM, Daniel P. Berrangé wrote:
> Macros in RPMs are expanded before line continuations, so when we write
>
>%systemd_preun foo \
> bar
>
> What happens is that it expands to
>
>if [ $1 -eq 0 ] ; then
> # Package removal, not upgrade
>
On 03/20/2018 01:00 PM, Daniel P. Berrangé wrote:
> Macros in RPMs are expanded before line continuations, so when we write
>
>%systemd_preun foo \
> bar
>
> What happens is that it expands to
>
>if [ $1 -eq 0 ] ; then
> # Package removal, not upgrade
>
Inspired by commit ffb7954f to improve readability of the libxl
migration APIs.
Signed-off-by: Jim Fehlig
---
Suggested by jferlan while reviewing other patches touch the libxl
migration code
https://www.redhat.com/archives/libvir-list/2018-March/msg00769.html
On Fri, 2018-03-16 at 11:33 -0400, John Ferlan wrote:
> This looks particularly useful for other commands, but...
>
[...]
>
> It's only generated/built for one - seems like a lot of work for little
> gain unless of course there's a plan to add in all the others. Without
> adding in others, one
Macros in RPMs are expanded before line continuations, so when we write
%systemd_preun foo \
bar
What happens is that it expands to
if [ $1 -eq 0 ] ; then
# Package removal, not upgrade
systemctl --no-reload disable --now foo \ > /dev/null 2>&1 || :
fi
On Mon, Mar 19, 2018 at 04:29:57PM +0100, Andrea Bolognani wrote:
> Disk size for guests is somewhat limited, so we need to tell
> ccache to only consume a reasonable chunk of it.
>
> Signed-off-by: Andrea Bolognani
> ---
> guests/files/ccache.conf | 1 +
>
On Mon, Mar 19, 2018 at 04:29:55PM +0100, Andrea Bolognani wrote:
> Having the name of the user that can access the machine match
> the name of the flavor, as is already the case for the 'test'
> flavor, makes some things easier.
>
> We can change this safely because the CentOS CI is the only
>
On Mon, Mar 19, 2018 at 04:29:56PM +0100, Andrea Bolognani wrote:
> Some steps involved in creating the user account are the same
> regardless of flavor, and more common steps will be introduced
> later on, so it makes sense to have them all in the same place
> instead of duplicating them.
>
>
The 'base' pseudo-package is an implementation detail, and as
such is better not exposed.
Signed-off-by: Andrea Bolognani
---
guests/host_vars/libvirt-centos-6/main.yml| 1 -
guests/host_vars/libvirt-centos-7/main.yml| 1 -
The 'jenkins' pseudo-package is an implementation detail, and
as such is better not exposed.
Moreover, with this change the JDK will only be installed when
the 'jenkins' flavor is used, which means developers will have
slightly smaller guests.
Signed-off-by: Andrea Bolognani
We're going to remove the 'jenkins' pseudo-project from the list
of per-guest projects soon, so we need another way of deciding
whether to install and configure the Jenkins agent.
The availability of the Jenkins secret in the vault is a perfect
candidate, and using it improves things in general
Applies on top of
https://www.redhat.com/archives/libvir-list/2018-March/msg01093.html
Andrea Bolognani (3):
guests: Configure Jenkins agent based on secret availability
guests: Don't expose 'jenkins' pseudo-package
guests: Don't expose 'base' pseudo-package
On Tue, Mar 20, 2018 at 04:03:13PM +0100, Andrea Bolognani wrote:
> Signed-off-by: Andrea Bolognani
> ---
> .travis.yml | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/.travis.yml b/.travis.yml
> index d071c98634..01dffaa602 100644
> --- a/.travis.yml
> +++
On Tue, Mar 20, 2018 at 03:20:31PM +0100, Martin Kletzander wrote:
> 1) Default devices/values
>
> Libvirt itself must default to whatever values there were before any
> particular element was introduced due to the fact that it strives to
> keep the guest ABI stable. That means, for example,
On Tue, Mar 20, Olaf Hering wrote:
> Mär 20 09:35:52 macintyre-old libvirtd[4527]: 2018-03-20 08:35:52.521+:
> 4531: error : virNetSocketNewListenTCP:389 : Unable to bind to port: Cannot
> assign requested address
After further debugging:
27672 16:04:46.774906 socket(PF_INET6,
Signed-off-by: Andrea Bolognani
---
.travis.yml | 2 ++
1 file changed, 2 insertions(+)
diff --git a/.travis.yml b/.travis.yml
index d071c98634..01dffaa602 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -7,10 +7,12 @@ matrix:
- compiler: gcc
dist: trusty
Hi everyone!
First of all sorry for such wide distribution, but apparently that's the
best way to make sure we cooperate nicely. So please be considerate as
this is a cross-post between huge amount of mailing lists.
After some discussions with developers from different projects that work
with
On Tue, Mar 20, 2018 at 12:36:37PM +, Daniel P. Berrangé wrote:
> The https:// protocol is much more reliably usable than git:// when
> faced with unreasonably strict firewalls. The libvirt.org web server is
> now setup to support the smart https:// protocol, which is just as fast
> as git://,
On Tue, Mar 20, 2018 at 12:36:36PM +, Daniel P. Berrangé wrote:
> The gitorious.org service went away a long time ago now, and our main
> download.html page tells people where all the official mirrors are
> for every component.
>
> Meanwhile telling people about CVS is a bad joke in 2018, and
On Tue, Mar 20, 2018 at 01:46:43PM +0100, Andrea Bolognani wrote:
> On Tue, 2018-03-20 at 12:40 +, Daniel P. Berrangé wrote:
> > On Tue, Mar 20, 2018 at 01:38:50PM +0100, Andrea Bolognani wrote:
> > > On Tue, 2018-03-20 at 11:12 +, Daniel P. Berrangé wrote:
> > > > While current RHEL are
On Tue, 2018-03-20 at 12:40 +, Daniel P. Berrangé wrote:
> On Tue, Mar 20, 2018 at 01:38:50PM +0100, Andrea Bolognani wrote:
> > On Tue, 2018-03-20 at 11:12 +, Daniel P. Berrangé wrote:
> > > While current RHEL are py2, future RHEL should be expected to
> > > use Python 3 too
> > >
[...]
>
On Tue, Mar 20, 2018 at 01:38:50PM +0100, Andrea Bolognani wrote:
> On Tue, 2018-03-20 at 11:12 +, Daniel P. Berrangé wrote:
> > On Tue, Mar 20, 2018 at 11:53:53AM +0100, Andrea Bolognani wrote:
> > > While RHEL / CentOS are still using Python 2 for the time being,
> > > Fedora has already
On Tue, 2018-03-20 at 11:12 +, Daniel P. Berrangé wrote:
> On Tue, Mar 20, 2018 at 11:53:53AM +0100, Andrea Bolognani wrote:
> > While RHEL / CentOS are still using Python 2 for the time being,
> > Fedora has already switched to Python 3 as the default Python
> > interpreter a while ago, so on
The https:// protocol is much more reliably usable than git:// when
faced with unreasonably strict firewalls. The libvirt.org web server is
now setup to support the smart https:// protocol, which is just as fast
as git://, so change all the docs to use https://
Signed-off-by: Daniel P. Berrangé
The gitorious.org service went away a long time ago now, and our main
download.html page tells people where all the official mirrors are
for every component.
Meanwhile telling people about CVS is a bad joke in 2018, and the CVS
server no longer exists on libvirt.org
Signed-off-by: Daniel P.
Daniel P. Berrangé (2):
docs: remove obsolete docs about gitorious and cvs access
docs: update all GIT repo examples to use https:// protocol
README-hacking | 2 +-
docs/csharp.html.in | 2 +-
docs/devguide.html.in| 6 +++---
docs/downloads.html.in | 9 +
This removes all the sd-bus code and uses GDBus instead.
Signed-off-by: Pavel Hrdina
---
README | 1 -
configure.ac | 3 -
data/Makefile.am | 4 +-
data/org.libvirt.Connect.xml | 56
data/org.libvirt.Domain.xml |
We will switch to GDBus implementation of D-Bus protocol because
sd-bus implementation is not thread safe.
Processing messages in threads is essential since Libvirt API can
take some significant amount of time to return and that would block
the whole libvirt-dbus daemon.
Signed-off-by: Pavel
The default thread count is currently 4 and it is also configurable
via --threads/-t paramter for the libvirt-dbus daemon.
Signed-off-by: Pavel Hrdina
---
src/connect.c | 4 +++
src/connect.h | 1 +
src/gdbus.c | 97
Changes in v2:
- removed patch that set the required libvirt version to
libvirt-dbus version
Pavel Hrdina (3):
introduce support for GDBus implementation
switch from sd-bus to GDBus implementation
main: introduce thread pool to process D-Bus messages
README
On Tue, Mar 20, 2018 at 06:48:43AM +, Radostin Stoyanov wrote:
> Changes since v1
> (https://www.redhat.com/archives/libvir-list/2018-March/msg01001.html)
>
> 01 - Fixed typo.
> 03 - Added whitespace after comma in: value = value +
> re.sub("^(\d+)U$","\\1", token[1])
> 05 and 06 - Use
nvdimm memory is backed by a path on the host. This currently works only via
hotplug where the AppArmor label is created via the domain label callbacks.
This adds the virt-aa-helper support for nvdimm memory devices to generate
rules for the needed paths from the initial guest definition as well.
So far users added manual rules for most of these uncommon devices,
but recent changes made some of the callbacks mandatory for hotplug
so we should take shot at implementing them as those callbacks as well
as for the initial start of a guest via virt-aa-helper.
Christian Ehrhardt (4):
d8116b5a "security: Introduce functions for input device hot(un)plug"
implemented the code (Set|Restore)InputLabel for several security modules,
this patch adds an AppArmor implementation for it as well.
That fixes hot-plugging event input devices by generating a rule for the
path that needs to
Recent changes have made implementing this mandatory to hot add any
memory.
Implementing this in apparmor fixes this as well as allows hot-add of nvdimm
tpye memory with an nvdimmPath set generating a AppArmor rule for that
path.
Example hot adding:
/tmp/nvdimm-test
Input devices can passthrough an event device. This currently works only via
hotplug where the AppArmor label is created via the domain label callbacks.
This adds the virt-aa-helper support for passthrough input devices to generate
rules for the needed paths from the initial guest definition as
On Tue, Mar 20, 2018 at 12:27:17PM +0100, Ján Tomko wrote:
> On Mon, Mar 19, 2018 at 07:47:54PM +0100, Jiri Denemark wrote:
> > On Wed, Mar 07, 2018 at 10:29:32 +0100, Ján Tomko wrote:
> > > All we need is DBus.
> >
> > Unfortunately, this is wrong. From a compilation/linking POV we really
> >
On Mon, Mar 19, 2018 at 07:47:54PM +0100, Jiri Denemark wrote:
On Wed, Mar 07, 2018 at 10:29:32 +0100, Ján Tomko wrote:
All we need is DBus.
Unfortunately, this is wrong. From a compilation/linking POV we really
don't need anything more than D-Bus.
Good, we should compile as much code as we
On Tue, Mar 20, 2018 at 11:42:38AM +0100, Andrea Bolognani wrote:
> Although it was never formally specified, it was always expected
> that the mingw RPM build would happen on Fedora, if anything
> because RHEL / CentOS don't ship the necessary mingw dependencies.
>
> Make this fact explicit by
On Tue, Mar 20, 2018 at 11:53:54AM +0100, Andrea Bolognani wrote:
> While RHEL / CentOS are still using Python 2 for the time being,
> Fedora has already switched to Python 3 as the default Python
> interpreter a while ago, so on that OS it doesn't make sense to
> drag in Python 2 anymore.
>
>
On Tue, Mar 20, 2018 at 11:53:53AM +0100, Andrea Bolognani wrote:
> While RHEL / CentOS are still using Python 2 for the time being,
> Fedora has already switched to Python 3 as the default Python
> interpreter a while ago, so on that OS it doesn't make sense to
> drag in Python 2 anymore.
While
On Tue, Mar 20, 2018 at 11:53:55AM +0100, Andrea Bolognani wrote:
> Signed-off-by: Andrea Bolognani
> ---
> docs/news.xml | 11 +++
> 1 file changed, 11 insertions(+)
Reviewed-by: Daniel P. Berrangé
Regards,
Daniel
--
|: https://berrange.com
On Tue, Mar 20, 2018 at 11:53:52AM +0100, Andrea Bolognani wrote:
> Our build process no longer depends on Python 2, so we can
> finally allow Python 3 to satisfy our requirement for a Python
> interpreter.
>
> Since several distributions have now switched to installing
> Python 3 by default and
On Fri, Mar 16, 2018 at 12:39:59 +0100, Michal Privoznik wrote:
> https://bugzilla.redhat.com/show_bug.cgi?id=1556828
>
> When defining a domain that has our
> parser creates two entries in virDomainDef: one for
> and one for . However, some info is shared between the
> two which makes user
Signed-off-by: Andrea Bolognani
---
docs/news.xml | 11 +++
1 file changed, 11 insertions(+)
diff --git a/docs/news.xml b/docs/news.xml
index 6d729d5085..75a0543084 100644
--- a/docs/news.xml
+++ b/docs/news.xml
@@ -35,6 +35,17 @@
+
+
+
While RHEL / CentOS are still using Python 2 for the time being,
Fedora has already switched to Python 3 as the default Python
interpreter a while ago, so on that OS it doesn't make sense to
drag in Python 2 anymore.
Signed-off-by: Andrea Bolognani
---
libvirt.spec.in | 9
>>> import blurb
Traceback (most recent call last):
File "", line 1, in
ModuleNotFoundError: No module named 'blurb'
>>>
Andrea Bolognani (4):
configure: Allow (and prefer) Python 3
spec: Use Python 3 for building on Fedora
mingw: Use Python 3 for building
news: Update for Python 3
While RHEL / CentOS are still using Python 2 for the time being,
Fedora has already switched to Python 3 as the default Python
interpreter a while ago, so on that OS it doesn't make sense to
drag in Python 2 anymore.
Signed-off-by: Andrea Bolognani
---
mingw-libvirt.spec.in
Our build process no longer depends on Python 2, so we can
finally allow Python 3 to satisfy our requirement for a Python
interpreter.
Since several distributions have now switched to installing
Python 3 by default and Python 2 is on its way out, prefer the
former when both are available.
Although it was never formally specified, it was always expected
that the mingw RPM build would happen on Fedora, if anything
because RHEL / CentOS don't ship the necessary mingw dependencies.
Make this fact explicit by erroring out if that's not the case,
the same way we already do in the main
Hi,
there is a race condition between 'qemuDomainCreate' and
'qemuDomainDestroy' causing a NULL pointer segmentation fault when
accessing priv->monConfig. The race condition can be easily reproduced
using gdb.
(gdb) set non-stop on
# set breakpoint on line 'mon = qemuMonitorOpen(vm, …)'
(gdb) b
Daniel P. Berrangé [2018-03-15, 11:36AM +]:
> It is nice that git has the short-hand for adding Signed-off-by, but
> adding other tags during reviews is kind of tedious and long winded.
> eg "ACK" is much shorter than typing "Reviewed-by: ...blah blah blah.."
>
> Good
On Mon, 2018-03-19 at 15:38 -0400, Cole Robinson wrote:
> Yet another dependency on dict() hash ordering
>
> Signed-off-by: Cole Robinson
> ---
> src/hyperv/hyperv_wmi_generator.py | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git
On Mon, Mar 19, 2018 at 03:38:04PM -0400, Cole Robinson wrote:
> Yet another dependency on dict() hash ordering
>
> Signed-off-by: Cole Robinson
> ---
> src/hyperv/hyperv_wmi_generator.py | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Reviewed-by: Daniel P.
On Mon, Mar 19, Jim Fehlig wrote:
> While working on the {Begin,End}API improvements I noticed a few problems
> in the migration code. The first two are trival, but the third describes
> a problem I encountered while testing, and provides a potential fix. See
> the patch for more details.
I
An OID of 36957 was assigned to libvirt by IANA, but the placeholder OID
of 12345 was never replaced.
IANA lists the libvirt registration as:
36957
libvirt
Daniel Veillard
daniel
https://www.iana.org/assignments/enterprise-numbers/enterprise-numbers
Signed-off-by: Michael Corcoran
Upstream net-snmp removed the U64 typedef in 2016 as it clashed with a
name in Perl, thus all usages of U64 must be replaced by struct counter64 to
compile against recent versions of net-snmp.
The replacements were made by hand, while referencing diff with new
source generated by the mib2c tool.
The first patch fixes the build against net-snmp newer than 2016ish, where they
removed their U64 typedef from headers to avoid a Perl incompability.
Second patch replaces the placeholder organisation OID (12345) with the IANA
registered libvirt OID (36957).
I have tested these patches lightly
On Mon, Mar 19, 2018 at 20:20:23 +0100, Jiri Denemark wrote:
> is the only way to disable balloon driver
> since libvirt will add one automatically if the memballoon element is
> missing. In other words, there's no balloon device if model is 'none'
> and generating an alias for it makes no sense.
Fix comments for virConnectListAllNodeDevices and
virConnectListAllSecrets.
Signed-off-by: Han Han
---
src/libvirt-nodedev.c | 2 +-
src/libvirt-secret.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/libvirt-nodedev.c b/src/libvirt-nodedev.c
index
Improve readability by reducing the complexity and length of
conditional statements.
Example: The following condition:
if (o >= 97 and o <= 122) or
(o >= 65 and o <= 90) or
(o >= 48 and o <= 57) or
(" \t(){}:;,+-*/%&!|[]=><".find(line[i]) == -1):
Will be
Reduce the number of if-statements used to assign a literals
to corresponding class variables.
Signed-off-by: Radostin Stoyanov
---
docs/apibuild.py | 31 +--
1 file changed, 13 insertions(+), 18 deletions(-)
diff --git a/docs/apibuild.py
Backslash between brackets in Python is redundant. [1]
1: https://lintlyci.github.io/Flake8Rules/rules/E502.html
Signed-off-by: Radostin Stoyanov
---
docs/apibuild.py | 26 +-
1 file changed, 13 insertions(+), 13 deletions(-)
diff --git
Replace the print statement, that is only available in Py2, with a
print function that is available in both Py2 and Py3 and drop the
explicit python version in the shebang.
Signed-off-by: Radostin Stoyanov
---
tests/cputestdata/cpu-reformat.py | 4 ++--
1 file changed, 2
The method strip_lead_star() removes a single leading asterisk
character from a string by ignoring leading whitespace, otherwise it
returns the original string.
This could be achieved with a single if-statement followed by replace.
Signed-off-by: Radostin Stoyanov
---
http://pylint-messages.wikidot.com/messages:c0325
Signed-off-by: Radostin Stoyanov
---
docs/apibuild.py | 74
1 file changed, 37 insertions(+), 37 deletions(-)
diff --git a/docs/apibuild.py b/docs/apibuild.py
index
Signed-off-by: Radostin Stoyanov
---
docs/apibuild.py | 18 +-
docs/index.py | 6 +++---
tests/cputestdata/cpu-cpuid.py | 2 +-
3 files changed, 13 insertions(+), 13 deletions(-)
diff --git a/docs/apibuild.py
The function generate_helper_header() only returns a formatted string.
This could be achieved without performing string concatenation.
Signed-off-by: Radostin Stoyanov
---
src/esx/esx_vi_generator.py | 22 +-
1 file changed, 9 insertions(+), 13
The generate_helper_source() function returns a formatted string.
This could be achieved without the use of a local variable "source"
and string concatenation.
Signed-off-by: Radostin Stoyanov
---
src/esx/esx_vi_generator.py | 31 ---
1 file
PEP8 recommends removing whitespace immediately before a comma,
semicolon, or colon [1]. In addition remove multiple spaces after
keyword (PEP8 - E271).
1:
https://www.python.org/dev/peps/pep-0008/#whitespace-in-expressions-and-statements
Signed-off-by: Radostin Stoyanov
PEP8 recommends not having spaces around = in a keyword argument or
a default parameter value.
https://www.python.org/dev/peps/pep-0008/#other-recommendations
Signed-off-by: Radostin Stoyanov
---
docs/apibuild.py | 24
Signed-off-by: Radostin Stoyanov
---
docs/apibuild.py | 14 +-
1 file changed, 5 insertions(+), 9 deletions(-)
diff --git a/docs/apibuild.py b/docs/apibuild.py
index 1f9c8f12c..5e218a9ad 100755
--- a/docs/apibuild.py
+++ b/docs/apibuild.py
@@ -432,21 +432,17 @@
Signed-off-by: Radostin Stoyanov
---
docs/apibuild.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/docs/apibuild.py b/docs/apibuild.py
index 98224c7e7..4c8fa5740 100755
--- a/docs/apibuild.py
+++ b/docs/apibuild.py
@@ -478,8 +478,8 @@ class
PEP8 recommends that the number of spaces used for indentation of
Python code to be a multiple of four [1] [2].
1: https://lintlyci.github.io/Flake8Rules/rules/E111.html
2: https://lintlyci.github.io/Flake8Rules/rules/E114.html
Signed-off-by: Radostin Stoyanov
---
Improve readability and reduce the complexity of the code that is
searching for string tokens (i.e. characters surrounded by a single
or double quote).
Signed-off-by: Radostin Stoyanov
---
docs/apibuild.py | 32 ++--
1 file changed, 10
Signed-off-by: Radostin Stoyanov
---
docs/apibuild.py | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/docs/apibuild.py b/docs/apibuild.py
index f073b36c7..98224c7e7 100755
--- a/docs/apibuild.py
+++ b/docs/apibuild.py
@@ -471,8 +471,7 @@ class CLexer:
Improve readability and reduce complexity the method
parseTypeComment().
Signed-off-by: Radostin Stoyanov
---
docs/apibuild.py | 42 --
1 file changed, 16 insertions(+), 26 deletions(-)
diff --git a/docs/apibuild.py
The uniq() function returns a sorted list, there is no need
to sort this list again.
Signed-off-by: Radostin Stoyanov
---
docs/apibuild.py | 19 ++-
1 file changed, 6 insertions(+), 13 deletions(-)
diff --git a/docs/apibuild.py b/docs/apibuild.py
index
Use a set (unordered collections of unique elements) [1] to remove
repeated elements in a list.
1: https://docs.python.org/3/tutorial/datastructures.html#sets
Signed-off-by: Radostin Stoyanov
---
docs/apibuild.py | 6 +-
1 file changed, 1 insertion(+), 5 deletions(-)
The functions like isalnum(), isalpha(), isdigit(), etc. are also
available in Python, however `make syntax-check` do not intend to
prohibit them.
Signed-off-by: Radostin Stoyanov
---
cfg.mk | 1 +
1 file changed, 1 insertion(+)
diff --git a/cfg.mk b/cfg.mk
index
Lists in Python are mutable and when used as a default value of a
parameter for class constructor, its value will be shared between
all class instances.
Example:
class Test:
def __init__(self, mylist=[]):
self.mylist = mylist
A = Test()
B =
Reduce the number of if-statements and use a single return.
Utilise a dictionary to map between occurrences and values.
Signed-off-by: Radostin Stoyanov
---
src/esx/esx_vi_generator.py | 19 ++-
1 file changed, 10 insertions(+), 9 deletions(-)
diff --git
Generate whitespace using the standard function ljust() that is
available in both Py3 [1] and Py2 [2].
1: https://docs.python.org/3/library/stdtypes.html?highlight=strip#str.ljust
2: https://docs.python.org/2.7/library/string.html#string.ljust
Signed-off-by: Radostin Stoyanov
The isinstance() function [1] returns true if an object argument is an
instance of a classinfo argument or of a direct, indirect subclass
thereof.
1: https://docs.python.org/3/library/functions.html#isinstance
Signed-off-by: Radostin Stoyanov
---
docs/apibuild.py | 7
Changes since v1
(https://www.redhat.com/archives/libvir-list/2018-March/msg01001.html)
01 - Fixed typo.
03 - Added whitespace after comma in: value = value + re.sub("^(\d+)U$","\\1",
token[1])
05 and 06 - Use printf style format and break strings everywhere there is a
newline.
07 - Use
PEP8 recommends imports to be on separate lines. [1]
1: https://www.python.org/dev/peps/pep-0008/#imports
Signed-off-by: Radostin Stoyanov
---
docs/apibuild.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/docs/apibuild.py b/docs/apibuild.py
index
96 matches
Mail list logo