On 02/08/2012 08:24 PM, Kevin Wolf wrote:
Am 01.02.2012 04:07, schrieb Supriya Kannery:
raw-posix driver changes for bdrv_reopen_xx functions to
safely reopen image files. Reopening of image files while
changing hostcache dynamically is handled here.



+typedef struct BDRVRawReopenState {
+    BDRVReopenState reopen_state;
+    BDRVRawState *stash_s;
+} BDRVRawReopenState;

See Stefan's comment. If it's possible to save only the fd and maybe one
or two other fields, then we should do that.


Yes, for V1 of this patchset, will look for stashing only those relevant
fields of a driver state wherever possible

+
+    if ((bs->open_flags&  ~fcntl_flags) == (flags&  ~fcntl_flags)) {
+        if ((flags&  BDRV_O_NOCACHE)) {
+            s->open_flags |= O_DIRECT;
+        } else {
+            s->open_flags&= ~O_DIRECT;
+        }
+        printf("O_DIRECT flag\n");

Debugging leftover?


yes :-), didn't do a proper cleanup as this is RFC
for the stashing approach.

+        ret = fcntl_setfl(s->fd, s->open_flags);
+    } else {
+
+        printf("close and open with new flags\n");

Same here.


V1 will be a clean one !

Kevin



Reply via email to