[PATCH] docs: guestfs_case_sensitive_path returns error on non-existent path
by Matthew Booth
---
generator/actions.ml | 3 +++
1 file changed, 3 insertions(+)
diff --git a/generator/actions.ml b/generator/actions.ml
index c73a319..32758b1 100644
--- a/generator/actions.ml
+++ b/generator/actions.ml
@@ -7161,6 +7161,9 @@ created under Windows).
I<Note>:
This function does not handle drive names, backslashes etc.
+C<guestfs_case_sensitive_path> will return an error if given a path
+which does not exist.
+
See also C<guestfs_realpath>." };
{ defaults with
--
1.8.3.1
11 years
[PATCH] * initial FrugalWare support
by Daniel Exner
Hi,
this patch enables building of the guestfs appliance with most of the
correct packages.
The missing ones will follow as soon as they are available.
Greetings
Daniel
11 years
[PATCH] * supermin support for FrugalWare (pacman-g2)
by Daniel Exner
Hi,
(added myself as CC as I'm not subscribed to this MailingList curently)
I already sent a pull request via github, but was told that review via ML
is preferred.
Another patch for libguestfs will follow in a seperate Mail.
Greetings
Daniel
11 years
Re: [Libguestfs] virt-builder looks AWESOME!
by Richard W.M. Jones
On Fri, Oct 25, 2013 at 01:14:04PM -0700, Scott Baker wrote:
> On 10/25/2013 12:56 PM, Richard W.M. Jones wrote:
> > F20 - it's in the beta now (as of yesterday).
> >
> > Rich.
>
> Wow this has a lot of dependencies :) Two questions...
Let's put this on the mailing list so others can help.
> Do I need OCaml installed?
> Where does guestfs_protocol.x come from?
>
> I checked out the master branch from github and tried compiling that.
>
> Warning: Install OCaml compiler in order to rebuild the generated files.
> touch stamp-generator
> make[2]: Leaving directory `/tmp/libguestfs/generator'
> Making all in src
> make[2]: Entering directory `/tmp/libguestfs/src'
> rm -f guestfs_protocol.c-t guestfs_protocol.c-t2
> rm -f guestfs_protocol.h-t
> rm -f errnostring-gperf.c
> rpcgen -DHAVE_XDR_UINT64_T=1 -c -o guestfs_protocol.c-t guestfs_protocol.x
> gperf -t errnostring-gperf.gperf > errnostring-gperf.c-t
> rpcgen -DHAVE_XDR_UINT64_T=1 -h -o guestfs_protocol.h-t guestfs_protocol.x
> guestfs_protocol.x: No such file or directory
> make[2]: *** [guestfs_protocol.c] Error 1
> make[2]: *** Waiting for unfinished jobs....
> guestfs_protocol.x: No such file or directory
> make[2]: *** [guestfs_protocol.h] Error 1
> Cannot open input file 'errnostring-gperf.gperf'
> make[2]: *** [errnostring-gperf.c] Error 1
> make[2]: Leaving directory `/tmp/libguestfs/src'
> make[1]: *** [all-recursive] Error 1
> make[1]: Leaving directory `/tmp/libguestfs'
> make: *** [all] Error 2
Did you start from the git repo or from an RPM?
I would start from the git repo. First install all the dependencies
by downloading the following file:
http://pkgs.fedoraproject.org/cgit/libguestfs.git/plain/libguestfs.spec
and doing (as root):
yum-builddep libguestfs.spec
You will have to comment out a handful of BuildRequires lines from the
spec file (because packages are not available in RHEL) until you get
everything possible installed.
Secondly, go to:
http://oirase.annexia.org/tmp/libguestfs-RHEL-6.5/
and install augeas* and febootstrap* packages for your architecture.
Then clone the libguestfs upstream git from github, and follow the
`Building' section in the README file (all non-root).
You might need to do:
make -C po-docs update-po
at some point half way through the build. It should be obvious where.
Rich.
--
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming blog: http://rwmj.wordpress.com
Fedora now supports 80 OCaml packages (the OPEN alternative to F#)
11 years
Notes on compiling libguestfs 1.24 on RHEL 6.4
by Richard W.M. Jones
(Actually, libguestfs from git, but 1.24 and git are pretty close now)
First install augeas 1.0.0 from here:
http://oirase.annexia.org/tmp/libguestfs-RHEL-6.5/
Check out libguestfs from git.
You'll need to create two files in the libguestfs source directory:
"localconfigure" containing:
----------------------------------------------------------------------
source localenv
# qemu is too old (< 1.0) so the qemu test will fail.
export vmchannel_test=no
./autogen.sh \
--prefix /usr \
--disable-ruby \
-C \
"$@"
----------------------------------------------------------------------
"localenv" containing:
----------------------------------------------------------------------
export SUPERMIN=/usr/bin/febootstrap3
export SKIP_TEST_LAUNCH_RACE_PL=1
----------------------------------------------------------------------
Then run:
chmod +x localconfigure
./localconfigure && make clean
make -j4 && make quickcheck
Note to run virt-builder you will have to create a $HOME/.cache
directory (RHBZ#1022431) since this directory is missing on RHEL 6.
Rich.
--
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
virt-top is 'top' for virtual machines. Tiny program with many
powerful monitoring features, net stats, disk stats, logging, etc.
http://people.redhat.com/~rjones/virt-top
11 years, 1 month
[PATCH 1/2] Preallocate output file
by Gabriel de Perthuis
---
pxzcat.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/pxzcat.c b/pxzcat.c
index 4ab8689..9bcdc36 100644
--- a/pxzcat.c
+++ b/pxzcat.c
@@ -29,10 +29,11 @@
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
+#define _GNU_SOURCE
#include <config.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -166,12 +167,12 @@ xzfile_uncompress (const char *filename, const
char *outputfile,
debug ("uncompressed size = %" PRIu64 " bytes", size);
ofd = open (outputfile, O_WRONLY|O_CREAT|O_TRUNC|O_NOCTTY, 0644);
if (ofd == -1)
error (EXIT_FAILURE, errno, "open: %s", outputfile);
- if (ftruncate (ofd, size) == -1)
- error (EXIT_FAILURE, errno, "ftruncate: %s", outputfile);
+ if (fallocate (ofd, 0, 0, size) == -1)
+ error (EXIT_FAILURE, errno, "fallocate: %s", outputfile);
/* Tell the kernel we won't read the output file. */
posix_fadvise (fd, 0, 0, POSIX_FADV_RANDOM|POSIX_FADV_DONTNEED);
/* Iterate over blocks. */
--
1.8.4.1.563.g8e6fc32
11 years, 1 month
[PATCH 2/2] Discard unwritten ranges
by Gabriel de Perthuis
---
pxzcat.c | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
diff --git a/pxzcat.c b/pxzcat.c
index 9bcdc36..55ccfc0 100644
--- a/pxzcat.c
+++ b/pxzcat.c
@@ -44,10 +44,11 @@
#include <sys/types.h>
#include <error.h>
#include <errno.h>
#include <getopt.h>
#include <pthread.h>
+#include <linux/falloc.h>
#include <lzma.h>
#define DEBUG 0
@@ -145,10 +146,11 @@ usage (int exitcode)
static void
xzfile_uncompress (const char *filename, const char *outputfile,
unsigned nr_threads)
{
int fd, ofd;
+ off_t hole_start, data_start;
uint64_t size;
lzma_index *idx;
/* Open the file. */
fd = open (filename, O_RDONLY);
@@ -176,10 +178,29 @@ xzfile_uncompress (const char *filename, const
char *outputfile,
posix_fadvise (fd, 0, 0, POSIX_FADV_RANDOM|POSIX_FADV_DONTNEED);
/* Iterate over blocks. */
iter_blocks (idx, nr_threads, filename, fd, outputfile, ofd);
+ /* discard ranges that were allocated but not written */
+ data_start = 0;
+ while (data_start < size) {
+ hole_start = lseek (ofd, data_start, SEEK_HOLE);
+ if (hole_start == (off_t) -1)
+ error (EXIT_FAILURE, errno, "lseek: %s", outputfile);
+ if (hole_start == size)
+ break;
+ data_start = lseek (ofd, hole_start, SEEK_DATA);
+ if (data_start == (off_t) -1) {
+ if (errno == ENXIO)
+ data_start = size;
+ else
+ error (EXIT_FAILURE, errno, "lseek: %s", outputfile);
+ }
+ if (fallocate (ofd, FALLOC_FL_PUNCH_HOLE|FALLOC_FL_KEEP_SIZE,
hole_start, data_start - hole_start) == -1)
+ error (EXIT_FAILURE, errno, "fallocate: %s", outputfile);
+ }
+
close (fd);
}
static int
check_header_magic (int fd)
--
1.8.4.1.563.g8e6fc32
11 years, 1 month
[PATCH 0/2] pxzcat preallocation
by Gabriel de Perthuis
Hello,
Here is a quick patch so that pxzcat creates sparse files without
fragmentation. It preallocates the file, then discards extents that
weren't written. This relies on Linux syscalls.
Preallocate output file
Discard unwritten ranges
pxzcat.c | 26 ++++++++++++++++++++++++--
1 file changed, 24 insertions(+), 2 deletions(-)
--
1.8.4.1.563.g8e6fc32
11 years, 1 month
Broken libguestfs package in Ubuntu 13.10
by Nikos Skalkotos
Hello all,
In ubuntu 13.10 libguestfs version 1:1.22.4-1 seems broken.
I don't seem to be able to create a working appliance.
After installing libguestfs-tools and executing "sudo
libguestfs-test-tool" I get:
Failed to connect to virtio-serial channel.
This is a fatal error and the appliance will now exit.
Usually this error is caused by either QEMU or the appliance
kernel not supporting the vmchannel method that the
libguestfs library chose to use. Please run
'libguestfs-test-tool' and provide the complete, unedited
output to the libguestfs developers, either in a bug report
or on the libguestfs redhat com mailing list.
The complete output of the command can be found in the attached file. I
did report this to Ubuntu
(https://bugs.launchpad.net/ubuntu/+source/libguestfs/+bug/1243190) but
I thought you might
want to take a look at this too.
Kind regards,
Nikos Skalkotos
11 years, 1 month
febootstrap-supermin-helper error
by Wanlong Gao
Hi Rich,
I got an error:
> supermin helper [00000ms] visiting /usr/local/lib/guestfs/supermin.d
> supermin helper [00000ms] visiting /usr/local/lib/guestfs/supermin.d/base.img
> supermin helper [00000ms] visiting /usr/local/lib/guestfs/supermin.d/daemon.img
> supermin helper [00000ms] visiting /usr/local/lib/guestfs/supermin.d/hostfiles
> supermin helper [00012ms] visiting /usr/local/lib/guestfs/supermin.d/init.img
> supermin helper [00012ms] visiting /usr/local/lib/guestfs/supermin.d/udev-rules.img
> supermin helper [00012ms] adding kernel modules
> supermin helper [00031ms] finished creating appliance
> libguestfs: checksum of existing appliance: 4c7b7ebc9242976d42a30d676624e001722d4256590ee5be78cabb3bf0ebe726
> libguestfs: [00033ms] begin building supermin appliance
> libguestfs: [00033ms] run supermin-helper
> libguestfs: command: run: /usr/bin/febootstrap-supermin-helper
> libguestfs: command: run: \ --verbose
> libguestfs: command: run: \ --copy-kernel
> libguestfs: command: run: \ -f ext2
> libguestfs: command: run: \ /usr/local/lib/guestfs/supermin.d
> libguestfs: command: run: \ x86_64
> libguestfs: command: run: \ /var/tmp/guestfs.2akZDG/kernel
> libguestfs: command: run: \ /var/tmp/guestfs.2akZDG/initrd
> libguestfs: command: run: \ /var/tmp/guestfs.2akZDG/root
> supermin helper [00000ms] whitelist = (not specified), host_cpu = x86_64, kernel = /var/tmp/guestfs.2akZDG/kernel, initrd = /var/tmp/guestfs.2akZDG/initrd, appliance = /var/tmp/guestfs.2akZDG/root
> supermin helper [00000ms] inputs[0] = /usr/local/lib/guestfs/supermin.d
> checking modpath /lib/modules/3.11.2-201.fc19.x86_64 is a directory
> picked vmlinuz-3.11.2-201.fc19.x86_64 because modpath /lib/modules/3.11.2-201.fc19.x86_64 exists
> checking modpath /lib/modules/3.11.4-201.fc19.x86_64 is a directory
> picked vmlinuz-3.11.4-201.fc19.x86_64 because modpath /lib/modules/3.11.4-201.fc19.x86_64 exists
> checking modpath /lib/modules/3.11.3-201.fc19.x86_64 is a directory
> picked vmlinuz-3.11.3-201.fc19.x86_64 because modpath /lib/modules/3.11.3-201.fc19.x86_64 exists
> supermin helper [00004ms] finished creating kernel
> supermin helper [00342ms] finished mke2fs
> supermin helper [00343ms] visiting /usr/local/lib/guestfs/supermin.d
> supermin helper [00343ms] visiting /usr/local/lib/guestfs/supermin.d/base.img
> supermin helper [00357ms] visiting /usr/local/lib/guestfs/supermin.d/daemon.img
> supermin helper [00361ms] visiting /usr/local/lib/guestfs/supermin.d/hostfiles
> supermin helper [00724ms] visiting /usr/local/lib/guestfs/supermin.d/init.img
> supermin helper [00725ms] visiting /usr/local/lib/guestfs/supermin.d/udev-rules.img
> supermin helper [00725ms] adding kernel modules
> /usr/bin/febootstrap-supermin-helper: ext2: parent directory not found: /lib/modules: File not found by ext2_lookup
> libguestfs: error: /usr/bin/febootstrap-supermin-helper exited with error status 1, see debug messages above
> libguestfs: command: run: rm
> libguestfs: command: run: \ -rf /var/tmp/guestfs.2akZDG
> libguestfs-test-tool: failed to launch appliance
> libguestfs: closing guestfs handle 0x153d340 (state 0)
> libguestfs: command: run: rm
> libguestfs: command: run: \ -rf /tmp/libguestfsDlCtiv
My feboot* is febootstrap-supermin-helper-3.21-2.fc18.x86_64, a bug or am I missing something?
Thanks,
Wanlong Gao
11 years, 1 month