On 03/24/2015 06:06 AM, Erik Skultety wrote:
Before introducing necessary changes to storage_driver.c, first
prepare
our structures for storage state XML support.
Resolves:
https://bugzilla.redhat.com/show_bug.cgi?id=1177733
---
src/conf/storage_conf.h | 1 +
src/storage/storage_driver.c | 1 +
2 files changed, 2 insertions(+)
I had started down this path before for a different bug/issue:
http://www.redhat.com/archives/libvir-list/2015-January/msg00465.html
but abandoned the stateDir because it was felt it wasn't necessary. I
recall running into a few "interesting" issues with stateDir including
fixing one issue seen during testing that didn't hit the list. Good
news is I still have the patches in a branch somewhere if you're
interested. 1 & 2 are on list... The 3rd one in the archive was a
solution to the particular problem - that was rejected and a different
solution was pushed.
In any case, I do suggest looking at 1 & 2, plus I can send you an
adjustment to 1 to resolve some condition I ran into, but cannot recall
the details.
John
diff --git a/src/conf/storage_conf.h b/src/conf/storage_conf.h
index 4584075..8ccc947 100644
--- a/src/conf/storage_conf.h
+++ b/src/conf/storage_conf.h
@@ -293,6 +293,7 @@ struct _virStorageDriverState {
char *configDir;
char *autostartDir;
+ char *stateDir;
bool privileged;
};
diff --git a/src/storage/storage_driver.c b/src/storage/storage_driver.c
index 64ea770..e088ffa 100644
--- a/src/storage/storage_driver.c
+++ b/src/storage/storage_driver.c
@@ -261,6 +261,7 @@ storageStateCleanup(void)
VIR_FREE(driver->configDir);
VIR_FREE(driver->autostartDir);
+ VIR_FREE(driver->stateDir);
storageDriverUnlock();
virMutexDestroy(&driver->lock);
VIR_FREE(driver);