libguestfs.git
14 years agoappliance: Change comment about unreadable binaries.
Richard Jones [Tue, 18 May 2010 09:01:45 +0000 (10:01 +0100)]
appliance: Change comment about unreadable binaries.

For stable branch, change reference to febootstrap-supermin-helper
to libguestfs-supermin-helper.
(cherry picked from commit 155aa76e57c99594a3724933b6d117f1053544b3)

14 years agoUpdate BUGS and PO files. 1.2.7
Richard Jones [Mon, 17 May 2010 11:11:53 +0000 (12:11 +0100)]
Update BUGS and PO files.

14 years agoUpdate BUGS.
Richard Jones [Mon, 17 May 2010 11:09:00 +0000 (12:09 +0100)]
Update BUGS.

14 years agoVersion 1.2.7.
Richard Jones [Mon, 17 May 2010 10:16:37 +0000 (11:16 +0100)]
Version 1.2.7.

14 years agoGenerate BUGS file from Red Hat Bugzilla database.
Richard Jones [Sat, 15 May 2010 07:43:02 +0000 (08:43 +0100)]
Generate BUGS file from Red Hat Bugzilla database.

Add a script which generates the 'BUGS' file from Red Hat Bugzilla.
This is run whenever we do 'make dist' and deliberately stored in git.
(cherry picked from commit 002dc21cba1469cc5b1ce5ef4a7984a733b44a1f)

14 years agovirt-df: Display domains in sorted order.
Richard Jones [Fri, 14 May 2010 18:42:48 +0000 (19:42 +0100)]
virt-df: Display domains in sorted order.
(cherry picked from commit 5d5565ca24b95719461b0c0aebdb0651dd2671ca)

14 years agoUpdate PO files.
Richard Jones [Fri, 14 May 2010 17:41:55 +0000 (18:41 +0100)]
Update PO files.

14 years agoVersion 1.2.6 1.2.6
Richard Jones [Fri, 14 May 2010 17:02:31 +0000 (18:02 +0100)]
Version 1.2.6

