diff --git a/ChangeLog b/ChangeLog index dcef06d9bdabb666323859baf9d06122ecf71344..d5926b2d84808590d54e1360bd2525343d90d4ee 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Wed Nov 5 12:41:00 CET 2008 Chris Lalancette + * configure.in, src/storage_backend_logical.c: Call vgscan before + attempting to scan logical volumes. This makes sure we've "touched" + any logical volumes, so they appear in the subsequent "pvs" call. + Tue Nov 4 23:33:31 UTC 2008 Daniel P. Berrange * configure.in: Set WITH_XXXX conditionals for drivers in diff --git a/configure.in b/configure.in index c105eca8094a72f2408930fbd438ce09db3b3bd6..ef6973076fe190269f852b0e8597fb0460b1d625 100644 --- a/configure.in +++ b/configure.in @@ -748,6 +748,7 @@ if test "$with_storage_lvm" = "yes" -o "$with_storage_lvm" = "check"; then 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]) @@ -760,6 +761,7 @@ if test "$with_storage_lvm" = "yes" -o "$with_storage_lvm" = "check"; then 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 @@ -770,7 +772,8 @@ if test "$with_storage_lvm" = "yes" -o "$with_storage_lvm" = "check"; then 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 @@ -787,6 +790,7 @@ if test "$with_storage_lvm" = "yes" -o "$with_storage_lvm" = "check"; then 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]) diff --git a/src/storage_backend_logical.c b/src/storage_backend_logical.c index 53bea67f35d9786d3bcf2fb031ce1dab6a497081..7b013f896e9e95aeeb7b65a253445a9ef8bcb6a8 100644 --- a/src/storage_backend_logical.c +++ b/src/storage_backend_logical.c @@ -326,11 +326,19 @@ virStorageBackendLogicalFindPoolSources(virConnectPtr conn, 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)); sourceList.type = VIR_STORAGE_POOL_LOGICAL;