提交 1ac47e34 编写于 作者: C Chris Lalancette

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.
Signed-off-by: NChris Lalancette <clalance@redhat.com>
上级 c9ff52fb
Wed Nov 5 12:41:00 CET 2008 Chris Lalancette <clalance@redhat.com>
* 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 <berrange@redhat.com> Tue Nov 4 23:33:31 UTC 2008 Daniel P. Berrange <berrange@redhat.com>
* configure.in: Set WITH_XXXX conditionals for drivers in * configure.in: Set WITH_XXXX conditionals for drivers in
......
...@@ -748,6 +748,7 @@ if test "$with_storage_lvm" = "yes" -o "$with_storage_lvm" = "check"; then ...@@ -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([VGREMOVE], [vgremove], [], [$PATH:/sbin:/usr/sbin])
AC_PATH_PROG([LVREMOVE], [lvremove], [], [$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([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([PVS], [pvs], [], [$PATH:/sbin:/usr/sbin])
AC_PATH_PROG([VGS], [vgs], [], [$PATH:/sbin:/usr/sbin]) AC_PATH_PROG([VGS], [vgs], [], [$PATH:/sbin:/usr/sbin])
AC_PATH_PROG([LVS], [lvs], [], [$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 ...@@ -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 "$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 "$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 "$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 "$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 "$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 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 ...@@ -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 "$PVREMOVE" ; then with_storage_lvm=no ; fi
if test -z "$VGREMOVE" ; 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 "$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 "$PVS" ; then with_storage_lvm=no ; fi
if test -z "$VGS" ; 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 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 ...@@ -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([VGREMOVE],["$VGREMOVE"],[Location of vgcreate program])
AC_DEFINE_UNQUOTED([LVREMOVE],["$LVREMOVE"],[Location of lvcreate program]) AC_DEFINE_UNQUOTED([LVREMOVE],["$LVREMOVE"],[Location of lvcreate program])
AC_DEFINE_UNQUOTED([VGCHANGE],["$VGCHANGE"],[Location of vgchange 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([PVS],["$PVS"],[Location of pvs program])
AC_DEFINE_UNQUOTED([VGS],["$VGS"],[Location of vgs program]) AC_DEFINE_UNQUOTED([VGS],["$VGS"],[Location of vgs program])
AC_DEFINE_UNQUOTED([LVS],["$LVS"],[Location of lvs program]) AC_DEFINE_UNQUOTED([LVS],["$LVS"],[Location of lvs program])
......
...@@ -326,11 +326,19 @@ virStorageBackendLogicalFindPoolSources(virConnectPtr conn, ...@@ -326,11 +326,19 @@ virStorageBackendLogicalFindPoolSources(virConnectPtr conn,
2 2
}; };
const char *const prog[] = { PVS, "--noheadings", "-o", "pv_name,vg_name", NULL }; const char *const prog[] = { PVS, "--noheadings", "-o", "pv_name,vg_name", NULL };
const char *const scanprog[] = { VGSCAN, NULL };
int exitstatus; int exitstatus;
char *retval = NULL; char *retval = NULL;
virStoragePoolSourceList sourceList; virStoragePoolSourceList sourceList;
int i; 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)); memset(&sourceList, 0, sizeof(sourceList));
sourceList.type = VIR_STORAGE_POOL_LOGICAL; sourceList.type = VIR_STORAGE_POOL_LOGICAL;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册