mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-08-26 18:41:17 +00:00
Revert previous storage patch which broke test driver
This commit is contained in:
parent
8a8826600c
commit
48f32d8033
@ -1,3 +1,8 @@
|
|||||||
|
Wed Nov 12 16:13:42 GMT 2008 Daniel P. Berrange <berrange@redhat.com>
|
||||||
|
|
||||||
|
* src/storage_backend.c, src/storage_backend.h, src/storage_driver.c:
|
||||||
|
Revert previous patch which breaks "test" driver's storage APIs.
|
||||||
|
|
||||||
Tue Nov 11 15:51:42 GMT 2008 Daniel P. Berrange <berrange@redhat.com>
|
Tue Nov 11 15:51:42 GMT 2008 Daniel P. Berrange <berrange@redhat.com>
|
||||||
|
|
||||||
* src/storage_backend.c, src/storage_backend.h, src/storage_driver.c:
|
* src/storage_backend.c, src/storage_backend.h, src/storage_driver.c:
|
||||||
|
@ -47,27 +47,49 @@
|
|||||||
|
|
||||||
#include "storage_backend.h"
|
#include "storage_backend.h"
|
||||||
|
|
||||||
|
#if WITH_STORAGE_LVM
|
||||||
|
#include "storage_backend_logical.h"
|
||||||
|
#endif
|
||||||
|
#if WITH_STORAGE_ISCSI
|
||||||
|
#include "storage_backend_iscsi.h"
|
||||||
|
#endif
|
||||||
|
#if WITH_STORAGE_DISK
|
||||||
|
#include "storage_backend_disk.h"
|
||||||
|
#endif
|
||||||
|
#if WITH_STORAGE_DIR
|
||||||
|
#include "storage_backend_fs.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
VIR_ENUM_IMPL(virStorageBackendPartTable,
|
VIR_ENUM_IMPL(virStorageBackendPartTable,
|
||||||
VIR_STORAGE_POOL_DISK_LAST,
|
VIR_STORAGE_POOL_DISK_LAST,
|
||||||
"unknown", "dos", "dvh", "gpt",
|
"unknown", "dos", "dvh", "gpt",
|
||||||
"mac", "bsd", "pc98", "sun", "lvm2");
|
"mac", "bsd", "pc98", "sun", "lvm2");
|
||||||
|
|
||||||
static unsigned nbackends = 0;
|
static virStorageBackendPtr backends[] = {
|
||||||
static virStorageBackendPtr *backends = NULL;
|
#if WITH_STORAGE_DIR
|
||||||
|
&virStorageBackendDirectory,
|
||||||
|
#endif
|
||||||
|
#if WITH_STORAGE_FS
|
||||||
|
&virStorageBackendFileSystem,
|
||||||
|
&virStorageBackendNetFileSystem,
|
||||||
|
#endif
|
||||||
|
#if WITH_STORAGE_LVM
|
||||||
|
&virStorageBackendLogical,
|
||||||
|
#endif
|
||||||
|
#if WITH_STORAGE_ISCSI
|
||||||
|
&virStorageBackendISCSI,
|
||||||
|
#endif
|
||||||
|
#if WITH_STORAGE_DISK
|
||||||
|
&virStorageBackendDisk,
|
||||||
|
#endif
|
||||||
|
NULL
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
int virStorageBackendRegister(virStorageBackendPtr bk) {
|
|
||||||
if (VIR_REALLOC_N(backends, nbackends+1) < 0)
|
|
||||||
return -1;
|
|
||||||
|
|
||||||
backends[nbackends++] = bk;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
virStorageBackendPtr
|
virStorageBackendPtr
|
||||||
virStorageBackendForType(int type) {
|
virStorageBackendForType(int type) {
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
for (i = 0; i < nbackends; i++)
|
for (i = 0; backends[i]; i++)
|
||||||
if (backends[i]->type == type)
|
if (backends[i]->type == type)
|
||||||
return backends[i];
|
return backends[i];
|
||||||
|
|
||||||
|
@ -121,7 +121,6 @@ struct _virStorageBackend {
|
|||||||
int volType;
|
int volType;
|
||||||
};
|
};
|
||||||
|
|
||||||
int virStorageBackendRegister(virStorageBackendPtr bk);
|
|
||||||
|
|
||||||
virStorageBackendPtr virStorageBackendForType(int type);
|
virStorageBackendPtr virStorageBackendForType(int type);
|
||||||
virStorageBackendPoolOptionsPtr virStorageBackendPoolOptionsForType(int type);
|
virStorageBackendPoolOptionsPtr virStorageBackendPoolOptionsForType(int type);
|
||||||
|
@ -41,20 +41,6 @@
|
|||||||
#include "memory.h"
|
#include "memory.h"
|
||||||
#include "storage_backend.h"
|
#include "storage_backend.h"
|
||||||
|
|
||||||
|
|
||||||
#if WITH_STORAGE_LVM
|
|
||||||
#include "storage_backend_logical.h"
|
|
||||||
#endif
|
|
||||||
#if WITH_STORAGE_ISCSI
|
|
||||||
#include "storage_backend_iscsi.h"
|
|
||||||
#endif
|
|
||||||
#if WITH_STORAGE_DISK
|
|
||||||
#include "storage_backend_disk.h"
|
|
||||||
#endif
|
|
||||||
#if WITH_STORAGE_DIR
|
|
||||||
#include "storage_backend_fs.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define storageLog(msg...) fprintf(stderr, msg)
|
#define storageLog(msg...) fprintf(stderr, msg)
|
||||||
|
|
||||||
static virStorageDriverStatePtr driverState;
|
static virStorageDriverStatePtr driverState;
|
||||||
@ -111,29 +97,6 @@ storageDriverStartup(void) {
|
|||||||
char *base = NULL;
|
char *base = NULL;
|
||||||
char driverConf[PATH_MAX];
|
char driverConf[PATH_MAX];
|
||||||
|
|
||||||
#if WITH_STORAGE_DIR
|
|
||||||
if (virStorageBackendRegister(&virStorageBackendDirectory) < 0)
|
|
||||||
return -1;
|
|
||||||
#endif
|
|
||||||
#if WITH_STORAGE_FS
|
|
||||||
if (virStorageBackendRegister(&virStorageBackendFileSystem) < 0)
|
|
||||||
return -1;
|
|
||||||
if (virStorageBackendRegister(&virStorageBackendNetFileSystem) < 0)
|
|
||||||
return -1;
|
|
||||||
#endif
|
|
||||||
#if WITH_STORAGE_LVM
|
|
||||||
if (virStorageBackendRegister(&virStorageBackendLogical) < 0)
|
|
||||||
return -1;
|
|
||||||
#endif
|
|
||||||
#if WITH_STORAGE_ISCSI
|
|
||||||
if (virStorageBackendRegister(&virStorageBackendISCSI) < 0)
|
|
||||||
return -1;
|
|
||||||
#endif
|
|
||||||
#if WITH_STORAGE_DISK
|
|
||||||
if (virStorageBackendRegister(&virStorageBackendDisk) < 0)
|
|
||||||
return -1;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (VIR_ALLOC(driverState) < 0)
|
if (VIR_ALLOC(driverState) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user