Status of libguestfs in Fedora, RHEL
by Richard W.M. Jones
Just a note (mainly to get it clear for *me*!) where we are with
libguestfs branches and Fedora/RHEL versions:
Fedora
│
├── Fedora 16 libguestfs 1.16 (currently 1.16.29)
│
├── Fedora 17 libguestfs 1.18 (currently 1.18.6)
│
├── Fedora 18 (just libguestfs 1.19.28, will move to
│ branched) stable 1.20 branch when it is ready
│
└── Rawhide follows development releases as usual
Unfortunately a combination of factors make testing releases in Fedora
18+ impossible right now:
- NTFS breakage with the new kernel (http://bugzilla.redhat.com/844485)
- DWARF symbols are broken, making it challenging to run any valgrind
tests
The unfortunate result is that Fedora 18+ releases aren't tested to
our usual high standards.
RHEL
│
├── RHEL 5 ancient libguestfs 1.2
│ │ (DO NOT USE this version except with virt-v2v,
│ │ and even then it's far better to use RHEL 6)
│ │
│ └── EPEL 5 libguestfs 1.19 from oldlinux branch, will
│ move to 1.20 when it is ready
│
│
├── RHEL 6
│ │
│ ├── RHEL 6.0 libguestfs 1.2 (no longer supported, DO NOT USE)
│ │
│ ├── RHEL 6.1 libguestfs 1.7.17 (no longer supported)
│ │
│ ├── RHEL 6.2 libguestfs 1.7.17 (no longer supported)
│ │
│ ├── RHEL 6.3 libguestfs 1.16.19 + RHEL patches
│ │
│ ├── RHEL 6.4 rebase along libguestfs 1.16 stable branch
│ │
│ └── RHEL 6.5 unknown, possibly rebase to 1.20 if
│ there is time and any demand for it
│
│
└── RHEL 7 intending to go with libguestfs 1.20
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
12 years, 3 months
virt-ls windows
by Evaggelos Balaskas
On a windows 2003 VM, i have two LVM partitions attached
I was wonder how can i use virt-ls on d: disk
eg.
# virt-ls -d win2003 /
works fine for c:
but i cant figured it out how i use this for d:
--
Evaggelos Balaskas - Unix System Engineer
http://gr.linkedin.com/in/evaggelosbalaskas
12 years, 3 months
Re: [Libguestfs] Can I use libguestfs with Java under windows os?
by Richard W.M. Jones
On Fri, Aug 03, 2012 at 04:10:05PM +0800, 吕袭蒙 wrote:
> Hi rjones,
>
> I’m now developing something about virtualization using
> java. when I use the example code at site
> http://libguestfs.org/guestfs-java.3.html, It occurs an exception
> Exception in thread "main" java.lang.UnsatisfiedLinkError: no
> guestfs_jni in java.library.path. I wonder if the libguestfs can
> work properly under windows using java.
The library hasn't been ported to Windows at this time.
Thing may improve once we add libvirt remote support in the near
future -- you would be able to access a remote hypervisor managed by
libvirt, using libguestfs + libvirt as client libraries on Windows.
But even this will still require that the library part of libguestfs
is ported to use Windows, so that will still be a fair bit of work.
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://et.redhat.com/~rjones/virt-top
12 years, 3 months
Re: [Libguestfs] libguestfs question - multiple partitions in the guest
by Richard W.M. Jones
On Wed, Aug 01, 2012 at 11:47:14AM -0500, Shawn Kennedy wrote:
> Problem:
> When trying to inspect the guest using a command like 'virt-ls', we
> get back:
>
> ~]# virt-ls -d guest /path
> virt-ls: multi-boot operating systems are not supported by the -i option
What does virt-inspector2 [this is RHEL 6] display for this guest?
virt-inspector2 -d guest
virt-ls fundamentally doesn't work with multi-boot guests. However
that doesn't mean to say you can't use libguestfs, you just need to
use some lower level tools or write a Perl/Python/whatever script
against the API. Have a look at the second example in the
guestfs-perl(3) / guestfs-python(3) man pages to give you some ideas
how to go about this.
By the way it's probably better to use the RHEL 6.3 package,
libguestfs 1.16.19, since it has more bugs fixed.
> Question:
> We know it's because we have 2 filesystems in the guest and
> we have no problem using the '-m' option on the lower-level tools,
> but how do we know which filesystem is mounted?? A simple
> 'mount' command could tell us that, but how to run it if I
> don't know which -m mount point to use??
If I understand your question correctly, then the 'mountpoints'
command lists what is mounted, eg:
$ guestfish -c qemu:///system -d F16x64 -i --ro
Welcome to guestfish, the libguestfs filesystem interactive shell for
editing virtual machine filesystems.
Type: 'help' for help on commands
'man' to read the manual
'quit' to quit the shell
Operating system: Fedora release 16 (Verne)
/dev/mapper/vg_f16x64-lv_root mounted on /
/dev/vda2 mounted on /boot
><fs> mountpoints
/dev/vg_f16x64/lv_root: /
/dev/vda2: /boot
(or 'mounts' which does the same but only lists the devices).
Please send replies to the mailing list. I hopefully deleted any
specifics of your environment in this reply.
Rich.
--
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
virt-p2v converts physical machines to virtual machines. Boot with a
live CD or over the network (PXE) and turn machines into Xen guests.
http://et.redhat.com/~rjones/virt-p2v
12 years, 3 months
[PATCH] xfs: add new api xfs-growfs
by Wanlong Gao
New api xfs_growfs for expanding a XFS filesystem.
Signed-off-by: Wanlong Gao <gaowanlong(a)cn.fujitsu.com>
---
daemon/xfs.c | 119 +++++++++++++++++++++++++++++++++++++++++
generator/generator_actions.ml | 15 ++++++
gobject/Makefile.inc | 6 ++-
po/POTFILES | 1 +
src/MAX_PROC_NR | 2 +-
5 files changed, 140 insertions(+), 3 deletions(-)
diff --git a/daemon/xfs.c b/daemon/xfs.c
index e0f0062..97da3f1 100644
--- a/daemon/xfs.c
+++ b/daemon/xfs.c
@@ -348,3 +348,122 @@ error:
free_strings (lines);
return ret;
}
+
+guestfs_int_xfsinfo *
+do_xfs_growfs (const char *path,
+ int datasec, int logsec, int rtsec,
+ int64_t datasize, int64_t logsize, int64_t rtsize,
+ int64_t rtextsize, int32_t maxpct)
+{
+
+#define MAX_ARGS 64
+
+ int r;
+ char *buf;
+ char *out = NULL, *err = NULL;
+ char **lines = NULL;
+ guestfs_int_xfsinfo *ret = NULL;
+ const char *argv[MAX_ARGS];
+ char datasize_s[64];
+ char logsize_s[64];
+ char rtsize_s[64];
+ char rtextsize_s[64];
+ char maxpct_s[32];
+ size_t i = 0;
+
+ buf = sysroot_path (path);
+ if (buf == NULL) {
+ reply_with_perror ("malloc");
+ return NULL;
+ }
+
+ ADD_ARG (argv, i, "xfs_growfs");
+
+ /* Optional arguments */
+ if (!(optargs_bitmask & GUESTFS_XFS_GROWFS_DATASEC_BITMASK))
+ datasec = 0;
+ if (!(optargs_bitmask & GUESTFS_XFS_GROWFS_LOGSEC_BITMASK))
+ logsec = 0;
+ if (!(optargs_bitmask & GUESTFS_XFS_GROWFS_RTSEC_BITMASK))
+ rtsec = 0;
+
+ if (datasec)
+ ADD_ARG (argv, i, "-d");
+ if (logsec)
+ ADD_ARG (argv, i, "-l");
+ if (rtsec)
+ ADD_ARG (argv, i, "-r");
+
+ if (optargs_bitmask & GUESTFS_XFS_GROWFS_DATASIZE_BITMASK) {
+ if (datasize < 0) {
+ reply_with_error ("datasize must be >= 0");
+ goto error;
+ }
+ snprintf (datasize_s, sizeof datasize_s, "%" PRIi64, datasize);
+ ADD_ARG (argv, i, "-D");
+ ADD_ARG (argv, i, datasize_s);
+ }
+
+ if (optargs_bitmask & GUESTFS_XFS_GROWFS_LOGSIZE_BITMASK) {
+ if (logsize < 0) {
+ reply_with_error ("logsize must be >= 0");
+ goto error;
+ }
+ snprintf(logsize_s, sizeof logsize_s, "%" PRIi64, logsize);
+ ADD_ARG (argv, i, "-L");
+ ADD_ARG (argv, i, logsize_s);
+ }
+
+ if (optargs_bitmask & GUESTFS_XFS_GROWFS_RTSIZE_BITMASK) {
+ if (rtsize < 0) {
+ reply_with_error ("rtsize must be >= 0");
+ goto error;
+ }
+ snprintf(rtsize_s, sizeof rtsize_s, "%" PRIi64, rtsize);
+ ADD_ARG (argv, i, "-R");
+ ADD_ARG (argv, i, rtsize_s);
+ }
+
+ if (optargs_bitmask & GUESTFS_XFS_GROWFS_RTEXTSIZE_BITMASK) {
+ if (rtextsize < 0) {
+ reply_with_error ("rtextsize must be >= 0");
+ goto error;
+ }
+ snprintf(rtextsize_s, sizeof rtextsize_s, "%" PRIi64, rtextsize);
+ ADD_ARG (argv, i, "-e");
+ ADD_ARG (argv, i, rtextsize_s);
+ }
+
+ if (optargs_bitmask & GUESTFS_XFS_GROWFS_MAXPCT_BITMASK) {
+ if (maxpct < 0) {
+ reply_with_error ("maxpct must be >= 0");
+ goto error;
+ }
+ snprintf(maxpct_s, sizeof maxpct_s, "%" PRIi32, maxpct);
+ ADD_ARG (argv, i, "-m");
+ ADD_ARG (argv, i, maxpct_s);
+ }
+
+ ADD_ARG (argv, i, buf);
+ ADD_ARG (argv, i, NULL);
+
+ r = commandv (&out, &err, argv);
+ free (buf);
+ if (r == -1) {
+ reply_with_error ("%s: %s", path, err);
+ goto error;
+ }
+
+ lines = split_lines (out);
+ if (lines == NULL)
+ goto error;
+
+ ret = parse_xfs_info (lines);
+
+error:
+ if (buf) free (buf);
+ if (err) free (err);
+ if (out) free (out);
+ if (lines) free_strings (lines);
+ return ret;
+}
diff --git a/generator/generator_actions.ml b/generator/generator_actions.ml
index e4956f7..4d650aa 100644
--- a/generator/generator_actions.ml
+++ b/generator/generator_actions.ml
@@ -9051,6 +9051,21 @@ This returns the kernel version of the appliance, where this is
available. This information is only useful for debugging. Nothing
in the returned structure is defined by the API." };
+ { defaults with
+ name = "xfs_growfs";
+ style = RStruct ("info", "xfsinfo"), [Pathname "path"], [OBool "datasec"; OBool "logsec"; OBool "rtsec"; OInt64 "datasize"; OInt64 "logsize"; OInt64 "rtsize"; OInt64 "rtextsize"; OInt "maxpct"];
+ proc_nr = Some 343;
+ optional = Some "xfs";
+ tests = [];
+ shortdesc = "expand a existing XFS filesystem";
+ longdesc = "\
+The C<path> argument is the pathname of the directory where
+the filesystem is mounted. The filesystem must be mounted to be grown.
+
+The returned struct contains geometry information. Missing
+fields are returned as C<-1> (for numeric fields) or empty
+string." };
+
]
(* Non-API meta-commands available only in guestfish.
diff --git a/gobject/Makefile.inc b/gobject/Makefile.inc
index 7a60933..3129275 100644
--- a/gobject/Makefile.inc
+++ b/gobject/Makefile.inc
@@ -65,7 +65,8 @@ guestfs_gobject_headers= \
include/guestfs-gobject/optargs-mkfs_btrfs.h \
include/guestfs-gobject/optargs-set_e2attrs.h \
include/guestfs-gobject/optargs-btrfs_fsck.h \
- include/guestfs-gobject/optargs-fstrim.h
+ include/guestfs-gobject/optargs-fstrim.h \
+ include/guestfs-gobject/optargs-xfs_growfs.h
guestfs_gobject_sources= \
src/session.c \
@@ -112,4 +113,5 @@ guestfs_gobject_sources= \
src/optargs-mkfs_btrfs.c \
src/optargs-set_e2attrs.c \
src/optargs-btrfs_fsck.c \
- src/optargs-fstrim.c
+ src/optargs-fstrim.c \
+ src/optargs-xfs_growfs.c
diff --git a/po/POTFILES b/po/POTFILES
index cdb873e..ada0da8 100644
--- a/po/POTFILES
+++ b/po/POTFILES
@@ -160,6 +160,7 @@ gobject/src/optargs-set_e2attrs.c
gobject/src/optargs-tune2fs.c
gobject/src/optargs-umount.c
gobject/src/optargs-umount_local.c
+gobject/src/optargs-xfs_growfs.c
gobject/src/session.c
gobject/src/struct-application.c
gobject/src/struct-btrfssubvolume.c
diff --git a/src/MAX_PROC_NR b/src/MAX_PROC_NR
index c9693eb..fe2cd8b 100644
--- a/src/MAX_PROC_NR
+++ b/src/MAX_PROC_NR
@@ -1 +1 @@
-342
+343
--
1.7.12.rc1
12 years, 3 months