[PATCH RFC] blkid: start using libblkid directly instead
Hi Rich: What do you think about this idea? although this still has some problems like do 'vfs-type /dev/vda'. Can you give some comments about this? Is this a bad idea? Thanks -Wanlong Gao ----------------------------------------------------------------------------- Use libblkid directly instead of the binary command in blkid. Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com> --- appliance/packagelist.in | 1 + configure.ac | 10 ++++++++ daemon/Makefile.am | 1 + daemon/blkid.c | 55 ++++++++++++++++++++++----------------------- 4 files changed, 39 insertions(+), 28 deletions(-) diff --git a/appliance/packagelist.in b/appliance/packagelist.in index 2ab6b80..575b8dd 100644 --- a/appliance/packagelist.in +++ b/appliance/packagelist.in @@ -45,6 +45,7 @@ vim-minimal xz zfs-fuse + libblkid #endif /* REDHAT */ #ifdef DEBIAN diff --git a/configure.ac b/configure.ac index cc11b2f..0beef28 100644 --- a/configure.ac +++ b/configure.ac @@ -393,6 +393,16 @@ if test "x$have_libselinux" = "xyes"; then AC_DEFINE([HAVE_LIBSELINUX],[1],[Define to 1 if you have libselinux]) fi AC_SUBST([SELINUX_LIB]) +AC_CHECK_HEADERS([blkid/blkid.h]) +AC_CHECK_LIB([blkid],[blkid_new_probe],[ + have_libblkid="$ac_cv_header_blkid_blkid_h" + LIBBLKID="-lblkid" + LIBS="$LIBS $LIBBLKID" + ],[have_libblkid=no]) +if test "x$have_libblkid" = "xyes"; then + AC_DEFINE([HAVE_LIBBLKID],[1],[Define to 1 if you have libblkid]) +fi +AC_SUBST([LIBBLKID]) dnl Check for systemtap/DTrace userspace probes (optional). dnl http://sourceware.org/systemtap/wiki/AddingUserSpaceProbingToApps diff --git a/daemon/Makefile.am b/daemon/Makefile.am index 3a698cc..5e4db57 100644 --- a/daemon/Makefile.am +++ b/daemon/Makefile.am @@ -167,6 +167,7 @@ guestfsd_LDADD = \ liberrnostring.a \ libprotocol.a \ $(SELINUX_LIB) \ + $(LIBBLKID) \ $(AUGEAS_LIBS) \ $(top_builddir)/gnulib/lib/.libs/libgnu.a \ $(GETADDRINFO_LIB) \ diff --git a/daemon/blkid.c b/daemon/blkid.c index 8728c29..0c4ca71 100644 --- a/daemon/blkid.c +++ b/daemon/blkid.c @@ -23,6 +23,8 @@ #include <string.h> #include <unistd.h> #include <limits.h> +#include <fcntl.h> +#include <blkid/blkid.h> #include "daemon.h" #include "actions.h" @@ -30,40 +32,37 @@ static char * get_blkid_tag (const char *device, const char *tag) { - char *out, *err; - int r; + int fd, rc; + const char *data = NULL; + blkid_probe blkprobe; - r = commandr (&out, &err, - "blkid", - /* Adding -c option kills all caching, even on RHEL 5. */ - "-c", "/dev/null", - "-o", "value", "-s", tag, device, NULL); - if (r != 0 && r != 2) { - if (r >= 0) - reply_with_error ("%s: %s (blkid returned %d)", device, err, r); - else - reply_with_error ("%s: %s", device, err); - free (out); - free (err); + if (!device || !tag) return NULL; - } - free (err); + fd = open (device, O_RDONLY); + if (fd < 0) + return NULL; - if (r == 2) { /* means UUID etc not found */ - free (out); - out = strdup (""); - if (out == NULL) - reply_with_perror ("strdup"); - return out; - } + blkprobe = blkid_new_probe (); + if (!blkprobe) + goto done; + if (blkid_probe_set_device (blkprobe, fd, 0, 0)) + goto done; + + blkid_probe_enable_superblocks(blkprobe, 1); + + blkid_probe_set_superblocks_flags (blkprobe, BLKID_SUBLKS_LABEL | + BLKID_SUBLKS_UUID | BLKID_SUBLKS_TYPE); - /* Trim trailing \n if present. */ - size_t len = strlen (out); - if (len > 0 && out[len-1] == '\n') - out[len-1] = '\0'; + rc = blkid_do_safeprobe (blkprobe); + if (!rc) + blkid_probe_lookup_value (blkprobe, tag, &data, NULL); - return out; /* caller frees */ +done: + close (fd); + if (blkprobe) + blkid_free_probe (blkprobe); + return data ? strdup ((char *) data) : NULL; } char * -- 1.7.9
On Tue, Feb 14, 2012 at 03:30:26PM +0800, Wanlong Gao wrote:
Hi Rich: What do you think about this idea? although this still has some problems like do 'vfs-type /dev/vda'. Can you give some comments about this? Is this a bad idea?
It's one of those things that might be an improvement, but it would have to be distinctly better than the existing approach of calling out to the 'blkid' binary. Is the libblkid library interface stable? Is it meant to be used by programs other than the blkid binary? I've CC'd this to kzak who will have a much better idea than me.
Thanks -Wanlong Gao
----------------------------------------------------------------------------- Use libblkid directly instead of the binary command in blkid.
Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com> --- appliance/packagelist.in | 1 + configure.ac | 10 ++++++++ daemon/Makefile.am | 1 + daemon/blkid.c | 55 ++++++++++++++++++++++----------------------- 4 files changed, 39 insertions(+), 28 deletions(-)
diff --git a/appliance/packagelist.in b/appliance/packagelist.in index 2ab6b80..575b8dd 100644 --- a/appliance/packagelist.in +++ b/appliance/packagelist.in @@ -45,6 +45,7 @@ vim-minimal xz zfs-fuse + libblkid #endif /* REDHAT */
#ifdef DEBIAN
On Debian/Ubuntu, this library is called libblkid1 so that needs to be added to the DEBIAN section.
diff --git a/configure.ac b/configure.ac index cc11b2f..0beef28 100644 --- a/configure.ac +++ b/configure.ac @@ -393,6 +393,16 @@ if test "x$have_libselinux" = "xyes"; then AC_DEFINE([HAVE_LIBSELINUX],[1],[Define to 1 if you have libselinux]) fi AC_SUBST([SELINUX_LIB]) +AC_CHECK_HEADERS([blkid/blkid.h]) +AC_CHECK_LIB([blkid],[blkid_new_probe],[ + have_libblkid="$ac_cv_header_blkid_blkid_h" + LIBBLKID="-lblkid" + LIBS="$LIBS $LIBBLKID" + ],[have_libblkid=no]) +if test "x$have_libblkid" = "xyes"; then + AC_DEFINE([HAVE_LIBBLKID],[1],[Define to 1 if you have libblkid]) +fi +AC_SUBST([LIBBLKID])
This is quite convoluted: blkid has a pkg-config file which seems like it would be easier to use. See existing examples using PKG_CHECK_MODULES.
dnl Check for systemtap/DTrace userspace probes (optional). dnl http://sourceware.org/systemtap/wiki/AddingUserSpaceProbingToApps diff --git a/daemon/Makefile.am b/daemon/Makefile.am index 3a698cc..5e4db57 100644 --- a/daemon/Makefile.am +++ b/daemon/Makefile.am @@ -167,6 +167,7 @@ guestfsd_LDADD = \ liberrnostring.a \ libprotocol.a \ $(SELINUX_LIB) \ + $(LIBBLKID) \ $(AUGEAS_LIBS) \ $(top_builddir)/gnulib/lib/.libs/libgnu.a \ $(GETADDRINFO_LIB) \ diff --git a/daemon/blkid.c b/daemon/blkid.c index 8728c29..0c4ca71 100644 --- a/daemon/blkid.c +++ b/daemon/blkid.c @@ -23,6 +23,8 @@ #include <string.h> #include <unistd.h> #include <limits.h> +#include <fcntl.h> +#include <blkid/blkid.h>
#include "daemon.h" #include "actions.h" @@ -30,40 +32,37 @@ static char * get_blkid_tag (const char *device, const char *tag) { - char *out, *err; - int r; + int fd, rc; + const char *data = NULL; + blkid_probe blkprobe;
- r = commandr (&out, &err, - "blkid", - /* Adding -c option kills all caching, even on RHEL 5. */ - "-c", "/dev/null", - "-o", "value", "-s", tag, device, NULL); - if (r != 0 && r != 2) { - if (r >= 0) - reply_with_error ("%s: %s (blkid returned %d)", device, err, r); - else - reply_with_error ("%s: %s", device, err); - free (out); - free (err); + if (!device || !tag) return NULL; - }
- free (err); + fd = open (device, O_RDONLY); + if (fd < 0) + return NULL;
- if (r == 2) { /* means UUID etc not found */ - free (out); - out = strdup (""); - if (out == NULL) - reply_with_perror ("strdup"); - return out; - } + blkprobe = blkid_new_probe (); + if (!blkprobe) + goto done; + if (blkid_probe_set_device (blkprobe, fd, 0, 0)) + goto done; + + blkid_probe_enable_superblocks(blkprobe, 1); + + blkid_probe_set_superblocks_flags (blkprobe, BLKID_SUBLKS_LABEL | + BLKID_SUBLKS_UUID | BLKID_SUBLKS_TYPE);
- /* Trim trailing \n if present. */ - size_t len = strlen (out); - if (len > 0 && out[len-1] == '\n') - out[len-1] = '\0'; + rc = blkid_do_safeprobe (blkprobe); + if (!rc) + blkid_probe_lookup_value (blkprobe, tag, &data, NULL);
- return out; /* caller frees */ +done: + close (fd); + if (blkprobe) + blkid_free_probe (blkprobe); + return data ? strdup ((char *) data) : NULL; }
char * -- 1.7.9
Does this avoid the cache like the existing code? Do all the existing tests pass? 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
On 02/14/2012 04:56 PM, Richard W.M. Jones wrote:
On Tue, Feb 14, 2012 at 03:30:26PM +0800, Wanlong Gao wrote:
Hi Rich: What do you think about this idea? although this still has some problems like do 'vfs-type /dev/vda'. Can you give some comments about this? Is this a bad idea?
It's one of those things that might be an improvement, but it would have to be distinctly better than the existing approach of calling out to the 'blkid' binary.
Is the libblkid library interface stable? Is it meant to be used by programs other than the blkid binary?
I've CC'd this to kzak who will have a much better idea than me.
Yeah, let Kzak answer these questions. :-) Thanks -Wanlong Gao
Thanks -Wanlong Gao
----------------------------------------------------------------------------- Use libblkid directly instead of the binary command in blkid.
Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com> --- appliance/packagelist.in | 1 + configure.ac | 10 ++++++++ daemon/Makefile.am | 1 + daemon/blkid.c | 55 ++++++++++++++++++++++----------------------- 4 files changed, 39 insertions(+), 28 deletions(-)
diff --git a/appliance/packagelist.in b/appliance/packagelist.in index 2ab6b80..575b8dd 100644 --- a/appliance/packagelist.in +++ b/appliance/packagelist.in @@ -45,6 +45,7 @@ vim-minimal xz zfs-fuse + libblkid #endif /* REDHAT */
#ifdef DEBIAN
On Debian/Ubuntu, this library is called libblkid1 so that needs to be added to the DEBIAN section.
diff --git a/configure.ac b/configure.ac index cc11b2f..0beef28 100644 --- a/configure.ac +++ b/configure.ac @@ -393,6 +393,16 @@ if test "x$have_libselinux" = "xyes"; then AC_DEFINE([HAVE_LIBSELINUX],[1],[Define to 1 if you have libselinux]) fi AC_SUBST([SELINUX_LIB]) +AC_CHECK_HEADERS([blkid/blkid.h]) +AC_CHECK_LIB([blkid],[blkid_new_probe],[ + have_libblkid="$ac_cv_header_blkid_blkid_h" + LIBBLKID="-lblkid" + LIBS="$LIBS $LIBBLKID" + ],[have_libblkid=no]) +if test "x$have_libblkid" = "xyes"; then + AC_DEFINE([HAVE_LIBBLKID],[1],[Define to 1 if you have libblkid]) +fi +AC_SUBST([LIBBLKID])
This is quite convoluted: blkid has a pkg-config file which seems like it would be easier to use. See existing examples using PKG_CHECK_MODULES.
dnl Check for systemtap/DTrace userspace probes (optional). dnl http://sourceware.org/systemtap/wiki/AddingUserSpaceProbingToApps diff --git a/daemon/Makefile.am b/daemon/Makefile.am index 3a698cc..5e4db57 100644 --- a/daemon/Makefile.am +++ b/daemon/Makefile.am @@ -167,6 +167,7 @@ guestfsd_LDADD = \ liberrnostring.a \ libprotocol.a \ $(SELINUX_LIB) \ + $(LIBBLKID) \ $(AUGEAS_LIBS) \ $(top_builddir)/gnulib/lib/.libs/libgnu.a \ $(GETADDRINFO_LIB) \ diff --git a/daemon/blkid.c b/daemon/blkid.c index 8728c29..0c4ca71 100644 --- a/daemon/blkid.c +++ b/daemon/blkid.c @@ -23,6 +23,8 @@ #include <string.h> #include <unistd.h> #include <limits.h> +#include <fcntl.h> +#include <blkid/blkid.h>
#include "daemon.h" #include "actions.h" @@ -30,40 +32,37 @@ static char * get_blkid_tag (const char *device, const char *tag) { - char *out, *err; - int r; + int fd, rc; + const char *data = NULL; + blkid_probe blkprobe;
- r = commandr (&out, &err, - "blkid", - /* Adding -c option kills all caching, even on RHEL 5. */ - "-c", "/dev/null", - "-o", "value", "-s", tag, device, NULL); - if (r != 0 && r != 2) { - if (r >= 0) - reply_with_error ("%s: %s (blkid returned %d)", device, err, r); - else - reply_with_error ("%s: %s", device, err); - free (out); - free (err); + if (!device || !tag) return NULL; - }
- free (err); + fd = open (device, O_RDONLY); + if (fd < 0) + return NULL;
- if (r == 2) { /* means UUID etc not found */ - free (out); - out = strdup (""); - if (out == NULL) - reply_with_perror ("strdup"); - return out; - } + blkprobe = blkid_new_probe (); + if (!blkprobe) + goto done; + if (blkid_probe_set_device (blkprobe, fd, 0, 0)) + goto done; + + blkid_probe_enable_superblocks(blkprobe, 1); + + blkid_probe_set_superblocks_flags (blkprobe, BLKID_SUBLKS_LABEL | + BLKID_SUBLKS_UUID | BLKID_SUBLKS_TYPE);
- /* Trim trailing \n if present. */ - size_t len = strlen (out); - if (len > 0 && out[len-1] == '\n') - out[len-1] = '\0'; + rc = blkid_do_safeprobe (blkprobe); + if (!rc) + blkid_probe_lookup_value (blkprobe, tag, &data, NULL);
- return out; /* caller frees */ +done: + close (fd); + if (blkprobe) + blkid_free_probe (blkprobe); + return data ? strdup ((char *) data) : NULL; }
char * -- 1.7.9
Does this avoid the cache like the existing code?
Do all the existing tests pass?
Rich.
On Tue, Feb 14, 2012 at 08:56:12AM +0000, Richard W.M. Jones wrote:
On Tue, Feb 14, 2012 at 03:30:26PM +0800, Wanlong Gao wrote: It's one of those things that might be an improvement, but it would have to be distinctly better than the existing approach of calling out to the 'blkid' binary.
Is the libblkid library interface stable? Is it meant to be used by programs other than the blkid binary?
Yes, for example the latest udevd is linked with libblkid.
+#include <blkid/blkid.h>
#include <blkid.h> if you want to use pkg-config
static char * get_blkid_tag (const char *device, const char *tag) { - char *out, *err; - int r; + int fd, rc; + const char *data = NULL; + blkid_probe blkprobe;
- r = commandr (&out, &err, - "blkid", - /* Adding -c option kills all caching, even on RHEL 5. */ - "-c", "/dev/null", - "-o", "value", "-s", tag, device, NULL); - if (r != 0 && r != 2) { - if (r >= 0) - reply_with_error ("%s: %s (blkid returned %d)", device, err, r); - else - reply_with_error ("%s: %s", device, err); - free (out); - free (err); + if (!device || !tag) return NULL; - }
- free (err); + fd = open (device, O_RDONLY); + if (fd < 0) + return NULL;
- if (r == 2) { /* means UUID etc not found */ - free (out); - out = strdup (""); - if (out == NULL) - reply_with_perror ("strdup"); - return out; - } + blkprobe = blkid_new_probe (); + if (!blkprobe) + goto done; + if (blkid_probe_set_device (blkprobe, fd, 0, 0)) + goto done; + + blkid_probe_enable_superblocks(blkprobe, 1);
You can also optionally enable blkid_probe_enable_partitions(pr, 1); to check for collisions between raids and partition tables (for example RAID1 could be partitioned -- then PT could be at the begin of the device and raid superblock at the end of the device, etc.)
+ blkid_probe_set_superblocks_flags (blkprobe, BLKID_SUBLKS_LABEL | + BLKID_SUBLKS_UUID | BLKID_SUBLKS_TYPE);
- /* Trim trailing \n if present. */ - size_t len = strlen (out); - if (len > 0 && out[len-1] == '\n') - out[len-1] = '\0'; + rc = blkid_do_safeprobe (blkprobe); + if (!rc) + blkid_probe_lookup_value (blkprobe, tag, &data, NULL);
- return out; /* caller frees */ +done: + close (fd); + if (blkprobe) + blkid_free_probe (blkprobe); + return data ? strdup ((char *) data) : NULL;
after blkid_free_probe() the "data" are deallocated, must be: done: close (fd); if (data) data = strdup ((char *) data); blkid_free_probe (blkprobe); return data; Note that if-before-free is unnecessary for blkid_free_probe. Karel -- Karel Zak <kzak@redhat.com> http://karelzak.blogspot.com
On 02/14/2012 06:53 PM, Karel Zak wrote:
On Tue, Feb 14, 2012 at 08:56:12AM +0000, Richard W.M. Jones wrote:
On Tue, Feb 14, 2012 at 03:30:26PM +0800, Wanlong Gao wrote: It's one of those things that might be an improvement, but it would have to be distinctly better than the existing approach of calling out to the 'blkid' binary.
Is the libblkid library interface stable? Is it meant to be used by programs other than the blkid binary?
Yes, for example the latest udevd is linked with libblkid.
+#include <blkid/blkid.h>
#include <blkid.h> if you want to use pkg-config
static char * get_blkid_tag (const char *device, const char *tag) { - char *out, *err; - int r; + int fd, rc; + const char *data = NULL; + blkid_probe blkprobe;
- r = commandr (&out, &err, - "blkid", - /* Adding -c option kills all caching, even on RHEL 5. */ - "-c", "/dev/null", - "-o", "value", "-s", tag, device, NULL); - if (r != 0 && r != 2) { - if (r >= 0) - reply_with_error ("%s: %s (blkid returned %d)", device, err, r); - else - reply_with_error ("%s: %s", device, err); - free (out); - free (err); + if (!device || !tag) return NULL; - }
- free (err); + fd = open (device, O_RDONLY); + if (fd < 0) + return NULL;
- if (r == 2) { /* means UUID etc not found */ - free (out); - out = strdup (""); - if (out == NULL) - reply_with_perror ("strdup"); - return out; - } + blkprobe = blkid_new_probe (); + if (!blkprobe) + goto done; + if (blkid_probe_set_device (blkprobe, fd, 0, 0)) + goto done; + + blkid_probe_enable_superblocks(blkprobe, 1);
You can also optionally enable
blkid_probe_enable_partitions(pr, 1);
to check for collisions between raids and partition tables (for example RAID1 could be partitioned -- then PT could be at the begin of the device and raid superblock at the end of the device, etc.)
+ blkid_probe_set_superblocks_flags (blkprobe, BLKID_SUBLKS_LABEL | + BLKID_SUBLKS_UUID | BLKID_SUBLKS_TYPE);
- /* Trim trailing \n if present. */ - size_t len = strlen (out); - if (len > 0 && out[len-1] == '\n') - out[len-1] = '\0'; + rc = blkid_do_safeprobe (blkprobe); + if (!rc) + blkid_probe_lookup_value (blkprobe, tag, &data, NULL);
- return out; /* caller frees */ +done: + close (fd); + if (blkprobe) + blkid_free_probe (blkprobe); + return data ? strdup ((char *) data) : NULL;
after blkid_free_probe() the "data" are deallocated, must be:
done: close (fd); if (data) data = strdup ((char *) data); blkid_free_probe (blkprobe); return data;
Note that if-before-free is unnecessary for blkid_free_probe.
Karel
I did like this. Now get a problem like below: The *vfs_type* calls this *get_blkid_tag* function. I added a disk image to guestfish, this disk image contains a partition "/dev/vda1" with "ext4" filesystem. Then I ran *vfs_type /dev/vda1", I got the result, but with "vfs_type /dev/vda", it hang. It seems that the vfs_type can't get a type of /dev/vda, it's right that the type of /dev/vda is unknown, but why can't it go back with unknown result or NULL result? Maybe there's something wrong with the code of *get_blkid_tag* ? Can you give some advise? Karel? Rich? Thanks -Wanlong Gao
On 02/15/2012 04:42 PM, Wanlong Gao wrote:
On 02/14/2012 06:53 PM, Karel Zak wrote:
On Tue, Feb 14, 2012 at 08:56:12AM +0000, Richard W.M. Jones wrote:
On Tue, Feb 14, 2012 at 03:30:26PM +0800, Wanlong Gao wrote: It's one of those things that might be an improvement, but it would have to be distinctly better than the existing approach of calling out to the 'blkid' binary.
Is the libblkid library interface stable? Is it meant to be used by programs other than the blkid binary?
Yes, for example the latest udevd is linked with libblkid.
+#include <blkid/blkid.h>
#include <blkid.h> if you want to use pkg-config
static char * get_blkid_tag (const char *device, const char *tag) { - char *out, *err; - int r; + int fd, rc; + const char *data = NULL; + blkid_probe blkprobe;
- r = commandr (&out, &err, - "blkid", - /* Adding -c option kills all caching, even on RHEL 5. */ - "-c", "/dev/null", - "-o", "value", "-s", tag, device, NULL); - if (r != 0 && r != 2) { - if (r >= 0) - reply_with_error ("%s: %s (blkid returned %d)", device, err, r); - else - reply_with_error ("%s: %s", device, err); - free (out); - free (err); + if (!device || !tag) return NULL; - }
- free (err); + fd = open (device, O_RDONLY); + if (fd < 0) + return NULL;
- if (r == 2) { /* means UUID etc not found */ - free (out); - out = strdup (""); - if (out == NULL) - reply_with_perror ("strdup"); - return out; - } + blkprobe = blkid_new_probe (); + if (!blkprobe) + goto done; + if (blkid_probe_set_device (blkprobe, fd, 0, 0)) + goto done; + + blkid_probe_enable_superblocks(blkprobe, 1);
You can also optionally enable
blkid_probe_enable_partitions(pr, 1);
to check for collisions between raids and partition tables (for example RAID1 could be partitioned -- then PT could be at the begin of the device and raid superblock at the end of the device, etc.)
+ blkid_probe_set_superblocks_flags (blkprobe, BLKID_SUBLKS_LABEL | + BLKID_SUBLKS_UUID | BLKID_SUBLKS_TYPE);
- /* Trim trailing \n if present. */ - size_t len = strlen (out); - if (len > 0 && out[len-1] == '\n') - out[len-1] = '\0'; + rc = blkid_do_safeprobe (blkprobe); + if (!rc) + blkid_probe_lookup_value (blkprobe, tag, &data, NULL);
- return out; /* caller frees */ +done: + close (fd); + if (blkprobe) + blkid_free_probe (blkprobe); + return data ? strdup ((char *) data) : NULL;
after blkid_free_probe() the "data" are deallocated, must be:
done: close (fd); if (data) data = strdup ((char *) data); blkid_free_probe (blkprobe); return data;
Note that if-before-free is unnecessary for blkid_free_probe.
Karel
I did like this. Now get a problem like below:
The *vfs_type* calls this *get_blkid_tag* function. I added a disk image to guestfish, this disk image contains a partition "/dev/vda1" with "ext4" filesystem. Then I ran *vfs_type /dev/vda1", I got the result, but with "vfs_type /dev/vda", it hang.
It seems that the vfs_type can't get a type of /dev/vda, it's right that the type of /dev/vda is unknown, but why can't it go back with unknown result or NULL result?
Maybe there's something wrong with the code of *get_blkid_tag* ?
Can you give some advise? Karel? Rich?
And the updated patch is below: --------------------------------------------------------
From c89fef505421266ac5138a4542236ef95184664b Mon Sep 17 00:00:00 2001 From: Wanlong Gao <gaowanlong@cn.fujitsu.com> Date: Tue, 14 Feb 2012 13:47:06 +0800 Subject: [PATCH] blkid: start using libblkid directly instead From: Wanlong Gao <gaowanlong@cn.fujitsu.com> To: rjones@redhat.com Cc: libguestfs@redhat.com
Use libblkid directly instead of the binary command in blkid. Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com> --- appliance/packagelist.in | 1 + configure.ac | 10 ++++++++ daemon/Makefile.am | 1 + daemon/blkid.c | 58 +++++++++++++++++++++++---------------------- 4 files changed, 42 insertions(+), 28 deletions(-) diff --git a/appliance/packagelist.in b/appliance/packagelist.in index 2ab6b80..575b8dd 100644 --- a/appliance/packagelist.in +++ b/appliance/packagelist.in @@ -45,6 +45,7 @@ vim-minimal xz zfs-fuse + libblkid #endif /* REDHAT */ #ifdef DEBIAN diff --git a/configure.ac b/configure.ac index cc11b2f..0beef28 100644 --- a/configure.ac +++ b/configure.ac @@ -393,6 +393,16 @@ if test "x$have_libselinux" = "xyes"; then AC_DEFINE([HAVE_LIBSELINUX],[1],[Define to 1 if you have libselinux]) fi AC_SUBST([SELINUX_LIB]) +AC_CHECK_HEADERS([blkid/blkid.h]) +AC_CHECK_LIB([blkid],[blkid_new_probe],[ + have_libblkid="$ac_cv_header_blkid_blkid_h" + LIBBLKID="-lblkid" + LIBS="$LIBS $LIBBLKID" + ],[have_libblkid=no]) +if test "x$have_libblkid" = "xyes"; then + AC_DEFINE([HAVE_LIBBLKID],[1],[Define to 1 if you have libblkid]) +fi +AC_SUBST([LIBBLKID]) dnl Check for systemtap/DTrace userspace probes (optional). dnl http://sourceware.org/systemtap/wiki/AddingUserSpaceProbingToApps diff --git a/daemon/Makefile.am b/daemon/Makefile.am index 3a698cc..5e4db57 100644 --- a/daemon/Makefile.am +++ b/daemon/Makefile.am @@ -167,6 +167,7 @@ guestfsd_LDADD = \ liberrnostring.a \ libprotocol.a \ $(SELINUX_LIB) \ + $(LIBBLKID) \ $(AUGEAS_LIBS) \ $(top_builddir)/gnulib/lib/.libs/libgnu.a \ $(GETADDRINFO_LIB) \ diff --git a/daemon/blkid.c b/daemon/blkid.c index 8728c29..fdde5f8 100644 --- a/daemon/blkid.c +++ b/daemon/blkid.c @@ -23,6 +23,8 @@ #include <string.h> #include <unistd.h> #include <limits.h> +#include <fcntl.h> +#include <blkid/blkid.h> #include "daemon.h" #include "actions.h" @@ -30,40 +32,40 @@ static char * get_blkid_tag (const char *device, const char *tag) { - char *out, *err; - int r; + int fd, rc; + const char *data = NULL; + blkid_probe blkprobe; - r = commandr (&out, &err, - "blkid", - /* Adding -c option kills all caching, even on RHEL 5. */ - "-c", "/dev/null", - "-o", "value", "-s", tag, device, NULL); - if (r != 0 && r != 2) { - if (r >= 0) - reply_with_error ("%s: %s (blkid returned %d)", device, err, r); - else - reply_with_error ("%s: %s", device, err); - free (out); - free (err); + if (!device || !tag) return NULL; - } - free (err); + fd = open (device, O_RDONLY); + if (fd < 0) + return NULL; - if (r == 2) { /* means UUID etc not found */ - free (out); - out = strdup (""); - if (out == NULL) - reply_with_perror ("strdup"); - return out; - } + blkprobe = blkid_new_probe (); + if (!blkprobe) + goto done; + if (blkid_probe_set_device (blkprobe, fd, 0, 0)) + goto done; + + blkid_probe_enable_superblocks (blkprobe, 1); + blkid_probe_enable_partitions (blkprobe, 1); + + blkid_probe_set_superblocks_flags (blkprobe, BLKID_SUBLKS_LABEL | + BLKID_SUBLKS_UUID | BLKID_SUBLKS_TYPE); + + rc = blkid_do_safeprobe (blkprobe); + if (!rc) + blkid_probe_lookup_value (blkprobe, tag, &data, NULL); - /* Trim trailing \n if present. */ - size_t len = strlen (out); - if (len > 0 && out[len-1] == '\n') - out[len-1] = '\0'; +done: + close (fd); + if (data) + data = strdup ((char *) data); + blkid_free_probe (blkprobe); - return out; /* caller frees */ + return (char *) data; } char * -- 1.7.9 --------------------------------------------------------
Thanks -Wanlong Gao
_______________________________________________ Libguestfs mailing list Libguestfs@redhat.com https://www.redhat.com/mailman/listinfo/libguestfs
On Wed, Feb 15, 2012 at 04:42:45PM +0800, Wanlong Gao wrote:
I did like this. Now get a problem like below:
The *vfs_type* calls this *get_blkid_tag* function. I added a disk image to guestfish, this disk image contains a partition "/dev/vda1" with "ext4" filesystem. Then I ran *vfs_type /dev/vda1", I got the result, but with "vfs_type /dev/vda", it hang.
Hmm... strange. Try to define BLKID_DEBUG=0xffff env. variable, libblkid then prints many debug messages.
It seems that the vfs_type can't get a type of /dev/vda, it's right that the type of /dev/vda is unknown, but why can't it go back with unknown result or NULL result?
Yes, blkid_do_safeprobe() returns 1 if nothing detected. Karel -- Karel Zak <kzak@redhat.com> http://karelzak.blogspot.com
Karel, on a related topic, does libblkid always ignore the cache (/run/blkid/blkid.tab etc)? We go to some length to disable the cache in libguestfs, eg. calling blkid -c /dev/null and/or blkid -p (this has to work on RHEL 5 which didn't have the -p option). Basically we never want the cache, we always want (lib)blkid to probe the disk directly. 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
On Wed, Feb 15, 2012 at 10:03:15AM +0000, Richard W.M. Jones wrote:
Karel, on a related topic, does libblkid always ignore the cache (/run/blkid/blkid.tab etc)?
We go to some length to disable the cache in libguestfs, eg. calling blkid -c /dev/null and/or blkid -p (this has to work on RHEL 5 which didn't have the -p option).
Basically we never want the cache, we always want (lib)blkid to probe the disk directly.
1) the low-level part of the library (blkid_probe_* functions and "blkid -p") does not use the cache at all. 2) the "blkid -c /dev/null" is a workaround for high-level part if the library. IMHO for libguestfs is the best to use "1)" and on old systems with old libblkid from e2fsprogs use "2)". See also: http://karelzak.blogspot.com/2012/02/libblkid-maintainers-brain-dump.html Karel -- Karel Zak <kzak@redhat.com> http://karelzak.blogspot.com
Use libblkid directly instead of the binary command in blkid. Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com> --- appliance/packagelist.in | 1 + configure.ac | 10 +++++++ daemon/Makefile.am | 1 + daemon/blkid.c | 59 +++++++++++++++++++++++++--------------------- 4 files changed, 44 insertions(+), 27 deletions(-) diff --git a/appliance/packagelist.in b/appliance/packagelist.in index 2ab6b80..575b8dd 100644 --- a/appliance/packagelist.in +++ b/appliance/packagelist.in @@ -45,6 +45,7 @@ vim-minimal xz zfs-fuse + libblkid #endif /* REDHAT */ #ifdef DEBIAN diff --git a/configure.ac b/configure.ac index 31a2cc5..517149d 100644 --- a/configure.ac +++ b/configure.ac @@ -393,6 +393,16 @@ if test "x$have_libselinux" = "xyes"; then AC_DEFINE([HAVE_LIBSELINUX],[1],[Define to 1 if you have libselinux]) fi AC_SUBST([SELINUX_LIB]) +AC_CHECK_HEADERS([blkid/blkid.h]) +AC_CHECK_LIB([blkid],[blkid_new_probe],[ + have_libblkid="$ac_cv_header_blkid_blkid_h" + LIBBLKID="-lblkid" + LIBS="$LIBS $LIBBLKID" + ],[have_libblkid=no]) +if test "x$have_libblkid" = "xyes"; then + AC_DEFINE([HAVE_LIBBLKID],[1],[Define to 1 if you have libblkid]) +fi +AC_SUBST([LIBBLKID]) dnl Check for systemtap/DTrace userspace probes (optional). dnl http://sourceware.org/systemtap/wiki/AddingUserSpaceProbingToApps diff --git a/daemon/Makefile.am b/daemon/Makefile.am index 3a698cc..5e4db57 100644 --- a/daemon/Makefile.am +++ b/daemon/Makefile.am @@ -167,6 +167,7 @@ guestfsd_LDADD = \ liberrnostring.a \ libprotocol.a \ $(SELINUX_LIB) \ + $(LIBBLKID) \ $(AUGEAS_LIBS) \ $(top_builddir)/gnulib/lib/.libs/libgnu.a \ $(GETADDRINFO_LIB) \ diff --git a/daemon/blkid.c b/daemon/blkid.c index 8728c29..0472707 100644 --- a/daemon/blkid.c +++ b/daemon/blkid.c @@ -23,6 +23,8 @@ #include <string.h> #include <unistd.h> #include <limits.h> +#include <fcntl.h> +#include <blkid/blkid.h> #include "daemon.h" #include "actions.h" @@ -30,40 +32,43 @@ static char * get_blkid_tag (const char *device, const char *tag) { - char *out, *err; - int r; + int fd, rc; + const char *data = NULL; + blkid_probe blkprobe; - r = commandr (&out, &err, - "blkid", - /* Adding -c option kills all caching, even on RHEL 5. */ - "-c", "/dev/null", - "-o", "value", "-s", tag, device, NULL); - if (r != 0 && r != 2) { - if (r >= 0) - reply_with_error ("%s: %s (blkid returned %d)", device, err, r); - else - reply_with_error ("%s: %s", device, err); - free (out); - free (err); + fd = open (device, O_RDONLY); + if (fd < 0) { + reply_with_perror ("open %s", device); return NULL; } - free (err); + blkprobe = blkid_new_probe (); + if (!blkprobe) + goto done; + if (blkid_probe_set_device (blkprobe, fd, 0, 0)) + goto done; - if (r == 2) { /* means UUID etc not found */ - free (out); - out = strdup (""); - if (out == NULL) - reply_with_perror ("strdup"); - return out; - } + blkid_probe_enable_superblocks (blkprobe, 1); + blkid_probe_enable_partitions (blkprobe, 1); - /* Trim trailing \n if present. */ - size_t len = strlen (out); - if (len > 0 && out[len-1] == '\n') - out[len-1] = '\0'; + blkid_probe_set_superblocks_flags (blkprobe, BLKID_SUBLKS_LABEL | + BLKID_SUBLKS_UUID | BLKID_SUBLKS_TYPE); + + rc = blkid_do_safeprobe (blkprobe); + if (!rc) + blkid_probe_lookup_value (blkprobe, tag, &data, NULL); + +done: + close (fd); + if (data) + data = strdup ((char *) data); + else + data = strdup (""); + blkid_free_probe (blkprobe); - return out; /* caller frees */ + if (!data) + reply_with_perror ("strdup"); + return (char *) data; } char * -- 1.7.9
On Fri, Feb 17, 2012 at 05:02:50PM +0800, Wanlong Gao wrote:
Use libblkid directly instead of the binary command in blkid.
There are still problems in this patch. Have a look at the comments I sent before: https://www.redhat.com/archives/libguestfs/2012-February/msg00059.html 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
On 02/17/2012 05:46 PM, Richard W.M. Jones wrote:
On Fri, Feb 17, 2012 at 05:02:50PM +0800, Wanlong Gao wrote:
Use libblkid directly instead of the binary command in blkid.
There are still problems in this patch. Have a look at the comments I sent before:
https://www.redhat.com/archives/libguestfs/2012-February/msg00059.html
Sorry I missed, I'll follow the comments and test for a while myself, then send out a v3. ;) Thanks -Wanlong Gao
Rich.
Hi Rich: This is the v3 version of the starting using libblkid in libguestfs. Now, use the pkg-config for libblkid. I also tested on Fedora 16, and all tests passed. This also avoid the cache like the existing code as Kzak said. So, any further comments? Thanks -Wanlong Gao --------------------------------------------------------------------------------- Use libblkid directly instead of the binary command in blkid. Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com> --- appliance/packagelist.in | 2 + configure.ac | 9 +++++++ daemon/Makefile.am | 4 ++- daemon/blkid.c | 59 +++++++++++++++++++++++++--------------------- 4 files changed, 46 insertions(+), 28 deletions(-) diff --git a/appliance/packagelist.in b/appliance/packagelist.in index 2ab6b80..1dedb58 100644 --- a/appliance/packagelist.in +++ b/appliance/packagelist.in @@ -45,6 +45,7 @@ vim-minimal xz zfs-fuse + libblkid #endif /* REDHAT */ #ifdef DEBIAN @@ -70,6 +71,7 @@ vim-tiny xz-utils zfs-fuse + libblkid1 #endif /* DEBIAN */ #ifdef ARCHLINUX diff --git a/configure.ac b/configure.ac index 31a2cc5..396d050 100644 --- a/configure.ac +++ b/configure.ac @@ -675,6 +675,15 @@ PKG_CHECK_MODULES([HIVEX], [hivex], [AC_MSG_WARN([hivex not found, some core features will be disabled])]) AM_CONDITIONAL([HAVE_HIVEX],[test "x$HIVEX_LIBS" != "x"]) +dnl libblkid (highly recommended) +PKG_CHECK_MODULES([LIBBLKID], [blkid], + [AC_SUBST([LIBBLKID_CFLAGS]) + AC_SUBST([LIBBLKID_LIBS]) + AC_DEFINE([HAVE_LIBBLKID],[1],[libblkid found at compile time.]) + ], + [AC_MSG_WARN([libblkid not found, some features will be disabled])]) +AM_CONDITIONAL([HAVE_LIBBLKID],[test "x$LIBBLKID_LIBS" != "x"]) + dnl FUSE is optional to build the FUSE module. AC_ARG_ENABLE([fuse], AS_HELP_STRING([--disable-fuse], [Disable FUSE (guestmount) support]), diff --git a/daemon/Makefile.am b/daemon/Makefile.am index 3a698cc..8764b41 100644 --- a/daemon/Makefile.am +++ b/daemon/Makefile.am @@ -167,6 +167,7 @@ guestfsd_LDADD = \ liberrnostring.a \ libprotocol.a \ $(SELINUX_LIB) \ + $(LIBBLKID_LIBS) \ $(AUGEAS_LIBS) \ $(top_builddir)/gnulib/lib/.libs/libgnu.a \ $(GETADDRINFO_LIB) \ @@ -178,6 +179,7 @@ guestfsd_LDADD = \ $(SERVENT_LIB) guestfsd_CPPFLAGS = -I$(top_srcdir)/gnulib/lib -I$(top_builddir)/gnulib/lib -guestfsd_CFLAGS = $(WARN_CFLAGS) $(WERROR_CFLAGS) $(AUGEAS_CFLAGS) +guestfsd_CFLAGS = $(WARN_CFLAGS) $(WERROR_CFLAGS) $(AUGEAS_CFLAGS) \ + $(LIBBLKID_CFLAGS) .PHONY: force diff --git a/daemon/blkid.c b/daemon/blkid.c index 8728c29..bc4c03d 100644 --- a/daemon/blkid.c +++ b/daemon/blkid.c @@ -23,6 +23,8 @@ #include <string.h> #include <unistd.h> #include <limits.h> +#include <fcntl.h> +#include <blkid.h> #include "daemon.h" #include "actions.h" @@ -30,40 +32,43 @@ static char * get_blkid_tag (const char *device, const char *tag) { - char *out, *err; - int r; + int fd, rc; + const char *data = NULL; + blkid_probe blkprobe; - r = commandr (&out, &err, - "blkid", - /* Adding -c option kills all caching, even on RHEL 5. */ - "-c", "/dev/null", - "-o", "value", "-s", tag, device, NULL); - if (r != 0 && r != 2) { - if (r >= 0) - reply_with_error ("%s: %s (blkid returned %d)", device, err, r); - else - reply_with_error ("%s: %s", device, err); - free (out); - free (err); + fd = open (device, O_RDONLY); + if (fd < 0) { + reply_with_perror ("open %s", device); return NULL; } - free (err); + blkprobe = blkid_new_probe (); + if (!blkprobe) + goto done; + if (blkid_probe_set_device (blkprobe, fd, 0, 0)) + goto done; - if (r == 2) { /* means UUID etc not found */ - free (out); - out = strdup (""); - if (out == NULL) - reply_with_perror ("strdup"); - return out; - } + blkid_probe_enable_superblocks (blkprobe, 1); + blkid_probe_enable_partitions (blkprobe, 1); - /* Trim trailing \n if present. */ - size_t len = strlen (out); - if (len > 0 && out[len-1] == '\n') - out[len-1] = '\0'; + blkid_probe_set_superblocks_flags (blkprobe, BLKID_SUBLKS_LABEL | + BLKID_SUBLKS_UUID | BLKID_SUBLKS_TYPE); + + rc = blkid_do_safeprobe (blkprobe); + if (!rc) + blkid_probe_lookup_value (blkprobe, tag, &data, NULL); + +done: + close (fd); + if (data) + data = strdup ((char *) data); + else + data = strdup (""); + blkid_free_probe (blkprobe); - return out; /* caller frees */ + if (!data) + reply_with_perror ("strdup"); + return (char *) data; } char * -- 1.7.9
On Mon, Feb 20, 2012 at 09:40:53AM +0800, Wanlong Gao wrote:
+dnl libblkid (highly recommended) +PKG_CHECK_MODULES([LIBBLKID], [blkid], + [AC_SUBST([LIBBLKID_CFLAGS]) + AC_SUBST([LIBBLKID_LIBS]) + AC_DEFINE([HAVE_LIBBLKID],[1],[libblkid found at compile time.]) + ], + [AC_MSG_WARN([libblkid not found, some features will be disabled])]) +AM_CONDITIONAL([HAVE_LIBBLKID],[test "x$LIBBLKID_LIBS" != "x"])
This makes libblkid conditional, but the code below assumes <blkid.h> and the blkid_* calls are present. I'll have to check what RHEL 5 can do ... 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
On 02/20/2012 04:41 PM, Richard W.M. Jones wrote:
On Mon, Feb 20, 2012 at 09:40:53AM +0800, Wanlong Gao wrote:
+dnl libblkid (highly recommended) +PKG_CHECK_MODULES([LIBBLKID], [blkid], + [AC_SUBST([LIBBLKID_CFLAGS]) + AC_SUBST([LIBBLKID_LIBS]) + AC_DEFINE([HAVE_LIBBLKID],[1],[libblkid found at compile time.]) + ], + [AC_MSG_WARN([libblkid not found, some features will be disabled])]) +AM_CONDITIONAL([HAVE_LIBBLKID],[test "x$LIBBLKID_LIBS" != "x"])
This makes libblkid conditional, but the code below assumes <blkid.h> and the blkid_* calls are present.
I'll have to check what RHEL 5 can do ...
yes, if not, we should make some change. thanks Rich -Wanlong
Rich.
On 02/20/2012 04:41 PM, Richard W.M. Jones wrote:
On Mon, Feb 20, 2012 at 09:40:53AM +0800, Wanlong Gao wrote:
+dnl libblkid (highly recommended) +PKG_CHECK_MODULES([LIBBLKID], [blkid], + [AC_SUBST([LIBBLKID_CFLAGS]) + AC_SUBST([LIBBLKID_LIBS]) + AC_DEFINE([HAVE_LIBBLKID],[1],[libblkid found at compile time.]) + ], + [AC_MSG_WARN([libblkid not found, some features will be disabled])]) +AM_CONDITIONAL([HAVE_LIBBLKID],[test "x$LIBBLKID_LIBS" != "x"])
This makes libblkid conditional, but the code below assumes <blkid.h> and the blkid_* calls are present.
I'll have to check what RHEL 5 can do ...
I saw that RHEL5 only has the e2fsprogs-* package but not libblkid* packages, and the e2fsprogs-* for RHEL5 without the *probe* functions in libblkid, so, we should use 'blkid -c /dev/null xxx' on RHEL5 for compatibility. Agree? Thanks -Wanlong Gao
Rich.
On 02/21/2012 05:20 PM, Wanlong Gao wrote:
On 02/20/2012 04:41 PM, Richard W.M. Jones wrote:
On Mon, Feb 20, 2012 at 09:40:53AM +0800, Wanlong Gao wrote:
+dnl libblkid (highly recommended) +PKG_CHECK_MODULES([LIBBLKID], [blkid], + [AC_SUBST([LIBBLKID_CFLAGS]) + AC_SUBST([LIBBLKID_LIBS]) + AC_DEFINE([HAVE_LIBBLKID],[1],[libblkid found at compile time.]) + ], + [AC_MSG_WARN([libblkid not found, some features will be disabled])]) +AM_CONDITIONAL([HAVE_LIBBLKID],[test "x$LIBBLKID_LIBS" != "x"])
This makes libblkid conditional, but the code below assumes <blkid.h> and the blkid_* calls are present.
I'll have to check what RHEL 5 can do ...
I saw that RHEL5 only has the e2fsprogs-* package but not libblkid* packages, and the e2fsprogs-* for RHEL5 without the *probe* functions in libblkid, so, we should use 'blkid -c /dev/null xxx' on RHEL5 for compatibility.
Agree?
Rich: Any ideas about this? Please help !
Thanks -Wanlong Gao
Rich.
_______________________________________________ Libguestfs mailing list Libguestfs@redhat.com https://www.redhat.com/mailman/listinfo/libguestfs
On Mon, Feb 27, 2012 at 05:01:04PM +0800, Wanlong Gao wrote:
On 02/21/2012 05:20 PM, Wanlong Gao wrote:
On 02/20/2012 04:41 PM, Richard W.M. Jones wrote:
On Mon, Feb 20, 2012 at 09:40:53AM +0800, Wanlong Gao wrote:
+dnl libblkid (highly recommended) +PKG_CHECK_MODULES([LIBBLKID], [blkid], + [AC_SUBST([LIBBLKID_CFLAGS]) + AC_SUBST([LIBBLKID_LIBS]) + AC_DEFINE([HAVE_LIBBLKID],[1],[libblkid found at compile time.]) + ], + [AC_MSG_WARN([libblkid not found, some features will be disabled])]) +AM_CONDITIONAL([HAVE_LIBBLKID],[test "x$LIBBLKID_LIBS" != "x"])
This makes libblkid conditional, but the code below assumes <blkid.h> and the blkid_* calls are present.
I'll have to check what RHEL 5 can do ...
I saw that RHEL5 only has the e2fsprogs-* package but not libblkid* packages, and the e2fsprogs-* for RHEL5 without the *probe* functions in libblkid, so, we should use 'blkid -c /dev/null xxx' on RHEL5 for compatibility.
Agree?
Rich:
Any ideas about this? Please help !
I've had no time to look at this at the moment. Using libblkid instead of blkid sounds like a good cleanup, but it's not something that is essential and it'll cause issues with RHEL 5 (assuming we care about RHEL 5). Here is a useful link that we shouldn't forget ... http://karelzak.blogspot.com/2012/02/libblkid-maintainers-brain-dump.html 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
participants (3)
-
Karel Zak -
Richard W.M. Jones -
Wanlong Gao