fix reading of storage pool definitions at startup

* src/storage_conf.c: fix reading of storage pool definitions at startup
  patch by Cole Robinson
daniel
This commit is contained in:
Daniel Veillard 2009-06-25 15:13:25 +00:00
parent 9e0809911c
commit 4c4ea03d7a
2 changed files with 8 additions and 9 deletions

View File

@ -1,3 +1,8 @@
Thu Jun 25 17:12:09 CEST 2009 Daniel Veillard <veillard@redhat.com>
* src/storage_conf.c: fix reading of storage pool definitions at startup
patch by Cole Robinson
Thu Jun 25 16:57:40 CEST 2009 Daniel Veillard <veillard@redhat.com> Thu Jun 25 16:57:40 CEST 2009 Daniel Veillard <veillard@redhat.com>
* src/uml_driver.c: fix UML driver logging macros, patch by Amy * src/uml_driver.c: fix UML driver logging macros, patch by Amy

View File

@ -1391,12 +1391,11 @@ virStoragePoolObjLoad(virConnectPtr conn,
virStoragePoolObjListPtr pools, virStoragePoolObjListPtr pools,
const char *file, const char *file,
const char *path, const char *path,
const char *xml,
const char *autostartLink) { const char *autostartLink) {
virStoragePoolDefPtr def; virStoragePoolDefPtr def;
virStoragePoolObjPtr pool; virStoragePoolObjPtr pool;
if (!(def = virStoragePoolDefParse(NULL, xml, file))) { if (!(def = virStoragePoolDefParseFile(conn, path))) {
return NULL; return NULL;
} }
@ -1450,7 +1449,6 @@ virStoragePoolLoadAllConfigs(virConnectPtr conn,
} }
while ((entry = readdir(dir))) { while ((entry = readdir(dir))) {
char *xml = NULL;
char path[PATH_MAX]; char path[PATH_MAX];
char autostartLink[PATH_MAX]; char autostartLink[PATH_MAX];
virStoragePoolObjPtr pool; virStoragePoolObjPtr pool;
@ -1477,14 +1475,10 @@ virStoragePoolLoadAllConfigs(virConnectPtr conn,
continue; continue;
} }
if (virFileReadAll(path, 8192, &xml) < 0) pool = virStoragePoolObjLoad(conn, pools, entry->d_name, path,
continue; autostartLink);
pool = virStoragePoolObjLoad(conn, pools, entry->d_name, path, xml, autostartLink);
if (pool) if (pool)
virStoragePoolObjUnlock(pool); virStoragePoolObjUnlock(pool);
VIR_FREE(xml);
} }
closedir(dir); closedir(dir);