generator: Rename 'add_drive_opts' API to 'add_drive'.

By using the once_had_no_optargs flag, this change is backwards
compatible for callers (except Haskell, PHP and GObject as discussed
in earlier commit).
This commit is contained in:
Richard W.M. Jones
2012-07-14 12:42:24 +01:00
parent b48ae2eadf
commit 7486fc6f43
47 changed files with 93 additions and 115 deletions

View File

@@ -16,7 +16,7 @@ f.close ()
g.set_trace (1)
# Attach the disk image to libguestfs.
g.add_drive_opts (output, format = "raw", readonly = 0)
g.add_drive (output, format = "raw", readonly = 0)
# Run the libguestfs back-end.
g.launch ()

View File

@@ -8,7 +8,7 @@ guestfs-python - How to use libguestfs from Python
import guestfs
g = guestfs.GuestFS ()
g.add_drive_opts ("disk.img", format="raw", readonly=1)
g.add_drive ("disk.img", format="raw", readonly=1)
g.launch ()
=head1 DESCRIPTION

View File

@@ -9,7 +9,7 @@ disk = sys.argv[1]
g = guestfs.GuestFS ()
# Attach the disk image read-only to libguestfs.
g.add_drive_opts (disk, readonly=1)
g.add_drive (disk, readonly=1)
# Run the libguestfs back-end.
g.launch ()

View File

@@ -19,7 +19,7 @@ import os
import guestfs
g = guestfs.GuestFS()
g.add_drive_opts ("/dev/null")
g.add_drive_opts ("/dev/null", readonly = 1)
g.add_drive_opts ("/dev/null", iface = "virtio", format = "raw")
g.add_drive ("/dev/null")
g.add_drive ("/dev/null", readonly = 1)
g.add_drive ("/dev/null", iface = "virtio", format = "raw")
g.close ()

View File

@@ -25,7 +25,7 @@ f.close ()
g = guestfs.GuestFS ()
# Deliberate error: the disk format is supposed to be raw.
g.add_drive_opts ("test.img", format="qcow2");
g.add_drive ("test.img", format="qcow2");
# Because error() wasn't being called, guestfs_last_error would return
# NULL, causing a segfault in the Python bindings (RHBZ#811650).