Pure Python binding?

2023-09-05 Thread Philipp Hahn
;? Or is there another "trick" to talk to libvirtd? And no, parsing the output of subprocess.run("ssh ... virsh ...") is not an option ;-) Philipp -- Philipp Hahn Open Source Software Engineer Univention GmbH Mary-Somerville-Str. 1 28359 Bremen Germany | Deutschland Phone

[python-libvirt] RFC:PEP 484 type annotation - how to continue

2020-10-05 Thread Philipp Hahn
refer adding a new attribute which can be used to override the Python type. This also would probably nicely fit with functions like "virDomainOpenConsole", when "dev_name" is optional and can be "None", which the current type hint requires a "string". Is exten

Re: Please revert f4be03b3 (libvirtaio: Drop object(*args, **kwargs)) for theoretical reasons

2020-08-28 Thread Philipp Hahn
Hello, Am 20.08.20 um 11:20 schrieb Daniel P. Berrangé: > On Wed, Aug 19, 2020 at 11:32:10PM +0200, Wojtek Porczyk wrote: >> Hi Philipp, >> (Cc: Daniel, because IIUC you reviewed !16 which got this merged), >> >> I'm sorry I didn't notice this earlier, but the commit f4be03b3 dated >> 2020-04-20 [

libvirt-python: Extending libvirt-*override-api.xml?

2020-07-27 Thread Philipp Hahn
Hello, Am 25.07.20 um 23:45 schrieb Philipp Hahn: > Am 27.04.20 um 15:44 schrieb Philipp Hahn: >> I'm working on adding PEP 484 type hints >> <https://www.python.org/dev/peps/pep-0484/> to the Python binding of >> libvirt. ... > I just opened a merge request &g

libvirt-python: API change List → (Named)Tuple?

2020-07-26 Thread Philipp Hahn
Hello, Am 25.07.20 um 23:45 schrieb Philipp Hahn: > Am 27.04.20 um 15:44 schrieb Philipp Hahn: >> I'm working on adding PEP 484 type hints >> <https://www.python.org/dev/peps/pep-0484/> to the Python binding of >> libvirt. ... > I just opened a merge request &g

Re: [PATCH libvirt-python 0/5] Fixes from adding type annotation

2020-07-25 Thread Philipp Hahn
Hello, Am 27.04.20 um 15:44 schrieb Philipp Hahn: > as announced a long time ago with > <https://www.redhat.com/archives/libvir-list/2018-November/msg00291.html> > and recently refreshed with > <https://www.redhat.com/archives/libvir-list/2020-April/msg00892.html> > I&

[PATCH libvirt-python 5/5] libvirtaio: Fix return types of callback

2020-04-27 Thread Philipp Hahn
return value, so remove the pointless return to pass on None. Signed-off-by: Philipp Hahn --- libvirtaio.py | 18 -- 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/libvirtaio.py b/libvirtaio.py index 328e6f2..f1811c1 100644 --- a/libvirtaio.py +++ b/libvirtaio.py

[PATCH libvirt-python 1/5] generator: Fix undefined variables file

2020-04-27 Thread Philipp Hahn
Signed-off-by: Philipp Hahn --- generator.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/generator.py b/generator.py index 426f007..7f4ae1f 100755 --- a/generator.py +++ b/generator.py @@ -928,7 +928,7 @@ def buildStubs(module, api_xml): parser.close

[PATCH libvirt-python 2/5] generator: Fix string formatting

2020-04-27 Thread Philipp Hahn
remove excessive arguments. Signed-off-by: Philipp Hahn --- generator.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generator.py b/generator.py index 7f4ae1f..a14 100755 --- a/generator.py +++ b/generator.py @@ -766,7 +766,7 @@ def print_function_wrapper(module

[PATCH libvirt-python 3/5] generator: Fix domainSnapshot.listAllChildren()

2020-04-27 Thread Philipp Hahn
>>> dom.snapshotCreateXML("""Second""") >>> child, == first.listAllChildren() >>> second.domain() ^ >>> child.domain() ^ Signed-off-by: Philipp Hahn --- libvirt-override-virDomainSnapshot.py

[PATCH libvirt-python 4/5] qemu-api: Fix return type

2020-04-27 Thread Philipp Hahn
The API XML description uses "C types": "str *" is not valid. Signed-off-by: Philipp Hahn --- libvirt-qemu-override-api.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libvirt-qemu-override-api.xml b/libvirt-qemu-override-api.xml index ca0dae9..

[PATCH libvirt-python 0/5] Fixes from adding type annotation

2020-04-27 Thread Philipp Hahn
patch bomb is quiet large I'm going to submit them in smaller chunks to make them more reviewable. Today I start with the first round consisting of "real" bugs in the current code: Philipp Hahn (5): generator: Fix undefined variables file generator: Fix string formatting generator:

[PATCH libvirt-python] examples: Fix connection error handling 2

2020-04-27 Thread Philipp Hahn
Fix two more cases in examples as libvirt.open*() does not return None but raises an exception Fixes: 283e2bc693746164b6e14d6fe3ccd38a07bf Signed-off-by: Philipp Hahn --- examples/dhcpleases.py | 5 +++-- examples/domipaddrs.py | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions

Re: [libvirt-python PATCH v2] setup: require python >= 3.5 to build

2020-04-21 Thread Philipp Hahn
Am 20.04.20 um 15:57 schrieb Daniel P. Berrangé: > Pytjon 3.5 is the oldest Python version available across our supported > build platforms. > > Signed-off-by: Daniel P. Berrangé Reviewed-by: Philipp Hahn > --- > setup.py | 8 ++-- > 1 file changed, 6 inser

Re: [libvirt-python PATCH] setup: require python >= 3.5 to build

2020-04-20 Thread Philipp Hahn
Hello Daniel, Am 20.04.20 um 15:02 schrieb Daniel P. Berrangé: > On Mon, Apr 20, 2020 at 02:59:38PM +0200, Philipp Hahn wrote: >> Am 20.04.20 um 14:47 schrieb Daniel P. Berrangé: >>> Pytjon 3.5 is the oldest Python version available across our supported ... >>> -

[PATCH v2] doc/python: Update to Python 3

2020-04-20 Thread Philipp Hahn
Convert the simple example to Python 3 syntax: - print() is a function - do not use bare except - libvirt.open*() does not return None but raises an exception The referenced source for the example was removed with 5bb2a245abbde4c0a407f631660e2f2c81bc4c02 Signed-off-by: Philipp Hahn --- docs

Re: [libvirt-python PATCH] setup: require python >= 3.5 to build

2020-04-20 Thread Philipp Hahn
Hello Daniel. 2 nits: Am 20.04.20 um 14:47 schrieb Daniel P. Berrangé: > Pytjon 3.5 is the oldest Python version available across our supported ^ h > build platforms. > > Signed-off-by: Daniel P. Berrangé > --- > setup.py | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > di

[PATCH libvirt-python] examples: Fix connection error handling

2020-04-19 Thread Philipp Hahn
libvirt.open*() does not return None but raises an exception Signed-off-by: Philipp Hahn --- examples/dominfo.py| 5 +++-- examples/domrestore.py | 5 +++-- examples/domsave.py| 5 +++-- examples/domstart.py | 5 +++-- examples/esxlist.py| 6 +++--- 5 files changed, 15 insertions

[PATCH] doc/python: Update to Python 3

2020-04-19 Thread Philipp Hahn
Convert the simple example to Python 3 syntax: - print() is a function - do not use bare except - libvirt.open*() does not return None but raises an exception The referenced source for the example was removed with 5bb2a245abbde4c0a407f631660e2f2c81bc4c02 --- docs/python.html.in | 18 +

Re: [python] WIP-FYI: mypy annotations for libvirt-python and cleanup for generator.py

2020-04-19 Thread Philipp Hahn
Hello, Am 08.11.18 um 11:11 schrieb Philipp Hahn: > Maybe you already have heard about mypy <http://mypy-lang.org/>, which > "is an experimental optional static type checker for Python that aims to > combine the benefits of dynamic (or "duck") typing and static typi

[libvirt] [PATCH go-xml 2/4] doc: Variable is already defined

2019-11-21 Thread Philipp Hahn
Signed-off-by: Philipp Hahn --- doc.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc.go b/doc.go index f97f2eb..d1f94b2 100644 --- a/doc.go +++ b/doc.go @@ -55,7 +55,7 @@ // xmldoc, err := dom.GetXMLDesc(0) // // domcfg := &libvirtxml.Domain{} -//

[libvirt] [PATCH go-xml 3/4] doc: Add missing newline

2019-11-21 Thread Philipp Hahn
Signed-off-by: Philipp Hahn --- doc.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc.go b/doc.go index d1f94b2..c4ce0dd 100644 --- a/doc.go +++ b/doc.go @@ -57,6 +57,6 @@ // domcfg := &libvirtxml.Domain{} // err = domcfg.Unmarshal(xmldoc) // -// fmt.Printf(&

[libvirt] [PATCH go-xml 1/4] doc: Handle conn.LookupDomainByName() error

2019-11-21 Thread Philipp Hahn
Signed-off-by: Philipp Hahn --- doc.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc.go b/doc.go index 2886c79..f97f2eb 100644 --- a/doc.go +++ b/doc.go @@ -51,7 +51,7 @@ // ) // // conn, err := libvirt.NewConnect("qemu:///system"

[libvirt] [PATCH go-xml 4/4] doc: Make examples a complete program

2019-11-21 Thread Philipp Hahn
Add `package main` and declare a `main()` function. Signed-off-by: Philipp Hahn --- doc.go | 28 ++-- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/doc.go b/doc.go index c4ce0dd..25bc1d5 100644 --- a/doc.go +++ b/doc.go @@ -33,30 +33,38

[libvirt] [PATCH go-xml 0/4] Update documentation

2019-11-21 Thread Philipp Hahn
Hello, as requested here are my proposed changes from <https://www.berrange.com/posts/2017/01/05/announce-new-libvirt-project-go-xml-parser-model/> for libvirt-go-xml/doc.go. Philipp Hahn (4): doc: Handle conn.LookupDomainByName() error doc: Variable is already defined doc: Add m

[libvirt] [PATCH console-proxy 3/6] Adapt to API change for dom.Devices.{Serials, Console}

2019-11-15 Thread Philipp Hahn
Follow > commit d44fdf9badbb798949ab9f82ef516a2fd36d8b55 > Author: Daniel P. Berrange > Date: Tue Nov 28 11:50:06 2017 + > > Generalize protocol handling for chardev sources Signed-off-by: Philipp Hahn --- cmd/virtconsoleresolveradm/cmd/enable.go | 4 ++-- 1

[libvirt] [PATCH console-proxy 6/6] virtconsoleresolveradm: Fix -c handling

2019-11-15 Thread Philipp Hahn
-c / --connect does not work: > $ build/virtconsoleresolveradm -c qemu:///session enable $VM > Error: unknown shorthand flag: 'c' in -c <https://github.com/spf13/cobra#persistent-flags> Signed-off-by: Philipp Hahn --- cmd/virtconsoleresolveradm/cmd/root.go | 2 +- 1 fil

[libvirt] [PATCH console-proxy 1/6] Adapt to API change for dom.Devices.Graphics

2019-11-15 Thread Philipp Hahn
Follow > commit 4772b681e87a8d0dcee011b8e43813e851e4f934 > Author: Daniel P. Berrange > Date: Fri Nov 24 16:15:30 2017 + > > Add remaining graphics configuration options Signed-off-by: Philipp Hahn --- cmd/virtconsoleresolveradm/cmd/enable.go | 6 ++ pkg/res

[libvirt] [PATCH console-proxy 4/6] virtconsoleresolveradm: Require sub-command

2019-11-15 Thread Philipp Hahn
Signed-off-by: Philipp Hahn --- cmd/virtconsoleresolveradm/cmd/root.go | 1 + 1 file changed, 1 insertion(+) diff --git a/cmd/virtconsoleresolveradm/cmd/root.go b/cmd/virtconsoleresolveradm/cmd/root.go index 76e1203..7aaca47 100644 --- a/cmd/virtconsoleresolveradm/cmd/root.go +++ b/cmd

[libvirt] [PATCH console-proxy 2/6] Adapt to uuid API change

2019-11-15 Thread Philipp Hahn
ill return `(UUID, error)` instead of `UUID`. > To emulate old behavior of panicking on enthropy errors one can wrap > a call into `Must` helper similar to: > ``` > u := uuid.Must(uuid.NewV4()) Signed-off-by: Philipp Hahn --- cmd/virtconsoleresolveradm/cmd/enable.go |

[libvirt] [PATCH console-proxy 5/6] virtconsoleresolveradm: Simplify argument parsing

2019-11-15 Thread Philipp Hahn
Use ExactArgs(1) to check for exactly one positional argument. <https://github.com/spf13/cobra#positional-and-custom-arguments> Signed-off-by: Philipp Hahn --- cmd/virtconsoleresolveradm/cmd/disable.go | 6 +- cmd/virtconsoleresolveradm/cmd/enable.go | 6 +- 2 files chan

[libvirt] [PATCH console-proxy 0/6] libvirt-go-xml and libvirt-console-proxy ?

2019-11-15 Thread Philipp Hahn
c main() { ... > } to make the example complete? Second is <https://www.berrange.com/posts/2017/01/26/announce-new-libvirt-console-proxy-project/>: Do you (or someone else) still work on libvirt-console-proxy? It no longer compiles after several API changed in libvirt-go-xml and uuid. I ha

Re: [libvirt] [PATCH] virt-xml-validate: Allow input to be read from stdin

2019-05-21 Thread Philipp Hahn
Hello, Am 21.05.19 um 09:35 schrieb Johannes Holmberg: > On Tue, 2019-05-21 at 07:36 +0200, Philipp Hahn wrote: >> Am 20.05.19 um 13:57 schrieb Johannes Holmberg: >>> diff --git a/tools/virt-xml-validate.in b/tools/virt-xml-validate.in ... >>> +if [ "$XMLFILE

Re: [libvirt] [PATCH] virt-xml-validate: Allow input to be read from stdin

2019-05-20 Thread Philipp Hahn
Hello, Some nits: Am 20.05.19 um 13:57 schrieb Johannes Holmberg: > diff --git a/tools/virt-xml-validate.in b/tools/virt-xml-validate.in > index 64ae33..2d2afb74ec 100644 > --- a/tools/virt-xml-validate.in > +++ b/tools/virt-xml-validate.in > @@ -16,6 +16,16 @@ > > set -e > > +TMPFILE= >

Re: [libvirt] [PATCH libvirt-python] virNodeInfo.memory is in KiB

2018-12-05 Thread Philipp Hahn
Hello Daniel, Am 05.12.18 um 13:10 schrieb Daniel P. Berrangé: > On Wed, Dec 05, 2018 at 01:01:13PM +0100, Philipp Hahn wrote: >> but the Python library does an extra left shift of 10 bits returning MiB >> instead: ... >>> # ./a.out >>> 4041088 >>

[libvirt] [PATCH libvirt-python] virNodeInfo.memory is in KiB

2018-12-05 Thread Philipp Hahn
nt rv = virNodeGetInfo(conn, &info); > printf("%ld\n", info.memory); > return rv; > } > # gcc y.c -I/usr/include/libvirt -lvirt > # ./a.out > 4041088 > # python -c 'import > libvirt;c=libvirt.open("qemu:///system");print(c.getInfo()[1])&

Re: [libvirt] [BUG][PATCH][RRFC][libvirt-python] libvirtError(..., conn=, dom=. vol=, pool=, snap=)

2018-11-27 Thread Philipp Hahn
Hello, Am 27.11.18 um 15:29 schrieb Daniel P. Berrangé: > On Mon, Nov 26, 2018 at 05:12:06PM +0100, Philipp Hahn wrote: >> Am 26.11.18 um 16:28 schrieb Michal Privoznik: >>> On 11/21/18 8:17 AM, Philipp Hahn wrote: >>>> while working on the Python type anno

Re: [libvirt] [BUG][PATCH][RRFC][libvirt-python] libvirtError(..., conn=, dom=. vol=, pool=, snap=)

2018-11-26 Thread Philipp Hahn
Hello, Am 26.11.18 um 16:28 schrieb Michal Privoznik: > On 11/21/18 8:17 AM, Philipp Hahn wrote: >> while working on the Python type annotations for the Python libvirt >> binding I noticed the following code in >> libvirt-override-virDomainSnapshot.py: >> >>>

[libvirt] [BUG][PATCH][RRFC][libvirt-python] libvirtError(..., conn=, dom=. vol=, pool=, snap=)

2018-11-20 Thread Philipp Hahn
not accessed and never stored in an instance variable. Should I add a new "snap" argument to libvirtError.__init__() or should we stop passing those references to the constructor altogether? Patch 2 and 3 might be applied to the current branch already, patch 1 currently depends on my other work.

[libvirt] [PATCH libvirt-python] Add daemon to list of shutdown reasons

2018-11-15 Thread Philipp Hahn
Add the support to work with libvirt commit 66a85cb13. Signed-off-by: Philipp Hahn --- examples/event-test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/event-test.py b/examples/event-test.py index 709277b..81ebfc1 100755 --- a/examples/event-test.py +++ b

[libvirt] [python] WIP-FYI: mypy annotations for libvirt-python

2018-11-08 Thread Philipp Hahn
else is interested in helping with that, please feel free to get in contact. Philipp -- Philipp Hahn Open Source Software Engineer Univention GmbH be open. Mary-Somerville-Str. 1 D-28359 Bremen Tel.: +49 421 22232-0 Fax : +49 421 22232-99 h...@univention.de http://www.univention.de/ Geschäftsfüh

[libvirt] [PATCH libvirt-python] event-test.py: Report ERROR events

2018-11-01 Thread Philipp Hahn
VIR_DOMAIN_EVENT_ID_IO_ERROR and VIR_DOMAIN_EVENT_ID_IO_ERROR_REASON callbacks receive the same 'action' parameter, so also translate that numeric action to a descriptive text for the first callback. Signed-off-by: Philipp Hahn --- examples/event-test.py | 4 ++-- 1 file changed, 2

[libvirt] [PATCH libvirt-python] event-test.py: Fix ERROR event

2018-11-01 Thread Philipp Hahn
uot;libvirt-python/examples/event-test.py", line 474, in __getitem__ > data = self.args[item] > TypeError: tuple indices must be integers, not str Fixes: f5928c6711654f1496707ca77f626b3192843d57 Signed-off-by: Philipp Hahn --- examples/event-test.py | 4 ++-- 1 file changed, 2 i

[libvirt] RFC: "Determine if the domain has been updated."?

2018-10-30 Thread Philipp Hahn
to update the variable, only 4 readers: > $ git grep -ne '->updated' > libxl/libxl_driver.c:4844:ret = vm->updated; > lxc/lxc_driver.c:343:ret = obj->updated; > qemu/qemu_driver.c:1628:ret = obj->updated; > uml/uml_driver.c:1456:ret = obj->

[libvirt] [PATCH libvirt-python v2 07/22] event-test.py: Simplify event ID lists

2018-09-21 Thread Philipp Hahn
by directly building the list with the IDs instead of appending them explicitly. Signed-off-by: Philipp Hahn --- examples/event-test.py | 87 ++ 1 file changed, 46 insertions(+), 41 deletions(-) diff --git a/examples/event-test.py b/examples

[libvirt] [PATCH libvirt-python v2 21/22] event-test.py: Convert CONNECTION events

2018-09-21 Thread Philipp Hahn
to use new Description class Signed-off-by: Philipp Hahn --- examples/event-test.py | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/examples/event-test.py b/examples/event-test.py index 5e3b884..1e94838 100755 --- a/examples/event-test.py +++ b/examples/event

[libvirt] [PATCH libvirt-python v2 22/22] event-test.py: Fix blanks

2018-09-21 Thread Philipp Hahn
Closer to pep8 Signed-off-by: Philipp Hahn --- examples/event-test.py | 97 -- 1 file changed, 71 insertions(+), 26 deletions(-) diff --git a/examples/event-test.py b/examples/event-test.py index 1e94838..540bf9b 100755 --- a/examples/event

[libvirt] [PATCH libvirt-python v2 13/22] event-test.py: Convert AGENT events

2018-09-21 Thread Philipp Hahn
to use new Description class Signed-off-by: Philipp Hahn --- examples/event-test.py | 17 - 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/examples/event-test.py b/examples/event-test.py index 4a801b7..b559ede 100755 --- a/examples/event-test.py +++ b/examples

[libvirt] [PATCH libvirt-python v2 08/22] event-test.py: Add class for event descriptions

2018-09-21 Thread Philipp Hahn
Signed-off-by: Philipp Hahn --- examples/event-test.py | 25 + 1 file changed, 25 insertions(+) diff --git a/examples/event-test.py b/examples/event-test.py index 91a7cb7..d2d2c60 100755 --- a/examples/event-test.py +++ b/examples/event-test.py @@ -456,6 +456,31 @@ def

[libvirt] [PATCH libvirt-python v2 16/22] event-test.py: Convert TRAY events

2018-09-21 Thread Philipp Hahn
to use new Description class Signed-off-by: Philipp Hahn --- examples/event-test.py | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/examples/event-test.py b/examples/event-test.py index 218103d..5426ecd 100755 --- a/examples/event-test.py +++ b/examples/event-test.py

[libvirt] [PATCH libvirt-python v2 12/22] event-test.py: Convert ERROR events

2018-09-21 Thread Philipp Hahn
to use new Description class Signed-off-by: Philipp Hahn --- examples/event-test.py | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/examples/event-test.py b/examples/event-test.py index 004a263..4a801b7 100755 --- a/examples/event-test.py +++ b/examples/event-test.py

[libvirt] [PATCH libvirt-python v2 14/22] event-test.py: Convert GRAPHICS events

2018-09-21 Thread Philipp Hahn
to use new Description class Signed-off-by: Philipp Hahn --- examples/event-test.py | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/examples/event-test.py b/examples/event-test.py index b559ede..d8ba8c9 100755 --- a/examples/event-test.py +++ b/examples/event-test.py

[libvirt] [PATCH libvirt-python v2 02/22] event-test.py: Remove extra parenthesis

2018-09-21 Thread Philipp Hahn
Signed-off-by: Philipp Hahn --- examples/event-test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/event-test.py b/examples/event-test.py index c17d2bb..a7c7054 100755 --- a/examples/event-test.py +++ b/examples/event-test.py @@ -224,7 +224,7 @@ class

[libvirt] [PATCH libvirt-python v2 15/22] event-test.py: Convert DISK events

2018-09-21 Thread Philipp Hahn
to use new Description class Signed-off-by: Philipp Hahn --- examples/event-test.py | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/examples/event-test.py b/examples/event-test.py index d8ba8c9..218103d 100755 --- a/examples/event-test.py +++ b/examples/event-test.py

[libvirt] [PATCH libvirt-python v2 00/22] event-test.py fixes

2018-09-21 Thread Philipp Hahn
Am 21.09.18 um 13:14 schrieb Michal Privoznik: > On 09/20/2018 08:10 AM, Philipp Hahn wrote: >> event-test.py is bad at handling newer livecycle events. >> Attached are two patches to improve that. >> >> Philipp Hahn (2): >> event-test.py: Sync list of domain li

[libvirt] [PATCH libvirt-python v2 17/22] event-test.py: Convert NETWORK events

2018-09-21 Thread Philipp Hahn
to use new Description class Signed-off-by: Philipp Hahn --- examples/event-test.py | 29 ++--- 1 file changed, 10 insertions(+), 19 deletions(-) diff --git a/examples/event-test.py b/examples/event-test.py index 5426ecd..2436827 100755 --- a/examples/event-test.py

[libvirt] [PATCH libvirt-python v2 18/22] event-test.py: Convert STORAGE events

2018-09-21 Thread Philipp Hahn
to use new Description class Signed-off-by: Philipp Hahn --- examples/event-test.py | 24 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/examples/event-test.py b/examples/event-test.py index 2436827..499f434 100755 --- a/examples/event-test.py +++ b

[libvirt] [PATCH libvirt-python v2 06/22] event-test.py: Merge livecycle callbacks

2018-09-21 Thread Philipp Hahn
paque' mechanism. Signed-off-by: Philipp Hahn --- examples/event-test.py | 18 +++--- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/examples/event-test.py b/examples/event-test.py index ab1da4a..2dcdee3 100755 --- a/examples/event-test.py +++ b/examples/eve

[libvirt] [PATCH libvirt-python v2 05/22] event-test.py: Use __file__

2018-09-21 Thread Philipp Hahn
instead of sys.argv[0] Signed-off-by: Philipp Hahn --- examples/event-test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/event-test.py b/examples/event-test.py index 646ce50..ab1da4a 100755 --- a/examples/event-test.py +++ b/examples/event-test.py @@ -667,7

[libvirt] [PATCH libvirt-python v2 09/22] event-test.py: Convert LIVECYCLE events

2018-09-21 Thread Philipp Hahn
to use new Description class Signed-off-by: Philipp Hahn --- examples/event-test.py | 42 ++ 1 file changed, 14 insertions(+), 28 deletions(-) diff --git a/examples/event-test.py b/examples/event-test.py index d2d2c60..493828f 100755 --- a/examples/event

[libvirt] [PATCH libvirt-python v2 19/22] event-test.py: Convert DEVICE events

2018-09-21 Thread Philipp Hahn
to use new Description class Signed-off-by: Philipp Hahn --- examples/event-test.py | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/examples/event-test.py b/examples/event-test.py index 499f434..0a1d06d 100755 --- a/examples/event-test.py +++ b/examples

[libvirt] [PATCH libvirt-python v2 20/22] event-test.py: Convert SECRET events

2018-09-21 Thread Philipp Hahn
to use new Description class Signed-off-by: Philipp Hahn --- examples/event-test.py | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/examples/event-test.py b/examples/event-test.py index 0a1d06d..5e3b884 100755 --- a/examples/event-test.py +++ b/examples

[libvirt] [PATCH libvirt-python v2 10/22] event-test.py: Convert BLOCKJOB events

2018-09-21 Thread Philipp Hahn
to use new Description class Signed-off-by: Philipp Hahn --- examples/event-test.py | 25 ++--- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/examples/event-test.py b/examples/event-test.py index 493828f..46a8db8 100755 --- a/examples/event-test.py +++ b

[libvirt] [PATCH libvirt-python v2 03/22] event-test.py: Remove dead assignment

2018-09-21 Thread Philipp Hahn
variable is unused Signed-off-by: Philipp Hahn --- examples/event-test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/event-test.py b/examples/event-test.py index a7c7054..1f34930 100755 --- a/examples/event-test.py +++ b/examples/event-test.py @@ -207,7 +207,7

[libvirt] [PATCH libvirt-python v2 04/22] event-test.py: Add missing globale statement

2018-09-21 Thread Philipp Hahn
to fix loop termination on exit. Signed-off-by: Philipp Hahn --- examples/event-test.py | 1 + 1 file changed, 1 insertion(+) diff --git a/examples/event-test.py b/examples/event-test.py index 1f34930..646ce50 100755 --- a/examples/event-test.py +++ b/examples/event-test.py @@ -663,6 +663,7

[libvirt] [PATCH libvirt-python v2 11/22] event-test.py: Convert WATCHDOG events

2018-09-21 Thread Philipp Hahn
to use new Description class Signed-off-by: Philipp Hahn --- examples/event-test.py | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/examples/event-test.py b/examples/event-test.py index 46a8db8..004a263 100755 --- a/examples/event-test.py +++ b/examples/event-test.py

[libvirt] [PATCH libvirt-python v2 01/22] event-test.py: Handle closed connection

2018-09-21 Thread Philipp Hahn
.secretEventDeregisterAny(id) > File "/usr/lib/python2.7/dist-packages/libvirt.py", line 4987, in > secretEventDeregisterAny > if ret == -1: raise libvirtError ('virConnectSecretEventDeregisterAny() > failed', conn=self) > libvirt.libvirtError: internal error

Re: [libvirt] missing libvirt events related to snapshots and media-change for inactive VMs?

2018-09-21 Thread Philipp Hahn
Hello, Am 20.09.18 um 08:10 schrieb Philipp Hahn: > event-test.py is bad at handling newer livecycle events. > Attached are two patches to improve that. > > Philipp Hahn (2): > event-test.py: Sync list of domain lifecycle events > event-test.py: Future proof lifecy

[libvirt] [PATCH libvirt-python 0/2] event-test.py fixes

2018-09-19 Thread Philipp Hahn
Hello, event-test.py is bad at handling newer livecycle events. Attached are two patches to improve that. Philipp Hahn (2): event-test.py: Sync list of domain lifecycle events event-test.py: Future proof lifecycle event handling examples/event-test.py | 18 -- 1 file

[libvirt] [PATCH libvirt-python 1/2] event-test.py: Sync list of domain lifecycle events

2018-09-19 Thread Philipp Hahn
mples/event-test.py", line 505, in > myDomainEventCallback1 > domDetailToString(event, detail))) > File "libvirt-python/examples/event-test.py", line 484, in domDetailToString > return domEventStrings[event][detail] > IndexError: tuple index out of range

[libvirt] [PATCH libvirt-python 2/2] event-test.py: Future proof lifecycle event handling

2018-09-19 Thread Philipp Hahn
EventStrings[event][detail] > IndexError: tuple index out of range Signed-off-by: Philipp Hahn --- examples/event-test.py | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/examples/event-test.py b/examples/event-test.py index 04310e1..4632110 100755 --- a/examples/

Re: [libvirt] How to best handle the reoccurring of rom changes breaking cross version migrations?

2017-11-03 Thread Philipp Hahn
Hello Am 03.11.2017 um 08:30 schrieb Christian Ehrhardt: > On Thu, Nov 2, 2017 at 4:34 PM, Daniel P. Berrange > wrote: >> >> On Thu, Nov 02, 2017 at 04:14:06PM +0100, Christian Ehrhardt wrote: >>> Ping - since there wasn't any reply so far - any best practices one could >>> share? >>> >>> Let me

Re: [libvirt] [PATCH] qemu: Honour

2017-08-03 Thread Philipp Hahn
Hello, Am 03.08.2017 um 09:36 schrieb Michal Privoznik: > https://bugzilla.redhat.com/show_bug.cgi?id=1476866 > > For some reason, we completely ignore setting for > domains. The implementation is simply not there. It never was. > However, things are slightly more complicated. QEMU sends us two

Re: [libvirt] [PATCH glib] Don't set LC_ALL=C during build as that breaks python apps

2017-07-25 Thread Philipp Hahn
Hello, Am 25.07.2017 um 14:07 schrieb Daniel P. Berrange: > Setting LC_ALL=C breaks python apps doing I/O on UTF-8 source > files. In particular this broke glib-mkenums > > GEN libvirt-gconfig-enum-types.h > Traceback (most recent call last): > File "/usr/bin/glib-mkenums", line 669, in

Re: [libvirt] [BUG] duplicate suspend/resume lifecycle events with QEMU

2017-06-13 Thread Philipp Hahn
Hello, Am 13.06.2017 um 06:13 schrieb Philipp Hahn: > I'm using the libvirt event mechanism and noticed, that several events > are reported twice: ... >> $ virsh event --loop --event lifecycle >> event 'lifecycle' for domain installer: Started Booted >>

[libvirt] [RFC] duplicate suspend/resume lifecycle events with QEMU

2017-06-12 Thread Philipp Hahn
micros, details); ... > 1325 qemuMonitorEmitResume(qemuMonitorPtr mon) > 1330 QEMU_MONITOR_CALLBACK(mon, ret, domainResume, mon->vm); but this doesn't yet completely explain, why only some events are reported twice. Is there some way to get rid of the duplication (in

[libvirt] [PATCH] qemu/doc: Fix function name for handling events

2017-06-12 Thread Philipp Hahn
Insert missing "IO" into function name. --- src/qemu/EVENTHANDLERS.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qemu/EVENTHANDLERS.txt b/src/qemu/EVENTHANDLERS.txt index 79c1505caa..c7798d600b 100644 --- a/src/qemu/EVENTHANDLERS.txt +++ b/src/qemu/EVENTHANDLERS.txt @

Re: [libvirt] [PATCH v3] doc: Correct the default werror policy

2017-03-08 Thread Philipp Hahn
Hello, Am 08.03.2017 um 17:28 schrieb Martin Kletzander: > On Wed, Mar 01, 2017 at 08:44:54PM +0100, Philipp Hahn wrote: >> The documentation is plain wrong about the default write_error policy, >> as its only implemented by QEMU (src/vz/vz_utils.c is the only other >> case,

[libvirt] [PATCH v2] doc: fix writing of QEMU

2017-03-07 Thread Philipp Hahn
QEMU should be written all upper or all lower case. --- v2: Drop docs/news-* as they are historic. Drop po/*.po files as they are from extern. ChangeLog-old | 4 ++-- docs/formatnwfilter.html.in | 6 +++--- docs/storage.html.in | 12 ++-- libvirt.spec.in

Re: [libvirt] [PATCH] doc: fix writing of QEMU

2017-03-01 Thread Philipp Hahn
Hello Peter, Am 23.02.2017 um 12:51 schrieb Peter Krempa: > On Thu, Feb 23, 2017 at 12:30:03 +0100, Philipp Hahn wrote: >> QEMU should be written all upper or all lower case. >> >> Signed-off-by: Philipp Hahn >> --- >> ChangeLog-old | 4 ++-

[libvirt] [PATCH v3] doc: Correct the default werror policy

2017-03-01 Thread Philipp Hahn
VIR_DOMAIN_DISK_ERROR_POLICY_ENOSPACE. Signed-off-by: Philipp Hahn --- Osier Yang proposed v1 on 2011-10-24, which never got applied due to discussions of "enospace" vs. "enospc". v2: Remove internal QEMU default docs/formatdomain.html.in | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-

[libvirt] [PATCH] doc: fix writing of QEMU

2017-02-23 Thread Philipp Hahn
QEMU should be written all upper or all lower case. Signed-off-by: Philipp Hahn --- ChangeLog-old | 4 ++-- docs/formatnwfilter.html.in | 6 +++--- docs/news-2009.html.in| 6 +++--- docs/news-2010.html.in| 12 ++-- docs/news-2011.html.in| 4

[libvirt] [PATCH v2] doc: Correct the default werror policy

2017-02-23 Thread Philipp Hahn
VIR_DOMAIN_DISK_ERROR_POLICY_ENOSPACE. Signed-off-by: Philipp Hahn --- docs/formatdomain.html.in | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) --- Osier Yang proposed v1 on 2011-10-24, which never got applied due to discussions of "enospace" vs. "enospc". diff --git a/docs/formatd

[libvirt] [PATCH v2] doc: add storage format entries

2017-02-23 Thread Philipp Hahn
Add format/@type entries to examples to show what the text is talking about. Add missing blank. Signed-off-by: Philipp Hahn --- docs/storage.html.in | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) --- This is a re-post from 2013-02-07, as ist still is unclear where the should go

[libvirt] [PATCH] doc updates

2017-02-23 Thread Philipp Hahn
a lot for the binary, but "Qemu" is used very little. Philipp Hahn (3): doc: add storage format entries doc: Correct the default werror policy doc: fix writing of QEMU ChangeLog-old | 4 ++-- docs/formatdomain.html.in | 6 +++--- docs/formatnwfilter.html.in

[libvirt] RFC: Qemu/SeaBIOS/VGA/PXE upgrades vs. longterm-snapshot/migration

2016-08-28 Thread Philipp Hahn
wadays) 3. How do others handle long-term snapshots? Just say "good-bye" to your old snapshots when upgrading to a newer Qemu version or keeping the old, probably unmaintained and vulnerable Qemu/BIOS binaries until the end-of-time? Thanks in advance Philipp -- Philipp Hahn Open Source So

[libvirt] [PATCHv2] xen: Also add sub-type for driver=tap2 in xen-xm

2016-05-18 Thread Philipp Hahn
tap2 only handles 'aio', but not 'raw', which must be explicitly given: | $ virsh domxml-to-native yyy.xml > yyy.xm | $ xm new yyy.xm | Error: tap:/srv/xen/xxx.img not a valid disk type | $ sed -i -e 's/tap2:/&aio:/' yyy.xm | $ xm new yyy.xm Fix reading and writing "xen-xm" format for "tap2" by h

[libvirt] [PATCHv2] test: Remove executable permission from Xen xm files

2016-05-18 Thread Philipp Hahn
The configuration files are not directly executable as they don't have as hash-bang line. --- tests/xlconfigdata/test-fullvirt-multiusb.cfg | 0 tests/xmconfigdata/test-fullvirt-localtime.cfg | 0 tests/xmconfigdata/test-fullvirt-new-cdrom.cfg | 0 tests/xmconfigdata/test-

[libvirt] [PATCHv2] xen: test for driver=tap2 sub-type in xen-xm

2016-05-18 Thread Philipp Hahn
tap2 only handles 'aio', but not 'raw', which must be explicitly given: XML:raw needs to be translated to XM:aio for 'tap' and 'tap2' Xen drivers. --- tests/xmconfigdata/test-disk-drv-blktap-raw.cfg | 12 + tests/xmconfigdata/test-disk-drv-blktap-raw.xml | 33 t

[libvirt] [PATCHv2] Xen: Handle tap2 sub-type

2016-05-18 Thread Philipp Hahn
Hi, here is v2 which adds the requested unit test and fixes some file permission for Xen configuration test files. Philipp Hahn (3): xen: Also add sub-type for driver=tap2 in xen-xm xen: test for driver=tap2 sub-type in xen-xm test: Remove executable permission from Xen xm files src

Re: [libvirt] [PATCH v2 3/8] Add support for fetching statistics of completed jobs

2016-05-09 Thread Philipp Hahn
is "active", it is a json-object with the > following RAM information (in bytes): but the example some lines below is wrong: > 2. Migration is done and has succeeded > > -> { "execute": "query-migrate" } > <- { "return": { >

Re: [libvirt] Join

2016-03-30 Thread Philipp Hahn
Am 25.03.2016 um 06:52 schrieb Tim Streit: > Im having problems with my install. Debian Jessie (8.3), but using libvirt > and kernel from back ports (for enhanced vt-d support, passing through a USB > card). Guest is a windows xp sp3 box. Initially I had hardware time set to > UTC, and I set

[libvirt] [PATCH] xen: Also add sub-type for driver=tap2 in xen-xm

2016-03-30 Thread Philipp Hahn
tap2 only handles 'aio', but not 'raw', which must be explicitly given: | $ virsh domxml-to-native yyy.xml > yyy.xm | $ xm new yyy.xm | Error: tap:/srv/xen/xxx.img not a valid disk type | $ sed -i -e 's/tap2:/&aio:/' yyy.xm | $ xm new yyy.xm Fix reading and writing "xen-xm" format for "tap2" by h

Re: [libvirt] Canging bridge names on live migration

2015-06-10 Thread Philipp Hahn
Hello, On 03.06.2015 13:18, seitan wrote: > i wonder, if there's a possibility to change a name of a shared interface in > virtual machine config, while doing migration. > The problem is: > hypervisor1 (source) uses shared interface name "br0". > hypervisor2 (target) uses shared interface name "b

Re: [libvirt] [PATCH] virsh: Implement command to rename domain

2014-09-01 Thread Philipp Hahn
Hello Tomas, On 01.09.2014 01:51, Tomas Meszaros wrote: > I've recently worked with rather large number of virtual machines > and needed to rename all domains. I couldn't find better way how > to rename domain other than: > > virsh dumpxml domain > domain.xml > (change domain name in doma

[libvirt] [BUG] xenInotify/keep-alive double-free

2014-04-02 Thread Philipp Hahn
start closing down things. Comments and ideas welcomed. We're tracking this as <https://forge.univention.org/bugzilla/show_bug.cgi?id=31032> Sincerely Philipp -- Philipp Hahn Open Source Software Engineer Univention GmbH be open. Mary-Somerville-Str. 1 D-28359 Bremen Tel.: +49

Re: [libvirt] [PATCH] XML: Escape double-hyphens in XML comment

2014-02-21 Thread Philipp Hahn
On 21.02.2014 12:18, Ján Tomko wrote: > This no longer reproduces with current master, it has been fixed by either of: > commit 0b121614a2086a8e66ae1f004fe912ba7c1d8a75 > Author: Ján Tomko > CommitDate: 2012-10-29 14:38:43 +0100 > > xml: print uuids in the warning > > commit 9b704ab8235a

[libvirt] [PATCH] XML: Escape double-hyphens in XML comment

2014-02-21 Thread Philipp Hahn
To quote : > For compatibility, the string "--" (double-hyphen) must not occur within > comments. For example this breaks creating snapshots: $ virsh snapshot-create-as $VM "comment--bug" $ xmllint --noout /var/lib/libvirt/qemu/snapshot/$VM/comment--bug

[libvirt] [PATCH] Fix stream related spelling mistakes

2014-02-13 Thread Philipp Hahn
Consistent spelling of all-uppercase I/O. Signed-off-by: Philipp Hahn --- libvirt-override-virStream.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libvirt-override-virStream.py b/libvirt-override-virStream.py index 53000da..e9dd09a 100644 --- a/libvirt-override

[libvirt] [PATCH] Fix stream related spelling mistakes

2014-02-13 Thread Philipp Hahn
Remove double "is". Consistent spelling of all-uppercase I/O. Signed-off-by: Philipp Hahn --- src/libvirt.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/libvirt.c b/src/libvirt.c index 9cc5b1c..666ab1e 100644 --- a/src/libvirt.c +++ b/src/libvirt.c @

  1   2   3   4   >