Created
October 4, 2010 14:02
-
-
Save redivy/609730 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/config.h.in b/config.h.in | |
index 22a3b34..b7fe9f3 100644 | |
--- a/config.h.in | |
+++ b/config.h.in | |
@@ -1619,6 +1619,9 @@ | |
/* whether SCSI backend for storage driver is enabled */ | |
#undef WITH_STORAGE_SCSI | |
+/* whether SCST backend for storage driver is enabled */ | |
+#undef WITH_STORAGE_SCST | |
+ | |
/* whether Test driver is enabled */ | |
#undef WITH_TEST | |
diff --git a/configure b/configure | |
index b9e7d69..ac4847d 100755 | |
--- a/configure | |
+++ b/configure | |
@@ -871,6 +871,8 @@ DEVMAPPER_LIBS | |
DEVMAPPER_CFLAGS | |
WITH_STORAGE_MPATH_FALSE | |
WITH_STORAGE_MPATH_TRUE | |
+WITH_STORAGE_SCST_FALSE | |
+WITH_STORAGE_SCST_TRUE | |
WITH_STORAGE_SCSI_FALSE | |
WITH_STORAGE_SCSI_TRUE | |
WITH_STORAGE_ISCSI_FALSE | |
@@ -1725,6 +1727,7 @@ with_storage_fs | |
with_storage_lvm | |
with_storage_iscsi | |
with_storage_scsi | |
+with_storage_scst | |
with_storage_mpath | |
with_storage_disk | |
with_python | |
@@ -2484,6 +2487,8 @@ Optional Packages: | |
[default=check] | |
--with-storage-scsi with SCSI backend for the storage driver | |
[default=check] | |
+ --with-storage-scst with SCST backend for the storage driver | |
+ [default=check] | |
--with-storage-mpath with mpath backend for the storage driver | |
[default=check] | |
--with-storage-disk with GPartd Disk backend for the storage driver | |
@@ -39489,13 +39494,13 @@ if test "${lt_cv_nm_interface+set}" = set; then | |
else | |
lt_cv_nm_interface="BSD nm" | |
echo "int some_variable = 0;" > conftest.$ac_ext | |
- (eval echo "\"\$as_me:39492: $ac_compile\"" >&5) | |
+ (eval echo "\"\$as_me:39497: $ac_compile\"" >&5) | |
(eval "$ac_compile" 2>conftest.err) | |
cat conftest.err >&5 | |
- (eval echo "\"\$as_me:39495: $NM \\\"conftest.$ac_objext\\\"\"" >&5) | |
+ (eval echo "\"\$as_me:39500: $NM \\\"conftest.$ac_objext\\\"\"" >&5) | |
(eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) | |
cat conftest.err >&5 | |
- (eval echo "\"\$as_me:39498: output\"" >&5) | |
+ (eval echo "\"\$as_me:39503: output\"" >&5) | |
cat conftest.out >&5 | |
if $GREP 'External.*some_variable' conftest.out > /dev/null; then | |
lt_cv_nm_interface="MS dumpbin" | |
@@ -40697,7 +40702,7 @@ ia64-*-hpux*) | |
;; | |
*-*-irix6*) | |
# Find out which ABI we are using. | |
- echo '#line 40700 "configure"' > conftest.$ac_ext | |
+ echo '#line 40705 "configure"' > conftest.$ac_ext | |
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 | |
(eval $ac_compile) 2>&5 | |
ac_status=$? | |
@@ -42064,11 +42069,11 @@ else | |
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ | |
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ | |
-e 's:$: $lt_compiler_flag:'` | |
- (eval echo "\"\$as_me:42067: $lt_compile\"" >&5) | |
+ (eval echo "\"\$as_me:42072: $lt_compile\"" >&5) | |
(eval "$lt_compile" 2>conftest.err) | |
ac_status=$? | |
cat conftest.err >&5 | |
- echo "$as_me:42071: \$? = $ac_status" >&5 | |
+ echo "$as_me:42076: \$? = $ac_status" >&5 | |
if (exit $ac_status) && test -s "$ac_outfile"; then | |
# The compiler can only warn and ignore the option if not recognized | |
# So say no if there are warnings other than the usual output. | |
@@ -42403,11 +42408,11 @@ else | |
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ | |
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ | |
-e 's:$: $lt_compiler_flag:'` | |
- (eval echo "\"\$as_me:42406: $lt_compile\"" >&5) | |
+ (eval echo "\"\$as_me:42411: $lt_compile\"" >&5) | |
(eval "$lt_compile" 2>conftest.err) | |
ac_status=$? | |
cat conftest.err >&5 | |
- echo "$as_me:42410: \$? = $ac_status" >&5 | |
+ echo "$as_me:42415: \$? = $ac_status" >&5 | |
if (exit $ac_status) && test -s "$ac_outfile"; then | |
# The compiler can only warn and ignore the option if not recognized | |
# So say no if there are warnings other than the usual output. | |
@@ -42508,11 +42513,11 @@ else | |
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ | |
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ | |
-e 's:$: $lt_compiler_flag:'` | |
- (eval echo "\"\$as_me:42511: $lt_compile\"" >&5) | |
+ (eval echo "\"\$as_me:42516: $lt_compile\"" >&5) | |
(eval "$lt_compile" 2>out/conftest.err) | |
ac_status=$? | |
cat out/conftest.err >&5 | |
- echo "$as_me:42515: \$? = $ac_status" >&5 | |
+ echo "$as_me:42520: \$? = $ac_status" >&5 | |
if (exit $ac_status) && test -s out/conftest2.$ac_objext | |
then | |
# The compiler can only warn and ignore the option if not recognized | |
@@ -42563,11 +42568,11 @@ else | |
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ | |
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ | |
-e 's:$: $lt_compiler_flag:'` | |
- (eval echo "\"\$as_me:42566: $lt_compile\"" >&5) | |
+ (eval echo "\"\$as_me:42571: $lt_compile\"" >&5) | |
(eval "$lt_compile" 2>out/conftest.err) | |
ac_status=$? | |
cat out/conftest.err >&5 | |
- echo "$as_me:42570: \$? = $ac_status" >&5 | |
+ echo "$as_me:42575: \$? = $ac_status" >&5 | |
if (exit $ac_status) && test -s out/conftest2.$ac_objext | |
then | |
# The compiler can only warn and ignore the option if not recognized | |
@@ -45366,7 +45371,7 @@ else | |
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 | |
lt_status=$lt_dlunknown | |
cat > conftest.$ac_ext <<_LT_EOF | |
-#line 45369 "configure" | |
+#line 45374 "configure" | |
#include "confdefs.h" | |
#if HAVE_DLFCN_H | |
@@ -45462,7 +45467,7 @@ else | |
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 | |
lt_status=$lt_dlunknown | |
cat > conftest.$ac_ext <<_LT_EOF | |
-#line 45465 "configure" | |
+#line 45470 "configure" | |
#include "confdefs.h" | |
#if HAVE_DLFCN_H | |
@@ -55663,6 +55668,14 @@ else | |
fi | |
+# Check whether --with-storage-scst was given. | |
+if test "${with_storage_scst+set}" = set; then | |
+ withval=$with_storage_scst; | |
+else | |
+ with_storage_scst=check | |
+fi | |
+ | |
+ | |
# Check whether --with-storage-mpath was given. | |
if test "${with_storage_mpath+set}" = set; then | |
withval=$with_storage_mpath; | |
@@ -55686,6 +55699,7 @@ if test "$with_libvirtd" = "no"; then | |
with_storage_lvm=no | |
with_storage_iscsi=no | |
with_storage_scsi=no | |
+ with_storage_scst=no | |
with_storage_mpath=no | |
with_storage_disk=no | |
fi | |
@@ -56547,6 +56561,24 @@ else | |
fi | |
+if test "$with_storage_scst" = "check"; then | |
+ with_storage_scst=yes | |
+ | |
+ | |
+cat >>confdefs.h <<_ACEOF | |
+#define WITH_STORAGE_SCST 1 | |
+_ACEOF | |
+ | |
+fi | |
+ if test "$with_storage_scst" = "yes"; then | |
+ WITH_STORAGE_SCST_TRUE= | |
+ WITH_STORAGE_SCST_FALSE='#' | |
+else | |
+ WITH_STORAGE_SCST_TRUE='#' | |
+ WITH_STORAGE_SCST_FALSE= | |
+fi | |
+ | |
+ | |
if test "$with_storage_mpath" = "check"; then | |
with_storage_mpath=yes | |
@@ -61585,6 +61617,13 @@ $as_echo "$as_me: error: conditional \"WITH_STORAGE_SCSI\" was never defined. | |
Usually this means the macro was only invoked conditionally." >&2;} | |
{ (exit 1); exit 1; }; } | |
fi | |
+if test -z "${WITH_STORAGE_SCST_TRUE}" && test -z "${WITH_STORAGE_SCST_FALSE}"; then | |
+ { { $as_echo "$as_me:$LINENO: error: conditional \"WITH_STORAGE_SCST\" was never defined. | |
+Usually this means the macro was only invoked conditionally." >&5 | |
+$as_echo "$as_me: error: conditional \"WITH_STORAGE_SCST\" was never defined. | |
+Usually this means the macro was only invoked conditionally." >&2;} | |
+ { (exit 1); exit 1; }; } | |
+fi | |
if test -z "${WITH_STORAGE_MPATH_TRUE}" && test -z "${WITH_STORAGE_MPATH_FALSE}"; then | |
{ { $as_echo "$as_me:$LINENO: error: conditional \"WITH_STORAGE_MPATH\" was never defined. | |
Usually this means the macro was only invoked conditionally." >&5 | |
@@ -64190,6 +64229,8 @@ $as_echo "$as_me: LVM: $with_storage_lvm" >&6;} | |
$as_echo "$as_me: iSCSI: $with_storage_iscsi" >&6;} | |
{ $as_echo "$as_me:$LINENO: SCSI: $with_storage_scsi" >&5 | |
$as_echo "$as_me: SCSI: $with_storage_scsi" >&6;} | |
+{ $as_echo "$as_me:$LINENO: SCST: $with_storage_scst" >&5 | |
+$as_echo "$as_me: SCST: $with_storage_scst" >&6;} | |
{ $as_echo "$as_me:$LINENO: mpath: $with_storage_mpath" >&5 | |
$as_echo "$as_me: mpath: $with_storage_mpath" >&6;} | |
{ $as_echo "$as_me:$LINENO: Disk: $with_storage_disk" >&5 | |
diff --git a/configure.ac b/configure.ac | |
index f25e173..e71c4aa 100644 | |
--- a/configure.ac | |
+++ b/configure.ac | |
@@ -1341,6 +1341,8 @@ AC_ARG_WITH([storage-iscsi], | |
AC_HELP_STRING([--with-storage-iscsi], [with iSCSI backend for the storage driver @<:@default=check@:>@]),[],[with_storage_iscsi=check]) | |
AC_ARG_WITH([storage-scsi], | |
AC_HELP_STRING([--with-storage-scsi], [with SCSI backend for the storage driver @<:@default=check@:>@]),[],[with_storage_scsi=check]) | |
+AC_ARG_WITH([storage-scst], | |
+ AC_HELP_STRING([--with-storage-scst], [with SCST backend for the storage driver @<:@default=check@:>@]),[],[with_storage_scst=check]) | |
AC_ARG_WITH([storage-mpath], | |
AC_HELP_STRING([--with-storage-mpath], [with mpath backend for the storage driver @<:@default=check@:>@]),[],[with_storage_mpath=check]) | |
AC_ARG_WITH([storage-disk], | |
@@ -1353,6 +1355,7 @@ if test "$with_libvirtd" = "no"; then | |
with_storage_lvm=no | |
with_storage_iscsi=no | |
with_storage_scsi=no | |
+ with_storage_scst=no | |
with_storage_mpath=no | |
with_storage_disk=no | |
fi | |
@@ -1475,6 +1478,14 @@ if test "$with_storage_scsi" = "check"; then | |
fi | |
AM_CONDITIONAL([WITH_STORAGE_SCSI], [test "$with_storage_scsi" = "yes"]) | |
+if test "$with_storage_scst" = "check"; then | |
+ with_storage_scst=yes | |
+ | |
+ AC_DEFINE_UNQUOTED([WITH_STORAGE_SCST], 1, | |
+ [whether SCST backend for storage driver is enabled]) | |
+fi | |
+AM_CONDITIONAL([WITH_STORAGE_SCST], [test "$with_storage_scst" = "yes"]) | |
+ | |
if test "$with_storage_mpath" = "check"; then | |
with_storage_mpath=yes | |
@@ -2090,6 +2101,7 @@ AC_MSG_NOTICE([ NetFS: $with_storage_fs]) | |
AC_MSG_NOTICE([ LVM: $with_storage_lvm]) | |
AC_MSG_NOTICE([ iSCSI: $with_storage_iscsi]) | |
AC_MSG_NOTICE([ SCSI: $with_storage_scsi]) | |
+AC_MSG_NOTICE([ SCST: $with_storage_scst]) | |
AC_MSG_NOTICE([ mpath: $with_storage_mpath]) | |
AC_MSG_NOTICE([ Disk: $with_storage_disk]) | |
AC_MSG_NOTICE([]) | |
diff --git a/libvirt.pc b/libvirt.pc | |
index 409b562..0423b26 100644 | |
--- a/libvirt.pc | |
+++ b/libvirt.pc | |
@@ -7,5 +7,5 @@ Name: libvirt | |
Version: 0.8.1 | |
Description: libvirt library | |
Requires: | |
-Libs: -L${libdir} -lvirt -ldl -lpthread | |
+Libs: -L${libdir} -lvirt -lpthread | |
Cflags: -I${includedir} | |
diff --git a/src/Makefile.am b/src/Makefile.am | |
index 7763ef4..210497a 100644 | |
--- a/src/Makefile.am | |
+++ b/src/Makefile.am | |
@@ -299,6 +299,9 @@ STORAGE_DRIVER_ISCSI_SOURCES = \ | |
STORAGE_DRIVER_SCSI_SOURCES = \ | |
storage/storage_backend_scsi.h storage/storage_backend_scsi.c | |
+STORAGE_DRIVER_SCST_SOURCES = \ | |
+ storage/storage_backend_scst.h storage/storage_backend_scst.c | |
+ | |
STORAGE_DRIVER_MPATH_SOURCES = \ | |
storage/storage_backend_mpath.h storage/storage_backend_mpath.c | |
@@ -724,6 +727,10 @@ if WITH_STORAGE_SCSI | |
libvirt_driver_storage_la_SOURCES += $(STORAGE_DRIVER_SCSI_SOURCES) | |
endif | |
+if WITH_STORAGE_SCST | |
+libvirt_driver_storage_la_SOURCES += $(STORAGE_DRIVER_SCST_SOURCES) | |
+endif | |
+ | |
if WITH_STORAGE_MPATH | |
libvirt_driver_storage_la_SOURCES += $(STORAGE_DRIVER_MPATH_SOURCES) | |
libvirt_driver_storage_la_CFLAGS += $(DEVMAPPER_CFLAGS) | |
@@ -821,6 +828,7 @@ EXTRA_DIST += \ | |
$(STORAGE_DRIVER_LVM_SOURCES) \ | |
$(STORAGE_DRIVER_ISCSI_SOURCES) \ | |
$(STORAGE_DRIVER_SCSI_SOURCES) \ | |
+ $(STORAGE_DRIVER_SCST_SOURCES) \ | |
$(STORAGE_DRIVER_MPATH_SOURCES) \ | |
$(STORAGE_DRIVER_DISK_SOURCES) \ | |
$(NODE_DEVICE_DRIVER_SOURCES) \ | |
diff --git a/src/Makefile.in b/src/Makefile.in | |
index 490608a..ac2e37d 100644 | |
--- a/src/Makefile.in | |
+++ b/src/Makefile.in | |
@@ -101,31 +101,32 @@ host_triplet = @host@ | |
@WITH_STORAGE_LVM_TRUE@am__append_59 = $(STORAGE_DRIVER_LVM_SOURCES) | |
@WITH_STORAGE_ISCSI_TRUE@am__append_60 = $(STORAGE_DRIVER_ISCSI_SOURCES) | |
@WITH_STORAGE_SCSI_TRUE@am__append_61 = $(STORAGE_DRIVER_SCSI_SOURCES) | |
-@WITH_STORAGE_MPATH_TRUE@am__append_62 = $(STORAGE_DRIVER_MPATH_SOURCES) | |
-@WITH_STORAGE_MPATH_TRUE@am__append_63 = $(DEVMAPPER_CFLAGS) | |
-@WITH_STORAGE_MPATH_TRUE@am__append_64 = $(DEVMAPPER_LIBS) | |
-@WITH_STORAGE_DISK_TRUE@am__append_65 = $(STORAGE_DRIVER_DISK_SOURCES) | |
+@WITH_STORAGE_SCST_TRUE@am__append_62 = $(STORAGE_DRIVER_SCST_SOURCES) | |
+@WITH_STORAGE_MPATH_TRUE@am__append_63 = $(STORAGE_DRIVER_MPATH_SOURCES) | |
+@WITH_STORAGE_MPATH_TRUE@am__append_64 = $(DEVMAPPER_CFLAGS) | |
+@WITH_STORAGE_MPATH_TRUE@am__append_65 = $(DEVMAPPER_LIBS) | |
+@WITH_STORAGE_DISK_TRUE@am__append_66 = $(STORAGE_DRIVER_DISK_SOURCES) | |
# Needed to keep automake quiet about conditionals | |
-@WITH_DRIVER_MODULES_TRUE@@WITH_NODE_DEVICES_TRUE@am__append_66 = libvirt_driver_nodedev.la | |
-@WITH_DRIVER_MODULES_FALSE@@WITH_NODE_DEVICES_TRUE@am__append_67 = libvirt_driver_nodedev.la | |
-@HAVE_HAL_TRUE@@WITH_NODE_DEVICES_TRUE@am__append_68 = $(NODE_DEVICE_DRIVER_HAL_SOURCES) | |
-@HAVE_HAL_TRUE@@WITH_NODE_DEVICES_TRUE@am__append_69 = $(HAL_CFLAGS) | |
-@HAVE_HAL_TRUE@@WITH_NODE_DEVICES_TRUE@am__append_70 = $(HAL_LIBS) | |
-@HAVE_UDEV_TRUE@@WITH_NODE_DEVICES_TRUE@am__append_71 = $(NODE_DEVICE_DRIVER_UDEV_SOURCES) | |
-@HAVE_UDEV_TRUE@@WITH_NODE_DEVICES_TRUE@am__append_72 = $(UDEV_CFLAGS) $(PCIACCESS_CFLAGS) | |
-@HAVE_UDEV_TRUE@@WITH_NODE_DEVICES_TRUE@am__append_73 = $(UDEV_LIBS) $(PCIACCESS_LIBS) | |
-@WITH_DRIVER_MODULES_TRUE@@WITH_NODE_DEVICES_TRUE@am__append_74 = -module -avoid-version | |
-@WITH_DRIVER_MODULES_TRUE@@WITH_NWFILTER_TRUE@am__append_75 = libvirt_driver_nwfilter.la | |
-@WITH_DRIVER_MODULES_FALSE@@WITH_NWFILTER_TRUE@am__append_76 = libvirt_driver_nwfilter.la | |
+@WITH_DRIVER_MODULES_TRUE@@WITH_NODE_DEVICES_TRUE@am__append_67 = libvirt_driver_nodedev.la | |
+@WITH_DRIVER_MODULES_FALSE@@WITH_NODE_DEVICES_TRUE@am__append_68 = libvirt_driver_nodedev.la | |
+@HAVE_HAL_TRUE@@WITH_NODE_DEVICES_TRUE@am__append_69 = $(NODE_DEVICE_DRIVER_HAL_SOURCES) | |
+@HAVE_HAL_TRUE@@WITH_NODE_DEVICES_TRUE@am__append_70 = $(HAL_CFLAGS) | |
+@HAVE_HAL_TRUE@@WITH_NODE_DEVICES_TRUE@am__append_71 = $(HAL_LIBS) | |
+@HAVE_UDEV_TRUE@@WITH_NODE_DEVICES_TRUE@am__append_72 = $(NODE_DEVICE_DRIVER_UDEV_SOURCES) | |
+@HAVE_UDEV_TRUE@@WITH_NODE_DEVICES_TRUE@am__append_73 = $(UDEV_CFLAGS) $(PCIACCESS_CFLAGS) | |
+@HAVE_UDEV_TRUE@@WITH_NODE_DEVICES_TRUE@am__append_74 = $(UDEV_LIBS) $(PCIACCESS_LIBS) | |
+@WITH_DRIVER_MODULES_TRUE@@WITH_NODE_DEVICES_TRUE@am__append_75 = -module -avoid-version | |
+@WITH_DRIVER_MODULES_TRUE@@WITH_NWFILTER_TRUE@am__append_76 = libvirt_driver_nwfilter.la | |
@WITH_DRIVER_MODULES_FALSE@@WITH_NWFILTER_TRUE@am__append_77 = libvirt_driver_nwfilter.la | |
-@WITH_DRIVER_MODULES_TRUE@@WITH_NWFILTER_TRUE@am__append_78 = -module -avoid-version ../gnulib/lib/libgnu.la | |
-@WITH_SECDRIVER_SELINUX_TRUE@am__append_79 = $(SECURITY_DRIVER_SELINUX_SOURCES) | |
-@WITH_SECDRIVER_SELINUX_TRUE@am__append_80 = $(SELINUX_CFLAGS) | |
-@WITH_SECDRIVER_SELINUX_TRUE@am__append_81 = $(SELINUX_LIBS) | |
-@WITH_SECDRIVER_APPARMOR_TRUE@am__append_82 = $(SECURITY_DRIVER_APPARMOR_SOURCES) | |
-@WITH_SECDRIVER_APPARMOR_TRUE@am__append_83 = $(APPARMOR_CFLAGS) | |
-@WITH_SECDRIVER_APPARMOR_TRUE@am__append_84 = $(APPARMOR_LIBS) | |
+@WITH_DRIVER_MODULES_FALSE@@WITH_NWFILTER_TRUE@am__append_78 = libvirt_driver_nwfilter.la | |
+@WITH_DRIVER_MODULES_TRUE@@WITH_NWFILTER_TRUE@am__append_79 = -module -avoid-version ../gnulib/lib/libgnu.la | |
+@WITH_SECDRIVER_SELINUX_TRUE@am__append_80 = $(SECURITY_DRIVER_SELINUX_SOURCES) | |
+@WITH_SECDRIVER_SELINUX_TRUE@am__append_81 = $(SELINUX_CFLAGS) | |
+@WITH_SECDRIVER_SELINUX_TRUE@am__append_82 = $(SELINUX_LIBS) | |
+@WITH_SECDRIVER_APPARMOR_TRUE@am__append_83 = $(SECURITY_DRIVER_APPARMOR_SOURCES) | |
+@WITH_SECDRIVER_APPARMOR_TRUE@am__append_84 = $(APPARMOR_CFLAGS) | |
+@WITH_SECDRIVER_APPARMOR_TRUE@am__append_85 = $(APPARMOR_LIBS) | |
# | |
# Build our version script. This is composed of three parts: | |
@@ -145,16 +146,16 @@ host_triplet = @host@ | |
# except that build options (such as --enable-debug) can mean these | |
# symbols aren't present at all. | |
# | |
-@WITH_DRIVER_MODULES_TRUE@am__append_85 = libvirt_driver_modules.syms | |
-@WITH_BRIDGE_TRUE@am__append_86 = libvirt_bridge.syms | |
-@WITH_LINUX_TRUE@am__append_87 = libvirt_linux.syms | |
-@WITH_MACVTAP_TRUE@am__append_88 = libvirt_macvtap.syms | |
-@WITH_LIBVIRTD_TRUE@am__append_89 = libvirt_daemon.syms | |
-@WITH_NWFILTER_TRUE@am__append_90 = libvirt_nwfilter.syms | |
+@WITH_DRIVER_MODULES_TRUE@am__append_86 = libvirt_driver_modules.syms | |
+@WITH_BRIDGE_TRUE@am__append_87 = libvirt_bridge.syms | |
+@WITH_LINUX_TRUE@am__append_88 = libvirt_linux.syms | |
+@WITH_MACVTAP_TRUE@am__append_89 = libvirt_macvtap.syms | |
+@WITH_LIBVIRTD_TRUE@am__append_90 = libvirt_daemon.syms | |
+@WITH_NWFILTER_TRUE@am__append_91 = libvirt_nwfilter.syms | |
libexec_PROGRAMS = $(am__EXEEXT_1) $(am__EXEEXT_2) $(am__EXEEXT_3) | |
-@WITH_LIBVIRTD_TRUE@@WITH_STORAGE_DISK_TRUE@am__append_91 = libvirt_parthelper | |
-@WITH_LIBVIRTD_TRUE@@WITH_LXC_TRUE@am__append_92 = libvirt_lxc | |
-@WITH_LIBVIRTD_TRUE@@WITH_SECDRIVER_APPARMOR_TRUE@am__append_93 = virt-aa-helper | |
+@WITH_LIBVIRTD_TRUE@@WITH_STORAGE_DISK_TRUE@am__append_92 = libvirt_parthelper | |
+@WITH_LIBVIRTD_TRUE@@WITH_LXC_TRUE@am__append_93 = libvirt_lxc | |
+@WITH_LIBVIRTD_TRUE@@WITH_SECDRIVER_APPARMOR_TRUE@am__append_94 = virt-aa-helper | |
subdir = src | |
DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in | |
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 | |
@@ -614,7 +615,8 @@ am__libvirt_driver_storage_la_SOURCES_DIST = storage/storage_driver.h \ | |
storage/storage_backend_logical.c \ | |
storage/storage_backend_iscsi.h \ | |
storage/storage_backend_iscsi.c storage/storage_backend_scsi.h \ | |
- storage/storage_backend_scsi.c storage/storage_backend_mpath.h \ | |
+ storage/storage_backend_scsi.c storage/storage_backend_scst.h \ | |
+ storage/storage_backend_scst.c storage/storage_backend_mpath.h \ | |
storage/storage_backend_mpath.c storage/storage_backend_disk.h \ | |
storage/storage_backend_disk.c | |
am__objects_37 = libvirt_driver_storage_la-storage_driver.lo \ | |
@@ -628,13 +630,15 @@ am__objects_42 = libvirt_driver_storage_la-storage_backend_iscsi.lo | |
@WITH_STORAGE_ISCSI_TRUE@am__objects_43 = $(am__objects_42) | |
am__objects_44 = libvirt_driver_storage_la-storage_backend_scsi.lo | |
@WITH_STORAGE_SCSI_TRUE@am__objects_45 = $(am__objects_44) | |
-am__objects_46 = libvirt_driver_storage_la-storage_backend_mpath.lo | |
-@WITH_STORAGE_MPATH_TRUE@am__objects_47 = $(am__objects_46) | |
-am__objects_48 = libvirt_driver_storage_la-storage_backend_disk.lo | |
-@WITH_STORAGE_DISK_TRUE@am__objects_49 = $(am__objects_48) | |
+am__objects_46 = libvirt_driver_storage_la-storage_backend_scst.lo | |
+@WITH_STORAGE_SCST_TRUE@am__objects_47 = $(am__objects_46) | |
+am__objects_48 = libvirt_driver_storage_la-storage_backend_mpath.lo | |
+@WITH_STORAGE_MPATH_TRUE@am__objects_49 = $(am__objects_48) | |
+am__objects_50 = libvirt_driver_storage_la-storage_backend_disk.lo | |
+@WITH_STORAGE_DISK_TRUE@am__objects_51 = $(am__objects_50) | |
am_libvirt_driver_storage_la_OBJECTS = $(am__objects_39) \ | |
$(am__objects_41) $(am__objects_43) $(am__objects_45) \ | |
- $(am__objects_47) $(am__objects_49) | |
+ $(am__objects_47) $(am__objects_49) $(am__objects_51) | |
libvirt_driver_storage_la_OBJECTS = \ | |
$(am_libvirt_driver_storage_la_OBJECTS) | |
libvirt_driver_storage_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ | |
@@ -648,8 +652,8 @@ libvirt_driver_storage_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ | |
libvirt_driver_test_la_LIBADD = | |
am__libvirt_driver_test_la_SOURCES_DIST = test/test_driver.c \ | |
test/test_driver.h | |
-am__objects_50 = libvirt_driver_test_la-test_driver.lo | |
-@WITH_TEST_TRUE@am_libvirt_driver_test_la_OBJECTS = $(am__objects_50) | |
+am__objects_52 = libvirt_driver_test_la-test_driver.lo | |
+@WITH_TEST_TRUE@am_libvirt_driver_test_la_OBJECTS = $(am__objects_52) | |
libvirt_driver_test_la_OBJECTS = $(am_libvirt_driver_test_la_OBJECTS) | |
libvirt_driver_test_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ | |
$(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ | |
@@ -661,9 +665,9 @@ libvirt_driver_test_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ | |
libvirt_driver_uml_la_LIBADD = | |
am__libvirt_driver_uml_la_SOURCES_DIST = uml/uml_conf.c uml/uml_conf.h \ | |
uml/uml_driver.c uml/uml_driver.h | |
-am__objects_51 = libvirt_driver_uml_la-uml_conf.lo \ | |
+am__objects_53 = libvirt_driver_uml_la-uml_conf.lo \ | |
libvirt_driver_uml_la-uml_driver.lo | |
-@WITH_UML_TRUE@am_libvirt_driver_uml_la_OBJECTS = $(am__objects_51) | |
+@WITH_UML_TRUE@am_libvirt_driver_uml_la_OBJECTS = $(am__objects_53) | |
libvirt_driver_uml_la_OBJECTS = $(am_libvirt_driver_uml_la_OBJECTS) | |
libvirt_driver_uml_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ | |
$(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ | |
@@ -678,12 +682,12 @@ am__libvirt_driver_vbox_la_SOURCES_DIST = vbox/vbox_XPCOMCGlue.c \ | |
vbox/vbox_XPCOMCGlue.h vbox/vbox_driver.c vbox/vbox_driver.h \ | |
vbox/vbox_V2_2.c vbox/vbox_CAPI_v2_2.h vbox/vbox_V3_0.c \ | |
vbox/vbox_CAPI_v3_0.h vbox/vbox_V3_1.c vbox/vbox_CAPI_v3_1.h | |
-am__objects_52 = libvirt_driver_vbox_la-vbox_XPCOMCGlue.lo \ | |
+am__objects_54 = libvirt_driver_vbox_la-vbox_XPCOMCGlue.lo \ | |
libvirt_driver_vbox_la-vbox_driver.lo \ | |
libvirt_driver_vbox_la-vbox_V2_2.lo \ | |
libvirt_driver_vbox_la-vbox_V3_0.lo \ | |
libvirt_driver_vbox_la-vbox_V3_1.lo | |
-@WITH_VBOX_TRUE@am_libvirt_driver_vbox_la_OBJECTS = $(am__objects_52) | |
+@WITH_VBOX_TRUE@am_libvirt_driver_vbox_la_OBJECTS = $(am__objects_54) | |
libvirt_driver_vbox_la_OBJECTS = $(am_libvirt_driver_vbox_la_OBJECTS) | |
libvirt_driver_vbox_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ | |
$(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ | |
@@ -700,17 +704,17 @@ am__libvirt_driver_xen_la_SOURCES_DIST = xen/proxy_internal.c \ | |
xen/xend_internal.h xen/xm_internal.c xen/xm_internal.h \ | |
xen/xs_internal.c xen/xs_internal.h xen/xen_inotify.c \ | |
xen/xen_inotify.h | |
-@WITH_XEN_INOTIFY_TRUE@am__objects_53 = \ | |
+@WITH_XEN_INOTIFY_TRUE@am__objects_55 = \ | |
@WITH_XEN_INOTIFY_TRUE@ libvirt_driver_xen_la-xen_inotify.lo | |
-am__objects_54 = libvirt_driver_xen_la-proxy_internal.lo \ | |
+am__objects_56 = libvirt_driver_xen_la-proxy_internal.lo \ | |
libvirt_driver_xen_la-sexpr.lo \ | |
libvirt_driver_xen_la-block_stats.lo \ | |
libvirt_driver_xen_la-xen_hypervisor.lo \ | |
libvirt_driver_xen_la-xen_driver.lo \ | |
libvirt_driver_xen_la-xend_internal.lo \ | |
libvirt_driver_xen_la-xm_internal.lo \ | |
- libvirt_driver_xen_la-xs_internal.lo $(am__objects_53) | |
-@WITH_XEN_TRUE@am_libvirt_driver_xen_la_OBJECTS = $(am__objects_54) | |
+ libvirt_driver_xen_la-xs_internal.lo $(am__objects_55) | |
+@WITH_XEN_TRUE@am_libvirt_driver_xen_la_OBJECTS = $(am__objects_56) | |
libvirt_driver_xen_la_OBJECTS = $(am_libvirt_driver_xen_la_OBJECTS) | |
libvirt_driver_xen_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ | |
$(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ | |
@@ -723,10 +727,10 @@ libvirt_driver_xenapi_la_LIBADD = | |
am__libvirt_driver_xenapi_la_SOURCES_DIST = xenapi/xenapi_driver.c \ | |
xenapi/xenapi_driver.h xenapi/xenapi_driver_private.h \ | |
xenapi/xenapi_utils.c xenapi/xenapi_utils.h | |
-am__objects_55 = libvirt_driver_xenapi_la-xenapi_driver.lo \ | |
+am__objects_57 = libvirt_driver_xenapi_la-xenapi_driver.lo \ | |
libvirt_driver_xenapi_la-xenapi_utils.lo | |
@WITH_XENAPI_TRUE@am_libvirt_driver_xenapi_la_OBJECTS = \ | |
-@WITH_XENAPI_TRUE@ $(am__objects_55) | |
+@WITH_XENAPI_TRUE@ $(am__objects_57) | |
libvirt_driver_xenapi_la_OBJECTS = \ | |
$(am_libvirt_driver_xenapi_la_OBJECTS) | |
libvirt_driver_xenapi_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ | |
@@ -740,33 +744,33 @@ am__DEPENDENCIES_2 = libvirt_util.la libvirt_conf.la libvirt_cpu.la \ | |
libvirt_driver.la $(am__append_4) $(am__append_7) \ | |
$(am__append_11) $(am__append_15) $(am__append_18) \ | |
$(am__append_21) $(am__append_24) $(am__append_45) \ | |
- $(am__append_51) $(am__append_76) libvirt_driver_security.la \ | |
+ $(am__append_51) $(am__append_77) libvirt_driver_security.la \ | |
$(am__DEPENDENCIES_1) ../gnulib/lib/libgnu.la | |
libvirt_test_la_DEPENDENCIES = $(am__DEPENDENCIES_2) | |
-am__objects_56 = | |
-am_libvirt_test_la_OBJECTS = $(am__objects_56) | |
+am__objects_58 = | |
+am_libvirt_test_la_OBJECTS = $(am__objects_58) | |
libvirt_test_la_OBJECTS = $(am_libvirt_test_la_OBJECTS) | |
libvirt_test_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ | |
$(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ | |
$(libvirt_test_la_CFLAGS) $(CFLAGS) $(libvirt_test_la_LDFLAGS) \ | |
$(LDFLAGS) -o $@ | |
libvirt_util_la_LIBADD = | |
-am__objects_57 = libvirt_util_la-authhelper.lo \ | |
- libvirt_util_la-bridge.lo libvirt_util_la-buf.lo \ | |
- libvirt_util_la-conf.lo libvirt_util_la-cgroup.lo \ | |
- libvirt_util_la-event.lo libvirt_util_la-hash.lo \ | |
- libvirt_util_la-hooks.lo libvirt_util_la-iptables.lo \ | |
- libvirt_util_la-ebtables.lo libvirt_util_la-dnsmasq.lo \ | |
- libvirt_util_la-json.lo libvirt_util_la-logging.lo \ | |
- libvirt_util_la-macvtap.lo libvirt_util_la-memory.lo \ | |
- libvirt_util_la-pci.lo libvirt_util_la-processinfo.lo \ | |
- libvirt_util_la-hostusb.lo libvirt_util_la-network.lo \ | |
- libvirt_util_la-interface.lo libvirt_util_la-qparams.lo \ | |
- libvirt_util_la-stats_linux.lo libvirt_util_la-storage_file.lo \ | |
- libvirt_util_la-threads.lo libvirt_util_la-uuid.lo \ | |
- libvirt_util_la-util.lo libvirt_util_la-xml.lo \ | |
- libvirt_util_la-virterror.lo | |
-am_libvirt_util_la_OBJECTS = $(am__objects_57) | |
+am__objects_59 = libvirt_util_la-authhelper.lo \ | |
+ libvirt_util_la-bitmap.lo libvirt_util_la-bridge.lo \ | |
+ libvirt_util_la-buf.lo libvirt_util_la-conf.lo \ | |
+ libvirt_util_la-cgroup.lo libvirt_util_la-event.lo \ | |
+ libvirt_util_la-hash.lo libvirt_util_la-hooks.lo \ | |
+ libvirt_util_la-iptables.lo libvirt_util_la-ebtables.lo \ | |
+ libvirt_util_la-dnsmasq.lo libvirt_util_la-json.lo \ | |
+ libvirt_util_la-logging.lo libvirt_util_la-macvtap.lo \ | |
+ libvirt_util_la-memory.lo libvirt_util_la-pci.lo \ | |
+ libvirt_util_la-processinfo.lo libvirt_util_la-hostusb.lo \ | |
+ libvirt_util_la-network.lo libvirt_util_la-interface.lo \ | |
+ libvirt_util_la-qparams.lo libvirt_util_la-stats_linux.lo \ | |
+ libvirt_util_la-storage_file.lo libvirt_util_la-threads.lo \ | |
+ libvirt_util_la-uuid.lo libvirt_util_la-util.lo \ | |
+ libvirt_util_la-xml.lo libvirt_util_la-virterror.lo | |
+am_libvirt_util_la_OBJECTS = $(am__objects_59) | |
libvirt_util_la_OBJECTS = $(am_libvirt_util_la_OBJECTS) | |
libvirt_util_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ | |
$(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ | |
@@ -780,39 +784,41 @@ PROGRAMS = $(libexec_PROGRAMS) | |
am__libvirt_lxc_SOURCES_DIST = lxc/lxc_conf.c lxc/lxc_conf.h \ | |
lxc/lxc_container.c lxc/lxc_container.h lxc/lxc_controller.c \ | |
lxc/veth.c lxc/veth.h util/authhelper.c util/authhelper.h \ | |
- util/bridge.c util/bridge.h util/buf.c util/buf.h util/conf.c \ | |
- util/conf.h util/cgroup.c util/cgroup.h util/event.c \ | |
- util/event.h util/hash.c util/hash.h util/hooks.c util/hooks.h \ | |
- util/iptables.c util/iptables.h util/ebtables.c \ | |
- util/ebtables.h util/dnsmasq.c util/dnsmasq.h util/json.c \ | |
- util/json.h util/logging.c util/logging.h util/macvtap.c \ | |
- util/macvtap.h util/memory.c util/memory.h util/pci.c \ | |
- util/pci.h util/processinfo.c util/processinfo.h \ | |
- util/hostusb.c util/hostusb.h util/network.c util/network.h \ | |
- util/interface.c util/interface.h util/qparams.c \ | |
- util/qparams.h util/stats_linux.c util/stats_linux.h \ | |
- util/storage_file.c util/storage_file.h util/threads.c \ | |
- util/threads.h util/threads-pthread.h util/threads-win32.h \ | |
- util/uuid.c util/uuid.h util/util.c util/util.h util/xml.c \ | |
- util/xml.h util/virterror.c util/virterror_internal.h \ | |
- nodeinfo.h nodeinfo.c conf/storage_encryption_conf.c \ | |
+ util/bitmap.c util/bitmap.h util/bridge.c util/bridge.h \ | |
+ util/buf.c util/buf.h util/conf.c util/conf.h util/cgroup.c \ | |
+ util/cgroup.h util/event.c util/event.h util/hash.c \ | |
+ util/hash.h util/hooks.c util/hooks.h util/iptables.c \ | |
+ util/iptables.h util/ebtables.c util/ebtables.h util/dnsmasq.c \ | |
+ util/dnsmasq.h util/json.c util/json.h util/logging.c \ | |
+ util/logging.h util/macvtap.c util/macvtap.h util/memory.c \ | |
+ util/memory.h util/pci.c util/pci.h util/processinfo.c \ | |
+ util/processinfo.h util/hostusb.c util/hostusb.h \ | |
+ util/network.c util/network.h util/interface.c \ | |
+ util/interface.h util/qparams.c util/qparams.h \ | |
+ util/stats_linux.c util/stats_linux.h util/storage_file.c \ | |
+ util/storage_file.h util/threads.c util/threads.h \ | |
+ util/threads-pthread.h util/threads-win32.h util/uuid.c \ | |
+ util/uuid.h util/util.c util/util.h util/xml.c util/xml.h \ | |
+ util/virterror.c util/virterror_internal.h nodeinfo.h \ | |
+ nodeinfo.c conf/storage_encryption_conf.c \ | |
conf/storage_encryption_conf.h conf/capabilities.c \ | |
conf/capabilities.h conf/domain_conf.c conf/domain_conf.h \ | |
conf/cpu_conf.c conf/cpu_conf.h conf/nwfilter_params.c \ | |
conf/nwfilter_params.h conf/nwfilter_conf.h | |
-am__objects_58 = libvirt_lxc-lxc_conf.$(OBJEXT) \ | |
+am__objects_60 = libvirt_lxc-lxc_conf.$(OBJEXT) \ | |
libvirt_lxc-lxc_container.$(OBJEXT) \ | |
libvirt_lxc-lxc_controller.$(OBJEXT) \ | |
libvirt_lxc-veth.$(OBJEXT) | |
-am__objects_59 = libvirt_lxc-authhelper.$(OBJEXT) \ | |
- libvirt_lxc-bridge.$(OBJEXT) libvirt_lxc-buf.$(OBJEXT) \ | |
- libvirt_lxc-conf.$(OBJEXT) libvirt_lxc-cgroup.$(OBJEXT) \ | |
- libvirt_lxc-event.$(OBJEXT) libvirt_lxc-hash.$(OBJEXT) \ | |
- libvirt_lxc-hooks.$(OBJEXT) libvirt_lxc-iptables.$(OBJEXT) \ | |
- libvirt_lxc-ebtables.$(OBJEXT) libvirt_lxc-dnsmasq.$(OBJEXT) \ | |
- libvirt_lxc-json.$(OBJEXT) libvirt_lxc-logging.$(OBJEXT) \ | |
- libvirt_lxc-macvtap.$(OBJEXT) libvirt_lxc-memory.$(OBJEXT) \ | |
- libvirt_lxc-pci.$(OBJEXT) libvirt_lxc-processinfo.$(OBJEXT) \ | |
+am__objects_61 = libvirt_lxc-authhelper.$(OBJEXT) \ | |
+ libvirt_lxc-bitmap.$(OBJEXT) libvirt_lxc-bridge.$(OBJEXT) \ | |
+ libvirt_lxc-buf.$(OBJEXT) libvirt_lxc-conf.$(OBJEXT) \ | |
+ libvirt_lxc-cgroup.$(OBJEXT) libvirt_lxc-event.$(OBJEXT) \ | |
+ libvirt_lxc-hash.$(OBJEXT) libvirt_lxc-hooks.$(OBJEXT) \ | |
+ libvirt_lxc-iptables.$(OBJEXT) libvirt_lxc-ebtables.$(OBJEXT) \ | |
+ libvirt_lxc-dnsmasq.$(OBJEXT) libvirt_lxc-json.$(OBJEXT) \ | |
+ libvirt_lxc-logging.$(OBJEXT) libvirt_lxc-macvtap.$(OBJEXT) \ | |
+ libvirt_lxc-memory.$(OBJEXT) libvirt_lxc-pci.$(OBJEXT) \ | |
+ libvirt_lxc-processinfo.$(OBJEXT) \ | |
libvirt_lxc-hostusb.$(OBJEXT) libvirt_lxc-network.$(OBJEXT) \ | |
libvirt_lxc-interface.$(OBJEXT) libvirt_lxc-qparams.$(OBJEXT) \ | |
libvirt_lxc-stats_linux.$(OBJEXT) \ | |
@@ -820,20 +826,20 @@ am__objects_59 = libvirt_lxc-authhelper.$(OBJEXT) \ | |
libvirt_lxc-threads.$(OBJEXT) libvirt_lxc-uuid.$(OBJEXT) \ | |
libvirt_lxc-util.$(OBJEXT) libvirt_lxc-xml.$(OBJEXT) \ | |
libvirt_lxc-virterror.$(OBJEXT) | |
-am__objects_60 = libvirt_lxc-nodeinfo.$(OBJEXT) | |
-am__objects_61 = libvirt_lxc-storage_encryption_conf.$(OBJEXT) | |
-am__objects_62 = libvirt_lxc-capabilities.$(OBJEXT) \ | |
+am__objects_62 = libvirt_lxc-nodeinfo.$(OBJEXT) | |
+am__objects_63 = libvirt_lxc-storage_encryption_conf.$(OBJEXT) | |
+am__objects_64 = libvirt_lxc-capabilities.$(OBJEXT) \ | |
libvirt_lxc-domain_conf.$(OBJEXT) | |
-am__objects_63 = libvirt_lxc-cpu_conf.$(OBJEXT) | |
-am__objects_64 = libvirt_lxc-nwfilter_params.$(OBJEXT) | |
+am__objects_65 = libvirt_lxc-cpu_conf.$(OBJEXT) | |
+am__objects_66 = libvirt_lxc-nwfilter_params.$(OBJEXT) | |
@WITH_LIBVIRTD_TRUE@@WITH_LXC_TRUE@am_libvirt_lxc_OBJECTS = \ | |
-@WITH_LIBVIRTD_TRUE@@WITH_LXC_TRUE@ $(am__objects_58) \ | |
-@WITH_LIBVIRTD_TRUE@@WITH_LXC_TRUE@ $(am__objects_59) \ | |
@WITH_LIBVIRTD_TRUE@@WITH_LXC_TRUE@ $(am__objects_60) \ | |
@WITH_LIBVIRTD_TRUE@@WITH_LXC_TRUE@ $(am__objects_61) \ | |
@WITH_LIBVIRTD_TRUE@@WITH_LXC_TRUE@ $(am__objects_62) \ | |
@WITH_LIBVIRTD_TRUE@@WITH_LXC_TRUE@ $(am__objects_63) \ | |
-@WITH_LIBVIRTD_TRUE@@WITH_LXC_TRUE@ $(am__objects_64) | |
+@WITH_LIBVIRTD_TRUE@@WITH_LXC_TRUE@ $(am__objects_64) \ | |
+@WITH_LIBVIRTD_TRUE@@WITH_LXC_TRUE@ $(am__objects_65) \ | |
+@WITH_LIBVIRTD_TRUE@@WITH_LXC_TRUE@ $(am__objects_66) | |
libvirt_lxc_OBJECTS = $(am_libvirt_lxc_OBJECTS) | |
@WITH_LIBVIRTD_TRUE@@WITH_LXC_TRUE@libvirt_lxc_DEPENDENCIES = \ | |
@WITH_LIBVIRTD_TRUE@@WITH_LXC_TRUE@ $(am__DEPENDENCIES_1) \ | |
@@ -843,9 +849,9 @@ libvirt_lxc_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ | |
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(libvirt_lxc_CFLAGS) \ | |
$(CFLAGS) $(libvirt_lxc_LDFLAGS) $(LDFLAGS) -o $@ | |
am__libvirt_parthelper_SOURCES_DIST = storage/parthelper.c | |
-am__objects_65 = libvirt_parthelper-parthelper.$(OBJEXT) | |
+am__objects_67 = libvirt_parthelper-parthelper.$(OBJEXT) | |
@WITH_LIBVIRTD_TRUE@@WITH_STORAGE_DISK_TRUE@am_libvirt_parthelper_OBJECTS = \ | |
-@WITH_LIBVIRTD_TRUE@@WITH_STORAGE_DISK_TRUE@ $(am__objects_65) | |
+@WITH_LIBVIRTD_TRUE@@WITH_STORAGE_DISK_TRUE@ $(am__objects_67) | |
libvirt_parthelper_OBJECTS = $(am_libvirt_parthelper_OBJECTS) | |
@WITH_LIBVIRTD_TRUE@@WITH_STORAGE_DISK_TRUE@libvirt_parthelper_DEPENDENCIES = $(am__DEPENDENCIES_1) | |
libvirt_parthelper_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ | |
@@ -853,8 +859,8 @@ libvirt_parthelper_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ | |
$(libvirt_parthelper_CFLAGS) $(CFLAGS) \ | |
$(libvirt_parthelper_LDFLAGS) $(LDFLAGS) -o $@ | |
am__virt_aa_helper_SOURCES_DIST = security/virt-aa-helper.c | |
-am__objects_66 = virt_aa_helper-virt-aa-helper.$(OBJEXT) | |
-@WITH_LIBVIRTD_TRUE@@WITH_SECDRIVER_APPARMOR_TRUE@am_virt_aa_helper_OBJECTS = $(am__objects_66) | |
+am__objects_68 = virt_aa_helper-virt-aa-helper.$(OBJEXT) | |
+@WITH_LIBVIRTD_TRUE@@WITH_SECDRIVER_APPARMOR_TRUE@am_virt_aa_helper_OBJECTS = $(am__objects_68) | |
virt_aa_helper_OBJECTS = $(am_virt_aa_helper_OBJECTS) | |
@WITH_LIBVIRTD_TRUE@@WITH_SECDRIVER_APPARMOR_TRUE@virt_aa_helper_DEPENDENCIES = $(am__DEPENDENCIES_1) \ | |
@WITH_LIBVIRTD_TRUE@@WITH_SECDRIVER_APPARMOR_TRUE@ $(am__DEPENDENCIES_1) \ | |
@@ -1761,8 +1767,8 @@ EXTRA_DIST = $(conf_DATA) util/threads-pthread.c util/threads-win32.c \ | |
$(INTERFACE_DRIVER_SOURCES) $(STORAGE_DRIVER_SOURCES) \ | |
$(STORAGE_DRIVER_FS_SOURCES) $(STORAGE_DRIVER_LVM_SOURCES) \ | |
$(STORAGE_DRIVER_ISCSI_SOURCES) $(STORAGE_DRIVER_SCSI_SOURCES) \ | |
- $(STORAGE_DRIVER_MPATH_SOURCES) $(STORAGE_DRIVER_DISK_SOURCES) \ | |
- $(NODE_DEVICE_DRIVER_SOURCES) \ | |
+ $(STORAGE_DRIVER_SCST_SOURCES) $(STORAGE_DRIVER_MPATH_SOURCES) \ | |
+ $(STORAGE_DRIVER_DISK_SOURCES) $(NODE_DEVICE_DRIVER_SOURCES) \ | |
$(NODE_DEVICE_DRIVER_HAL_SOURCES) \ | |
$(NODE_DEVICE_DRIVER_UDEV_SOURCES) $(NWFILTER_DRIVER_SOURCES) \ | |
$(SECURITY_DRIVER_SELINUX_SOURCES) \ | |
@@ -1782,7 +1788,7 @@ mod_LTLIBRARIES = $(am__append_2) $(am__append_5) $(am__append_9) \ | |
$(am__append_22) $(am__append_26) $(am__append_32) \ | |
$(am__append_37) $(am__append_40) $(am__append_43) \ | |
$(am__append_47) $(am__append_49) $(am__append_53) \ | |
- $(am__append_55) $(am__append_66) $(am__append_75) | |
+ $(am__append_55) $(am__append_67) $(am__append_76) | |
confdir = $(sysconfdir)/libvirt | |
conf_DATA = $(am__append_29) $(am__append_34) | |
augeasdir = $(datadir)/augeas/lenses | |
@@ -1794,6 +1800,7 @@ augeastest_DATA = $(am__append_31) $(am__append_36) | |
# helper APIs for various purposes | |
UTIL_SOURCES = \ | |
util/authhelper.c util/authhelper.h \ | |
+ util/bitmap.c util/bitmap.h \ | |
util/bridge.c util/bridge.h \ | |
util/buf.c util/buf.h \ | |
util/conf.c util/conf.h \ | |
@@ -2039,6 +2046,9 @@ STORAGE_DRIVER_ISCSI_SOURCES = \ | |
STORAGE_DRIVER_SCSI_SOURCES = \ | |
storage/storage_backend_scsi.h storage/storage_backend_scsi.c | |
+STORAGE_DRIVER_SCST_SOURCES = \ | |
+ storage/storage_backend_scst.h storage/storage_backend_scst.c | |
+ | |
STORAGE_DRIVER_MPATH_SOURCES = \ | |
storage/storage_backend_mpath.h storage/storage_backend_mpath.c | |
@@ -2106,13 +2116,13 @@ noinst_LTLIBRARIES = libvirt_util.la libvirt_conf.la libvirt_cpu.la \ | |
$(am__append_20) $(am__append_23) $(am__append_27) \ | |
$(am__append_33) $(am__append_38) $(am__append_41) \ | |
$(am__append_44) $(am__append_48) $(am__append_50) \ | |
- $(am__append_54) $(am__append_56) $(am__append_67) \ | |
- $(am__append_77) libvirt_driver_security.la libvirt_test.la | |
+ $(am__append_54) $(am__append_56) $(am__append_68) \ | |
+ $(am__append_78) libvirt_driver_security.la libvirt_test.la | |
libvirt_la_LIBADD = libvirt_util.la libvirt_conf.la libvirt_cpu.la \ | |
libvirt_driver.la $(am__append_4) $(am__append_7) \ | |
$(am__append_11) $(am__append_15) $(am__append_18) \ | |
$(am__append_21) $(am__append_24) $(am__append_45) \ | |
- $(am__append_51) $(am__append_76) libvirt_driver_security.la \ | |
+ $(am__append_51) $(am__append_77) libvirt_driver_security.la \ | |
$(CYGWIN_EXTRA_LIBADD) ../gnulib/lib/libgnu.la | |
libvirt_util_la_SOURCES = \ | |
$(UTIL_SOURCES) | |
@@ -2131,9 +2141,9 @@ libvirt_driver_la_CFLAGS = $(NUMACTL_CFLAGS) \ | |
-I@top_srcdir@/src/conf | |
libvirt_driver_la_LDFLAGS = $(NUMACTL_LIBS) | |
-USED_SYM_FILES = libvirt_private.syms $(am__append_85) \ | |
- $(am__append_86) $(am__append_87) $(am__append_88) \ | |
- $(am__append_89) $(am__append_90) | |
+USED_SYM_FILES = libvirt_private.syms $(am__append_86) \ | |
+ $(am__append_87) $(am__append_88) $(am__append_89) \ | |
+ $(am__append_90) $(am__append_91) | |
@WITH_TEST_TRUE@libvirt_driver_test_la_CFLAGS = \ | |
@WITH_TEST_TRUE@ -I@top_srcdir@/src/conf | |
@@ -2239,32 +2249,32 @@ USED_SYM_FILES = libvirt_private.syms $(am__append_85) \ | |
# Needed to keep automake quiet about conditionals | |
libvirt_driver_storage_la_SOURCES = $(am__append_58) $(am__append_59) \ | |
$(am__append_60) $(am__append_61) $(am__append_62) \ | |
- $(am__append_65) | |
+ $(am__append_63) $(am__append_66) | |
libvirt_driver_storage_la_CFLAGS = -I@top_srcdir@/src/conf \ | |
- $(am__append_63) | |
-libvirt_driver_storage_la_LDFLAGS = $(am__append_57) $(am__append_64) | |
+ $(am__append_64) | |
+libvirt_driver_storage_la_LDFLAGS = $(am__append_57) $(am__append_65) | |
# Stateful, so linked to daemon instead | |
#libvirt_la_LIBADD += libvirt_driver_nodedev.la | |
@WITH_NODE_DEVICES_TRUE@libvirt_driver_nodedev_la_SOURCES = \ | |
@WITH_NODE_DEVICES_TRUE@ $(NODE_DEVICE_DRIVER_SOURCES) \ | |
-@WITH_NODE_DEVICES_TRUE@ $(am__append_68) $(am__append_71) | |
+@WITH_NODE_DEVICES_TRUE@ $(am__append_69) $(am__append_72) | |
@WITH_NODE_DEVICES_TRUE@libvirt_driver_nodedev_la_CFLAGS = \ | |
@WITH_NODE_DEVICES_TRUE@ -I@top_srcdir@/src/conf \ | |
-@WITH_NODE_DEVICES_TRUE@ $(am__append_69) $(am__append_72) | |
+@WITH_NODE_DEVICES_TRUE@ $(am__append_70) $(am__append_73) | |
@WITH_NODE_DEVICES_TRUE@libvirt_driver_nodedev_la_LDFLAGS = \ | |
-@WITH_NODE_DEVICES_TRUE@ $(am__append_70) $(am__append_73) \ | |
-@WITH_NODE_DEVICES_TRUE@ $(am__append_74) | |
+@WITH_NODE_DEVICES_TRUE@ $(am__append_71) $(am__append_74) \ | |
+@WITH_NODE_DEVICES_TRUE@ $(am__append_75) | |
@WITH_NWFILTER_TRUE@libvirt_driver_nwfilter_la_CFLAGS = $(LIBPCAP_CFLAGS) \ | |
@WITH_NWFILTER_TRUE@ -I@top_srcdir@/src/conf | |
@WITH_NWFILTER_TRUE@libvirt_driver_nwfilter_la_LDFLAGS = \ | |
-@WITH_NWFILTER_TRUE@ $(LIBPCAP_LIBS) $(am__append_78) | |
+@WITH_NWFILTER_TRUE@ $(LIBPCAP_LIBS) $(am__append_79) | |
@WITH_NWFILTER_TRUE@libvirt_driver_nwfilter_la_SOURCES = $(NWFILTER_DRIVER_SOURCES) | |
libvirt_driver_security_la_SOURCES = $(SECURITY_DRIVER_SOURCES) \ | |
- $(am__append_79) $(am__append_82) | |
-libvirt_driver_security_la_CFLAGS = -I@top_srcdir@/src/conf \ | |
$(am__append_80) $(am__append_83) | |
-libvirt_driver_security_la_LDFLAGS = $(am__append_81) $(am__append_84) | |
+libvirt_driver_security_la_CFLAGS = -I@top_srcdir@/src/conf \ | |
+ $(am__append_81) $(am__append_84) | |
+libvirt_driver_security_la_LDFLAGS = $(am__append_82) $(am__append_85) | |
# Empty source list - it merely links a bunch of convenience libs together | |
libvirt_la_SOURCES = | |
@@ -2616,6 +2626,7 @@ distclean-compile: | |
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libvirt_driver_storage_la-storage_backend_logical.Plo@am__quote@ | |
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libvirt_driver_storage_la-storage_backend_mpath.Plo@am__quote@ | |
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libvirt_driver_storage_la-storage_backend_scsi.Plo@am__quote@ | |
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libvirt_driver_storage_la-storage_backend_scst.Plo@am__quote@ | |
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libvirt_driver_storage_la-storage_driver.Plo@am__quote@ | |
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libvirt_driver_test_la-test_driver.Plo@am__quote@ | |
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libvirt_driver_uml_la-uml_conf.Plo@am__quote@ | |
@@ -2637,6 +2648,7 @@ distclean-compile: | |
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libvirt_driver_xenapi_la-xenapi_driver.Plo@am__quote@ | |
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libvirt_driver_xenapi_la-xenapi_utils.Plo@am__quote@ | |
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libvirt_lxc-authhelper.Po@am__quote@ | |
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libvirt_lxc-bitmap.Po@am__quote@ | |
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libvirt_lxc-bridge.Po@am__quote@ | |
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libvirt_lxc-buf.Po@am__quote@ | |
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libvirt_lxc-capabilities.Po@am__quote@ | |
@@ -2676,6 +2688,7 @@ distclean-compile: | |
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libvirt_lxc-xml.Po@am__quote@ | |
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libvirt_parthelper-parthelper.Po@am__quote@ | |
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libvirt_util_la-authhelper.Plo@am__quote@ | |
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libvirt_util_la-bitmap.Plo@am__quote@ | |
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libvirt_util_la-bridge.Plo@am__quote@ | |
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libvirt_util_la-buf.Plo@am__quote@ | |
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libvirt_util_la-cgroup.Plo@am__quote@ | |
@@ -3305,6 +3318,14 @@ libvirt_driver_storage_la-storage_backend_scsi.lo: storage/storage_backend_scsi. | |
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ | |
@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libvirt_driver_storage_la_CFLAGS) $(CFLAGS) -c -o libvirt_driver_storage_la-storage_backend_scsi.lo `test -f 'storage/storage_backend_scsi.c' || echo '$(srcdir)/'`storage/storage_backend_scsi.c | |
+libvirt_driver_storage_la-storage_backend_scst.lo: storage/storage_backend_scst.c | |
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libvirt_driver_storage_la_CFLAGS) $(CFLAGS) -MT libvirt_driver_storage_la-storage_backend_scst.lo -MD -MP -MF $(DEPDIR)/libvirt_driver_storage_la-storage_backend_scst.Tpo -c -o libvirt_driver_storage_la-storage_backend_scst.lo `test -f 'storage/storage_backend_scst.c' || echo '$(srcdir)/'`storage/storage_backend_scst.c | |
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libvirt_driver_storage_la-storage_backend_scst.Tpo $(DEPDIR)/libvirt_driver_storage_la-storage_backend_scst.Plo | |
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ | |
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='storage/storage_backend_scst.c' object='libvirt_driver_storage_la-storage_backend_scst.lo' libtool=yes @AMDEPBACKSLASH@ | |
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ | |
+@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libvirt_driver_storage_la_CFLAGS) $(CFLAGS) -c -o libvirt_driver_storage_la-storage_backend_scst.lo `test -f 'storage/storage_backend_scst.c' || echo '$(srcdir)/'`storage/storage_backend_scst.c | |
+ | |
libvirt_driver_storage_la-storage_backend_mpath.lo: storage/storage_backend_mpath.c | |
@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libvirt_driver_storage_la_CFLAGS) $(CFLAGS) -MT libvirt_driver_storage_la-storage_backend_mpath.lo -MD -MP -MF $(DEPDIR)/libvirt_driver_storage_la-storage_backend_mpath.Tpo -c -o libvirt_driver_storage_la-storage_backend_mpath.lo `test -f 'storage/storage_backend_mpath.c' || echo '$(srcdir)/'`storage/storage_backend_mpath.c | |
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libvirt_driver_storage_la-storage_backend_mpath.Tpo $(DEPDIR)/libvirt_driver_storage_la-storage_backend_mpath.Plo | |
@@ -3481,6 +3502,14 @@ libvirt_util_la-authhelper.lo: util/authhelper.c | |
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ | |
@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libvirt_util_la_CFLAGS) $(CFLAGS) -c -o libvirt_util_la-authhelper.lo `test -f 'util/authhelper.c' || echo '$(srcdir)/'`util/authhelper.c | |
+libvirt_util_la-bitmap.lo: util/bitmap.c | |
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libvirt_util_la_CFLAGS) $(CFLAGS) -MT libvirt_util_la-bitmap.lo -MD -MP -MF $(DEPDIR)/libvirt_util_la-bitmap.Tpo -c -o libvirt_util_la-bitmap.lo `test -f 'util/bitmap.c' || echo '$(srcdir)/'`util/bitmap.c | |
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libvirt_util_la-bitmap.Tpo $(DEPDIR)/libvirt_util_la-bitmap.Plo | |
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ | |
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='util/bitmap.c' object='libvirt_util_la-bitmap.lo' libtool=yes @AMDEPBACKSLASH@ | |
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ | |
+@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libvirt_util_la_CFLAGS) $(CFLAGS) -c -o libvirt_util_la-bitmap.lo `test -f 'util/bitmap.c' || echo '$(srcdir)/'`util/bitmap.c | |
+ | |
libvirt_util_la-bridge.lo: util/bridge.c | |
@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libvirt_util_la_CFLAGS) $(CFLAGS) -MT libvirt_util_la-bridge.lo -MD -MP -MF $(DEPDIR)/libvirt_util_la-bridge.Tpo -c -o libvirt_util_la-bridge.lo `test -f 'util/bridge.c' || echo '$(srcdir)/'`util/bridge.c | |
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libvirt_util_la-bridge.Tpo $(DEPDIR)/libvirt_util_la-bridge.Plo | |
@@ -3777,6 +3806,22 @@ libvirt_lxc-authhelper.obj: util/authhelper.c | |
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ | |
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libvirt_lxc_CFLAGS) $(CFLAGS) -c -o libvirt_lxc-authhelper.obj `if test -f 'util/authhelper.c'; then $(CYGPATH_W) 'util/authhelper.c'; else $(CYGPATH_W) '$(srcdir)/util/authhelper.c'; fi` | |
+libvirt_lxc-bitmap.o: util/bitmap.c | |
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libvirt_lxc_CFLAGS) $(CFLAGS) -MT libvirt_lxc-bitmap.o -MD -MP -MF $(DEPDIR)/libvirt_lxc-bitmap.Tpo -c -o libvirt_lxc-bitmap.o `test -f 'util/bitmap.c' || echo '$(srcdir)/'`util/bitmap.c | |
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libvirt_lxc-bitmap.Tpo $(DEPDIR)/libvirt_lxc-bitmap.Po | |
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ | |
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='util/bitmap.c' object='libvirt_lxc-bitmap.o' libtool=no @AMDEPBACKSLASH@ | |
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ | |
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libvirt_lxc_CFLAGS) $(CFLAGS) -c -o libvirt_lxc-bitmap.o `test -f 'util/bitmap.c' || echo '$(srcdir)/'`util/bitmap.c | |
+ | |
+libvirt_lxc-bitmap.obj: util/bitmap.c | |
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libvirt_lxc_CFLAGS) $(CFLAGS) -MT libvirt_lxc-bitmap.obj -MD -MP -MF $(DEPDIR)/libvirt_lxc-bitmap.Tpo -c -o libvirt_lxc-bitmap.obj `if test -f 'util/bitmap.c'; then $(CYGPATH_W) 'util/bitmap.c'; else $(CYGPATH_W) '$(srcdir)/util/bitmap.c'; fi` | |
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libvirt_lxc-bitmap.Tpo $(DEPDIR)/libvirt_lxc-bitmap.Po | |
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ | |
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='util/bitmap.c' object='libvirt_lxc-bitmap.obj' libtool=no @AMDEPBACKSLASH@ | |
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ | |
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libvirt_lxc_CFLAGS) $(CFLAGS) -c -o libvirt_lxc-bitmap.obj `if test -f 'util/bitmap.c'; then $(CYGPATH_W) 'util/bitmap.c'; else $(CYGPATH_W) '$(srcdir)/util/bitmap.c'; fi` | |
+ | |
libvirt_lxc-bridge.o: util/bridge.c | |
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libvirt_lxc_CFLAGS) $(CFLAGS) -MT libvirt_lxc-bridge.o -MD -MP -MF $(DEPDIR)/libvirt_lxc-bridge.Tpo -c -o libvirt_lxc-bridge.o `test -f 'util/bridge.c' || echo '$(srcdir)/'`util/bridge.c | |
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libvirt_lxc-bridge.Tpo $(DEPDIR)/libvirt_lxc-bridge.Po | |
diff --git a/src/conf/storage_conf.c b/src/conf/storage_conf.c | |
index 6218e02..5f89f0a 100644 | |
--- a/src/conf/storage_conf.c | |
+++ b/src/conf/storage_conf.c | |
@@ -51,7 +51,7 @@ VIR_ENUM_IMPL(virStoragePool, | |
VIR_STORAGE_POOL_LAST, | |
"dir", "fs", "netfs", | |
"logical", "disk", "iscsi", | |
- "scsi", "mpath") | |
+ "scsi", "scst", "mpath") | |
VIR_ENUM_IMPL(virStoragePoolFormatFileSystem, | |
VIR_STORAGE_POOL_FS_LAST, | |
@@ -193,6 +193,11 @@ static virStoragePoolTypeInfo poolTypeInfo[] = { | |
.formatToString = virStoragePoolFormatDiskTypeToString, | |
} | |
}, | |
+ { .poolType = VIR_STORAGE_POOL_SCST, | |
+ .volOptions = { | |
+ .formatToString = virStoragePoolFormatDiskTypeToString, | |
+ } | |
+ }, | |
{ .poolType = VIR_STORAGE_POOL_MPATH, | |
.volOptions = { | |
.formatToString = virStoragePoolFormatDiskTypeToString, | |
@@ -611,7 +616,7 @@ virStoragePoolDefParseXML(xmlXPathContextPtr ctxt) { | |
type = virXPathString("string(./@type)", ctxt); | |
if ((ret->type = virStoragePoolTypeFromString((const char *)type)) < 0) { | |
virStorageReportError(VIR_ERR_INTERNAL_ERROR, | |
- _("unknown storage pool type %s"), (const char*)type); | |
+ _("storage_conf - virStoragePoolDefParseXML - unknown storage pool type %s"), (const char*)type); | |
goto cleanup; | |
} | |
diff --git a/src/conf/storage_conf.h b/src/conf/storage_conf.h | |
index 1c9ba04..3e64066 100644 | |
--- a/src/conf/storage_conf.h | |
+++ b/src/conf/storage_conf.h | |
@@ -119,6 +119,7 @@ enum virStoragePoolType { | |
VIR_STORAGE_POOL_DISK, /* Disk partitions */ | |
VIR_STORAGE_POOL_ISCSI, /* iSCSI targets */ | |
VIR_STORAGE_POOL_SCSI, /* SCSI HBA */ | |
+ VIR_STORAGE_POOL_SCST, /* SCSI target */ | |
VIR_STORAGE_POOL_MPATH, /* Multipath devices */ | |
VIR_STORAGE_POOL_LAST, | |
diff --git a/src/storage/storage_backend.c b/src/storage/storage_backend.c | |
index 5003b8c..3d282e6 100644 | |
--- a/src/storage/storage_backend.c | |
+++ b/src/storage/storage_backend.c | |
@@ -63,6 +63,9 @@ | |
#if WITH_STORAGE_SCSI | |
# include "storage_backend_scsi.h" | |
#endif | |
+#if WITH_STORAGE_SCST | |
+# include "storage_backend_scst.h" | |
+#endif | |
#if WITH_STORAGE_MPATH | |
# include "storage_backend_mpath.h" | |
#endif | |
@@ -92,6 +95,9 @@ static virStorageBackendPtr backends[] = { | |
#if WITH_STORAGE_SCSI | |
&virStorageBackendSCSI, | |
#endif | |
+#if WITH_STORAGE_SCST | |
+ &virStorageBackendSCST, | |
+#endif | |
#if WITH_STORAGE_MPATH | |
&virStorageBackendMpath, | |
#endif | |
diff --git a/src/storage/storage_backend_scsi.h b/src/storage/storage_backend_scsi.h | |
index c3af173..d19f3b5 100644 | |
--- a/src/storage/storage_backend_scsi.h | |
+++ b/src/storage/storage_backend_scsi.h | |
@@ -38,5 +38,14 @@ virStorageBackendSCSIGetHostNumber(const char *sysfs_path, | |
int | |
virStorageBackendSCSIFindLUs(virStoragePoolObjPtr pool, | |
uint32_t scanhost); | |
+int | |
+virStorageBackendSCSIFindFreeLU(virStoragePoolObjPtr pool, | |
+ uint32_t scanhost); | |
+int | |
+virStorageBackendSCSIGetVolumeVname(virStorageVolDefPtr vol, | |
+ uint32_t host, char **device_name); | |
+int | |
+virStorageBackendSCSINameVolumes(virStoragePoolObjPtr pool, | |
+ uint32_t scanhost); | |
#endif /* __VIR_STORAGE_BACKEND_SCSI_H__ */ | |
diff --git a/src/storage/storage_backend_scst.c b/src/storage/storage_backend_scst.c | |
new file mode 100644 | |
index 0000000..d558949 | |
--- /dev/null | |
+++ b/src/storage/storage_backend_scst.c | |
@@ -0,0 +1,1250 @@ | |
+/* | |
+ * storage_backend_scsi.c: storage backend for SCSI handling | |
+ * | |
+ * Copyright (C) 2007-2008 Red Hat, Inc. | |
+ * Copyright (C) 2007-2008 Daniel P. Berrange | |
+ * | |
+ * This library is free software; you can redistribute it and/or | |
+ * modify it under the terms of the GNU Lesser General Public | |
+ * License as published by the Free Software Foundation; either | |
+ * version 2.1 of the License, or (at your option) any later version. | |
+ * | |
+ * This library is distributed in the hope that it will be useful, | |
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
+ * Lesser General Public License for more details. | |
+ * | |
+ * You should have received a copy of the GNU Lesser General Public | |
+ * License along with this library; if not, write to the Free Software | |
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
+ * | |
+ * Author: Daniel P. Berrange <berrange redhat com> | |
+ */ | |
+ | |
+#include <config.h> | |
+ | |
+#include <unistd.h> | |
+#include <stdio.h> | |
+#include <dirent.h> | |
+#include <fcntl.h> | |
+ | |
+#include "virterror_internal.h" | |
+#include "storage_backend_scst.h" | |
+#include "memory.h" | |
+#include "logging.h" | |
+ | |
+//code common with storage_backend_scsi.c | |
+ | |
+#define VIR_FROM_THIS VIR_FROM_STORAGE | |
+ | |
+/* Function to check if the type file in the given sysfs_path is a | |
+ * Direct-Access device (i.e. type 0). Return -1 on failure, type of | |
+ * the device otherwise. | |
+ */ | |
+static int | |
+getDeviceType(uint32_t host, | |
+ uint32_t bus, | |
+ uint32_t target, | |
+ uint32_t lun, | |
+ int *type) | |
+{ | |
+ char *type_path = NULL; | |
+ char typestr[3]; | |
+ char *gottype, *p; | |
+ FILE *typefile; | |
+ int retval = 0; | |
+ | |
+ if (virAsprintf(&type_path, "/sys/bus/scsi/devices/%u:%u:%u:%u/type", | |
+ host, bus, target, lun) < 0) { | |
+ virReportOOMError(); | |
+ goto out; | |
+ } | |
+ | |
+ typefile = fopen(type_path, "r"); | |
+ if (typefile == NULL) { | |
+ virReportSystemError(errno, | |
+ _("Could not find typefile '%s'"), | |
+ type_path); | |
+ /* there was no type file; that doesn't seem right */ | |
+ retval = -1; | |
+ goto out; | |
+ } | |
+ | |
+ gottype = fgets(typestr, 3, typefile); | |
+ fclose(typefile); | |
+ | |
+ if (gottype == NULL) { | |
+ virReportSystemError(errno, | |
+ _("Could not read typefile '%s'"), | |
+ type_path); | |
+ /* we couldn't read the type file; have to give up */ | |
+ retval = -1; | |
+ goto out; | |
+ } | |
+ | |
+ /* we don't actually care about p, but if you pass NULL and the last | |
+ * character is not \0, virStrToLong_i complains | |
+ */ | |
+ if (virStrToLong_i(typestr, &p, 10, type) < 0) { | |
+ virStorageReportError(VIR_ERR_INTERNAL_ERROR, | |
+ _("Device type '%s' is not an integer"), | |
+ typestr); | |
+ /* Hm, type wasn't an integer; seems strange */ | |
+ retval = -1; | |
+ goto out; | |
+ } | |
+ | |
+ VIR_DEBUG(_("Device type is %d"), *type); | |
+ | |
+out: | |
+ VIR_FREE(type_path); | |
+ return retval; | |
+} | |
+ | |
+struct diskType { | |
+ int part_table_type; | |
+ unsigned short offset; | |
+ unsigned short length; | |
+ unsigned long long magic; | |
+}; | |
+ | |
+static struct diskType const disk_types[] = { | |
+ { VIR_STORAGE_POOL_DISK_LVM2, 0x218, 8, 0x31303020324D564CULL }, | |
+ { VIR_STORAGE_POOL_DISK_GPT, 0x200, 8, 0x5452415020494645ULL }, | |
+ { VIR_STORAGE_POOL_DISK_DVH, 0x0, 4, 0x41A9E50BULL }, | |
+ { VIR_STORAGE_POOL_DISK_MAC, 0x0, 2, 0x5245ULL }, | |
+ { VIR_STORAGE_POOL_DISK_BSD, 0x40, 4, 0x82564557ULL }, | |
+ { VIR_STORAGE_POOL_DISK_SUN, 0x1fc, 2, 0xBEDAULL }, | |
+ /* | |
+ * NOTE: pc98 is funky; the actual signature is 0x55AA (just like dos), so | |
+ * we can't use that. At the moment I'm relying on the "dummy" IPL | |
+ * bootloader data that comes from parted. Luckily, the chances of running | |
+ * into a pc98 machine running libvirt are approximately nil. | |
+ */ | |
+ /*{ 0x1fe, 2, 0xAA55UL },*/ | |
+ { VIR_STORAGE_POOL_DISK_PC98, 0x0, 8, 0x314C5049000000CBULL }, | |
+ /* | |
+ * NOTE: the order is important here; some other disk types (like GPT and | |
+ * and PC98) also have 0x55AA at this offset. For that reason, the DOS | |
+ * one must be the last one. | |
+ */ | |
+ { VIR_STORAGE_POOL_DISK_DOS, 0x1fe, 2, 0xAA55ULL }, | |
+ { -1, 0x0, 0, 0x0ULL }, | |
+}; | |
+ | |
+static int | |
+virStorageBackendSCSTUpdateVolTargetInfo(virStorageVolTargetPtr target, | |
+ unsigned long long *allocation, | |
+ unsigned long long *capacity) | |
+{ | |
+ int fd, i, ret = -1; | |
+ off_t start; | |
+ unsigned char buffer[1024]; | |
+ ssize_t bytes; | |
+ | |
+ if ((fd = open(target->path, O_RDONLY)) < 0) { | |
+ virReportSystemError(errno, | |
+ _("cannot open volume '%s'"), | |
+ target->path); | |
+ return -1; | |
+ } | |
+ | |
+ if (virStorageBackendUpdateVolTargetInfoFD(target, | |
+ fd, | |
+ allocation, | |
+ capacity) < 0) | |
+ goto cleanup; | |
+ | |
+ /* make sure to set the target format "unknown" to begin with */ | |
+ target->format = VIR_STORAGE_POOL_DISK_UNKNOWN; | |
+ | |
+ start = lseek(fd, 0, SEEK_SET); | |
+ if (start < 0) { | |
+ virReportSystemError(errno, | |
+ _("cannot seek to beginning of file '%s'"), | |
+ target->path); | |
+ goto cleanup; | |
+ } | |
+ bytes = saferead(fd, buffer, sizeof(buffer)); | |
+ if (bytes < 0) { | |
+ virReportSystemError(errno, | |
+ _("cannot read beginning of file '%s'"), | |
+ target->path); | |
+ goto cleanup; | |
+ } | |
+ | |
+ for (i = 0; disk_types[i].part_table_type != -1; i++) { | |
+ if (disk_types[i].offset + disk_types[i].length > bytes) | |
+ continue; | |
+ if (memcmp(buffer+disk_types[i].offset, &disk_types[i].magic, | |
+ disk_types[i].length) == 0) { | |
+ target->format = disk_types[i].part_table_type; | |
+ break; | |
+ } | |
+ } | |
+ | |
+ ret = 0; | |
+ | |
+ cleanup: | |
+ close(fd); | |
+ | |
+ return ret; | |
+} | |
+ | |
+static int | |
+virStorageBackendSCSTNewLun(virStoragePoolObjPtr pool, | |
+ uint32_t host, | |
+ uint32_t bus, | |
+ uint32_t target, | |
+ uint32_t lun, | |
+ const char *dev) | |
+{ | |
+ virStorageVolDefPtr vol; | |
+ char *devpath = NULL; | |
+ int retval = 0; | |
+ | |
+ if (VIR_ALLOC(vol) < 0) { | |
+ virReportOOMError(); | |
+ retval = -1; | |
+ goto out; | |
+ } | |
+ | |
+ vol->type = VIR_STORAGE_VOL_BLOCK; | |
+ | |
+ if (virAsprintf(&(vol->name), "%u.%u.%u.%u", host, bus, target, lun) < 0) { | |
+ virReportOOMError(); | |
+ retval = -1; | |
+ goto free_vol; | |
+ } | |
+ | |
+ if (virAsprintf(&devpath, "/dev/%s", dev) < 0) { | |
+ virReportOOMError(); | |
+ retval = -1; | |
+ goto free_vol; | |
+ } | |
+ | |
+ VIR_DEBUG(_("Trying to create volume for '%s'"), devpath); | |
+ | |
+ /* Now figure out the stable path | |
+ * | |
+ * XXX this method is O(N) because it scans the pool target | |
+ * dir every time its run. Should figure out a more efficient | |
+ * way of doing this... | |
+ */ | |
+ if ((vol->target.path = virStorageBackendStablePath(pool, | |
+ devpath)) == NULL) { | |
+ retval = -1; | |
+ goto free_vol; | |
+ } | |
+ | |
+ if (STREQLEN(devpath, vol->target.path, PATH_MAX) && | |
+ !(STREQ(pool->def->target.path, "/dev") || | |
+ STREQ(pool->def->target.path, "/dev/"))) { | |
+ | |
+ VIR_DEBUG(_("No stable path found for '%s' in '%s'"), | |
+ devpath, pool->def->target.path); | |
+ | |
+ retval = -1; | |
+ goto free_vol; | |
+ } | |
+ | |
+ if (virStorageBackendSCSTUpdateVolTargetInfo(&vol->target, | |
+ &vol->allocation, | |
+ &vol->capacity) < 0) { | |
+ | |
+ virStorageReportError(VIR_ERR_INTERNAL_ERROR, | |
+ _("Failed to update volume for '%s'"), | |
+ devpath); | |
+ retval = -1; | |
+ goto free_vol; | |
+ } | |
+ | |
+ /* XXX should use logical unit's UUID instead */ | |
+ vol->key = strdup(vol->target.path); | |
+ if (vol->key == NULL) { | |
+ virReportOOMError(); | |
+ retval = -1; | |
+ goto free_vol; | |
+ } | |
+ | |
+ pool->def->capacity += vol->capacity; | |
+ pool->def->allocation += vol->allocation; | |
+ | |
+ if (VIR_REALLOC_N(pool->volumes.objs, | |
+ pool->volumes.count + 1) < 0) { | |
+ virReportOOMError(); | |
+ retval = -1; | |
+ goto free_vol; | |
+ } | |
+ pool->volumes.objs[pool->volumes.count++] = vol; | |
+ | |
+ goto out; | |
+ | |
+free_vol: | |
+ virStorageVolDefFree(vol); | |
+out: | |
+ VIR_FREE(devpath); | |
+ return retval; | |
+} | |
+ | |
+ | |
+static int | |
+getNewStyleBlockDevice(const char *lun_path, | |
+ const char *block_name ATTRIBUTE_UNUSED, | |
+ char **block_device) | |
+{ | |
+ char *block_path = NULL; | |
+ DIR *block_dir = NULL; | |
+ struct dirent *block_dirent = NULL; | |
+ int retval = 0; | |
+ | |
+ if (virAsprintf(&block_path, "%s/block", lun_path) < 0) { | |
+ virReportOOMError(); | |
+ goto out; | |
+ } | |
+ | |
+ VIR_DEBUG(_("Looking for block device in '%s'"), block_path); | |
+ | |
+ block_dir = opendir(block_path); | |
+ if (block_dir == NULL) { | |
+ virReportSystemError(errno, | |
+ _("Failed to opendir sysfs path '%s'"), | |
+ block_path); | |
+ retval = -1; | |
+ goto out; | |
+ } | |
+ | |
+ while ((block_dirent = readdir(block_dir))) { | |
+ | |
+ if (STREQLEN(block_dirent->d_name, ".", 1)) { | |
+ continue; | |
+ } | |
+ | |
+ *block_device = strdup(block_dirent->d_name); | |
+ | |
+ if (*block_device == NULL) { | |
+ virReportOOMError(); | |
+ closedir(block_dir); | |
+ retval = -1; | |
+ goto out; | |
+ } | |
+ | |
+ VIR_DEBUG(_("Block device is '%s'"), *block_device); | |
+ | |
+ break; | |
+ } | |
+ | |
+ closedir(block_dir); | |
+ | |
+out: | |
+ VIR_FREE(block_path); | |
+ return retval; | |
+} | |
+ | |
+ | |
+static int | |
+getOldStyleBlockDevice(const char *lun_path ATTRIBUTE_UNUSED, | |
+ const char *block_name, | |
+ char **block_device) | |
+{ | |
+ char *blockp = NULL; | |
+ int retval = 0; | |
+ | |
+ /* old-style; just parse out the sd */ | |
+ blockp = strrchr(block_name, ':'); | |
+ if (blockp == NULL) { | |
+ /* Hm, wasn't what we were expecting; have to give up */ | |
+ virStorageReportError(VIR_ERR_INTERNAL_ERROR, | |
+ _("Failed to parse block name %s"), | |
+ block_name); | |
+ retval = -1; | |
+ } else { | |
+ blockp++; | |
+ *block_device = strdup(blockp); | |
+ | |
+ if (*block_device == NULL) { | |
+ virReportOOMError(); | |
+ retval = -1; | |
+ goto out; | |
+ } | |
+ | |
+ VIR_DEBUG(_("Block device is '%s'"), *block_device); | |
+ } | |
+ | |
+out: | |
+ return retval; | |
+} | |
+ | |
+ | |
+static int | |
+getBlockDevice(uint32_t host, | |
+ uint32_t bus, | |
+ uint32_t target, | |
+ uint32_t lun, | |
+ char **block_device) | |
+{ | |
+ char *lun_path = NULL; | |
+ DIR *lun_dir = NULL; | |
+ struct dirent *lun_dirent = NULL; | |
+ int retval = 0; | |
+ | |
+ if (virAsprintf(&lun_path, "/sys/bus/scsi/devices/%u:%u:%u:%u", | |
+ host, bus, target, lun) < 0) { | |
+ virReportOOMError(); | |
+ goto out; | |
+ } | |
+ | |
+ lun_dir = opendir(lun_path); | |
+ if (lun_dir == NULL) { | |
+ virReportSystemError(errno, | |
+ _("Failed to opendir sysfs path '%s'"), | |
+ lun_path); | |
+ retval = -1; | |
+ goto out; | |
+ } | |
+ | |
+ while ((lun_dirent = readdir(lun_dir))) { | |
+ if (STREQLEN(lun_dirent->d_name, "block", 5)) { | |
+ if (strlen(lun_dirent->d_name) == 5) { | |
+ retval = getNewStyleBlockDevice(lun_path, | |
+ lun_dirent->d_name, | |
+ block_device); | |
+ } else { | |
+ retval = getOldStyleBlockDevice(lun_path, | |
+ lun_dirent->d_name, | |
+ block_device); | |
+ } | |
+ break; | |
+ } | |
+ } | |
+ | |
+ closedir(lun_dir); | |
+ | |
+out: | |
+ VIR_FREE(lun_path); | |
+ return retval; | |
+} | |
+ | |
+ | |
+static int | |
+processLU(virStoragePoolObjPtr pool, | |
+ uint32_t host, | |
+ uint32_t bus, | |
+ uint32_t target, | |
+ uint32_t lun) | |
+{ | |
+ char *type_path = NULL; | |
+ int retval = 0; | |
+ int device_type; | |
+ char *block_device = NULL, *dev_name = NULL; | |
+ | |
+ VIR_DEBUG(_("Processing LU %u:%u:%u:%u"), | |
+ host, bus, target, lun); | |
+ | |
+ if (getDeviceType(host, bus, target, lun, &device_type) < 0) { | |
+ virStorageReportError(VIR_ERR_INTERNAL_ERROR, | |
+ _("Failed to determine if %u:%u:%u:%u is a Direct-Access LUN"), | |
+ host, bus, target, lun); | |
+ retval = -1; | |
+ goto out; | |
+ } | |
+ | |
+ /* We don't create volumes for devices other than disk and cdrom | |
+ * devices, but finding a device that isn't one of those types | |
+ * isn't an error, either. */ | |
+ if (!(device_type == VIR_STORAGE_DEVICE_TYPE_DISK || | |
+ device_type == VIR_STORAGE_DEVICE_TYPE_ROM)) | |
+ { | |
+ retval = 0; | |
+ goto out; | |
+ } | |
+ | |
+ if (virAsprintf(&dev_name, "%u:%u:%u:%u", host, bus, target, lun) < 0) { | |
+ virReportOOMError(); | |
+ goto out; | |
+ } | |
+ | |
+ if (virStorageVolDefFindByName(pool, dev_name)) { | |
+ retval = 0; | |
+ goto out; | |
+ } | |
+ | |
+ VIR_DEBUG(_("%u:%u:%u:%u is a Direct-Access LUN"), | |
+ host, bus, target, lun); | |
+ | |
+ if (getBlockDevice(host, bus, target, lun, &block_device) < 0) { | |
+ goto out; | |
+ } | |
+ | |
+ if (virStorageBackendSCSTNewLun(pool, | |
+ host, bus, target, lun, | |
+ block_device) < 0) { | |
+ VIR_DEBUG(_("Failed to create new storage volume for %u:%u:%u:%u"), | |
+ host, bus, target, lun); | |
+ retval = -1; | |
+ goto out; | |
+ } | |
+ | |
+ VIR_DEBUG(_("Created new storage volume for %u:%u:%u:%u successfully"), | |
+ host, bus, target, lun); | |
+ | |
+ VIR_FREE(type_path); | |
+ | |
+out: | |
+ if (dev_name) | |
+ VIR_FREE(dev_name); | |
+ return retval; | |
+} | |
+ | |
+ | |
+int | |
+virStorageBackendSCSTFindLUs(virStoragePoolObjPtr pool, | |
+ uint32_t scanhost) | |
+{ | |
+ int retval = 0; | |
+ uint32_t bus, target, lun; | |
+ char *device_path = NULL; | |
+ DIR *devicedir = NULL; | |
+ struct dirent *lun_dirent = NULL; | |
+ char devicepattern[64]; | |
+ | |
+ VIR_DEBUG(_("Discovering LUs on host %u"), scanhost); | |
+ | |
+ virFileWaitForDevices(); | |
+ | |
+ if (virAsprintf(&device_path, "/sys/bus/scsi/devices") < 0) { | |
+ virReportOOMError(); | |
+ goto out; | |
+ } | |
+ | |
+ devicedir = opendir(device_path); | |
+ | |
+ if (devicedir == NULL) { | |
+ virReportSystemError(errno, | |
+ _("Failed to opendir path '%s'"), device_path); | |
+ retval = -1; | |
+ goto out; | |
+ } | |
+ | |
+ snprintf(devicepattern, sizeof(devicepattern), "%u:%%u:%%u:%%u\n", scanhost); | |
+ | |
+ while ((lun_dirent = readdir(devicedir))) { | |
+ if (sscanf(lun_dirent->d_name, devicepattern, | |
+ &bus, &target, &lun) != 3) { | |
+ continue; | |
+ } | |
+ | |
+ VIR_DEBUG(_("Found LU '%s'"), lun_dirent->d_name); | |
+ | |
+ processLU(pool, scanhost, bus, target, lun); | |
+ } | |
+ | |
+ closedir(devicedir); | |
+ | |
+out: | |
+ VIR_FREE(device_path); | |
+ return retval; | |
+} | |
+ | |
+ | |
+static int | |
+virStorageBackendSCSTTriggerRescan(uint32_t host) | |
+{ | |
+ int fd = -1; | |
+ int retval = 0; | |
+ char *path; | |
+ | |
+ VIR_DEBUG(_("Triggering rescan of host %d"), host); | |
+ | |
+ if (virAsprintf(&path, "/sys/class/scsi_host/host%u/scan", host) < 0) { | |
+ virReportOOMError(); | |
+ retval = -1; | |
+ goto out; | |
+ } | |
+ | |
+ VIR_DEBUG(_("Scan trigger path is '%s'"), path); | |
+ | |
+ fd = open(path, O_WRONLY); | |
+ | |
+ if (fd < 0) { | |
+ virReportSystemError(errno, | |
+ _("Could not open '%s' to trigger host scan"), | |
+ path); | |
+ retval = -1; | |
+ goto free_path; | |
+ } | |
+ | |
+ if (safewrite(fd, | |
+ LINUX_SYSFS_SCSI_HOST_SCAN_STRING, | |
+ sizeof(LINUX_SYSFS_SCSI_HOST_SCAN_STRING)) < 0) { | |
+ | |
+ virReportSystemError(errno, | |
+ _("Write to '%s' to trigger host scan failed"), | |
+ path); | |
+ retval = -1; | |
+ } | |
+ | |
+ close(fd); | |
+free_path: | |
+ VIR_FREE(path); | |
+out: | |
+ VIR_DEBUG(_("Rescan of host %d complete"), host); | |
+ return retval; | |
+} | |
+ | |
+ | |
+static int | |
+virStorageBackendSCSTRefreshPool(virConnectPtr conn ATTRIBUTE_UNUSED, | |
+ virStoragePoolObjPtr pool) | |
+{ | |
+ int retval = 0; | |
+ uint32_t host; | |
+ | |
+ pool->def->allocation = pool->def->capacity = pool->def->available = 0; | |
+ | |
+ if (sscanf(pool->def->source.adapter, "host%u", &host) != 1) { | |
+ VIR_DEBUG(_("Failed to get host number from '%s'"), | |
+ pool->def->source.adapter); | |
+ retval = -1; | |
+ goto out; | |
+ } | |
+ | |
+ VIR_DEBUG(_("Scanning host%u"), host); | |
+ | |
+ if (virStorageBackendSCSTTriggerRescan(host) < 0) { | |
+ retval = -1; | |
+ goto out; | |
+ } | |
+ | |
+ virStorageBackendSCSTFindLUs(pool, host); | |
+ virStorageBackendSCSTNameVolumes(pool, host); | |
+ | |
+out: | |
+ return retval; | |
+} | |
+ | |
+ | |
+// scst specific functions | |
+ | |
+ | |
+static int | |
+virStorageBackendSCSTStartPool(virConnectPtr conn ATTRIBUTE_UNUSED, | |
+ virStoragePoolObjPtr pool, | |
+ unsigned int flags ATTRIBUTE_UNUSED) | |
+{ | |
+ const char *sysfs_path = "/sys/class/scsi_host"; | |
+ DIR *sysdir = NULL; | |
+ struct dirent *dirent = NULL; | |
+ FILE *proc_file = NULL; | |
+ char *proc_name_file = NULL; | |
+ char proc_name[100] = {0}; | |
+ int retval = -1; | |
+ | |
+ VIR_DEBUG(_("Finding host number from '%s'"), sysfs_path); | |
+ | |
+ virFileWaitForDevices(); | |
+ | |
+ sysdir = opendir(sysfs_path); | |
+ | |
+ if (sysdir == NULL) { | |
+ virReportSystemError(errno, | |
+ _("Failed to opendir path '%s'"), sysfs_path); | |
+ return retval; | |
+ } | |
+ | |
+ while ((dirent = readdir(sysdir))) { | |
+ if (STRNEQLEN(dirent->d_name, "host", strlen("host"))) { | |
+ continue; | |
+ } | |
+ if (virAsprintf(&proc_name_file, "%s/%s/%s", sysfs_path, | |
+ dirent->d_name, "proc_name") < 0) { | |
+ virReportOOMError(); | |
+ break; | |
+ } | |
+ | |
+ proc_file = fopen(proc_name_file, "r"); | |
+ if (proc_file == NULL) { | |
+ virReportSystemError(errno, | |
+ _("Could not find file '%s'"), | |
+ proc_name_file); | |
+ break; | |
+ } | |
+ | |
+ VIR_FREE(proc_name_file); | |
+ fscanf(proc_file, "%s", proc_name); | |
+ fclose(proc_file); | |
+ | |
+ if (STREQLEN(proc_name, "scst", strlen("scst"))) { | |
+ if (virAsprintf(&(pool->def->source.adapter), | |
+ "%s", dirent->d_name) < 0) { | |
+ virReportOOMError(); | |
+ } else { | |
+ retval = 0; | |
+ } | |
+ break; | |
+ } | |
+ } | |
+ | |
+ closedir(sysdir); | |
+ if (proc_name_file != NULL) { | |
+ VIR_FREE(proc_name_file); | |
+ } | |
+ return retval; | |
+} | |
+ | |
+ | |
+int | |
+virStorageBackendSCSTNameVolumes(virStoragePoolObjPtr pool, | |
+ uint32_t host) | |
+{ | |
+ virStorageVolDefPtr vol; | |
+ int i, fd = -1; | |
+ uint32_t bus, target, lun; | |
+ char devicepattern[64]; | |
+ char dev_name[255] = {0}; | |
+ int dev_lun = -1; | |
+ FILE *file; | |
+ | |
+ snprintf(devicepattern, sizeof(devicepattern), "%u.%%u.%%u.%%u\n", host); | |
+ | |
+ fd = open(LINUX_SYSFS_SCSI_DEFAULT_GROUP_FILE, O_RDONLY); | |
+ | |
+ if (fd < 0) { | |
+ virReportSystemError(errno, | |
+ _("Could not open '%s' to parse devices"), | |
+ LINUX_SYSFS_SCSI_DEFAULT_GROUP_FILE); | |
+ return -1; | |
+ } | |
+ | |
+ file = fdopen(fd, "r"); | |
+ | |
+ do { | |
+ fscanf(file, "%1c", dev_name); | |
+ } while( dev_name[0] != '\n'); | |
+ | |
+ while (fscanf(file, "%s%u", dev_name, &dev_lun) == 2) { | |
+ | |
+ for (i = 0; i < pool->volumes.count; ++i) { | |
+ | |
+ vol = pool->volumes.objs[i]; | |
+ | |
+ if (sscanf(vol->name, devicepattern, | |
+ &bus, &target, &lun) != 3) { | |
+ continue; | |
+ } | |
+ | |
+ if (lun == (uint32_t) dev_lun) { | |
+ | |
+ VIR_FREE(vol->name); | |
+ if (virAsprintf(&(vol->name), "%s", dev_name) < 0) { | |
+ virReportOOMError(); | |
+ return -1; | |
+ } | |
+ } | |
+ | |
+ } | |
+ } | |
+ | |
+ close(fd); | |
+ return 0; | |
+} | |
+ | |
+int | |
+virStorageBackendSCSTGetVolumeVname(virStorageVolDefPtr vol, | |
+ uint32_t host, | |
+ char **volume_name) | |
+{ | |
+ char devicepattern[64]; | |
+ uint32_t bus, target, lun; | |
+ int fd = -1; | |
+ char dev_name[255] = {0}; | |
+ int dev_lun = -1; | |
+ FILE *file; | |
+ | |
+ snprintf(devicepattern, sizeof(devicepattern), "%u.%%u.%%u.%%u\n", host); | |
+ | |
+ if (sscanf(vol->name, devicepattern, | |
+ &bus, &target, &lun) != 3) { | |
+ virReportSystemError(errno, | |
+ _("Can not define LUN for volume '%s'"), | |
+ vol->name); | |
+ return -1; | |
+ } | |
+ | |
+ fd = open(LINUX_SYSFS_SCSI_DEFAULT_GROUP_FILE, O_RDONLY); | |
+ | |
+ if (fd < 0) { | |
+ virReportSystemError(errno, | |
+ _("Can not open '%s' to parse devices"), | |
+ LINUX_SYSFS_SCSI_DEFAULT_GROUP_FILE); | |
+ return -1; | |
+ } | |
+ | |
+ file = fdopen(fd, "r"); | |
+ | |
+ do { | |
+ fscanf(file, "%1c", dev_name); | |
+ } while( dev_name[0] != '\n'); | |
+ | |
+ while (fscanf(file, "%s%u", dev_name, &dev_lun) == 2) { | |
+ | |
+ if (lun == (uint32_t) dev_lun) { | |
+ | |
+ if (virAsprintf(volume_name, "%s", dev_name) < 0) { | |
+ virReportOOMError(); | |
+ close(fd); | |
+ return -1; | |
+ } | |
+ } | |
+ | |
+ } | |
+ | |
+ close(fd); | |
+ | |
+ if (*volume_name == NULL) { | |
+ virReportSystemError(errno, | |
+ _("Can not define device name for volume '%s'"), | |
+ vol->name); | |
+ return -1; | |
+ } | |
+ | |
+ return 0; | |
+} | |
+ | |
+int | |
+virStorageBackendSCSTFindFreeLU(virStoragePoolObjPtr pool ATTRIBUTE_UNUSED, | |
+ uint32_t scanhost) | |
+{ | |
+ //TODO: all errors should be processed inside FindFreeLU | |
+ //returns a free LUN | |
+ | |
+ int max_lun = -1; | |
+ uint32_t bus, target, lun; | |
+ char *device_path = NULL; | |
+ DIR *devicedir = NULL; | |
+ struct dirent *lun_dirent = NULL; | |
+ char devicepattern[64]; | |
+ | |
+ VIR_DEBUG(_("Discovering LUs on host %u"), scanhost); | |
+ | |
+ virFileWaitForDevices(); | |
+ | |
+ if (virAsprintf(&device_path, "/sys/bus/scsi/devices") < 0) { | |
+ virReportOOMError(); | |
+ goto out; | |
+ } | |
+ | |
+ devicedir = opendir(device_path); | |
+ | |
+ if (devicedir == NULL) { | |
+ virReportSystemError(errno, | |
+ _("Failed to opendir path '%s'"), device_path); | |
+ goto out; | |
+ } | |
+ | |
+ snprintf(devicepattern, sizeof(devicepattern), "%u:%%u:%%u:%%u\n", scanhost); | |
+ | |
+ while ((lun_dirent = readdir(devicedir))) { | |
+ if (sscanf(lun_dirent->d_name, devicepattern, | |
+ &bus, &target, &lun) != 3) { | |
+ continue; | |
+ } | |
+ | |
+ VIR_DEBUG(_("Found LU '%s' with lun %u"), lun_dirent->d_name, lun); | |
+ | |
+ if ((int) lun > max_lun) | |
+ max_lun = (int) lun; | |
+ } | |
+ | |
+ closedir(devicedir); | |
+ | |
+ max_lun++; | |
+ | |
+out: | |
+ VIR_FREE(device_path); | |
+ return max_lun; | |
+} | |
+ | |
+ | |
+static int | |
+virStorageBackendSCSTDeleteVol(virConnectPtr conn ATTRIBUTE_UNUSED, | |
+ virStoragePoolObjPtr pool ATTRIBUTE_UNUSED, | |
+ virStorageVolDefPtr vol, | |
+ unsigned int flags ATTRIBUTE_UNUSED) | |
+{ | |
+ int fd = -1; | |
+ char *cmd = NULL, *device_name = NULL; | |
+ uint32_t host; | |
+ char devicepattern[64], *delete_device_file = NULL; | |
+ uint32_t bus, target, lun; | |
+ | |
+ // device could have name as h:ch:id:lu or vname | |
+ | |
+ if (sscanf(pool->def->source.adapter, "host%u", &host) != 1) { | |
+ virStorageReportError(VIR_ERR_INTERNAL_ERROR, | |
+ _("Failed to get host number from '%s'"), | |
+ pool->def->source.adapter); | |
+ return -1; | |
+ } | |
+ | |
+ snprintf(devicepattern, sizeof(devicepattern), "%u.%%u.%%u.%%u", host); | |
+ | |
+ if (sscanf(vol->name, devicepattern, | |
+ &bus, &target, &lun) != 3) { | |
+ device_name = vol->name; | |
+ } else { | |
+ | |
+ // try to define volume vname | |
+ if (virStorageBackendSCSTGetVolumeVname(vol, host, &device_name) < 0) { | |
+ goto non_vname; | |
+ } | |
+ } | |
+ | |
+ // for vname for device | |
+ // echo del DISK > /proc/scsi_tgt/groups/Default/devices | |
+ | |
+ if (virAsprintf(&cmd, "del %s\n", device_name) < 0) { | |
+ virReportOOMError(); | |
+ return -1; | |
+ } | |
+ | |
+ fd = open(LINUX_SYSFS_SCSI_DEFAULT_GROUP_FILE, O_WRONLY); | |
+ | |
+ if (fd < 0) { | |
+ virReportSystemError(errno, | |
+ _("Could not open '%s' to delete a device from default group"), | |
+ LINUX_SYSFS_SCSI_DEFAULT_GROUP_FILE); | |
+ VIR_FREE(cmd); | |
+ return -1; | |
+ } | |
+ | |
+ if (safewrite(fd, cmd, strlen(cmd) + 1) < 0) { | |
+ virReportSystemError(errno, | |
+ _("Delete a device '%s' from default group failed '%s'"), | |
+ vol->name, cmd); | |
+ VIR_FREE(cmd); | |
+ close(fd); | |
+ return -1; | |
+ } | |
+ | |
+ VIR_FREE(cmd); | |
+ close(fd); | |
+ | |
+ // echo close 3 > /proc/scsi_tgt/vdisk/vdisk | |
+ | |
+ if (virAsprintf(&cmd, "close %s\n", device_name) < 0) { | |
+ virReportOOMError(); | |
+ return -1; | |
+ } | |
+ | |
+ fd = open(LINUX_SYSFS_SCSI_DEVICE_FILE, O_WRONLY); | |
+ | |
+ if (fd < 0) { | |
+ virReportSystemError(errno, | |
+ _("Could not open '%s' to delete a device"), | |
+ LINUX_SYSFS_SCSI_DEVICE_FILE); | |
+ VIR_FREE(cmd); | |
+ return -1; | |
+ } | |
+ | |
+ if (safewrite(fd, cmd, strlen(cmd) + 1) < 0) { | |
+ virReportSystemError(errno, | |
+ _("Delete a device '%s' from list failed with command '%s'"), | |
+ vol->target.path, cmd); | |
+ close(fd); | |
+ VIR_FREE(cmd); | |
+ return -1; | |
+ } | |
+ | |
+ VIR_FREE(cmd); | |
+ if (!STREQ(device_name, vol->name)) | |
+ VIR_FREE(device_name); | |
+ close(fd); | |
+ | |
+ return 0; | |
+ | |
+non_vname: | |
+ // echo 1 > /sys/class/scsi_host/host2/device/target2:0:0/2:0:0:1/delete | |
+ | |
+ if (virAsprintf(&delete_device_file, | |
+ "/sys/class/scsi_host/host%u/device/target%u:%u:%u/%u:%u:%u:%u/delete", | |
+ host, host, bus, target, host, bus, target, lun) < 0) { | |
+ virReportOOMError(); | |
+ return -1; | |
+ } | |
+ | |
+ fd = open(delete_device_file, O_WRONLY); | |
+ | |
+ if (fd < 0) { | |
+ virReportSystemError(errno, | |
+ _("Could not open '%s' to delete a device"), | |
+ delete_device_file); | |
+ VIR_FREE(delete_device_file); | |
+ return -1; | |
+ } | |
+ | |
+ if (safewrite(fd, "echo 1\n", strlen("echo 1\n") + 1) < 0) { | |
+ virReportSystemError(errno, | |
+ _("Delete a device '%s' from list failed with command '%s'"), | |
+ vol->target.path, delete_device_file); | |
+ close(fd); | |
+ VIR_FREE(delete_device_file); | |
+ return -1; | |
+ } | |
+ | |
+ VIR_FREE(delete_device_file); | |
+ close(fd); | |
+ return 0; | |
+} | |
+ | |
+ | |
+static int | |
+virStorageBackendSCSTCreateVol(virConnectPtr conn, | |
+ virStoragePoolObjPtr pool, | |
+ virStorageVolDefPtr vol) | |
+{ | |
+ int fd = -1; | |
+ uint32_t host; | |
+ char size[100]; | |
+ char *cmd = NULL, *scan_file = NULL; | |
+ int free_lun = -1; | |
+ struct stat stat_buf; | |
+ char *device_path = NULL, *device_name = NULL; | |
+ | |
+ //checking | |
+ | |
+ if (vol->target.encryption != NULL) { | |
+ virStorageReportError(VIR_ERR_NO_SUPPORT, | |
+ "%s", _("storage pool does not support encrypted " | |
+ "volumes")); | |
+ return -1; | |
+ } | |
+ | |
+ // adding a device | |
+ //find a free lun for device | |
+ | |
+ if (sscanf(pool->def->source.adapter, "host%u", &host) != 1) { | |
+ virStorageReportError(VIR_ERR_INTERNAL_ERROR, | |
+ _("Failed to get host number from '%s'"), | |
+ pool->def->source.adapter); | |
+ return -1; | |
+ } | |
+ | |
+ //all errors should be processed inside FindFreeLU | |
+ | |
+ free_lun = virStorageBackendSCSTFindFreeLU(pool, host); | |
+ | |
+ if (free_lun < 0) { | |
+ virStorageReportError(VIR_ERR_INTERNAL_ERROR, | |
+ _("Failed to get free lun for new device '%s', free_lun is %d"), | |
+ vol->name, free_lun); | |
+ return -1; | |
+ } | |
+ | |
+ //echo "open DISK00 /home/diskimade WRITE_THROUGH" | |
+ // > /proc/scsi_tgt/vdisk/vdisk | |
+ | |
+ if (virAsprintf(&cmd, "open %s %s WRITE_THROUGH\n", | |
+ vol->name, vol->target.path) < 0) { | |
+ virReportOOMError(); | |
+ return -1; | |
+ } | |
+ | |
+ fd = open(LINUX_SYSFS_SCSI_DEVICE_FILE, O_WRONLY); | |
+ | |
+ if (fd < 0) { | |
+ virReportSystemError(errno, | |
+ _("Could not open '%s' to add a device"), | |
+ LINUX_SYSFS_SCSI_DEVICE_FILE); | |
+ VIR_FREE(cmd); | |
+ return -1; | |
+ } | |
+ | |
+ if (safewrite(fd, cmd, strlen(cmd) + 1) < 0) { | |
+ virReportSystemError(errno, | |
+ _("Add '%s' to scst device list failed with command '%s'"), | |
+ vol->target.path, cmd); | |
+ close(fd); | |
+ VIR_FREE(cmd); | |
+ return -1; | |
+ } | |
+ | |
+ VIR_FREE(cmd); | |
+ close(fd); | |
+ | |
+ //echo "add 0:0:0:0 10" > /proc/scsi_tgt/groups/Default/devices | |
+ | |
+ if (virAsprintf(&cmd, "add %s %u\n", vol->name, free_lun) < 0) { | |
+ virReportOOMError(); | |
+ return -1; | |
+ } | |
+ | |
+ fd = open(LINUX_SYSFS_SCSI_DEFAULT_GROUP_FILE, O_WRONLY); | |
+ | |
+ if (fd < 0) { | |
+ virReportSystemError(errno, | |
+ _("Could not open '%s' to assign a group to device"), | |
+ LINUX_SYSFS_SCSI_DEFAULT_GROUP_FILE); | |
+ VIR_FREE(cmd); | |
+ return -1; | |
+ } | |
+ | |
+ if (safewrite(fd, cmd, strlen(cmd) + 1) < 0) { | |
+ virReportSystemError(errno, | |
+ _("Assign a default group to device '%s' failed with cmd '%s'"), | |
+ vol->name, cmd); | |
+ VIR_FREE(cmd); | |
+ goto cleanup; | |
+ } | |
+ | |
+ VIR_FREE(cmd); | |
+ close(fd); | |
+ | |
+ // rescan host | |
+ | |
+ if (virAsprintf(&cmd, "0 0 %u\n", free_lun) < 0) { | |
+ virReportOOMError(); | |
+ return -1; | |
+ } | |
+ | |
+ if (virAsprintf(&scan_file, "/sys/class/scsi_host/host%u/scan", host) < 0) { | |
+ virReportOOMError(); | |
+ return -1; | |
+ } | |
+ | |
+ fd = open(scan_file, O_WRONLY); | |
+ | |
+ if (fd < 0) { | |
+ virReportSystemError(errno, | |
+ _("Could not open '%s' to rescan a host"), | |
+ scan_file); | |
+ VIR_FREE(scan_file); | |
+ VIR_FREE(cmd); | |
+ goto cleanup; | |
+ } | |
+ | |
+ if (safewrite(fd, cmd, strlen(cmd) + 1) < 0) { | |
+ virReportSystemError(errno, | |
+ _("Rescah a host '%u' failed with cmd '%s'"), | |
+ host, cmd); | |
+ VIR_FREE(cmd); | |
+ VIR_FREE(scan_file); | |
+ goto cleanup; | |
+ } | |
+ | |
+ VIR_FREE(cmd); | |
+ VIR_FREE(scan_file); | |
+ close(fd); | |
+ | |
+ // defining properties | |
+ | |
+ vol->type = VIR_STORAGE_VOL_BLOCK; | |
+ | |
+ // capacity for volume | |
+ | |
+ if (stat(vol->target.path, &stat_buf) < 0) { | |
+ virReportSystemError(errno, | |
+ _("cannot stat file '%s'"), | |
+ vol->target.path); | |
+ goto cleanup; | |
+ } | |
+ | |
+ vol->capacity = stat_buf.st_size; | |
+ snprintf(size, sizeof(size)-1, "%lluK", vol->capacity/1024); | |
+ size[sizeof(size)-1] = '\0'; | |
+ | |
+ // changing permissions for target path | |
+ | |
+ if ((fd = open(vol->target.path, O_RDONLY)) < 0) { | |
+ virReportSystemError(errno, | |
+ _("cannot read path '%s'"), | |
+ vol->target.path); | |
+ goto cleanup; | |
+ } | |
+ | |
+ /* We can only chown/grp if root */ | |
+ if (getuid() == 0) { | |
+ if (fchown(fd, vol->target.perms.uid, vol->target.perms.gid) < 0) { | |
+ virReportSystemError(errno, | |
+ _("cannot set file owner '%s'"), | |
+ vol->target.path); | |
+ goto cleanup; | |
+ } | |
+ } | |
+ if (fchmod(fd, vol->target.perms.mode) < 0) { | |
+ virReportSystemError(errno, | |
+ _("cannot set file mode '%s'"), | |
+ vol->target.path); | |
+ goto cleanup; | |
+ } | |
+ | |
+ if (close(fd) < 0) { | |
+ virReportSystemError(errno, | |
+ _("cannot close file '%s'"), | |
+ vol->target.path); | |
+ goto cleanup; | |
+ } | |
+ | |
+ fd = -1; | |
+ | |
+ // define key | |
+ vol->key = strdup(vol->target.path); | |
+ | |
+ if (vol->key == NULL) { | |
+ virReportOOMError(); | |
+ goto cleanup; | |
+ } | |
+ | |
+ // define path /dev/disk/by-path | |
+ if (getBlockDevice(host, 0, 0, free_lun, &device_name) < 0) { | |
+ goto cleanup; | |
+ } | |
+ | |
+ if (virAsprintf(&device_path, "/dev/%s", device_name) < 0) { | |
+ virReportOOMError(); | |
+ goto cleanup; | |
+ } | |
+ | |
+ VIR_FREE(device_name); | |
+ VIR_FREE(vol->target.path); | |
+ virFileWaitForDevices(); | |
+ | |
+ if ((vol->target.path = virStorageBackendStablePath(pool, | |
+ device_path)) == NULL) { | |
+ goto cleanup; | |
+ } | |
+ | |
+ if (STREQLEN(device_path, vol->target.path, PATH_MAX) && | |
+ !(STREQ(pool->def->target.path, "/dev") || | |
+ STREQ(pool->def->target.path, "/dev/"))) { | |
+ | |
+ VIR_DEBUG(_("No stable path found for '%s' in '%s'"), | |
+ device_path, pool->def->target.path); | |
+ | |
+ goto cleanup; | |
+ } | |
+ | |
+ VIR_FREE(device_path); | |
+ return 0; | |
+ | |
+ cleanup: | |
+ if (fd != -1) | |
+ close(fd); | |
+ if (device_name != NULL) | |
+ VIR_FREE(device_name); | |
+ if (device_path != NULL) | |
+ VIR_FREE(device_path); | |
+ virStorageBackendSCSTDeleteVol(conn, pool, vol, 0); | |
+ return -1; | |
+} | |
+ | |
+virStorageBackend virStorageBackendSCST = { | |
+ .type = VIR_STORAGE_POOL_SCST, | |
+ | |
+ .startPool = virStorageBackendSCSTStartPool, | |
+ .refreshPool = virStorageBackendSCSTRefreshPool, | |
+ .createVol = virStorageBackendSCSTCreateVol, | |
+ .deleteVol = virStorageBackendSCSTDeleteVol, | |
+ .buildVol = NULL, | |
+}; | |
+ | |
diff --git a/src/storage/storage_backend_scst.h b/src/storage/storage_backend_scst.h | |
new file mode 100644 | |
index 0000000..a0ace3c | |
--- /dev/null | |
+++ b/src/storage/storage_backend_scst.h | |
@@ -0,0 +1,60 @@ | |
+/* | |
+ * storage_backend_scst.h: storage backend for SCSI target handling | |
+ * | |
+ * derived from storage_backend_scsi.h | |
+ * Copyright (C) 2007-2008 Red Hat, Inc. | |
+ * Copyright (C) 2007-2008 Daniel P. Berrange | |
+ * | |
+ * This library is free software; you can redistribute it and/or | |
+ * modify it under the terms of the GNU Lesser General Public | |
+ * License as published by the Free Software Foundation; either | |
+ * version 2.1 of the License, or (at your option) any later version. | |
+ * | |
+ * This library is distributed in the hope that it will be useful, | |
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
+ * Lesser General Public License for more details. | |
+ * | |
+ * You should have received a copy of the GNU Lesser General Public | |
+ * License along with this library; if not, write to the Free Software | |
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
+ * | |
+ * Author: Daniel P. Berrange <berrange redhat com> | |
+ */ | |
+ | |
+#ifndef __VIR_STORAGE_BACKEND_SCST_H__ | |
+# define __VIR_STORAGE_BACKEND_SCST_H__ | |
+ | |
+# include "storage_backend.h" | |
+ | |
+// common defines | |
+ | |
+# define LINUX_SYSFS_SCSI_HOST_PREFIX "/sys/class/scsi_host" | |
+# define LINUX_SYSFS_SCSI_HOST_POSTFIX "device" | |
+# define LINUX_SYSFS_SCSI_HOST_SCAN_STRING "- - -" | |
+ | |
+// scst specific defines | |
+ | |
+# define LINUX_SYSFS_SCSI_DEVICE_FILE "/proc/scsi_tgt/vdisk/vdisk" | |
+# define LINUX_SYSFS_SCSI_DEFAULT_GROUP_FILE "/proc/scsi_tgt/groups/Default/devices" | |
+ | |
+extern virStorageBackend virStorageBackendSCST; | |
+ | |
+//common functions | |
+ | |
+int | |
+virStorageBackendSCSTFindLUs(virStoragePoolObjPtr pool, | |
+ uint32_t scanhost); | |
+//scst specific functions | |
+ | |
+int | |
+virStorageBackendSCSTFindFreeLU(virStoragePoolObjPtr pool, | |
+ uint32_t scanhost); | |
+int | |
+virStorageBackendSCSTGetVolumeVname(virStorageVolDefPtr vol, | |
+ uint32_t host, char **device_name); | |
+int | |
+virStorageBackendSCSTNameVolumes(virStoragePoolObjPtr pool, | |
+ uint32_t scanhost); | |
+ | |
+#endif /* __VIR_STORAGE_BACKEND_SCST_H__ */ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment