qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [RFC Patch 5/7]Qemu: raw-posix image file reopen


From: Supriya Kannery
Subject: Re: [Qemu-devel] [RFC Patch 5/7]Qemu: raw-posix image file reopen
Date: Tue, 14 Feb 2012 19:06:36 +0530
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.20) Gecko/20110817 Fedora/3.1.12-1.fc14 Thunderbird/3.1.12

On 02/07/2012 03:47 PM, Stefan Hajnoczi wrote:
On Wed, Feb 01, 2012 at 08:37:12AM +0530, Supriya Kannery wrote:
+    /* stash state before reopen */
+    raw_rs->stash_s = g_malloc0(sizeof(BDRVRawState));
+    memcpy(raw_rs->stash_s, s, sizeof(BDRVRawState));

Copying a struct is fragile, Mike Roth pointed out the potential issue
with aligned_buf.

If raw-posix could open from a given file descriptor as an alternative
to opening a filename, then it would be clean and natural to simply
re-initialize from the dup'd file descriptor in the abort case.  That's
the approach I would try instead of stashing the whole struct.

Stefan


fine, will get V1 with stashing of only required fields wherever
possible instead of stashing the full struct.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]