
On Fri, Mar 27, 2009 at 11:51:57AM -0400, Dave Allan wrote:
Daniel P. Berrange wrote:
Spot the obvious mistake...
virStorageBackendWaitForDevices(conn);
if ((session = virStorageBackendISCSISession(conn, pool, 0)) == NULL) goto cleanup; if (virStorageBackendISCSIRescanLUNs(conn, pool, session) < 0) goto cleanup; if (virStorageBackendISCSIFindLUNs(conn, pool, session) < 0) goto cleanup;
Its calling udev settle before it has actually told the iSCSI client to rescan the target for new LUNs :-) Probably best to move the call to virStorageBackendWaitForDevices() into the method virStorageBackendISCSIFindLUNs() itself.
Hah...that would break things, wouldn't it? I've moved the call. Give the attached a go and see if it fixes it.
This seems to have solved it.
From 106b4f9b91340b724d9768182bc8788ab48022c0 Mon Sep 17 00:00:00 2001 From: David Allan <dallan@redhat.com> Date: Fri, 27 Mar 2009 11:45:12 -0400 Subject: [PATCH 1/1] Fixed broken placement of udevadm noticed by DanPB.
--- src/storage_backend_iscsi.c | 2 -- src/storage_backend_scsi.c | 4 ++-- 2 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/src/storage_backend_iscsi.c b/src/storage_backend_iscsi.c index 2ececdd..9da7cdc 100644 --- a/src/storage_backend_iscsi.c +++ b/src/storage_backend_iscsi.c @@ -298,8 +298,6 @@ virStorageBackendISCSIRefreshPool(virConnectPtr conn,
pool->def->allocation = pool->def->capacity = pool->def->available = 0;
- virStorageBackendWaitForDevices(conn); - if ((session = virStorageBackendISCSISession(conn, pool, 0)) == NULL) goto cleanup; if (virStorageBackendISCSIRescanLUNs(conn, pool, session) < 0) diff --git a/src/storage_backend_scsi.c b/src/storage_backend_scsi.c index 62c05ae..e0ced8f 100644 --- a/src/storage_backend_scsi.c +++ b/src/storage_backend_scsi.c @@ -445,6 +445,8 @@ virStorageBackendSCSIFindTargets(virConnectPtr conn,
VIR_DEBUG(_("Discovering targets in '%s'"), sysfs_path);
+ virStorageBackendWaitForDevices(conn); + sysdir = opendir(sysfs_path);
if (sysdir == NULL) { @@ -482,8 +484,6 @@ virStorageBackendSCSIRefreshPool(virConnectPtr conn,
pool->def->allocation = pool->def->capacity = pool->def->available = 0;
- virStorageBackendWaitForDevices(conn); - 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; --
Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|