1 TODO list for libguestfs
2 ======================================================================
4 This list contains random ideas and musings on features we could add
5 to libguestfs in future.
12 The API needs more test coverage, particularly lesser-used system
15 The big unresolved issue is UID/GID mapping between guest filesystem
16 IDs and the host. It's not easy to automate this because you need
17 extra details about the guest itself in order to get to its
18 UID->username map (eg. /etc/passwd from the guest).
23 Complete the Haskell bindings (see discussion on haskell-cafe).
28 Add bindtests to PHP bindings.
33 Complete the bind tests - must test the return values and error cases.
35 virt-inspector - make libvirt XML
36 ---------------------------------
38 It should be possible to generate libvirt XML from virt-inspector
39 data, at least partially. This would be just another output type so:
41 virt-inspector --libvirt guest.img
43 Note that recent versions of libvirt/virt-install allow guests to be
44 imported, so this is not so useful any more.
46 "Standalone/local mode"
47 -----------------------
49 Instead of running guestfsd (the daemon) inside qemu, there should be
50 an option to just run guestfsd directly.
52 The architecture in this mode would look like:
67 (1) This only makes sense if we are running as root.
69 (2) There is no console / kernel messages in this configuration, but
70 we might consider capturing stderr from the daemon.
72 (3) guestfs_config and guestfs_add_drive become no-ops.
74 Obviously in this configuration, commands are run directly on the
75 local machine's disks. You could just run the commands themselves
76 directly, but libguestfs provides a convenient API and language
77 bindings. Also deals with tricky stuff like parsing the output of the
78 LVM commands. Also we get to leverage other code such as
81 This is mainly useful from live CDs, ie. virt-p2v.
83 Should we bother having the daemon at all and just link the guestfsd
84 code directly into libguestfs?
86 Ideas for extra commands
87 ------------------------
89 General glibc / core programs:
117 Other initrd-* commands
118 -----------------------
125 Simple editing of configuration files
126 -------------------------------------
128 Some easy non-Augeas methods to edit configuration files.
131 replace /etc/file key value
133 which would look in /etc/file for any instances of
139 and replace them with
145 That would solve about 50% of reconfiguration needs, and for the
146 rest you'd use Augeas, 'download'+'upload' or 'edit'.
148 RWMJ: I had a go at implementing this, but it's quite error-prone to
149 do this sort of editing inside the C-based daemon code. It's far
150 better to do it with Augeas, or else to use an external language like
156 Currently we can't do Perl "one-liners". ie. The current syntax for
157 any short Perl one-liner would be:
159 perl -MSys::Guestfs -e '$g = Sys::Guestfs->new(); $g->add_drive ("foo"); $g->launch; $g->mount ("/dev/sda1", "/"); ....'
161 You can see we're well beyond a single line just getting to the point
162 of adding drives and mounting.
166 $h = create ($filename, \"/dev/sda1\" => \"/\");
168 $h = create ([$file1, $file2], \"/dev/sda1\" => \"/\");
170 To mount read-only, add C<ro =E<gt> 1> like this:
172 $h = create ($filename, \"/dev/sda1\" => \"/\", ro => 1);
174 which is equivalent to the following sequence of calls:
176 $h = Sys::Guestfs->new ();
177 $h->add_drive_ro ($filename);
179 $h->mount_ro (\"/dev/sda1\", \"/\");
181 Command-line form would be:
183 perl -MSys::Guestfs=:all -e '$_=create("guest.img", "/dev/sda1" => "/"); $_->cat ("/etc/fstab");'
185 That's not brief enough for one-liners, so we could have an extra
186 autogenerated module which creates a Sys::Guestfs handle singleton
187 (the handle is an implicit global variable as in guestfish), eg:
189 perl -MSys::Guestfs::One -e 'inspect("guest.img"); cat ("/etc/fstab");'
191 How would editing files work?
197 http://man.linux-ntfs.org/ntfsclone.8.html
203 http://search.cpan.org/~rgiersig/IO-Tty-1.08/Pty.pm
204 http://www.perlmonks.org/index.pl?node_id=582185
206 Note that pty requires cooperation inside the C code too (there are
207 two sides to a pty, and one has to be handled after the fork).
209 Windows-based daemon/appliance
210 ------------------------------
212 See discussion on list:
213 https://www.redhat.com/archives/libguestfs/2009-November/msg00165.html
218 Add -drive file=...,lock=exclusive and -drive file=...,lock=shared
220 Change libguestfs and libvirt to do the right thing, so that multiple
221 instances of qemu cannot stomp on each other.
226 For multi-level disk images such as live CDs:
227 http://rwmj.wordpress.com/2009/07/15/unpack-the-russian-doll-of-a-f11-live-cd/
229 It's possible with libguestfs to recursively look for anything that
230 might be a filesystem, mount-{,loop} it and look in those, revealing
231 anything in a disk image.
233 However this won't work easily for VM disk images in the disk image.
234 One would have to download those to the host and launch another
237 Map filesystems to disk blocks
238 ------------------------------
240 Map files/filesystems/(any other object) to the actual disk
247 See also contribs/visualize-alignment/
249 Integration with host intrusion systems
250 ---------------------------------------
252 Perfect way to monitor VMs from outside the VM. Look for file
253 hashes, log events, login/logout etc.
255 http://www.ossec.net/
256 http://la-samhna.de/samhain/
257 http://sourceforge.net/projects/aide/
258 http://osiris.shmoo.com/
259 http://sourceforge.net/projects/tripwire/
264 https://www.redhat.com/archives/libguestfs/2010-June/msg00053.html
265 https://www.redhat.com/archives/libguestfs/2010-June/msg00079.html
267 Regression test on virt-inspector
268 ---------------------------------
270 Occasionally we break virt-inspector through some change. We should
271 add a regression test for it. However this is hard because we'd need
272 to avoid having to carry huge images.
274 Update: I managed to fit a real-but-minimal Fedora 13 image into 6.2 MB.
275 See: http://rwmj.wordpress.com/2010/09/07/tip-pack-files-into-a-new-disk-image/#content
277 Freeze/thaw filesystems
278 -----------------------
280 Access to these ioctls:
281 http://git.kernel.org/linus/fcccf502540e3d7
283 Tips for new users in guestfish
284 -------------------------------
287 Tip: You need to 'add disk.img' or 'alloc disk.img nn' to make a new image.
288 Type 'notips' to disable tips permanently.
290 Tip: You need to type 'run' before you can see into the disk image.
292 Tip: Use 'list-filesystems' to see what filesystems are available.
293 ><fs> list-filesystems
295 Tip: Use 'mount fs /' to mount a filesystem.
296 ><fs> mount /dev/vda1 /
297 Tip: Use 'll /' to view the filesystem or ...
300 Could we make guestfish interactive if commands are used without params?
301 ------------------------------------------------------------------------
311 How can we solve these common user problems?
313 [space for common problems here]
315 Better support for encrypted devices
316 ------------------------------------
318 Currently LUKS support only works if the device contains volume
319 groups. If it contains, eg., partitions, you cannot access them.
320 We would like to add:
322 - An easier way to use this from guestfish.
323 - Direct access to the /dev/mapper device (eg. if it contains
324 anything apart from VGs).
329 Display the structure of an image file as a PS.
331 Greater use of blkid / libblkid
332 -------------------------------
334 guestfs_zero should use wipefs. See wipefs(8).
336 There are various useful functions in libblkid for listing partitions,
337 devices etc which we are essentially duplicating in the daemon. It
338 would make more sense to just use libblkid for this.
340 There are some places where we call out to the 'blkid' program. This
341 might be replaced by direct use of the library (if this is easier).
346 Eric Sandeen pointed out the blktrace tool which is a better way of
347 capturing traces than using patched qemu (see
348 contrib/visualize-alignment). We would still use the same
349 visualization tools in conjunction with blktrace traces.
354 guestfs_add_domain (g, "libvirt-dom");
356 However this would need to not depend on libvirt, eg. loading it