X-Git-Url: http://git.annexia.org/?p=libguestfs.git;a=blobdiff_plain;f=TODO;h=28b884f05c31e78ee589d5cc6bf0b2de3fa25e5a;hp=3241b3674e11c4a57c390b9f7c124f9241ac2e52;hb=0c07f0d23698798475e0d09491812aca52440328;hpb=d296feb05fbbd331a4ae3ed3e18bb822acdc13c8 diff --git a/TODO b/TODO index 3241b36..28b884f 100644 --- a/TODO +++ b/TODO @@ -144,14 +144,9 @@ Ideas for extra commands General glibc / core programs: chgrp - grep (do it locally using pipe?) dd (?) - ln / ln -s - readlink utime / utimes / futimes / futimens / l.. more mk*temp calls - some sort of alloc/fallocate/posix_fallocate call to create empty space - realpath trunc[ate??] ext2 properties: @@ -177,27 +172,6 @@ Ideas for extra commands pivot_root fts(3) / ftw(3) -Swap space ----------- - -Allow swap space from the guest to be used. Is it a good idea? - -Query guest architecture ------------------------- - -Need a way to query a binary or library file for its architecture. -Using objdump or readelf? -What about non-ELF files (eg. Windows, BSD). - -To do this properly requires some serious logic, eg. to cover Linux -and Windows we'd need objdump and i686-pc-mingw32-objdump, and more to -cover a.out, COFF and 64 bit Windows. Therefore this cannot be done -inside the daemon, and should be done by a separate, external program -similar to virt-inspector. - -Probably we should go all the way and have virt-inspector able to -determine kernel and userspace architectures of guests. - Other initrd-* commands ----------------------- @@ -244,3 +218,34 @@ any short Perl one-liner would be: You can see we're well beyond a single line just getting to the point of adding drives and mounting. + +First suggestion: + + $h = create ($filename, \"/dev/sda1\" => \"/\"); + + $h = create ([$file1, $file2], \"/dev/sda1\" => \"/\"); + +To mount read-only, add C 1> like this: + + $h = create ($filename, \"/dev/sda1\" => \"/\", ro => 1); + +which is equivalent to the following sequence of calls: + + $h = Sys::Guestfs->new (); + $h->set_autosync (1); + $h->add_drive_ro ($filename); + $h->launch (); + $h->wait_ready (); + $h->mount_ro (\"/dev/sda1\", \"/\"); + +Command-line form would be: + + perl -MSys::Guestfs=:all -e '$_=create("guest.img", "/dev/sda1" => "/"); $_->cat ("/etc/fstab");' + +That's not brief enough for one-liners, so we could have an extra +autogenerated module which creates a Sys::Guestfs handle singleton +(the handle is an implicit global variable as in guestfish), eg: + + perl -MSys::Guestfs::One -e 'inspect("guest.img"); cat ("/etc/fstab");' + +How would editing files work?