iscsi.c (70ecdc6e4e7f91e7d88540f19fb0f56f9e6f54a0) iscsi.c (f2e5dca46b5ba4588c0756c5f272123585cbbf23)
1/*
2 * QEMU Block driver for iSCSI images
3 *
4 * Copyright (c) 2010-2011 Ronnie Sahlberg <ronniesahlberg@gmail.com>
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a copy
7 * of this software and associated documentation files (the "Software"), to deal
8 * in the Software without restriction, including without limitation the rights

--- 145 unchanged lines hidden (view full) ---

154
155 /* We always register a read handler. */
156 ev = POLLIN;
157 ev |= iscsi_which_events(iscsi);
158 if (ev != iscsilun->events) {
159 qemu_aio_set_fd_handler(iscsi_get_fd(iscsi),
160 iscsi_process_read,
161 (ev & POLLOUT) ? iscsi_process_write : NULL,
1/*
2 * QEMU Block driver for iSCSI images
3 *
4 * Copyright (c) 2010-2011 Ronnie Sahlberg <ronniesahlberg@gmail.com>
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a copy
7 * of this software and associated documentation files (the "Software"), to deal
8 * in the Software without restriction, including without limitation the rights

--- 145 unchanged lines hidden (view full) ---

154
155 /* We always register a read handler. */
156 ev = POLLIN;
157 ev |= iscsi_which_events(iscsi);
158 if (ev != iscsilun->events) {
159 qemu_aio_set_fd_handler(iscsi_get_fd(iscsi),
160 iscsi_process_read,
161 (ev & POLLOUT) ? iscsi_process_write : NULL,
162 NULL,
163 iscsilun);
164
165 }
166
167 iscsilun->events = ev;
168}
169
170static void

--- 1032 unchanged lines hidden (view full) ---

1203{
1204 IscsiLun *iscsilun = bs->opaque;
1205 struct iscsi_context *iscsi = iscsilun->iscsi;
1206
1207 if (iscsilun->nop_timer) {
1208 qemu_del_timer(iscsilun->nop_timer);
1209 qemu_free_timer(iscsilun->nop_timer);
1210 }
162 iscsilun);
163
164 }
165
166 iscsilun->events = ev;
167}
168
169static void

--- 1032 unchanged lines hidden (view full) ---

1202{
1203 IscsiLun *iscsilun = bs->opaque;
1204 struct iscsi_context *iscsi = iscsilun->iscsi;
1205
1206 if (iscsilun->nop_timer) {
1207 qemu_del_timer(iscsilun->nop_timer);
1208 qemu_free_timer(iscsilun->nop_timer);
1209 }
1211 qemu_aio_set_fd_handler(iscsi_get_fd(iscsi), NULL, NULL, NULL, NULL);
1210 qemu_aio_set_fd_handler(iscsi_get_fd(iscsi), NULL, NULL, NULL);
1212 iscsi_destroy_context(iscsi);
1213 memset(iscsilun, 0, sizeof(IscsiLun));
1214}
1215
1216static int iscsi_truncate(BlockDriverState *bs, int64_t offset)
1217{
1218 IscsiLun *iscsilun = bs->opaque;
1219 int ret = 0;

--- 140 unchanged lines hidden ---
1211 iscsi_destroy_context(iscsi);
1212 memset(iscsilun, 0, sizeof(IscsiLun));
1213}
1214
1215static int iscsi_truncate(BlockDriverState *bs, int64_t offset)
1216{
1217 IscsiLun *iscsilun = bs->opaque;
1218 int ret = 0;

--- 140 unchanged lines hidden ---