summaryrefslogtreecommitdiffstats
path: root/src/net/tcp/iscsi.c
diff options
context:
space:
mode:
authorMichael Brown2007-01-15 09:49:10 +0100
committerMichael Brown2007-01-15 09:49:10 +0100
commit4e20d73bb52326261f8cf49c20d6de2edea309ee (patch)
tree3d24466a78c4c8f53294384b76e62e871eb96def /src/net/tcp/iscsi.c
parentAdd missing include (diff)
downloadipxe-4e20d73bb52326261f8cf49c20d6de2edea309ee.tar.gz
ipxe-4e20d73bb52326261f8cf49c20d6de2edea309ee.tar.xz
ipxe-4e20d73bb52326261f8cf49c20d6de2edea309ee.zip
Gave asynchronous operations approximate POSIX signal semantics. This
will enable us to cascade async operations, which is necessary in order to properly support DNS. (For example, an HTTP request may have to redirect to a new location and will have to perform a new DNS lookup, so we can't just rely on doing the name lookup at the time of parsing the initial URL). Anything other than HTTP is probably broken right now; I'll fix the others up asap.
Diffstat (limited to 'src/net/tcp/iscsi.c')
-rw-r--r--src/net/tcp/iscsi.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/net/tcp/iscsi.c b/src/net/tcp/iscsi.c
index ae23cfe8..09edf697 100644
--- a/src/net/tcp/iscsi.c
+++ b/src/net/tcp/iscsi.c
@@ -121,7 +121,7 @@ static void iscsi_done ( struct iscsi_session *iscsi, int rc ) {
iscsi->command = NULL;
/* Mark asynchronous operation as complete */
- async_done ( &iscsi->aop, rc );
+ async_done ( &iscsi->async, rc );
}
/****************************************************************************
@@ -1208,10 +1208,11 @@ static struct tcp_operations iscsi_tcp_operations = {
*
* @v iscsi iSCSI session
* @v command SCSI command
- * @ret aop Asynchronous operation for this SCSI command
+ * @v parent Parent asynchronous operation
+ * @ret rc Return status code
*/
-struct async_operation * iscsi_issue ( struct iscsi_session *iscsi,
- struct scsi_command *command ) {
+int iscsi_issue ( struct iscsi_session *iscsi, struct scsi_command *command,
+ struct async *parent ) {
int rc;
assert ( iscsi->command == NULL );
@@ -1219,7 +1220,7 @@ struct async_operation * iscsi_issue ( struct iscsi_session *iscsi,
if ( iscsi->instant_rc ) {
/* Abort immediately rather than retrying */
- iscsi_done ( iscsi, iscsi->instant_rc );
+ return iscsi->instant_rc;
} else if ( iscsi->status ) {
/* Session already open: issue command */
iscsi_start_command ( iscsi );
@@ -1231,11 +1232,12 @@ struct async_operation * iscsi_issue ( struct iscsi_session *iscsi,
0 ) ) != 0 ) {
DBGC ( iscsi, "iSCSI %p could not open TCP "
"connection: %s\n", iscsi, strerror ( rc ) );
- iscsi_done ( iscsi, rc );
+ return rc;
}
}
- return &iscsi->aop;
+ async_init ( &iscsi->async, &default_async_operations, parent );
+ return 0;
}
/**