<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/libvirt-python.git/libvirt-override-virStoragePool.py, branch v7.2.0</title>
<subtitle>libvirt.org: git/libvirt-python.git
</subtitle>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libvirt-python.git/'/>
<entry>
<title>override: Convert to list comprehension</title>
<updated>2020-08-18T09:48:25+00:00</updated>
<author>
<name>Philipp Hahn</name>
<email>hahn@univention.de</email>
</author>
<published>2020-07-23T06:44:41+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libvirt-python.git/commit/?id=57770081971f3f52002926ea7aa2d1bb135216c4'/>
<id>57770081971f3f52002926ea7aa2d1bb135216c4</id>
<content type='text'>
:%s/retlist = list()\n\s*\(for \w\+ in ret\):\n\s*retlist.append(\(.*\))\n\n\s*return retlist/return [\2 \1]/

Signed-off-by: Philipp Hahn &lt;hahn@univention.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
:%s/retlist = list()\n\s*\(for \w\+ in ret\):\n\s*retlist.append(\(.*\))\n\n\s*return retlist/return [\2 \1]/

Signed-off-by: Philipp Hahn &lt;hahn@univention.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>override: Add manual PEP 484 type annotations</title>
<updated>2020-08-18T09:48:25+00:00</updated>
<author>
<name>Philipp Hahn</name>
<email>hahn@univention.de</email>
</author>
<published>2018-11-20T07:59:35+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libvirt-python.git/commit/?id=abbd47f4ea1736a2d9eaf50b157cdfcd69dfffb9'/>
<id>abbd47f4ea1736a2d9eaf50b157cdfcd69dfffb9</id>
<content type='text'>
Signed-off-by: Philipp Hahn &lt;hahn@univention.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Philipp Hahn &lt;hahn@univention.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Remove legacy libvirtError arguments</title>
<updated>2020-08-06T06:50:37+00:00</updated>
<author>
<name>Philipp Hahn</name>
<email>hahn@univention.de</email>
</author>
<published>2018-11-21T06:55:57+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libvirt-python.git/commit/?id=ee5c856af7563619305a0c68ab32c06e6e6c1b2d'/>
<id>ee5c856af7563619305a0c68ab32c06e6e6c1b2d</id>
<content type='text'>
The fields have been deprecated in C with
git:f60dc0bc09f09c6817d6706a9edb1579a3e2b2b8

They are only passed to the libvirtError constructor, but not stored for
later or used anywhere else.

sed -ri '/raise libvirtError/s/, \w+=self(\._dom)?//' *.py

Signed-off-by: Philipp Hahn &lt;hahn@univention.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The fields have been deprecated in C with
git:f60dc0bc09f09c6817d6706a9edb1579a3e2b2b8

They are only passed to the libvirtError constructor, but not stored for
later or used anywhere else.

sed -ri '/raise libvirtError/s/, \w+=self(\._dom)?//' *.py

Signed-off-by: Philipp Hahn &lt;hahn@univention.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>generator: Fix parent type</title>
<updated>2020-07-27T11:48:28+00:00</updated>
<author>
<name>Philipp Hahn</name>
<email>hahn@univention.de</email>
</author>
<published>2020-04-20T16:28:36+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libvirt-python.git/commit/?id=ca394b9f3cec48f76b715836a737384f6660e1a6'/>
<id>ca394b9f3cec48f76b715836a737384f6660e1a6</id>
<content type='text'>
The constructors for virDomain, virStoragePool, virDomainCheckpoint,
virDomainSnapshot expect virConnect as their first argument. The current
code always uses `self`, which is okay when such an instance is created
from a method of virConnect itself, but there are several cases where
this is not the case:

    virDomain.migrate() -&gt; virDomain
    virDomain.migrate2() -&gt; virDomain
    virDomain.migrate3() -&gt; virDomain
    virDomainCheckpoint.getParent() -&gt; virDomainCheckpoint
    virDomainSnapshot.getParent() -&gt; virDomainSnapshot
    virStorageVol.storagePoolLookupByVolume() -&gt; virStoragePool

&gt; libvirt.py:1850: error: Argument 1 to "virDomain" has incompatible type "virDomain"; expected "virConnect"
&gt; libvirt.py:1871: error: Argument 1 to "virDomain" has incompatible type "virDomain"; expected "virConnect"
&gt; libvirt.py:1888: error: Argument 1 to "virDomain" has incompatible type "virDomain"; expected "virConnect"
&gt; libvirt.py:3422: error: Argument 1 to "virStorageVol" has incompatible type "virStoragePool"; expected "virConnect"
&gt; libvirt.py:6835: error: Argument 1 to "virDomainCheckpoint" has incompatible type "virDomainCheckpoint"; expected "virDomain"
&gt; libvirt.py:6943: error: Argument 1 to "virDomainSnapshot" has incompatible type "virDomainSnapshot"; expected "virDomain"

&gt;&gt;&gt; import libvirt
&gt;&gt;&gt; con = libvirt.open('test:///default')
&gt;&gt;&gt; dom = con.lookupByName("test")
&gt;&gt;&gt; first = dom.checkpointCreateXML("""&lt;domaincheckpoint&gt;&lt;name&gt;First&lt;/name&gt;&lt;/domaincheckpoint&gt;""")
&gt;&gt;&gt; first.domain()
&lt;libvirt.virDomain object at 0x7f728c3b6b80&gt;
            ^^^^^^
