From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:53652) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rwvy0-0002yV-72 for qemu-devel@nongnu.org; Mon, 13 Feb 2012 08:29:17 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Rwvxu-00063x-Iu for qemu-devel@nongnu.org; Mon, 13 Feb 2012 08:29:16 -0500 Received: from e23smtp01.au.ibm.com ([202.81.31.143]:33138) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rwvxt-00063b-U6 for qemu-devel@nongnu.org; Mon, 13 Feb 2012 08:29:10 -0500 Received: from /spool/local by e23smtp01.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 13 Feb 2012 13:22:57 +1000 Received: from d23av04.au.ibm.com (d23av04.au.ibm.com [9.190.235.139]) by d23relay05.au.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q1DDNGZj3465280 for ; Tue, 14 Feb 2012 00:23:17 +1100 Received: from d23av04.au.ibm.com (loopback [127.0.0.1]) by d23av04.au.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q1DDSOUf028863 for ; Tue, 14 Feb 2012 00:28:25 +1100 Message-ID: <4F390FF6.1050601@linux.vnet.ibm.com> Date: Mon, 13 Feb 2012 18:58:22 +0530 From: Supriya Kannery MIME-Version: 1.0 References: <20120201030557.2990.74150.sendpatchset@skannery.in.ibm.com> <20120201030712.2990.41527.sendpatchset@skannery.in.ibm.com> <4F328CB0.3010509@redhat.com> In-Reply-To: <4F328CB0.3010509@redhat.com> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [RFC Patch 5/7]Qemu: raw-posix image file reopen Reply-To: supriyak@linux.vnet.ibm.com List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf Cc: Stefan Hajnoczi , Luiz Capitulino , Christoph Hellwig , qemu-devel@nongnu.org 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 >