14 years agoImproved error if virt-inspector cannot find OSes in image (RHBZ#591142).
Richard Jones [Wed, 12 May 2010 17:11:37 +0000 (18:11 +0100)]
Improved error if virt-inspector cannot find OSes in image (RHBZ#591142).

(cherry picked from commit 94e310dcfbcd368cbe02dbc1643ed2ff9821cd48
and modified to apply to the stable branch)

14 years agoFix error message in strings-e command (RHBZ#588651).
Richard Jones [Wed, 12 May 2010 15:55:59 +0000 (16:55 +0100)]
Fix error message in strings-e command (RHBZ#588651).

(cherry picked from commit 287f8957fea3efe411c7ac55595d5d6c7b613e4e
and modified to apply to the stable branch.  Note that the original
commit message contains a typo 'string-e' instead of 'strings-e')

14 years agoReduce imported functions in virt-df to ones which are actually used.
Richard Jones [Wed, 12 May 2010 17:10:58 +0000 (18:10 +0100)]
Reduce imported functions in virt-df to ones which are actually used.
(cherry picked from commit 5477d98548661394cf0df3ce48929961e0d2a38f)

14 years agoRun udev_settle() after swapon/swapoff (RHBZ#516096).
Richard Jones [Wed, 12 May 2010 15:12:07 +0000 (16:12 +0100)]
Run udev_settle() after swapon/swapoff (RHBZ#516096).
(cherry picked from commit 9d158c3ab132df21d58890f18224cd2fe020de67)

14 years agovirt-rescue: Refresh documentation.
Richard Jones [Sat, 8 May 2010 18:55:27 +0000 (19:55 +0100)]
virt-rescue: Refresh documentation.
(cherry picked from commit d0afef23e54f75a521eed8c7261a533776242cfc)

14 years agolaunch: Rearrange the code so config check is first.
Richard Jones [Sat, 8 May 2010 08:28:19 +0000 (09:28 +0100)]
launch: Rearrange the code so config check is first.

Move the config state check first in the guestfs_launch function,
so that we don't reset g->launch_t or calculate the temporary
directory in the case where the launch function will immediately
return with an error.
(cherry picked from commit 55e9707f8591488542da48fc89738234b4d85016)

14 years agoIgnore test1.img file in directory.
Richard Jones [Sat, 8 May 2010 08:10:00 +0000 (09:10 +0100)]
Ignore test1.img file in directory.
(cherry picked from commit 2064e43bcfc7fc5bde08a0442c646a0a46997875)

14 years agofish: Make '-x' option enable traces instead of using separate echo path.
Richard Jones [Sat, 8 May 2010 08:04:28 +0000 (09:04 +0100)]
fish: Make '-x' option enable traces instead of using separate echo path.

Previously we had separate code paths for echoing commands (-x)
and tracing (guestfs_set_trace).  This just unifies that so that
the guestfish -x option enables tracing.

(cherry picked from commit 8e007581c91a5193e6aec0f6f9aeb379a935c9d4
and commit a96d70113ffcd01f55262c3d0fbe711bee759fec
and commit 87eecb507ee09a62f3a12f5f75d3417a09c0c8d4 which are all
logically part of the same fix)

14 years agodaemon: gnulib module 'error' is used directly by the daemon.
Richard Jones [Fri, 7 May 2010 21:49:49 +0000 (22:49 +0100)]
daemon: gnulib module 'error' is used directly by the daemon.
(cherry picked from commit b52ef0b021fc443d88d4d9c43f57468712e40965)

14 years agoIf qemu dies during launch, set an error message (RHBZ#588851).
Richard Jones [Fri, 7 May 2010 21:37:55 +0000 (22:37 +0100)]
If qemu dies during launch, set an error message (RHBZ#588851).
(cherry picked from commit fc6dd9daa13ac774156d0822b5aa7830171feb85)

14 years agodaemon: Fix read-file so it fails gracefully for large files (RHBZ#589039).
Richard Jones [Fri, 7 May 2010 12:30:42 +0000 (13:30 +0100)]
daemon: Fix read-file so it fails gracefully for large files (RHBZ#589039).

Pengzhen Cao noticed that read-file would fail for files
larger than the protocol size; this is *not* the bug.  However
it would also lose protocol synchronization after this.

The reason was that functions which return RBufferOut in the
generator must not 'touch' the *size_r parameter along error
return paths.

I fixed read-file and initrd-cat, and I checked that pread was
doing the right thing.

This also adds regression tests for read-file with various categories
of large file.
(cherry picked from commit 42f59b28f123f53ae038df23a9abee08e959e46b)

14 years agoWarn instead of dying if grub refers to non-existent kernel
Matthew Booth [Fri, 7 May 2010 13:58:32 +0000 (14:58 +0100)]
Warn instead of dying if grub refers to non-existent kernel
(cherry picked from commit 4839d5142ca50818965866287932f9ded14729e6)

14 years agoChange network configuration to use macros.
Richard Jones [Tue, 4 May 2010 14:06:09 +0000 (15:06 +0100)]
Change network configuration to use macros.

Change the network configuration so everything is set using
some macros at the top of src/guestfs.c.

Also, rename the macros used in the daemon so they are not the
same.  It was a very long time since these sets of macros had to
match the ones defined in src/guestfs.c, despite what the comment
said.

Note that this commit should not change the semantics of the
program at all.
(cherry picked from commit 8a9f2ca65521d093ac14307aca4370d9497ac840)

14 years agotests: In verbose mode, print dashes between each test.
Richard Jones [Fri, 30 Apr 2010 22:12:34 +0000 (23:12 +0100)]
tests: In verbose mode, print dashes between each test.

Only affects tests when run with LIBGUESTFS_DEBUG=1.  Lets you easily
see when each test starts and ends.
(cherry picked from commit 097266e01cfa28319834bf750649650f3c22006f)

14 years agoVersion 1.2.5 1.2.5
Richard Jones [Fri, 30 Apr 2010 16:39:33 +0000 (17:39 +0100)]
Version 1.2.5

14 years agoDocument that guestfs_mount implies -o sync and performance problem (RHBZ#587582).
Richard Jones [Fri, 30 Apr 2010 12:56:11 +0000 (13:56 +0100)]
Document that guestfs_mount implies -o sync and performance problem (RHBZ#587582).
(cherry picked from commit fd2d10d6ed91f417a9b99bb61526b45bb7ed3e4e)

14 years agocontrib: Add dependency diagram of libguestfs ecosystem.
Richard Jones [Fri, 30 Apr 2010 11:27:00 +0000 (12:27 +0100)]
contrib: Add dependency diagram of libguestfs ecosystem.
(cherry picked from commit 90b4e24df6f27c02d3b11d8021b27a197cf18b75)

14 years agocontrib: Add header to README file.
Richard Jones [Fri, 30 Apr 2010 10:34:21 +0000 (11:34 +0100)]
contrib: Add header to README file.
(cherry picked from commit 2f9f3375028a02fdaec62f30e11bacd6524a342c)

14 years agolvresize: Use --force so it can make LVs smaller (RHBZ#587484).
Richard Jones [Fri, 30 Apr 2010 09:51:49 +0000 (10:51 +0100)]
lvresize: Use --force so it can make LVs smaller (RHBZ#587484).

This also adds a regression test for this bug.
(cherry picked from commit c24de46d06cc3ecccf00bfaaffb06172659cdd0a)

14 years agotools: Fix documentation for CurrentControlSet (thanks Yuval Kashtan).
Richard Jones [Fri, 30 Apr 2010 08:46:40 +0000 (09:46 +0100)]
tools: Fix documentation for CurrentControlSet (thanks Yuval Kashtan).
(cherry picked from commit 25c15261253bbd2fb140e5ca1c902acf714f76a9)

14 years agoguestfs(3): Documentation on protocol gotchas.
Richard Jones [Thu, 29 Apr 2010 12:55:52 +0000 (13:55 +0100)]
guestfs(3): Documentation on protocol gotchas.
(cherry picked from commit 55641f5d1e9964f8a039005b511b8e688c92cddb)

14 years agodocs: Routine refresh of the documentation for guestfs(3) and guestfish(1).
Richard Jones [Sat, 24 Apr 2010 07:50:40 +0000 (08:50 +0100)]
docs: Routine refresh of the documentation for guestfs(3) and guestfish(1).

For stable branch:
 - cherry picked from commit ce95be8b185ce69
 - updated the patch so it doesn't refer to any new guestfish features
     in the 1.3 branch

14 years agoVersion 1.2.4 1.2.4
Richard Jones [Fri, 23 Apr 2010 17:00:41 +0000 (18:00 +0100)]
Version 1.2.4

14 years agotodo docs: Discuss shrinking filesystems and specifying sizes in guestfish.
Richard Jones [Fri, 23 Apr 2010 13:29:56 +0000 (14:29 +0100)]
todo docs: Discuss shrinking filesystems and specifying sizes in guestfish.
(cherry picked from commit 7c285ea84f63e511f95a3c8bfbb98cbf99b9466b)

14 years agodaemon: Split out checksum type to program name mapping into function.
Richard Jones [Fri, 23 Apr 2010 12:42:10 +0000 (13:42 +0100)]
daemon: Split out checksum type to program name mapping into function.

This shouldn't change the semantics of the program.

For stable-1.2 this was cherry picked from commit af29c84 and
rebased against the older code in daemon/checksum.c.

14 years agotodo docs: Integrate with host intrusion detection systems.
Richard Jones [Fri, 23 Apr 2010 09:25:35 +0000 (10:25 +0100)]
todo docs: Integrate with host intrusion detection systems.
(cherry picked from commit 6e269c6e5123c1558589e0a59844dc0187fbd63a)

14 years agotodo docs: Mapping filesystems to and from disk blocks.
Richard Jones [Fri, 23 Apr 2010 09:23:45 +0000 (10:23 +0100)]
todo docs: Mapping filesystems to and from disk blocks.

(cherry picked from commit 2ed549e95c7ad75f28b5f0dd4c53849e1607444e)

14 years agofish docs: Be consistent about using I<-..> for options.
Richard Jones [Thu, 22 Apr 2010 09:46:34 +0000 (10:46 +0100)]
fish docs: Be consistent about using I<-..> for options.
(cherry picked from commit 89486c50eaeb8b1cc5a6ff388cb47e859f8565d1)

14 years agofish docs: Use L</...> for internal links in the man page.
Richard Jones [Thu, 22 Apr 2010 09:44:35 +0000 (10:44 +0100)]
fish docs: Use L</...> for internal links in the man page.
(cherry picked from commit e3e67f63b0a6ce952ba92cb966b8ac5ef239dcf9)

14 years agoWhitelist the loop kernel module
Matthew Booth [Thu, 22 Apr 2010 12:57:56 +0000 (13:57 +0100)]
Whitelist the loop kernel module

loop is sometimes a module, for example on RHEL 5.
(cherry picked from commit 75d9c056b2db9ceedef9eca64e67ad3350eabad8)

14 years agoDon't die during inspection if rpm -qa or dpkg-query fails
Matthew Booth [Wed, 21 Apr 2010 14:39:49 +0000 (15:39 +0100)]
Don't die during inspection if rpm -qa or dpkg-query fails

If a problem in the package database prevented package enumeration from working,
inspection would die. This change makes it emit a warning and continue.
(cherry picked from commit 39416cdb11bb2005915ed293eafb3cc6d714416d)

14 years agoDon't die during inspection if initrd doesn't exist
Matthew Booth [Wed, 21 Apr 2010 14:39:48 +0000 (15:39 +0100)]
Don't die during inspection if initrd doesn't exist

This fixes a problem where inspection would die if grub.conf referenced a
non-existent initrd. Just return an empty initrd instead.
(cherry picked from commit 2b43970c8c97f24b1f45c040c6963d30661fa514)

14 years agoRemove checks for Test::Pod and Test::Pod::Coverage.
Richard Jones [Tue, 20 Apr 2010 17:46:45 +0000 (18:46 +0100)]
Remove checks for Test::Pod and Test::Pod::Coverage.

Although these modules are optionally used by the Perl tests,
they aren't necessary and won't break the build if they are not
there.  These modules aren't available in RHEL 5.  Therefore
remove these checks.
(cherry picked from commit c8f302a17453ad58acccd137342438795763606a)

14 years agoCheck user doesn't run configure, make or make check as root.
Richard Jones [Tue, 20 Apr 2010 12:22:09 +0000 (13:22 +0100)]
Check user doesn't run configure, make or make check as root.

(Thanks to Yufang Zhang for helping to debug this issue).
(cherry picked from commit 199f218bf431b77c12a728f7072bed1553a0f0af)

14 years agoReplace 'dd' in tests with use of guestfish 'sparse' command.
Richard Jones [Tue, 20 Apr 2010 10:04:14 +0000 (11:04 +0100)]
Replace 'dd' in tests with use of guestfish 'sparse' command.

'dd' is a very inefficient way to create files.  'truncate' is
better, but unfortunately that command is not available in RHEL 5.
So use the guestfish 'sparse' command instead (which also avoids
allocating disk space).
(cherry picked from commit 175c01d2336c07113f1c2966966957de5c344e3a)

14 years agoDocument new version numbering policy.
Richard Jones [Tue, 20 Apr 2010 09:50:50 +0000 (10:50 +0100)]
Document new version numbering policy.

See discussion on mailing list:

https://www.redhat.com/archives/libguestfs/2010-April/msg00005.html
https://www.redhat.com/archives/libguestfs/2010-April/msg00057.html
https://www.redhat.com/archives/libguestfs/2010-April/msg00058.html
(cherry picked from commit 54a8f8f30de2f3132da97c54d07ca4639c405de1)

14 years agoUpdate PO files. 1.2.3
Richard Jones [Tue, 20 Apr 2010 08:44:05 +0000 (09:44 +0100)]
Update PO files.

14 years agoPrepare for 1.2.3.
Richard Jones [Tue, 20 Apr 2010 07:46:30 +0000 (08:46 +0100)]
Prepare for 1.2.3.

14 years agoDocument umask (RHBZ#582548, RHBZ#583554).
Richard Jones [Mon, 19 Apr 2010 19:55:15 +0000 (20:55 +0100)]
Document umask (RHBZ#582548, RHBZ#583554).
(cherry picked from commit c2a8efc548d6f997049cbb3d63bab360b0d946b6)

14 years agodocs: Clarify documentation for mknod (RHBZ#582948).
Richard Jones [Mon, 19 Apr 2010 19:13:05 +0000 (20:13 +0100)]
docs: Clarify documentation for mknod (RHBZ#582948).
(cherry picked from commit 42e43db927dac13da0afe6dba39708295eb06021)

14 years agodocs: Add virt-resize(1) link to guestfish(1) manpage.
Richard Jones [Mon, 19 Apr 2010 09:20:58 +0000 (10:20 +0100)]
docs: Add virt-resize(1) link to guestfish(1) manpage.
(cherry picked from commit 92d38b9ae3a0b1b4694da5e3d3a3cb155842cd91)

14 years agotodo documentation: Idea: List, mount filesystems by UUID and label.
Richard Jones [Sat, 17 Apr 2010 19:41:28 +0000 (20:41 +0100)]
todo documentation: Idea: List, mount filesystems by UUID and label.
(cherry picked from commit e55400960a6a06eb6dc16ea96f3c30ed580d3d3a)

14 years agotodo documentation: remove 'virt-grow/shrink', see virt-resize
Richard Jones [Sat, 17 Apr 2010 19:36:11 +0000 (20:36 +0100)]
todo documentation: remove 'virt-grow/shrink', see virt-resize
(cherry picked from commit abb7365d4df7b945846a9f6189bbbd70e10122d1)

14 years agotodo documentation: virt-rescue now uses $TERM from library, remove from todo list
Richard Jones [Sat, 17 Apr 2010 19:35:34 +0000 (20:35 +0100)]
todo documentation: virt-rescue now uses $TERM from library, remove from todo list
(cherry picked from commit 398e6830a34e916c52cd23ba6d0b4c00602dfc61)

14 years agotodo documentation: Remove old section on PPC bugs.
Richard Jones [Sat, 17 Apr 2010 19:34:35 +0000 (20:34 +0100)]
todo documentation: Remove old section on PPC bugs.

No one cares for PPC, and if they do they should file these
as bugs in the bug tracker.
(cherry picked from commit 3b759fe7fe568a3d643ee99e0aef0adaf163d1e5)

14 years agotodo documentation: Remove old ideas for Python bindings.
Richard Jones [Sat, 17 Apr 2010 19:34:21 +0000 (20:34 +0100)]
todo documentation: Remove old ideas for Python bindings.
(cherry picked from commit fc50bf2680d4ed653ff00d390cd7a17ebeb22cf2)

14 years agoDocumentation: Use 'g' instead of 'handle' in documentation.
Richard Jones [Sat, 17 Apr 2010 15:33:07 +0000 (16:33 +0100)]
Documentation: Use 'g' instead of 'handle' in documentation.

By convention we use 'g' for handles.  Copy this convention
through to all the documentation.
(cherry picked from commit 2e0f3ed54b978925c79ca0d33e76bec338b23631)

14 years agoIn guestfs(3), unmount "/" directory in the example.
Richard Jones [Sat, 17 Apr 2010 15:24:03 +0000 (16:24 +0100)]
In guestfs(3), unmount "/" directory in the example.
(cherry picked from commit 6e4bf8e278f5c8bd28eba7152d2f11d1e537ee1b)

14 years agoAdd compilation/linking example to guestfs(3) man page.
Richard Jones [Sat, 17 Apr 2010 15:22:53 +0000 (16:22 +0100)]
Add compilation/linking example to guestfs(3) man page.
(cherry picked from commit 4680c732585b2c2d292f521f393215c7943096fa)

14 years agoBuild top-level directories in a more logical order.
Richard Jones [Sat, 17 Apr 2010 14:46:08 +0000 (15:46 +0100)]
Build top-level directories in a more logical order.
(cherry picked from commit 09a0427448b1f4328b9246d4d8a26610bb5228c8)

14 years agogenerator: Fix typo in a comment.
Richard Jones [Sat, 17 Apr 2010 13:14:30 +0000 (14:14 +0100)]
generator: Fix typo in a comment.
(cherry picked from commit 68467cb1c2f8b1cc7844ed6512b7f76ef2aba1d1)

14 years agoImproved checking, documentation of modes (RHBZ#582901, RHBZ#582929).
Richard Jones [Sat, 17 Apr 2010 12:33:14 +0000 (13:33 +0100)]
Improved checking, documentation of modes (RHBZ#582901, RHBZ#582929).

chmod: Disallow negative mode, document mode affected by umask.

mkdir-mode: Disallow negative mode, document that filesystems
may interpret the mode in different ways.

mknod: Disallow negative mode, document mode affected by umask.

umask: Check the range of umask mask value carefully.
(cherry picked from commit 61ab83d19009a8006dd73ebe16d22494b78be4d1)

14 years agofish: Autocomplete 'sparse' command (RHBZ#582899).
Richard Jones [Sat, 17 Apr 2010 12:11:20 +0000 (13:11 +0100)]
fish: Autocomplete 'sparse' command (RHBZ#582899).

I also rechecked the list of built-in commands against
the actual commands to make sure no others were omitted.
(cherry picked from commit 42fc0e02b094ef3b19dae115276a0a33116af6d5)

14 years agoAdd a build test for the 'umask' command.
Richard Jones [Sat, 17 Apr 2010 11:38:18 +0000 (12:38 +0100)]
Add a build test for the 'umask' command.

(cherry picked from commit 116d497c68c2e57f6e92abf8834112a794a145f0)

14 years agoDocumentation: lvcreate should say 'logical volume' (RHBZ#582953)
Richard Jones [Sat, 17 Apr 2010 11:13:23 +0000 (12:13 +0100)]
Documentation: lvcreate should say 'logical volume' (RHBZ#582953)
(cherry picked from commit e64c1e5aacd605ea177972e56ede5be22ae13d4f)

14 years agoFix build error in fuse/guestmount.c.
Matthew Booth [Wed, 14 Apr 2010 10:13:04 +0000 (11:13 +0100)]
Fix build error in fuse/guestmount.c.

guestmount.c: In function 'main':
guestmount.c:899: error: implicit declaration of function 'setlocale'
[-Wimplicit-function-declaration]

guestmount.c wasn't including locale.h.
(cherry picked from commit c0d73e0e60b99b87855364ff346551f5ff7efccb)

14 years agofish: Allow '-' prefix on command line to override exit on error (RHBZ#578407).
Richard Jones [Tue, 13 Apr 2010 21:06:43 +0000 (22:06 +0100)]
fish: Allow '-' prefix on command line to override exit on error (RHBZ#578407).

Allow -cmd on the command line to mean that normal exit on error
behaviour is overridden, ie. we will not exit.

This allows you to do:

  guestfish -- command : -command : command

with the second command allowing errors.  (Note that '--' is required
to stop getopt parsing -command as an option).

Also this fixes the remote case which is what the original
bug report was about.
(cherry picked from commit ad752b80d7fa064b7bdd3d4c8d47c95d79265b58)

14 years agofish: Update documentation: Add another pipe example.
Richard Jones [Tue, 13 Apr 2010 20:26:14 +0000 (21:26 +0100)]
fish: Update documentation: Add another pipe example.
(cherry picked from commit c076aaea7e6d9459c8d8a96d21abd71a0223f098)

14 years agofish: Update documentation: Using 'lcd' command to change local directory.
Richard Jones [Tue, 13 Apr 2010 20:25:50 +0000 (21:25 +0100)]
fish: Update documentation: Using 'lcd' command to change local directory.
(cherry picked from commit c7c4a476a5957794dc2e9af0ec14b447ecef5740)

14 years agoVersion 1.2.2 1.2.2
Richard Jones [Mon, 12 Apr 2010 18:56:02 +0000 (19:56 +0100)]
Version 1.2.2

14 years agoFix time and timezone to be correct within the appliance.
Richard Jones [Mon, 12 Apr 2010 15:34:57 +0000 (16:34 +0100)]
Fix time and timezone to be correct within the appliance.
(cherry picked from commit 508f1ee87e816bf6b6fc8e629ccbb2d61a971169)

14 years agovirt-resize: Mention alternate tools like gparted in the documentation.
Richard Jones [Mon, 12 Apr 2010 11:17:08 +0000 (12:17 +0100)]
virt-resize: Mention alternate tools like gparted in the documentation.

Note for stable-1.2:
Cherry picked from development commit c53e64a and rebased
against stable-1.2 tree.

14 years agoDocumentation updates.
Richard Jones [Sun, 11 Apr 2010 16:02:18 +0000 (17:02 +0100)]
Documentation updates.

Fix copyright years.
Fix URLs to point to new PRC site.
Make sure guestfish(1) and guestfs(3) manpages reference the
current list of tools.

(cherry picked from commit 9a608a1516bd339dc6d5ebe9952d3bced273c416)

14 years agoBugfixes for virt-resize.
Richard Jones [Sat, 10 Apr 2010 12:35:31 +0000 (13:35 +0100)]
Bugfixes for virt-resize.

 - copy more than 64 boot loader sectors across, since real boot
   loaders (eg. for Windows) can be much larger than this
 - copy bootable flag and ID byte to new partitions
 - start the first partition on the new disk at the same sector
   offset as on the old disk
 - sync the disks before existing
(cherry picked from commit add5e22563972210f5c8baf9e8cf651fc1a7bbd8)

14 years agoNew partition APIs: part_del, part_get_bootable, part_get/set_mbr_id
Richard Jones [Sat, 10 Apr 2010 12:19:43 +0000 (13:19 +0100)]
New partition APIs: part_del, part_get_bootable, part_get/set_mbr_id

These APIs flesh out further the partitioning API.

Note for stable-1.2 branch:
Cherry picked from b68c030adfdbefe65bc9 and modified
to apply against stable-1.2.  We need these new APIs
in order to support bugfixes in virt-resize.

14 years agodaemon: More reliable parsing of the output from 'parted print'.
Richard Jones [Sat, 10 Apr 2010 12:17:50 +0000 (13:17 +0100)]
daemon: More reliable parsing of the output from 'parted print'.

Previously we used strtok.  However this has the problem that
strtok considers multiple delimiter characters to be like a single
delimiter, eg. "1:::2" would be parsed the same as "1:2".  In
other words, the previous code would skip over or fail if there
are empty fields.
(cherry picked from commit cb9350019cc6382a35c98f522c9c4d221c92b605)

14 years agodaemon: Make the RUN_PARTED macro take an error statement.
Richard Jones [Sat, 10 Apr 2010 12:16:19 +0000 (13:16 +0100)]
daemon: Make the RUN_PARTED macro take an error statement.

This allows us to make the RUN_PARTED macro do something else
along the error path, other than just returning -1.
(cherry picked from commit 440ad646cdf31bdb5ad2bc92fc51fa6df3fb9c63)

14 years agoDocumentation: Clarify documentation on the bootable flag.
Richard Jones [Sat, 10 Apr 2010 12:14:54 +0000 (13:14 +0100)]
Documentation: Clarify documentation on the bootable flag.
(cherry picked from commit 30752ac7ca042f533b8d0c4c6144400a8532b154)

14 years agoAllow aug-ls to take Augeas variable as argument (RHBZ#580016).
Richard Jones [Fri, 9 Apr 2010 08:40:59 +0000 (09:40 +0100)]
Allow aug-ls to take Augeas variable as argument (RHBZ#580016).
(cherry picked from commit d1dd00606d0b5b1430598e5092b017aa15d9ee11)

14 years agoUpdate PO files. 1.2.1
Richard Jones [Thu, 8 Apr 2010 21:56:29 +0000 (22:56 +0100)]
Update PO files.

14 years agoPrepare for stable version 1.2.1.
Richard Jones [Thu, 8 Apr 2010 21:26:01 +0000 (22:26 +0100)]
Prepare for stable version 1.2.1.

14 years agoRemove warning "No grub default" (RHBZ#580650).
Richard Jones [Thu, 8 Apr 2010 18:33:57 +0000 (19:33 +0100)]
Remove warning "No grub default" (RHBZ#580650).
(cherry picked from commit 3765f97898a1194d96ab4124e1eb46e25701b3b2)

14 years agoIf qemu dies during launch in "null vmchannel" mode, don't hang (RHBZ#579155).
Richard Jones [Thu, 8 Apr 2010 18:07:45 +0000 (19:07 +0100)]
If qemu dies during launch in "null vmchannel" mode, don't hang (RHBZ#579155).

Detect if qemu dies during launch by wait(2)-ing for it, and
then getting EOF on the qemu pipe.  This was broken in null
vmchannel mode, causing a hang.
(cherry picked from commit e35debd642bea240609775610b68145dab0a634b)

14 years agoDon't kill self accidentally.
Richard Jones [Thu, 8 Apr 2010 18:06:00 +0000 (19:06 +0100)]
Don't kill self accidentally.

Always check that pid > 0 before calling kill (pid, 9).  The
issue was that sometimes pid == 0, and this ends up killing
ourselves.
(cherry picked from commit dc5df3bfec706803e75a5f2454293db30e753249)

14 years agoFix for "warning: unexpected connection from UID ..."
Richard Jones [Thu, 8 Apr 2010 17:53:40 +0000 (18:53 +0100)]
Fix for "warning: unexpected connection from UID ..."

This warning is currently a fatal error.  The code attempts
to retry the accept call, but because we don't reset sock = -1
the retry doesn't happen and it dies anyway.

Set sock = -1 so the retry attempt can happen.
(cherry picked from commit fb4ec82d97f71963ea7f830cb0bc38abefcbac99)

14 years agoconfigure: Default to using Fedora 12 repo (was Fedora 11).
Richard Jones [Thu, 8 Apr 2010 14:49:14 +0000 (15:49 +0100)]
configure: Default to using Fedora 12 repo (was Fedora 11).

Fedora 11 is almost EOL at this point.
(cherry picked from commit 0ce9b2bb9bcac61f7fb5dd2811d9b3b621f8309b)

14 years agoCode cleanups related to RHBZ#580246.
Richard Jones [Wed, 7 Apr 2010 20:04:01 +0000 (21:04 +0100)]
Code cleanups related to RHBZ#580246.

This includes various code cleanups:

 (a) A regression test for RHBZ#580246.

 (b) Use write instead of fwrite to write out the tar file.  This is
     just because the error handling of write seems to be better
     specified and easier to use.

 (c) Use size_t instead of int for length.

 (d) Clearer debug messages when in verbose mode.
(cherry picked from commit de7ef2a0fdcbcddfd35ecb8ee2804e1ca0968454)

14 years agoFix tar-in command hangs when running out of disk space (RHBZ#580246).
Richard Jones [Thu, 8 Apr 2010 07:48:38 +0000 (08:48 +0100)]
Fix tar-in command hangs when running out of disk space (RHBZ#580246).

The problem was this sequence of events:

 (1) File transfer goes through OK.

 (2) pclose returns failure (because 'tar' subprocess failed)

 (3) We try to cancel the transfer by calling cancel_receive.

Step (3) fails because the transfer (as far as the library is
concerned) has succeeded, so causing a hang.

The more fundamental reason why we see steps (1) and (2) is that
'tar' does NOT fail immediately if there is a write error.  Instead
it continues reading and discarding the input until the end of the
input before giving "Error exit delayed from previous errors".
IMHO this is a bug with tar, since an ENOSPC write error should
be fatal for tar.
(cherry picked from commit 07f4b20ae959069fca41756b0dc103ec5fa99754)

14 years agofish: Print extended help when the user types an unknown command first.
Richard Jones [Tue, 6 Apr 2010 22:54:08 +0000 (23:54 +0100)]
fish: Print extended help when the user types an unknown command first.

$ guestfish /tmp/disk.img
/tmp/disk.img: unknown command
Did you mean to open a disk image?  guestfish -a disk.img
For a list of commands:             guestfish -h
For complete documentation:         man guestfish
(cherry picked from commit 4c50f4c38d9a50fbf983c79dd208d1b1598fef8a)

14 years agoCheck error returns from posix_fallocate (RHBZ#579664).
Richard Jones [Tue, 6 Apr 2010 10:03:03 +0000 (11:03 +0100)]
Check error returns from posix_fallocate (RHBZ#579664).

posix_fallocate has a non-standard way to return error indications.
Thus all our calls to posix_fallocate were effectively unchecked.  For
example:

  $ guestfish alloc test.img 1P
  $ echo $?
  0
  $ ll test.img
  -rw-rw-r--. 1 rjones rjones 0 2010-04-06 11:02 test.img
  $ rm test.img

With this change, errors are detected and reported properly:

  $ ./fish/guestfish alloc test.img 1P
  fallocate: File too large

This is a fix for:
https://bugzilla.redhat.com/show_bug.cgi?id=579664
(cherry picked from commit 2ade61d1f864c75ce65c358e4ac8a012a897b89a)

14 years agoPrettier POD CSS.
Richard W.M. Jones [Tue, 30 Mar 2010 20:07:27 +0000 (21:07 +0100)]
Prettier POD CSS.
(cherry picked from commit fb0375a0984efca96db1277398f9fe50ecdd578d)

14 years agoUpdate PO files. 1.0.89 1.2.0 1.3.0
Richard Jones [Tue, 30 Mar 2010 16:49:44 +0000 (17:49 +0100)]
Update PO files.

14 years agochmod +x virt-resize binary.
Richard Jones [Tue, 30 Mar 2010 16:49:24 +0000 (17:49 +0100)]
chmod +x virt-resize binary.

14 years agoFix EXTRA_DIST rule.
Richard Jones [Tue, 30 Mar 2010 16:49:06 +0000 (17:49 +0100)]
Fix EXTRA_DIST rule.

14 years agoPrepare for 1.0.89.
Richard Jones [Tue, 30 Mar 2010 16:05:56 +0000 (17:05 +0100)]
Prepare for 1.0.89.

14 years agoImproved version of virt-win-reg, supporting exporting and merging.
Richard Jones [Fri, 26 Mar 2010 17:14:04 +0000 (17:14 +0000)]
Improved version of virt-win-reg, supporting exporting and merging.

14 years agovirt-df: Match output with native (coreutils) 'df' command (RHBZ#578123).
Richard Jones [Tue, 30 Mar 2010 15:14:09 +0000 (16:14 +0100)]
virt-df: Match output with native (coreutils) 'df' command (RHBZ#578123).

This commit fixes the 'Use%' field in the output so it matches what
coreutils' 'df' command would print.

Firstly we change the calculation to use the space available to root,
not the space available to non-root.  This means it matches what 'df'
when run as root in the guest would show.

Secondly we display this rounded up to the next whole percent (ie. using
ceil), which is also what 'df' does.

Thirdly we change the regression test so it tests this.

Note that even with these changes you are not guaranteed to get precisely
the same figures from inside and outside the guest, as it depends on
how quiescent the guest is and how recently the superblock was synced.

Thanks: Rita Wu

14 years agotools: Add basic tests for the virt-* tools.
Richard Jones [Tue, 30 Mar 2010 13:18:44 +0000 (14:18 +0100)]
tools: Add basic tests for the virt-* tools.

14 years agotools: Sectional header for manpages in Makefile.am
Richard Jones [Tue, 30 Mar 2010 12:45:16 +0000 (13:45 +0100)]
tools: Sectional header for manpages in Makefile.am

14 years agotools: Rearrange list of tools in Makefile.am.
Richard Jones [Tue, 30 Mar 2010 12:44:29 +0000 (13:44 +0100)]
tools: Rearrange list of tools in Makefile.am.

14 years agodaemon: Set TERM=dumb inside the daemon.
Richard Jones [Tue, 30 Mar 2010 12:34:16 +0000 (13:34 +0100)]
daemon: Set TERM=dumb inside the daemon.

Since commit 977edb3185fe8f we have been passing TERM from the
library into the appliance (for the benefit of virt-rescue).
However this changes the output of parted, which I would argue
is a bug in parted:

 TERM=xterm /sbin/parted -m -- /dev/sda unit b print 2>&1 | hexdump -C
 00000000  1b 5b 3f 31 30 33 34 68  42 59 54 3b 0a 2f 64 65  |.[?1034hBYT;./de|

Notice the escape-sequence junk before the official "BYT;"
header.

By setting TERM=dumb we avoid this.

14 years agoFix the error message when reply body is too large (RHBZ#509597).
Richard Jones [Sat, 27 Mar 2010 11:02:03 +0000 (11:02 +0000)]
Fix the error message when reply body is too large (RHBZ#509597).