Added some debug output.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22604 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -10,6 +10,8 @@
|
|||||||
#include <set>
|
#include <set>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
#include <Directory.h>
|
#include <Directory.h>
|
||||||
#include <Entry.h>
|
#include <Entry.h>
|
||||||
#include <image.h>
|
#include <image.h>
|
||||||
@@ -22,6 +24,11 @@
|
|||||||
#include <DiskSystemAddOn.h>
|
#include <DiskSystemAddOn.h>
|
||||||
|
|
||||||
|
|
||||||
|
#undef TRACE
|
||||||
|
//#define TRACE(format...)
|
||||||
|
#define TRACE(format...) printf(format)
|
||||||
|
|
||||||
|
|
||||||
using std::nothrow;
|
using std::nothrow;
|
||||||
|
|
||||||
|
|
||||||
@@ -267,6 +274,8 @@ DiskSystemAddOnManager::_LoadAddOns(StringSet& alreadyLoaded,
|
|||||||
if (error != B_OK)
|
if (error != B_OK)
|
||||||
return error;
|
return error;
|
||||||
|
|
||||||
|
TRACE("DiskSystemAddOnManager::_LoadAddOns(): %s\n", path.Path());
|
||||||
|
|
||||||
error = path.Append("disk_systems");
|
error = path.Append("disk_systems");
|
||||||
if (error != B_OK)
|
if (error != B_OK)
|
||||||
return error;
|
return error;
|
||||||
@@ -283,8 +292,10 @@ DiskSystemAddOnManager::_LoadAddOns(StringSet& alreadyLoaded,
|
|||||||
entry_ref ref;
|
entry_ref ref;
|
||||||
while (directory.GetNextRef(&ref) == B_OK) {
|
while (directory.GetNextRef(&ref) == B_OK) {
|
||||||
// skip, if already loaded
|
// skip, if already loaded
|
||||||
if (alreadyLoaded.find(ref.name) != alreadyLoaded.end())
|
if (alreadyLoaded.find(ref.name) != alreadyLoaded.end()) {
|
||||||
|
TRACE(" skipping \"%s\" -- already loaded\n", ref.name);
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
// get the entry path
|
// get the entry path
|
||||||
BPath entryPath;
|
BPath entryPath;
|
||||||
@@ -292,13 +303,16 @@ DiskSystemAddOnManager::_LoadAddOns(StringSet& alreadyLoaded,
|
|||||||
if (error != B_OK) {
|
if (error != B_OK) {
|
||||||
if (error == B_NO_MEMORY)
|
if (error == B_NO_MEMORY)
|
||||||
return error;
|
return error;
|
||||||
|
TRACE(" skipping \"%s\" -- failed to get path\n", ref.name);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
// load the add-on
|
// load the add-on
|
||||||
image_id image = load_add_on(entryPath.Path());
|
image_id image = load_add_on(entryPath.Path());
|
||||||
if (image < 0)
|
if (image < 0) {
|
||||||
|
TRACE(" skipping \"%s\" -- failed to load add-on\n", ref.name);
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
AddOnImage* addOnImage = new(nothrow) AddOnImage(image);
|
AddOnImage* addOnImage = new(nothrow) AddOnImage(image);
|
||||||
if (!addOnImage) {
|
if (!addOnImage) {
|
||||||
@@ -311,13 +325,17 @@ DiskSystemAddOnManager::_LoadAddOns(StringSet& alreadyLoaded,
|
|||||||
status_t (*getAddOns)(BList*);
|
status_t (*getAddOns)(BList*);
|
||||||
error = get_image_symbol(image, "get_disk_system_add_ons",
|
error = get_image_symbol(image, "get_disk_system_add_ons",
|
||||||
B_SYMBOL_TYPE_TEXT, (void**)&getAddOns);
|
B_SYMBOL_TYPE_TEXT, (void**)&getAddOns);
|
||||||
if (error != B_OK)
|
if (error != B_OK) {
|
||||||
|
TRACE(" skipping \"%s\" -- function symbol not found\n", ref.name);
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
BList addOns;
|
BList addOns;
|
||||||
error = getAddOns(&addOns);
|
error = getAddOns(&addOns);
|
||||||
if (error != B_OK || addOns.IsEmpty())
|
if (error != B_OK || addOns.IsEmpty()) {
|
||||||
|
TRACE(" skipping \"%s\" -- getting add-ons failed\n", ref.name);
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
// create and add AddOn objects
|
// create and add AddOn objects
|
||||||
int32 count = addOns.CountItems();
|
int32 count = addOns.CountItems();
|
||||||
@@ -337,6 +355,9 @@ DiskSystemAddOnManager::_LoadAddOns(StringSet& alreadyLoaded,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TRACE(" got %ld BDiskSystemAddOn(s) from add-on \"%s\"\n", count,
|
||||||
|
ref.name);
|
||||||
|
|
||||||
// add the add-on name to the set of already loaded add-ons
|
// add the add-on name to the set of already loaded add-ons
|
||||||
try {
|
try {
|
||||||
alreadyLoaded.insert(ref.name);
|
alreadyLoaded.insert(ref.name);
|
||||||
|
|||||||
@@ -10,6 +10,11 @@
|
|||||||
#include "DiskSystemAddOnManager.h"
|
#include "DiskSystemAddOnManager.h"
|
||||||
|
|
||||||
|
|
||||||
|
#undef TRACE
|
||||||
|
//#define TRACE(format...)
|
||||||
|
#define TRACE(format...) printf(format)
|
||||||
|
|
||||||
|
|
||||||
// constructor
|
// constructor
|
||||||
BPartition::Delegate::Delegate(BPartition* partition)
|
BPartition::Delegate::Delegate(BPartition* partition)
|
||||||
: fPartition(partition),
|
: fPartition(partition),
|
||||||
@@ -63,12 +68,18 @@ BPartition::Delegate::InitAfterHierarchy()
|
|||||||
DiskSystemAddOnManager* manager = DiskSystemAddOnManager::Default();
|
DiskSystemAddOnManager* manager = DiskSystemAddOnManager::Default();
|
||||||
BDiskSystemAddOn* addOn = manager->GetAddOn(
|
BDiskSystemAddOn* addOn = manager->GetAddOn(
|
||||||
fMutablePartition.ContentType());
|
fMutablePartition.ContentType());
|
||||||
if (!addOn)
|
if (!addOn) {
|
||||||
|
TRACE("BPartition::Delegate::InitAfterHierarchy(): add-on for disk "
|
||||||
|
"system \"%s\" not found\n", fMutablePartition.ContentType());
|
||||||
return B_ENTRY_NOT_FOUND;
|
return B_ENTRY_NOT_FOUND;
|
||||||
|
}
|
||||||
|
|
||||||
BPartitionHandle* handle;
|
BPartitionHandle* handle;
|
||||||
status_t error = addOn->CreatePartitionHandle(&fMutablePartition, &handle);
|
status_t error = addOn->CreatePartitionHandle(&fMutablePartition, &handle);
|
||||||
if (error != B_OK) {
|
if (error != B_OK) {
|
||||||
|
TRACE("BPartition::Delegate::InitAfterHierarchy(): Failed to create "
|
||||||
|
"partition handle for partition %ld, disk system: \"%s\": %s\n",
|
||||||
|
Partition()->ID(), addOn->Name(), strerror(error));
|
||||||
manager->PutAddOn(addOn);
|
manager->PutAddOn(addOn);
|
||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user