From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:53472) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rwvyh-0003jc-Kt for qemu-devel@nongnu.org; Mon, 13 Feb 2012 08:30:00 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Rwvyb-0006Bx-Uy for qemu-devel@nongnu.org; Mon, 13 Feb 2012 08:29:59 -0500 Received: from e23smtp09.au.ibm.com ([202.81.31.142]:57625) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rwvyb-0006Al-EZ for qemu-devel@nongnu.org; Mon, 13 Feb 2012 08:29:53 -0500 Received: from /spool/local by e23smtp09.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 13 Feb 2012 14:21:15 +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 q1DDOfr43371008 for ; Tue, 14 Feb 2012 00:24:41 +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 q1DDTnHV029681 for ; Tue, 14 Feb 2012 00:29:49 +1100 Message-ID: <4F39104B.7080806@linux.vnet.ibm.com> Date: Mon, 13 Feb 2012 18:59:47 +0530 From: Supriya Kannery MIME-Version: 1.0 References: <20120201030557.2990.74150.sendpatchset@skannery.in.ibm.com> <20120201030726.2990.68290.sendpatchset@skannery.in.ibm.com> <4F328E9F.1040106@redhat.com> In-Reply-To: <4F328E9F.1040106@redhat.com> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [RFC Patch 6/7]Qemu: raw-win32 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:32 PM, Kevin Wolf wrote: > Am 01.02.2012 04:07, schrieb Supriya Kannery: >> win32 driver changes for bdrv_reopen_xx functions to >> safely reopen image files. Reopening of image files while >> changing hostcache dynamically is handled here. >> >> + >> + if (osvi.dwMajorVersion>= WINDOWS_VISTA) { >> + s->hfile = ReOpenFile(raw_rs->stash_hfile, 0, FILE_SHARE_READ, >> + overlapped); >> + if (s->hfile == INVALID_HANDLE_VALUE) { >> + int err = GetLastError(); >> + if (err == ERROR_ACCESS_DENIED) { >> + ret = -EACCES; >> + } else { >> + ret = -1; > > Returning -1 where -errno is expected is bad (turns out as -EPERM on > Linux, which is misleading). Maybe -EIO here. ok -thanks, Supriya