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: Stefan Hajnoczi
Subject: Re: [Qemu-devel] [RFC Patch 5/7]Qemu: raw-posix image file reopen
Date: Tue, 7 Feb 2012 10:17:27 +0000
User-agent: Mutt/1.5.21 (2010-09-15)

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



reply via email to

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