Index: configure.in
===================================================================
RCS file: /data/cvs/libvirt/configure.in,v
retrieving revision 1.177
diff -u -r1.177 configure.in
--- a/configure.in	24 Oct 2008 13:10:30 -0000	1.177
+++ b/configure.in	4 Nov 2008 13:21:47 -0000
@@ -734,6 +734,7 @@
   AC_PATH_PROG([VGREMOVE], [vgremove], [], [$PATH:/sbin:/usr/sbin])
   AC_PATH_PROG([LVREMOVE], [lvremove], [], [$PATH:/sbin:/usr/sbin])
   AC_PATH_PROG([VGCHANGE], [vgchange], [], [$PATH:/sbin:/usr/sbin])
+  AC_PATH_PROG([VGSCAN], [vgscan], [], [$PATH:/sbin:/usr/sbin])
   AC_PATH_PROG([PVS], [pvs], [], [$PATH:/sbin:/usr/sbin])
   AC_PATH_PROG([VGS], [vgs], [], [$PATH:/sbin:/usr/sbin])
   AC_PATH_PROG([LVS], [lvs], [], [$PATH:/sbin:/usr/sbin])
@@ -746,6 +747,7 @@
     if test -z "$VGREMOVE" ; then AC_MSG_ERROR([We need vgremove for LVM storage driver]) ; fi
     if test -z "$LVREMOVE" ; then AC_MSG_ERROR([We need lvremove for LVM storage driver]) ; fi
     if test -z "$VGCHANGE" ; then AC_MSG_ERROR([We need vgchange for LVM storage driver]) ; fi
+    if test -z "$VGSCAN" ; then AC_MSG_ERROR([We need vgscan for LVM storage driver]) ; fi
     if test -z "$PVS" ; then AC_MSG_ERROR([We need pvs for LVM storage driver]) ; fi
     if test -z "$VGS" ; then AC_MSG_ERROR([We need vgs for LVM storage driver]) ; fi
     if test -z "$LVS" ; then AC_MSG_ERROR([We need lvs for LVM storage driver]) ; fi
@@ -756,7 +758,8 @@
     if test -z "$PVREMOVE" ; then with_storage_lvm=no ; fi
     if test -z "$VGREMOVE" ; then with_storage_lvm=no ; fi
     if test -z "$LVREMOVE" ; then with_storage_lvm=no ; fi
-    if test -z "VGCHANGE" ; then with_storage_lvm=no ; fi
+    if test -z "$VGCHANGE" ; then with_storage_lvm=no ; fi
+    if test -z "$VGSCAN" ; then with_storage_lvm=no ; fi
     if test -z "$PVS" ; then with_storage_lvm=no ; fi
     if test -z "$VGS" ; then with_storage_lvm=no ; fi
     if test -z "$LVS" ; then with_storage_lvm=no ; fi
@@ -773,6 +776,7 @@
     AC_DEFINE_UNQUOTED([VGREMOVE],["$VGREMOVE"],[Location of vgcreate program])
     AC_DEFINE_UNQUOTED([LVREMOVE],["$LVREMOVE"],[Location of lvcreate program])
     AC_DEFINE_UNQUOTED([VGCHANGE],["$VGCHANGE"],[Location of vgchange program])
+    AC_DEFINE_UNQUOTED([VGSCAN],["$VGSCAN"],[Location of vgscan program])
     AC_DEFINE_UNQUOTED([PVS],["$PVS"],[Location of pvs program])
     AC_DEFINE_UNQUOTED([VGS],["$VGS"],[Location of vgs program])
     AC_DEFINE_UNQUOTED([LVS],["$LVS"],[Location of lvs program])
Index: src/storage_backend_logical.c
===================================================================
RCS file: /data/cvs/libvirt/src/storage_backend_logical.c,v
retrieving revision 1.21
diff -u -r1.21 storage_backend_logical.c
--- a/src/storage_backend_logical.c	23 Oct 2008 11:39:53 -0000	1.21
+++ b/src/storage_backend_logical.c	4 Nov 2008 13:23:58 -0000
@@ -325,11 +325,19 @@
         2
     };
     const char *const prog[] = { PVS, "--noheadings", "-o", "pv_name,vg_name", NULL };
+    const char *const scanprog[] = { VGSCAN, NULL };
     int exitstatus;
     char *retval = NULL;
     virStoragePoolSourceList sourceList;
     int i;
 
+    /*
+     * NOTE: ignoring errors here; this is just to "touch" any logical volumes
+     * that might be hanging around, so if this fails for some reason, the
+     *  worst that happens is that scanning doesn't pick everything up
+     */
+    virRun(conn, scanprog, &exitstatus);
+
     memset(&sourceList, 0, sizeof(sourceList));
     if (virStorageBackendRunProgRegex(conn, NULL, prog, 1, regexes, vars,
                                       virStorageBackendLogicalFindPoolSourcesFunc,
