<feed xmlns='http://www.w3.org/2005/Atom'>
<title>libguestfs.git/python/t, branch 1.18.7</title>
<subtitle>[MIRROR] library for accessing and modifying guest disk images</subtitle>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/rjones/public_git/libguestfs.git/'/>
<entry>
<title>New API: guestfs_shutdown: Cleanly shutdown the backend.</title>
<updated>2012-07-06T16:36:30+00:00</updated>
<author>
<name>Richard W.M. Jones</name>
<email>rjones@redhat.com</email>
</author>
<published>2012-07-03T12:22:45+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/rjones/public_git/libguestfs.git/commit/?id=a659f2c316fa8a959a6286f214e50911253c5580'/>
<id>a659f2c316fa8a959a6286f214e50911253c5580</id>
<content type='text'>
The new API splits orderly close into a two-step process:

  if (guestfs_shutdown (g) == -1) {
    /* handle the error, eg. qemu error */
  }
  guestfs_close (g);

Note that the explicit shutdown step is only necessary in the case
where you have made changes to the disk image and want to handle write
errors.  Read the documentation for further information.

This change also:

 - deprecates guestfs_kill_subprocess

 - turns guestfs_kill_subprocess into the same as guestfs_shutdown

 - changes guestfish and other tools to call shutdown + close
   where necessary (not for read-only tools)

 - updates documentation

 - updates examples

(cherry picked from commit ffbf1475f7ae7c462db289ad4834391469e72edd)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The new API splits orderly close into a two-step process:

  if (guestfs_shutdown (g) == -1) {
    /* handle the error, eg. qemu error */
  }
  guestfs_close (g);

Note that the explicit shutdown step is only necessary in the case
where you have made changes to the disk image and want to handle write
errors.  Read the documentation for further information.

This change also:

 - deprecates guestfs_kill_subprocess

 - turns guestfs_kill_subprocess into the same as guestfs_shutdown

 - changes guestfish and other tools to call shutdown + close
   where necessary (not for read-only tools)

 - updates documentation

 - updates examples

(cherry picked from commit ffbf1475f7ae7c462db289ad4834391469e72edd)
</pre>
</div>
</content>
</entry>
<entry>
<title>tests: Fix a few tests where /dev/null was being used with format=qcow2.</title>
<updated>2012-06-28T08:13:41+00:00</updated>
<author>
<name>Richard W.M. Jones</name>
<email>rjones@redhat.com</email>
</author>
<published>2012-06-25T08:03:39+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/rjones/public_git/libguestfs.git/commit/?id=05d40ce0234db9fe16703ba0e1f22088ce437a61'/>
<id>05d40ce0234db9fe16703ba0e1f22088ce437a61</id>
<content type='text'>
This was always incorrect behaviour, but qemu appears to tolerate it.

This cherry picks just the test fixes from
commit 729bb9c6b5ae0c0e7c68dc802b1617936062f966.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This was always incorrect behaviour, but qemu appears to tolerate it.

This cherry picks just the test fixes from
commit 729bb9c6b5ae0c0e7c68dc802b1617936062f966.
</pre>
</div>
</content>
</entry>
<entry>
<title>python: Remove 'del g' from the docs, replace with 'g.close ()'.</title>
<updated>2012-04-17T16:41:43+00:00</updated>
<author>
<name>Richard W.M. Jones</name>
<email>rjones@redhat.com</email>
</author>
<published>2012-04-17T16:41:43+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/rjones/public_git/libguestfs.git/commit/?id=255882a3f615c7727d2cc2f18f692513dc0a75e9'/>
<id>255882a3f615c7727d2cc2f18f692513dc0a75e9</id>
<content type='text'>
'del g' is a trap for the unwary.  If the handle has any other
references, it does nothing (in fact, it can be actively dangerous if
the user was expecting the appliance to go away).  In non-CPython it
can be delayed arbitrarily long.

Using 'g.close()' on the other hand is always safe.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
'del g' is a trap for the unwary.  If the handle has any other
references, it does nothing (in fact, it can be actively dangerous if
the user was expecting the appliance to go away).  In non-CPython it
can be delayed arbitrarily long.

