summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoe Marcus Clarke <marcus@FreeBSD.org>2007-04-14 17:14:15 -0400
committerDavid Zeuthen <davidz@redhat.com>2007-04-16 15:41:21 -0400
commit00a651c28c552d207178e1b6be1dc2fef80b211d (patch)
tree8e333952cf5d107e9ce93af7e62fe9079274258d
parent1078461043f99e2f9adc51d9101e3c343a04ff6d (diff)
do not re-probe devices that are managed by hald-addon-storage
Do not re-probe devices that are managed by hald-addon-storage since that will result in a double-probe and data corruption. In particular, this fixes a problem with CD unmounting when ATAPICAM is enabled.
-rw-r--r--hald/freebsd/hf-storage.c26
1 files changed, 25 insertions, 1 deletions
diff --git a/hald/freebsd/hf-storage.c b/hald/freebsd/hf-storage.c
index 19c3ad7b..347aef31 100644
--- a/hald/freebsd/hf-storage.c
+++ b/hald/freebsd/hf-storage.c
@@ -65,6 +65,7 @@ static GNode *hf_storage_geom_tree = NULL;
static GHashTable *hf_storage_geom_hash = NULL;
static void hf_storage_init_geom (void);
+static gboolean hf_storage_device_has_addon (HalDevice *device);
static void
hf_storage_geom_free (gpointer data)
@@ -587,7 +588,8 @@ hf_storage_conftxt_timeout_cb (gpointer data)
{
/* disk changed */
device = hf_devtree_find_from_name(hald_get_gdl(), disk->name);
- if (device && hal_device_has_capability(device, "storage"))
+ if (device && hal_device_has_capability(device, "storage") &&
+ ! hf_storage_device_has_addon(device))
hf_storage_device_rescan_real(device);
}
}
@@ -768,6 +770,28 @@ hf_storage_device_rescan (HalDevice *device)
return FALSE;
}
+static gboolean
+hf_storage_device_has_addon (HalDevice *device)
+{
+ HalDeviceStrListIter iter;
+
+ g_return_val_if_fail(device != NULL, FALSE);
+
+ for (hal_device_property_strlist_iter_init(device, "info.addons", &iter);
+ hal_device_property_strlist_iter_is_valid(&iter);
+ hal_device_property_strlist_iter_next(&iter))
+ {
+ const char *addon;
+
+ addon = hal_device_property_strlist_iter_get_value(&iter);
+
+ if (! strcmp(addon, "hald-addon-storage"))
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
HFHandler hf_storage_handler = {
.init = hf_storage_init,
.probe = hf_storage_probe,