&gt;&gt;&gt; second = dom.checkpointCreateXML("""&lt;domaincheckpoint&gt;&lt;name&gt;Second&lt;/name&gt;&lt;/domaincheckpoint&gt;""")
&gt;&gt;&gt; parent = second.getParent()
&gt;&gt;&gt; parent.domain()
&lt;libvirt.virDomainCheckpoint object at 0x7f728c424d30&gt;
            ^^^^^^^^^^^^^^^^

Signed-off-by: Philipp Hahn &lt;hahn@univention.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The constructors for virDomain, virStoragePool, virDomainCheckpoint,
virDomainSnapshot expect virConnect as their first argument. The current
code always uses `self`, which is okay when such an instance is created
from a method of virConnect itself, but there are several cases where
this is not the case:

    virDomain.migrate() -&gt; virDomain
    virDomain.migrate2() -&gt; virDomain
    virDomain.migrate3() -&gt; virDomain
    virDomainCheckpoint.getParent() -&gt; virDomainCheckpoint
    virDomainSnapshot.getParent() -&gt; virDomainSnapshot
    virStorageVol.storagePoolLookupByVolume() -&gt; virStoragePool

&gt; libvirt.py:1850: error: Argument 1 to "virDomain" has incompatible type "virDomain"; expected "virConnect"
&gt; libvirt.py:1871: error: Argument 1 to "virDomain" has incompatible type "virDomain"; expected "virConnect"
&gt; libvirt.py:1888: error: Argument 1 to "virDomain" has incompatible type "virDomain"; expected "virConnect"
&gt; libvirt.py:3422: error: Argument 1 to "virStorageVol" has incompatible type "virStoragePool"; expected "virConnect"
&gt; libvirt.py:6835: error: Argument 1 to "virDomainCheckpoint" has incompatible type "virDomainCheckpoint"; expected "virDomain"
&gt; libvirt.py:6943: error: Argument 1 to "virDomainSnapshot" has incompatible type "virDomainSnapshot"; expected "virDomain"

&gt;&gt;&gt; import libvirt
&gt;&gt;&gt; con = libvirt.open('test:///default')
&gt;&gt;&gt; dom = con.lookupByName("test")
&gt;&gt;&gt; first = dom.checkpointCreateXML("""&lt;domaincheckpoint&gt;&lt;name&gt;First&lt;/name&gt;&lt;/domaincheckpoint&gt;""")
&gt;&gt;&gt; first.domain()
&lt;libvirt.virDomain object at 0x7f728c3b6b80&gt;
            ^^^^^^
&gt;&gt;&gt; second = dom.checkpointCreateXML("""&lt;domaincheckpoint&gt;&lt;name&gt;Second&lt;/name&gt;&lt;/domaincheckpoint&gt;""")
&gt;&gt;&gt; parent = second.getParent()
&gt;&gt;&gt; parent.domain()
&lt;libvirt.virDomainCheckpoint object at 0x7f728c424d30&gt;
            ^^^^^^^^^^^^^^^^

Signed-off-by: Philipp Hahn &lt;hahn@univention.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>python: treat flags as default argument with value 0</title>
<updated>2013-03-22T03:50:09+00:00</updated>
<author>
<name>Guannan Ren</name>
<email>gren@redhat.com</email>
</author>
<published>2013-03-21T08:27:09+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libvirt-python.git/commit/?id=497a0ceecbdf4dc72f20612cf2a88a1e551bc8f4'/>
<id>497a0ceecbdf4dc72f20612cf2a88a1e551bc8f4</id>
<content type='text'>
The following four functions have not changed because default arguments
have to come after positional arguments. Changing them will break the
the binding APIs.

migrate(self, dconn, flags, dname, uri, bandwidth):
migrate2(self, dconn, dxml, flags, dname, uri, bandwidth):
migrateToURI(self, duri, flags, dname, bandwidth):
migrateToURI2(self, dconnuri, miguri, dxml, flags, dname, bandwidth):
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The following four functions have not changed because default arguments
have to come after positional arguments. Changing them will break the
the binding APIs.

migrate(self, dconn, flags, dname, uri, bandwidth):
migrate2(self, dconn, dxml, flags, dname, uri, bandwidth):
migrateToURI(self, duri, flags, dname, bandwidth):
migrateToURI2(self, dconnuri, miguri, dxml, flags, dname, bandwidth):
</pre>
</div>
</content>
</entry>
<entry>
<title>list: Expose virStoragePoolListAllVolumes to Python binding</title>
<updated>2012-09-10T02:41:18+00:00</updated>
<author>
<name>Osier Yang</name>
<email>jyang@redhat.com</email>
</author>
<published>2012-09-04T15:32:58+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libvirt-python.git/commit/?id=9b64533be6efc412f6daf9461a3fc0301c351be3'/>
<id>9b64533be6efc412f6daf9461a3fc0301c351be3</id>
<content type='text'>
The implementation is done manually as the generator does not support
wrapping lists of C pointers into Python objects.

python/libvirt-override-api.xml: Document

python/libvirt-override-virStoragePool.py:
  * New file, includes implementation of listAllVolumes.

python/libvirt-override.c: Implementation for the wrapper.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The implementation is done manually as the generator does not support
wrapping lists of C pointers into Python objects.

python/libvirt-override-api.xml: Document

python/libvirt-override-virStoragePool.py:
  * New file, includes implementation of listAllVolumes.

python/libvirt-override.c: Implementation for the wrapper.
</pre>
</div>
</content>
</entry>
</feed>