Using 'g.close()' on the other hand is always safe.
</pre>
</div>
</content>
</entry>
<entry>
<title>python: Add a regression test for RHBZ#811650.</title>
<updated>2012-04-11T16:56:12+00:00</updated>
<author>
<name>Richard W.M. Jones</name>
<email>rjones@redhat.com</email>
</author>
<published>2012-04-11T16:53:46+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/rjones/public_git/libguestfs.git/commit/?id=b6dd7e72500cbfa4e13379b9f2b1d0ccfa7ebec3'/>
<id>b6dd7e72500cbfa4e13379b9f2b1d0ccfa7ebec3</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Tempus fugit.</title>
<updated>2012-01-18T22:05:02+00:00</updated>
<author>
<name>Richard W.M. Jones</name>
<email>rjones@redhat.com</email>
</author>
<published>2012-01-18T22:05:02+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/rjones/public_git/libguestfs.git/commit/?id=08840bab44c38d0c69b5780c57b2bf370c96d58c'/>
<id>08840bab44c38d0c69b5780c57b2bf370c96d58c</id>
<content type='text'>
Update all copyright dates to 2012.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Update all copyright dates to 2012.
</pre>
</div>
</content>
</entry>
<entry>
<title>Update FSF address.</title>
<updated>2011-11-08T14:43:07+00:00</updated>
<author>
<name>Matthew Booth</name>
<email>mbooth@redhat.com</email>
</author>
<published>2011-11-08T14:27:49+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/rjones/public_git/libguestfs.git/commit/?id=04ea1375c55aa67df4e7fc61dbb534111767f3b6'/>
<id>04ea1375c55aa67df4e7fc61dbb534111767f3b6</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>python: Add explicit g.close() method (RHBZ#717786).</title>
<updated>2011-06-30T09:14:33+00:00</updated>
<author>
<name>Richard W.M. Jones</name>
<email>rjones@redhat.com</email>
</author>
<published>2011-06-30T09:14:33+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/rjones/public_git/libguestfs.git/commit/?id=8c5bdc3e12947580e91c018b71adf9ad3128bb75'/>
<id>8c5bdc3e12947580e91c018b71adf9ad3128bb75</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>python: Implement new event API.</title>
<updated>2011-04-22T20:50:16+00:00</updated>
<author>
<name>Richard W.M. Jones</name>
<email>rjones@redhat.com</email>
</author>
<published>2011-04-22T20:36:41+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/rjones/public_git/libguestfs.git/commit/?id=2cac52000a6a96a583af72e289a4296c596047d5'/>
<id>2cac52000a6a96a583af72e289a4296c596047d5</id>
<content type='text'>
This implements set_event_callback and delete_event_callback so that
Python programs can use the new event mechanism.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This implements set_event_callback and delete_event_callback so that
Python programs can use the new event mechanism.
</pre>
</div>
</content>
</entry>
<entry>
<title>python: Combine tests to reduce number of launches.</title>
<updated>2010-11-30T13:59:50+00:00</updated>
<author>
<name>Richard W.M. Jones</name>
<email>rjones@redhat.com</email>
</author>
<published>2010-11-30T13:59:50+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/rjones/public_git/libguestfs.git/commit/?id=b034795a259fb5f255c1f9c835d722efab4d4f7c'/>
<id>b034795a259fb5f255c1f9c835d722efab4d4f7c</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>generator: Optional arguments, add-drive-opts (RHBZ#642934,CVE-2010-3851).</title>
<updated>2010-10-22T16:45:00+00:00</updated>
<author>
<name>Richard W.M. Jones</name>
<email>rjones@redhat.com</email>
</author>
<published>2010-10-20T10:34:57+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/rjones/public_git/libguestfs.git/commit/?id=14490c3e1aac61c6ac90f28828896683f64f0dc9'/>
<id>14490c3e1aac61c6ac90f28828896683f64f0dc9</id>
<content type='text'>
This large commit changes the generator so that optional arguments
can be supported for functions.

The model for arguments (known as the "style") is changed from
(ret, args) to (ret, args, optargs) where optargs is a more limited
list of arguments.

One function has been added which takes optional arguments, it is
"add-drive-opts", modelled as:

  (RErr, [String "filename"], #required
         [Bool "readonly"; String "format"; String "iface"]) #optional

Note that this function is processed in the library (does not go over
the RPC protocol to the daemon).  This has allowed us to simplify
the current implementation by omitting changes related to RPC or the
daemon, although we plan to add these at some point in the future.

From C this function can be called in 3 different ways as in these
examples:

  guestfs_add_drive_opts (g, filename,
                          GUESTFS_ADD_DRIVE_OPTS_READONLY, 1,
			  GUESTFS_ADD_DRIVE_OPTS_FORMAT, "raw",
                          -1);

(the argument(s) between 'filename' and '-1' are the optional ones).

  guestfs_add_drive_opts_va (g, filename, args);

where 'args' is a va_list.  This works like the first version.

  struct guestfs_add_drive_opts_argv optargs = {
    .bitmask = GUESTFS_ADD_DRIVE_OPTS_READONLY_BITMASK,
    .readonly = 1,
  }
  guestfs_add_drive_opts_argv (g, filename, &amp;optargs);

This last form lets you construct lists of optional arguments, and
is used by guestfish and the language bindings.

In guestfish optional arguments are used like this:

  add-drive-opts filename readonly:true

In OCaml these are mapped naturally to OCaml optional arguments, eg:

  g#add_drive_opts ~readonly:true filename;

In Perl these are mapped to extra arguments, eg:

  $g-&gt;add_drive_opts ($filename, readonly =&gt; 1);

In Python these are mapped to optional arguments, eg:

  g.add_drive_opts ("file", readonly = 1, format = "qcow2")

In Ruby these are mapped to a final hash argument, eg:

  g.add_drive_opts("file", {})
  g.add_drive_opts("file", :readonly =&gt; 1)
  g.add_drive_opts("file", :readonly =&gt; 1, :iface =&gt; "virtio")

In PHP these are mapped to extra parameters.  This is not quite
accurate since you cannot omit arbitrary optional parameters, but
there's not much than can be done within the limitations of PHP
as a language.

Unimplemented in: Haskell, C#, Java.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This large commit changes the generator so that optional arguments
can be supported for functions.

The model for arguments (known as the "style") is changed from
(ret, args) to (ret, args, optargs) where optargs is a more limited
list of arguments.

One function has been added which takes optional arguments, it is
"add-drive-opts", modelled as:

  (RErr, [String "filename"], #required
         [Bool "readonly"; String "format"; String "iface"]) #optional

Note that this function is processed in the library (does not go over
the RPC protocol to the daemon).  This has allowed us to simplify
the current implementation by omitting changes related to RPC or the
daemon, although we plan to add these at some point in the future.

From C this function can be called in 3 different ways as in these
examples:

  guestfs_add_drive_opts (g, filename,
                          GUESTFS_ADD_DRIVE_OPTS_READONLY, 1,
			  GUESTFS_ADD_DRIVE_OPTS_FORMAT, "raw",
                          -1);

(the argument(s) between 'filename' and '-1' are the optional ones).

  guestfs_add_drive_opts_va (g, filename, args);

where 'args' is a va_list.  This works like the first version.

  struct guestfs_add_drive_opts_argv optargs = {
    .bitmask = GUESTFS_ADD_DRIVE_OPTS_READONLY_BITMASK,
    .readonly = 1,
  }
  guestfs_add_drive_opts_argv (g, filename, &amp;optargs);

This last form lets you construct lists of optional arguments, and
is used by guestfish and the language bindings.

In guestfish optional arguments are used like this:

  add-drive-opts filename readonly:true

In OCaml these are mapped naturally to OCaml optional arguments, eg:

  g#add_drive_opts ~readonly:true filename;

In Perl these are mapped to extra arguments, eg:

  $g-&gt;add_drive_opts ($filename, readonly =&gt; 1);

In Python these are mapped to optional arguments, eg:

  g.add_drive_opts ("file", readonly = 1, format = "qcow2")

In Ruby these are mapped to a final hash argument, eg:

  g.add_drive_opts("file", {})
  g.add_drive_opts("file", :readonly =&gt; 1)
  g.add_drive_opts("file", :readonly =&gt; 1, :iface =&gt; "virtio")

In PHP these are mapped to extra parameters.  This is not quite
accurate since you cannot omit arbitrary optional parameters, but
there's not much than can be done within the limitations of PHP
as a language.

Unimplemented in: Haskell, C#, Java.
</pre>
</div>
</content>
</entry>
</feed>
