Hello community, here is the log from the commit of package tgt for openSUSE:Factory checked in at 2012-06-18 17:34:41 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/tgt (Old) and /work/SRC/openSUSE:Factory/.tgt.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "tgt", Maintainer is "h...@suse.com" Changes: -------- --- /work/SRC/openSUSE:Factory/tgt/tgt.changes 2011-09-23 12:48:09.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.tgt.new/tgt.changes 2012-06-18 17:34:43.000000000 +0200 @@ -1,0 +2,15 @@ +Thu Jun 14 09:51:09 CEST 2012 - vu...@opensuse.org + +- Remove "# pidfile: /var/run/tgtd.pid" from tgt.init, as it makes + the script hang on systemd-based systems. This is the same bug as + rh#797913, and the fix was used in Fedora. Apparently, there's no + such pid file written by tgtd. + +------------------------------------------------------------------- +Mon Jun 4 14:39:47 CEST 2012 - h...@suse.de + +- Update to latest upstream release 1.0.23 + * Improved SCSI emulation + * Various small fixes + +------------------------------------------------------------------- Old: ---- scsi_tgt_if.h tgt-0.9.0-update tgt-20080805.tar.bz2 New: ---- tgt-1.0.28.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ tgt.spec ++++++ --- /var/tmp/diff_new_pack.wUIsUU/_old 2012-06-18 17:34:45.000000000 +0200 +++ /var/tmp/diff_new_pack.wUIsUU/_new 2012-06-18 17:34:45.000000000 +0200 @@ -1,7 +1,7 @@ # -# spec file for package tgt (Version 0.9.0) +# spec file for package tgt # -# Copyright (c) 2009 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -15,28 +15,26 @@ # Please submit bugfixes or comments via http://bugs.opensuse.org/ # -# norootforbuild - Name: tgt -BuildRequires: libaio-devel openssl-devel perl-Config-General +BuildRequires: docbook-xsl-stylesheets +BuildRequires: libaio-devel +BuildRequires: libxslt +BuildRequires: openssl-devel +BuildRequires: perl-Config-General Obsoletes: iscsitarget -Provides: iscsitarget Requires: perl-Config-General Url: http://stgt.berlios.de -License: GPL-2.0+ -Group: System/Daemons PreReq: %fillup_prereq %insserv_prereq -AutoReqProv: on -Version: 0.9.0 -Release: 2 +Version: 1.0.28 +Release: 0 Summary: Generic Linux target framework (tgt) -Source: %{name}-20080805.tar.bz2 +License: GPL-2.0+ +Group: System/Daemons +Source: %{name}-%{version}.tar.bz2 Source1: %{name}.init -Source2: scsi_tgt_if.h Source3: %{name}.services -Patch1: %{name}-0.9.0-update -Patch2: %{name}-git-update +Patch1: %{name}-git-update Patch11: %{name}-fix-build BuildRoot: %{_tmppath}/%{name}-%{version}-build @@ -56,14 +54,11 @@ Mike Christie <micha...@cs.wisc.edu> %prep -%setup -n %{name}-20080805 +%setup -n %{name}-%{version} %patch1 -p1 -%patch2 -p1 %patch11 -p1 -cp %{S:2} usr %build -cd usr %ifarch ppc ppc64 %define backends ISCSI=1 FCP=1 FCOE=1 IBMVIO=1 %else @@ -72,10 +67,7 @@ %{__make} OPTFLAGS="${RPM_OPT_FLAGS}" %{backends} %install -cd usr -%{__make} DESTDIR=${RPM_BUILD_ROOT} install -cd ../scripts -install -vD -m 755 tgt-admin ${RPM_BUILD_ROOT}/usr/sbin/tgt-admin +%{__make} DESTDIR=${RPM_BUILD_ROOT} docdir=%_docdir/%{name} install install -vD -m 755 %{S:1} ${RPM_BUILD_ROOT}/etc/init.d/tgtd ln -sf /etc/init.d/tgtd ${RPM_BUILD_ROOT}/usr/sbin/rctgtd install -vD %{S:3} ${RPM_BUILD_ROOT}/etc/sysconfig/SuSEfirewall2.d/services/iscsitarget @@ -97,8 +89,13 @@ %defattr(-,root,root) /usr/sbin/* /etc/init.d/tgtd +%dir /etc/tgt +%dir /etc/tgt/examples +%config %attr(0644,root,root) /etc/tgt/targets.conf +%config %attr(0644,root,root) /etc/tgt/examples/* %config %attr(0644,root,root) /etc/sysconfig/SuSEfirewall2.d/services/iscsitarget -%doc README doc/README.iscsi doc/TODO +%doc README doc/README.iscsi doc/README.iser doc/README.lu_configuration +%doc doc/README.mmc doc/README.passthrough doc/README.sbcjukebox doc/README.ssc %doc %{_mandir}/man8/* %changelog ++++++ tgt-20080805.tar.bz2 -> tgt-1.0.28.tar.bz2 ++++++ ++++ 45876 lines of diff (skipped) ++++++ tgt-fix-build ++++++ --- /var/tmp/diff_new_pack.wUIsUU/_old 2012-06-18 17:34:45.000000000 +0200 +++ /var/tmp/diff_new_pack.wUIsUU/_new 2012-06-18 17:34:45.000000000 +0200 @@ -1,260 +1,20 @@ -diff --git a/scripts/tgt-setup-lun b/scripts/tgt-setup-lun -index 1e214ee..2ae9193 100755 ---- a/scripts/tgt-setup-lun -+++ b/scripts/tgt-setup-lun -@@ -1,3 +1,5 @@ -+#!/bin/bash -+ - # LUN assignment script - # - # Copyright (C) 2007 Erez Zilber <er...@voltaire.com> -@@ -17,8 +19,6 @@ - # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA - # 02110-1301 USA - --#!/bin/bash -- - usage() - { - name=$(basename $0) diff --git a/usr/Makefile b/usr/Makefile -index a59364b..bf264f4 100644 +index 64cb58c..deb7e39 100644 --- a/usr/Makefile +++ b/usr/Makefile -@@ -50,7 +50,7 @@ INCLUDES += -I. -I../include -I$(KERNELSRC)/include +@@ -28,12 +28,15 @@ INCLUDES += -I. CFLAGS += -D_GNU_SOURCE CFLAGS += $(INCLUDES) --CFLAGS += -g -O2 -Wall -Wstrict-prototypes -fPIC ++ifneq ($(OPTFLAGS),) +CFLAGS += $(OPTFLAGS) + ifneq ($(DEBUG),) + CFLAGS += -g -O0 -ggdb -rdynamic + else + CFLAGS += -g -O2 -fno-strict-aliasing + endif + CFLAGS += -Wall -Wstrict-prototypes -fPIC ++endif + CFLAGS += -DTGT_VERSION=\"$(VERSION)$(EXTRAVERSION)\" LIBS += -lpthread - -diff --git a/usr/fc/fc.c b/usr/fc/fc.c -index febb1e9..59f7573 100644 ---- a/usr/fc/fc.c -+++ b/usr/fc/fc.c -@@ -29,6 +29,8 @@ - #include <syscall.h> - #include <unistd.h> - #include <linux/fs.h> -+#include <linux/types.h> -+typedef __u8 u8; - #include <scsi/scsi.h> - #include <sys/mman.h> - -diff --git a/usr/iscsi/iscsi_rdma.c b/usr/iscsi/iscsi_rdma.c -index d3b5147..c155b48 100644 ---- a/usr/iscsi/iscsi_rdma.c -+++ b/usr/iscsi/iscsi_rdma.c -@@ -144,7 +144,7 @@ struct conn_info { - /* but count so we can drain CQ on close */ - int recvl_posted; - -- struct tgt_event tx_sched; -+ struct tgtd_event tx_sched; - - /* login phase resources, freed at full-feature */ - void *srbuf_login; -@@ -196,7 +196,7 @@ struct iser_device { - void *mempool_listbuf; - struct ibv_mr *mempool_mr; - -- struct tgt_event poll_sched; -+ struct tgtd_event poll_sched; - - /* free and allocated mempool entries */ - struct list_head mempool_free, mempool_alloc; -@@ -281,9 +281,9 @@ static void iscsi_rdma_release(struct iscsi_connection *conn); - static int iscsi_rdma_show(struct iscsi_connection *conn, char *buf, - int rest); - static void iscsi_rdma_event_modify(struct iscsi_connection *conn, int events); --static void iser_sched_poll_cq(struct tgt_event *tev); --static void iser_sched_consume_cq(struct tgt_event *tev); --static void iser_sched_tx(struct tgt_event *evt); -+static void iser_sched_poll_cq(struct tgtd_event *tev); -+static void iser_sched_consume_cq(struct tgtd_event *tev); -+static void iser_sched_tx(struct tgtd_event *evt); - - /* - * Called when ready for full feature, builds resources. -@@ -1058,7 +1058,7 @@ static void iser_poll_cq_armable(struct iser_device *dev) - /* Scheduled to poll cq after a completion event has been - received and acknowledged, if no more completions are found - the interrupts are re-armed */ --static void iser_sched_poll_cq(struct tgt_event *tev) -+static void iser_sched_poll_cq(struct tgtd_event *tev) - { - struct iser_device *dev = tev->data; - iser_poll_cq_armable(dev); -@@ -1069,7 +1069,7 @@ static void iser_sched_poll_cq(struct tgt_event *tev) - the notification interrupts were re-armed. - Intended to consume those remaining completions only, - this function does not re-arm interrupts. */ --static void iser_sched_consume_cq(struct tgt_event *tev) -+static void iser_sched_consume_cq(struct tgtd_event *tev) - { - struct iser_device *dev = tev->data; - int ret; -@@ -1112,7 +1112,7 @@ static void iser_cqe_handler(int fd __attribute__((unused)), - * tries to push tx on a connection, until nothing - * is ready anymore. No progress limit here. - */ --static void iser_sched_tx(struct tgt_event *evt) -+static void iser_sched_tx(struct tgtd_event *evt) - { - struct conn_info *ci = evt->data; - struct iscsi_connection *conn = &ci->iscsi_conn; -diff --git a/usr/tgtd.c b/usr/tgtd.c -index 62aaa04..a226906 100644 ---- a/usr/tgtd.c -+++ b/usr/tgtd.c -@@ -99,7 +99,7 @@ static int oom_adjust(void) - int tgt_event_add(int fd, int events, event_handler_t handler, void *data) - { - struct epoll_event ev; -- struct tgt_event *tev; -+ struct tgtd_event *tev; - int err; - - tev = zalloc(sizeof(*tev)); -@@ -123,9 +123,9 @@ int tgt_event_add(int fd, int events, event_handler_t handler, void *data) - return err; - } - --static struct tgt_event *tgt_event_lookup(int fd) -+static struct tgtd_event *tgt_event_lookup(int fd) - { -- struct tgt_event *tev; -+ struct tgtd_event *tev; - - list_for_each_entry(tev, &tgt_events_list, e_list) { - if (tev->fd == fd) -@@ -136,7 +136,7 @@ static struct tgt_event *tgt_event_lookup(int fd) - - void tgt_event_del(int fd) - { -- struct tgt_event *tev; -+ struct tgtd_event *tev; - - tev = tgt_event_lookup(fd); - if (!tev) { -@@ -152,7 +152,7 @@ void tgt_event_del(int fd) - int tgt_event_modify(int fd, int events) - { - struct epoll_event ev; -- struct tgt_event *tev; -+ struct tgtd_event *tev; - - tev = tgt_event_lookup(fd); - if (!tev) { -@@ -167,7 +167,7 @@ int tgt_event_modify(int fd, int events) - return epoll_ctl(ep_fd, EPOLL_CTL_MOD, fd, &ev); - } - --void tgt_init_sched_event(struct tgt_event *evt, -+void tgt_init_sched_event(struct tgtd_event *evt, - sched_event_handler_t sched_handler, void *data) - { - evt->sched_handler = sched_handler; -@@ -176,7 +176,7 @@ void tgt_init_sched_event(struct tgt_event *evt, - INIT_LIST_HEAD(&evt->e_list); - } - --void tgt_add_sched_event(struct tgt_event *evt) -+void tgt_add_sched_event(struct tgtd_event *evt) - { - if (!evt->scheduled) { - evt->scheduled = 1; -@@ -184,7 +184,7 @@ void tgt_add_sched_event(struct tgt_event *evt) - } - } - --void tgt_remove_sched_event(struct tgt_event *evt) -+void tgt_remove_sched_event(struct tgtd_event *evt) - { - if (evt->scheduled) { - evt->scheduled = 0; -@@ -195,7 +195,7 @@ void tgt_remove_sched_event(struct tgt_event *evt) - static int tgt_exec_scheduled(void) - { - struct list_head *last_sched; -- struct tgt_event *tev, *tevn; -+ struct tgtd_event *tev, *tevn; - int work_remains = 0; - - if (!list_empty(&tgt_sched_events_list)) { -@@ -218,7 +218,7 @@ static void event_loop(void) - { - int nevent, i, sched_remains, timeout; - struct epoll_event events[1024]; -- struct tgt_event *tev; -+ struct tgtd_event *tev; - - retry: - sched_remains = tgt_exec_scheduled(); -@@ -232,7 +232,7 @@ retry: - } - } else if (nevent) { - for (i = 0; i < nevent; i++) { -- tev = (struct tgt_event *) events[i].data.ptr; -+ tev = (struct tgtd_event *) events[i].data.ptr; - tev->handler(tev->fd, events[i].events, tev->data); - } - } else -diff --git a/usr/tgtd.h b/usr/tgtd.h -index da751c8..207c167 100644 ---- a/usr/tgtd.h -+++ b/usr/tgtd.h -@@ -206,21 +206,21 @@ extern int tgt_bind_host_to_target(int tid, int host_no); - extern int tgt_unbind_host_to_target(int tid, int host_no); - extern int tgt_bound_target_lookup(int host_no); - --struct tgt_event; --typedef void (*sched_event_handler_t)(struct tgt_event *tev); -+struct tgtd_event; -+typedef void (*sched_event_handler_t)(struct tgtd_event *tev); - --extern void tgt_init_sched_event(struct tgt_event *evt, -+extern void tgt_init_sched_event(struct tgtd_event *evt, - sched_event_handler_t sched_handler, void *data); - - typedef void (*event_handler_t)(int fd, int events, void *data); - --extern int tgt_event_add(int fd, int events, event_handler_t handler, void *data); --extern void tgt_event_del(int fd); -+extern int tgtd_event_add(int fd, int events, event_handler_t handler, void *data); -+extern void tgtd_event_del(int fd); - --extern void tgt_add_sched_event(struct tgt_event *evt); --extern void tgt_remove_sched_event(struct tgt_event *evt); -+extern void tgt_add_sched_event(struct tgtd_event *evt); -+extern void tgt_remove_sched_event(struct tgtd_event *evt); - --extern int tgt_event_modify(int fd, int events); -+extern int tgtd_event_modify(int fd, int events); - extern int target_cmd_queue(int tid, struct scsi_cmd *cmd); - extern void target_cmd_done(struct scsi_cmd *cmd); - struct scsi_cmd *target_cmd_lookup(int tid, uint64_t itn_id, uint64_t tag); -@@ -269,7 +269,7 @@ extern int dtd_load_unload(int tid, uint64_t lun, int load, char *file); - extern int register_backingstore_template(struct backingstore_template *bst); - extern struct backingstore_template *get_backingstore_template(const char *name); - --struct tgt_event { -+struct tgtd_event { - union { - event_handler_t handler; - sched_event_handler_t sched_handler; -diff --git a/usr/tgtif.c b/usr/tgtif.c -index fd5ad5b..9b87b13 100644 ---- a/usr/tgtif.c -+++ b/usr/tgtif.c -@@ -36,7 +36,7 @@ - #ifndef aligned_u64 - #define aligned_u64 unsigned long long __attribute__((aligned(8))) - #endif --#include <scsi/scsi_tgt_if.h> -+#include "scsi_tgt_if.h" - - #include "list.h" - #include "util.h" ++++++ tgt-git-update ++++++ ++++ 1547 lines (skipped) ++++ between /work/SRC/openSUSE:Factory/tgt/tgt-git-update ++++ and /work/SRC/openSUSE:Factory/.tgt.new/tgt-git-update ++++++ tgt.init ++++++ --- /var/tmp/diff_new_pack.wUIsUU/_old 2012-06-18 17:34:45.000000000 +0200 +++ /var/tmp/diff_new_pack.wUIsUU/_new 2012-06-18 17:34:45.000000000 +0200 @@ -16,10 +16,10 @@ # # -# pidfile: /var/run/tgtd.pid DAEMON=/usr/sbin/tgtd PIDFILE=/var/run/tgtd.pid +TGTD_CONFIG=/etc/tgt/targets.conf # Source LSB init functions . /etc/rc.status @@ -28,29 +28,133 @@ PATH=/sbin:/bin:/usr/sbin:/usr/bin +start() +{ + echo "Starting target framework daemon" + # Start tgtd first. + tgtd &>/dev/null + RETVAL=$? + if [ "$RETVAL" -ne 0 ] ; then + rc_failed -v + else + # Put tgtd into "offline" state until all the targets are configured. + # We don't want initiators to (re)connect and fail the connection + # if it's not ready. + tgtadm --op update --mode sys --name State -v offline + # Configure the targets. + tgt-admin -e -c $TGTD_CONFIG + # Put tgtd into "ready" state. + tgtadm --op update --mode sys --name State -v ready + rc_failed 0 + fi + rc_status -v +} + +stop() +{ + if [ "$RUNLEVEL" == 0 -o "$RUNLEVEL" == 6 ] ; then + forcedstop + fi + echo "Stopping target framework daemon" + # Remove all targets. It only removes targets which are not in use. + tgt-admin --update ALL -c /dev/null &>/dev/null + # tgtd will exit if all targets were removed + tgtadm --op delete --mode system &>/dev/null + RETVAL=$? + if [ "$RETVAL" -eq 107 ] ; then + rc_failed 7 + [ "$TASK" != "restart" ] && exit 1 + elif [ "$RETVAL" -ne 0 ] ; then + echo -n "(Some initiators are still connected)" + rc_failed 1 + fi + rc_status -v +} + +forcedstop() +{ + # NOTE: Forced shutdown of the iscsi target may cause data corruption + # for initiators that are connected. + echo "Force-stopping target framework daemon" + # Offline everything first. May be needed if we're rebooting, but + # expect the initiators to reconnect cleanly when we boot again + # (i.e. we don't want them to reconnect to a tgtd which is still + # working, but the target is gone). + tgtadm --op update --mode sys --name State -v offline &>/dev/null + RETVAL=$? + if [ "$RETVAL" -eq 107 ] ; then + rc_failed 7 + [ "$TASK" != "restart" ] && exit 1 + else + tgt-admin --offline ALL + # Remove all targets, even if they are still in use. + tgt-admin --update ALL -c /dev/null -f + # It will shut down tgtd only after all targets were removed. + tgtadm --op delete --mode system + RETVAL=$? + if [ "$RETVAL" -ne 0 ] ; then + rc_failed 1 + fi + fi +} + +reload() +{ + echo "Updating target framework daemon configuration" + # Update configuration for targets. Only targets which + # are not in use will be updated. + tgt-admin --update ALL -c $TGTD_CONFIG &>/dev/null + RETVAL=$? + if [ "$RETVAL" -eq 107 ] ; then + rc_failed 7 + fi +} + +forcedreload() +{ + echo "Force-updating target framework daemon configuration" + # Update configuration for targets, even those in use. + tgt-admin --update ALL -f -c $TGTD_CONFIG &>/dev/null + RETVAL=$? + if [ "$RETVAL" -eq 107 ] ; then + rc_failed 7 + fi +} + case "$1" in start) echo -n "Starting SCSI target service: " - modprobe crc32c - modprobe scsi_tgt - startproc -p $PIDFILE $DAEMON + start rc_status -v ;; stop) echo -n "Stopping SCSI target service: " - tgtadm --op delete >/dev/null 2>/dev/null - killproc -p $PIDFILE -TERM $DAEMON - modprobe -r scsi_tgt 2>/dev/null - RETVAL=$? - modprobe -r crc32c 2>/dev/null + stop if [ $RETVAL != "0" ]; then - rc_failed + rc_failed + else + modprobe -r scsi_tgt 2>/dev/null + modprobe -r crc32c 2>/dev/null + rc_failed 0 fi rc_status -v ;; + forcedstop) + forcedstop + rc_status -v + ;; + forcereload) + forcedreload + rc_status -v + ;; restart|reload) - $0 stop - $0 start + TASK=$1 + stop + RETVAL=$? + if [ $RETVAL -eq 0 ] ; then + start + fi + rc_status -v ;; status) echo -n "Checking for SCSI target service" @@ -58,7 +162,7 @@ rc_status -v ;; *) - echo $"Usage: $0 {start|stop|restart|status}" + echo $"Usage: $0 {start|stop|restart|reload|forcedreload|forcedstop|status}" exit 1 esac rc_exit -- To unsubscribe, e-mail: opensuse-commit+unsubscr...@opensuse.org For additional commands, e-mail: opensuse-commit+h...@opensuse.org