virt-df: ext2/3/4 statvfs(2) output changed between two recent Linux kernels (3.2.0)
by Richard W.M. Jones
[Jim, as coreutils developer, this might interest you]
In libguestfs we run some quite detailed checks of the output of the
statvfs system call for our tool "virt-df". I noticed that the output
of virt-df changed slightly.
Narrowing it down, the difference only happens between:
Fedora kernel 3.2.0-0.rc0.git4.1.fc17 (3rd Nov)
Fedora kernel 3.2.0-0.rc1.git2.1.fc17 (11th Nov)
With 3.2.0-0.rc0.git4.1.fc17, and all earlier versions, the output of
statvfs(2) on a freshly created 20M ext2 filesystem is:
bsize: 1024
frsize: 1024
blocks: 19827 <-- NB
bfree: 19655
bavail: 18631
files: 5136
ffree: 5125
favail: 5125
fsid: 1411286354856931562
flag: 4096
namemax: 255
With 3.2.0-0.rc1.git2.1.fc17, it changed to:
bsize: 1024
frsize: 1024
blocks: 19939 <-- NB
bfree: 19655
bavail: 18631
files: 5136
ffree: 5125
favail: 5125
fsid: -9088586685126948527
flag: 4096
namemax: 255
I am able to demonstrate the difference by keeping every other package
identical, and just booting the two different kernels. As far as I
know, everything else including e2fsprogs is completely identical.
Reproducer:
export FEBOOTSTRAP_KERNEL=/boot/vmlinuz-<version>
guestfish sparse /tmp/test.img 20M : run : \
mkfs ext2 /dev/sda : mount /dev/sda / : statvfs /
I tracked this down to the way the filesystem overhead is calculated.
It changed slightly in the commit below. The description seems to be
wrong; it seems to affect any filesystem going through the ext4 driver
(this driver is used for ext2 & ext3 in recent Fedora), and doesn't
appear to have anything to do with 'bigalloc'.
commit f975d6bcc7a698a10cc755115e27d3612dcfe322
Author: Theodore Ts'o <tytso(a)mit.edu>
Date: Fri Sep 9 19:00:51 2011 -0400
ext4: teach ext4_statfs() to deal with clusters if bigalloc is enabled
Rich.
--
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
New in Fedora 11: Fedora Windows cross-compiler. Compile Windows
programs, test, and build Windows installers. Over 70 libraries supprt'd
http://fedoraproject.org/wiki/MinGW http://www.annexia.org/fedora_mingw
13 years
[PATCH] kvm-tool: don't add the -Wunused-result flag
by Wanlong Gao
The -Wunused-result is the default option of gcc, so no need to
add it to the FLAGS.
And the previous version of gcc can't support this flag, it may
cause a compile error.
Signed-off-by: Wanlong Gao <gaowanlong(a)cn.fujitsu.com>
---
tools/kvm/Makefile | 1 -
1 files changed, 0 insertions(+), 1 deletions(-)
diff --git a/tools/kvm/Makefile b/tools/kvm/Makefile
index f4741f2..bb5f6b0 100644
--- a/tools/kvm/Makefile
+++ b/tools/kvm/Makefile
@@ -176,7 +176,6 @@ WARNINGS += -Wstrict-prototypes
WARNINGS += -Wundef
WARNINGS += -Wvolatile-register-var
WARNINGS += -Wwrite-strings
-WARNINGS += -Wunused-result
CFLAGS += $(WARNINGS)
--
1.7.8.rc1
13 years
[PATCH v2] Add tune2fs command.
by Richard W.M. Jones
The changes since the previous patch:
- safe ADD_ARG macro for adding arguments to a fixed size stack array
- support for testing functions that return RHashtable, ie. tune2fs-l.
- add tests that set (tune2fs) and get (tune2fs-l) various parameters.
- only one 'intervalbetweenchecks' parameter (in seconds)
Rich.
13 years
[PATCH 1/2] New API: list_md_devices
by Matthew Booth
Return a list of Linux MD devices detected in the guest.
This API complements list_devices, list_partitions, list_lvs and
list_dm_devices.
---
daemon/Makefile.am | 1 +
daemon/daemon.h | 1 +
daemon/guestfsd.c | 23 +++++++---
daemon/md.c | 75 +++++++++++++++++++++++++++++++++++
generator/generator_actions.ml | 10 +++++
po/POTFILES.in | 1 +
regressions/Makefile.am | 1 +
regressions/test-list-md-devices.sh | 59 +++++++++++++++++++++++++++
src/MAX_PROC_NR | 2 +-
9 files changed, 165 insertions(+), 8 deletions(-)
create mode 100644 daemon/md.c
create mode 100755 regressions/test-list-md-devices.sh
13 years
[PATCH] Add tune2fs support to libguestfs.
by Richard W.M. Jones
At the moment OpenStack uses kpartx and nbd to resize filesystems and
inject files to guests. I sincerely hope they don't allow untrusted
users to upload guest images / AMIs :-(
To fix this I'm looking into adding libguestfs support as an optional
backend in OpenStack.
The only missing feature in libguestfs is the ability to call tune2fs
on a filesystem. This patch series adds tune2fs support. This also
reveals a few bugs in the generator when you start to have calls with
lots of required and optional parameters.
Rich.
13 years
[PATCH] New API: list-mddevices
by Matthew Booth
Return a list of Linux MD devices detected in the guest.
---
appliance/packagelist.in | 2 +
daemon/Makefile.am | 4 +-
daemon/daemon.h | 1 +
daemon/guestfsd.c | 23 ++++++---
daemon/md.c | 95 ++++++++++++++++++++++++++++++++++++
generator/generator_actions.ml | 16 ++++++
regressions/test-list-mddevices.sh | 43 ++++++++++++++++
src/MAX_PROC_NR | 2 +-
8 files changed, 177 insertions(+), 9 deletions(-)
create mode 100644 daemon/md.c
create mode 100755 regressions/test-list-mddevices.sh
13 years
[PATCH] NFC: Update FSF address everywhere it's used
by Matthew Booth
The FSF is now at 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
---
Makefile.am | 2 +-
align/Makefile.am | 2 +-
align/scan.c | 2 +-
align/virt-alignment-scan.pod | 2 +-
appliance/Makefile.am | 2 +-
appliance/make.sh.in | 2 +-
autogen.sh | 2 +-
bugs-in-changelog.sh | 2 +-
capitests/Makefile.am | 2 +-
cat/Makefile.am | 2 +-
cat/virt-cat.c | 2 +-
cat/virt-cat.pod | 2 +-
cat/virt-filesystems.c | 2 +-
cat/virt-filesystems.pod | 2 +-
cat/virt-ls.c | 2 +-
cat/virt-ls.pod | 2 +-
caution/Makefile.am | 2 +-
caution/qemu-snapshot-isolation.sh | 2 +-
clone/Makefile.am | 2 +-
clone/test-virt-sysprep.sh | 2 +-
clone/virt-sysprep.in | 2 +-
clone/virt-sysprep.pod | 2 +-
configure.ac | 2 +-
contrib/autobuild/autobuild.sh | 2 +-
contrib/guestfsd-in-wine.sh | 2 +-
contrib/visualize-alignment/tracetops.ml | 2 +-
csharp/Makefile.am | 2 +-
daemon/9p.c | 2 +-
daemon/Makefile.am | 2 +-
daemon/augeas.c | 2 +-
daemon/available.c | 2 +-
daemon/base64.c | 2 +-
daemon/blkid.c | 2 +-
daemon/blockdev.c | 2 +-
daemon/btrfs.c | 2 +-
daemon/checksum.c | 2 +-
daemon/cmp.c | 2 +-
daemon/command.c | 2 +-
daemon/compress.c | 2 +-
daemon/copy.c | 2 +-
daemon/cpmv.c | 2 +-
daemon/dd.c | 2 +-
daemon/debug.c | 2 +-
daemon/devsparts.c | 2 +-
daemon/df.c | 2 +-
daemon/dir.c | 2 +-
daemon/dmesg.c | 2 +-
daemon/dropcaches.c | 2 +-
daemon/du.c | 2 +-
daemon/echo_daemon.c | 2 +-
daemon/ext2.c | 2 +-
daemon/fallocate.c | 2 +-
daemon/file.c | 2 +-
daemon/fill.c | 2 +-
daemon/find.c | 2 +-
daemon/findfs.c | 2 +-
daemon/fsck.c | 2 +-
daemon/glob.c | 2 +-
daemon/grep.c | 2 +-
daemon/grub.c | 2 +-
daemon/guestfsd.c | 2 +-
daemon/headtail.c | 2 +-
daemon/hexdump.c | 2 +-
daemon/initrd.c | 2 +-
daemon/inotify.c | 2 +-
daemon/is.c | 2 +-
daemon/link.c | 2 +-
daemon/ls.c | 2 +-
daemon/luks.c | 2 +-
daemon/lvm-filter.c | 2 +-
daemon/lvm.c | 2 +-
daemon/mkfs.c | 2 +-
daemon/mknod.c | 2 +-
daemon/modprobe.c | 2 +-
daemon/mount.c | 2 +-
daemon/ntfs.c | 2 +-
daemon/parted.c | 2 +-
daemon/pingdaemon.c | 2 +-
daemon/proto.c | 2 +-
daemon/readdir.c | 2 +-
daemon/realpath.c | 2 +-
daemon/scrub.c | 2 +-
daemon/selinux.c | 2 +-
daemon/sfdisk.c | 2 +-
daemon/sleep.c | 2 +-
daemon/stat.c | 2 +-
daemon/statvfs.c | 2 +-
daemon/strings.c | 2 +-
daemon/swap.c | 2 +-
daemon/sync.c | 2 +-
daemon/tar.c | 2 +-
daemon/truncate.c | 2 +-
daemon/umask.c | 2 +-
daemon/upload.c | 2 +-
daemon/utimens.c | 2 +-
daemon/wc.c | 2 +-
daemon/xattr.c | 2 +-
daemon/zero.c | 2 +-
daemon/zerofree.c | 2 +-
df/Makefile.am | 2 +-
df/df.c | 2 +-
df/domains.c | 2 +-
df/main.c | 2 +-
df/output.c | 2 +-
df/virt-df.h | 2 +-
df/virt-df.pod | 2 +-
edit/Makefile.am | 2 +-
edit/virt-edit.c | 2 +-
edit/virt-edit.pod | 2 +-
erlang/Makefile.am | 2 +-
erlang/examples/Makefile.am | 2 +-
examples/Makefile.am | 2 +-
fish/Makefile.am | 2 +-
fish/alloc.c | 2 +-
fish/copy.c | 2 +-
fish/destpaths.c | 2 +-
fish/display.c | 2 +-
fish/echo.c | 2 +-
fish/edit.c | 2 +-
fish/fish.c | 2 +-
fish/glob.c | 2 +-
fish/guestfish-bash-completion.sh | 2 +-
fish/guestfish.pod | 2 +-
fish/help.c | 2 +-
fish/hexedit.c | 2 +-
fish/inspect.c | 2 +-
fish/keys.c | 2 +-
fish/lcd.c | 2 +-
fish/man.c | 2 +-
fish/more.c | 2 +-
fish/prep.c | 2 +-
fish/prep_boot.c | 2 +-
fish/prep_disk.c | 2 +-
fish/prep_fs.c | 2 +-
fish/prep_lv.c | 2 +-
fish/prep_part.c | 2 +-
fish/progress.c | 2 +-
fish/progress.h | 2 +-
fish/rc.c | 2 +-
fish/reopen.c | 2 +-
fish/setenv.c | 2 +-
fish/supported.c | 2 +-
fish/tilde.c | 2 +-
fish/time.c | 2 +-
fish/virt-copy-in | 2 +-
fish/virt-copy-in.pod | 2 +-
fish/virt-copy-out | 2 +-
fish/virt-copy-out.pod | 2 +-
fish/virt-tar-in | 2 +-
fish/virt-tar-in.pod | 2 +-
fish/virt-tar-out | 2 +-
fish/virt-tar-out.pod | 2 +-
fish/virt.c | 2 +-
fuse/Makefile.am | 2 +-
fuse/dircache.c | 2 +-
fuse/dircache.h | 2 +-
fuse/guestmount.c | 2 +-
fuse/guestmount.h | 2 +-
fuse/guestmount.pod | 2 +-
fuse/test-fuse.sh | 2 +-
generator/Makefile.am | 2 +-
haskell/Guestfs005Load.hs | 2 +-
haskell/Guestfs010Basic.hs | 2 +-
haskell/Makefile.am | 2 +-
haskell/run-bindtests | 2 +-
images/Makefile.am | 2 +-
images/guest-aux/make-debian-img.sh | 2 +-
images/guest-aux/make-fedora-img.sh | 2 +-
images/guest-aux/make-ubuntu-img.sh | 2 +-
images/guest-aux/make-windows-img.sh | 2 +-
inspector/Makefile.am | 2 +-
inspector/virt-inspector.c | 2 +-
inspector/virt-inspector.pod | 2 +-
java/Makefile.am | 2 +-
java/examples/Makefile.am | 2 +-
java/run-bindtests | 2 +-
java/run-java-tests | 2 +-
libtool-kill-dependency_libs.sh | 2 +-
ocaml/Makefile.am | 2 +-
ocaml/examples/Makefile.am | 2 +-
ocaml/run-bindtests | 2 +-
ocaml/t/guestfs_005_load.ml | 2 +-
ocaml/t/guestfs_010_basic.ml | 2 +-
ocaml/t/guestfs_070_threads.ml | 2 +-
ocaml/t/guestfs_080_optargs.ml | 2 +-
ocaml/t/guestfs_400_events.ml | 2 +-
ocaml/t/guestfs_400_progress.ml | 2 +-
perl/Makefile.PL.in | 2 +-
perl/Makefile.am | 2 +-
perl/examples/Makefile.am | 2 +-
perl/run-bindtests | 2 +-
perl/run-perl-tests | 2 +-
perl/t/005-pod.t | 2 +-
perl/t/006-pod-coverage.t | 2 +-
perl/t/010-load.t | 2 +-
perl/t/020-create.t | 2 +-
perl/t/030-config.t | 2 +-
perl/t/050-lvcreate.t | 2 +-
perl/t/060-readdir.t | 2 +-
perl/t/070-optargs.t | 2 +-
perl/t/400-events.t | 2 +-
perl/t/500-lib-load.t | 2 +-
perl/t/800-explicit-close.t | 2 +-
perl/t/810-mkdir-eexist.t | 2 +-
perl/t/900-introspection.t | 2 +-
php/Makefile.am | 2 +-
php/extension/config.m4 | 2 +-
php/run-php-tests.sh | 2 +-
po-docs/Makefile.am | 2 +-
po-docs/ja/Makefile.am | 2 +-
po-docs/uk.po | 2 +-
po-docs/uk/Makefile.am | 2 +-
po/POTFILES.in | 1 +
podwrapper.sh.in | 2 +-
python/Makefile.am | 2 +-
python/examples/Makefile.am | 2 +-
python/run-bindtests | 2 +-
python/run-python-tests | 2 +-
python/t/005-import.py | 2 +-
python/t/010-basic.py | 2 +-
python/t/060-optargs.py | 2 +-
python/t/400-events.py | 2 +-
python/t/800-explicit-close.py | 2 +-
regressions/Makefile.am | 2 +-
regressions/rhbz501893.c | 2 +-
regressions/rhbz503169c13.sh | 2 +-
regressions/rhbz557655.sh | 2 +-
regressions/rhbz576879.sh | 2 +-
regressions/rhbz578407.sh | 2 +-
regressions/rhbz580246.sh | 2 +-
regressions/rhbz602997.sh | 2 +-
regressions/rhbz690819.sh | 2 +-
regressions/rhbz727178.sh | 2 +-
regressions/tell-user-to-ignore-errors.sh | 2 +-
regressions/test-add-domain.sh | 2 +-
regressions/test-bootbootboot.sh | 2 +-
regressions/test-both-ends-cancel.sh | 2 +-
.../test-cancellation-download-librarycancels.sh | 2 +-
.../test-cancellation-upload-daemoncancels.sh | 2 +-
regressions/test-copy.sh | 2 +-
regressions/test-find0.sh | 2 +-
regressions/test-guestfish-a.sh | 2 +-
regressions/test-guestfish-d.sh | 2 +-
regressions/test-guestfish-escapes.sh | 2 +-
regressions/test-guestfish-tilde.sh | 2 +-
regressions/test-inspect-fstab.sh | 2 +-
regressions/test-launch-race.pl | 2 +-
regressions/test-luks-list.sh | 2 +-
regressions/test-luks.sh | 2 +-
regressions/test-lvm-filtering.sh | 2 +-
regressions/test-lvm-mapping.pl | 2 +-
regressions/test-noexec-stack.pl | 2 +-
regressions/test-qemudie-killsub.sh | 2 +-
regressions/test-qemudie-launchfail.sh | 2 +-
regressions/test-qemudie-midcommand.sh | 2 +-
regressions/test-qemudie-synch.sh | 2 +-
regressions/test-read_file.sh | 2 +-
regressions/test-remote.sh | 2 +-
regressions/test-reopen.sh | 2 +-
regressions/test-stringlist.sh | 2 +-
regressions/test-upload-to-dir.sh | 2 +-
rescue/Makefile.am | 2 +-
rescue/virt-rescue.c | 2 +-
rescue/virt-rescue.pod | 2 +-
resize/Makefile.am | 2 +-
resize/progress_c.c | 2 +-
resize/test-virt-resize.sh | 2 +-
resize/virt-resize.pod | 2 +-
ruby/Makefile.am | 2 +-
ruby/Rakefile.in | 2 +-
ruby/examples/Makefile.am | 2 +-
ruby/ext/guestfs/extconf.rb | 2 +-
ruby/run-bindtests | 2 +-
ruby/run-ruby-tests | 2 +-
ruby/tests/tc_010_load.rb | 2 +-
ruby/tests/tc_050_lvcreate.rb | 2 +-
ruby/tests/tc_060_optargs.rb | 2 +-
ruby/tests/tc_400_events.rb | 2 +-
ruby/tests/tc_rhbz507346.rb | 2 +-
ruby/tests/tc_rhbz664558c6.rb | 2 +-
run.in | 2 +-
sparsify/Makefile.am | 2 +-
sparsify/progress_c.c | 2 +-
sparsify/test-virt-sparsify.sh | 2 +-
sparsify/virt-sparsify.pod | 2 +-
src/Makefile.am | 2 +-
src/api-support/update-from-tarballs.sh | 2 +-
subdir-rules.mk | 2 +-
test-tool/Makefile.am | 2 +-
test-tool/libguestfs-test-tool.pod | 2 +-
test-tool/test-tool.c | 2 +-
tools/Makefile.am | 2 +-
tools/test-virt-make-fs.sh | 2 +-
tools/virt-list-filesystems | 4 ++--
tools/virt-list-partitions | 4 ++--
tools/virt-make-fs | 4 ++--
tools/virt-tar | 4 ++--
tools/virt-win-reg | 4 ++--
tx-pull.sh | 2 +-
update-bugs.sh | 2 +-
300 files changed, 305 insertions(+), 304 deletions(-)
13 years
Re: [Libguestfs] guestmount error
by Richard W.M. Jones
On Fri, Nov 04, 2011 at 08:57:27PM +0200, Evaggelos Balaskas wrote:
> sorry for bothering you, but if you gimme some pointers
> it would be great
>
> # file /vm/images/archlinux/archlinux.qcow2
> /vm/images/archlinux/archlinux.qcow2: QEMU QCOW Image (v2), 5368709120 bytes
>
> # ls -la /mnt/
> total 8
> drwxr-xr-x 2 root root 4096 Oct 26 15:31 .
> drwxr-xr-x 24 root root 4096 Oct 14 13:27 ..
>
>
> # guestmount -a /vm/images/archlinux/archlinux.qcow2 -i /mnt/
>
> warning: Unable to get device geometry for /var/tmp/guestfs.jmCrFb/root
> libguestfs: error: aug_init: do_aug_init: function not available
What version of libguestfs and what host are you running it on?
You could try a couple of things:
(1) Use:
virt-filesystems -a /vm/images/archlinux/archlinux.qcow2 --all --long -h
to list out the filesystems in the image, then try mounting them
manually, as in this example, note the -m options which you will need
to adjust according to the output of virt-filesystems:
guestmount -a /vm/images/archlinux/archlinux.qcow2 \
-m /dev/vg/lv:/ -m /dev/sda1:/boot \
/mnt
(The error message indicates you are lacking Augeas, which we use to
examine the disk image for the right mountpoints, so you'd have to do
that by hand.)
(2) Set the following envionment variables and run the original
guestmount command again:
export LIBGUESTFS_DEBUG=1
export LIBGUESTFS_TRACE=1
Rich.
--
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
libguestfs lets you edit virtual machines. Supports shell scripting,
bindings from many languages. http://libguestfs.org
13 years