From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:53398) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SfYDn-00027G-OT for qemu-devel@nongnu.org; Fri, 15 Jun 2012 11:14:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SfYDh-0006db-5H for qemu-devel@nongnu.org; Fri, 15 Jun 2012 11:13:59 -0400 Received: from e36.co.us.ibm.com ([32.97.110.154]:42764) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SfYDg-0006d5-Tj for qemu-devel@nongnu.org; Fri, 15 Jun 2012 11:13:53 -0400 Received: from /spool/local by e36.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 15 Jun 2012 09:13:47 -0600 Received: from d03relay04.boulder.ibm.com (d03relay04.boulder.ibm.com [9.17.195.106]) by d03dlp03.boulder.ibm.com (Postfix) with ESMTP id 63E6819D804C for ; Fri, 15 Jun 2012 15:13:25 +0000 (WET) Received: from d03av01.boulder.ibm.com (d03av01.boulder.ibm.com [9.17.195.167]) by d03relay04.boulder.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q5FFCeT7103350 for ; Fri, 15 Jun 2012 09:12:57 -0600 Received: from d03av01.boulder.ibm.com (loopback [127.0.0.1]) by d03av01.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q5FFCJKw027098 for ; Fri, 15 Jun 2012 09:12:19 -0600 Message-ID: <4FDB50CB.9010107@linux.vnet.ibm.com> Date: Fri, 15 Jun 2012 11:12:11 -0400 From: Corey Bryant MIME-Version: 1.0 References: <1339689305-27031-1-git-send-email-coreyb@linux.vnet.ibm.com> <1339689305-27031-6-git-send-email-coreyb@linux.vnet.ibm.com> <20120615113811.225a5ed6@doriath.home> In-Reply-To: <20120615113811.225a5ed6@doriath.home> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v3 5/5] block: Prevent /dev/fd/X filename from being detected as floppy List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Luiz Capitulino Cc: kwolf@redhat.com, aliguori@us.ibm.com, stefanha@linux.vnet.ibm.com, libvir-list@redhat.com, qemu-devel@nongnu.org, pbonzini@redhat.com, eblake@redhat.com On 06/15/2012 10:38 AM, Luiz Capitulino wrote: > On Thu, 14 Jun 2012 11:55:05 -0400 > Corey Bryant wrote: > >> Reported-by: Kevin Wolf >> Reviewed-by: Paolo Bonzini >> Signed-off-by: Corey Bryant > > This too, would be better to move before the /dev/fd/X feature so that we > avoid having introducing a bug and fixing it in a later commit. But again, > it's not a huge issue. > Yes, this one makes even more sense to move earlier in the series. Thanks. >> --- >> v3: >> -This patch is new in v3. It was previously submitted on its >> own, and is now being included in this series. >> >> block/raw-posix.c | 4 +++- >> 1 file changed, 3 insertions(+), 1 deletion(-) >> >> diff --git a/block/raw-posix.c b/block/raw-posix.c >> index d8eff2f..68886cd 100644 >> --- a/block/raw-posix.c >> +++ b/block/raw-posix.c >> @@ -946,9 +946,11 @@ static int floppy_probe_device(const char *filename) >> int prio = 0; >> struct floppy_struct fdparam; >> struct stat st; >> + const char *p; >> >> - if (strstart(filename, "/dev/fd", NULL)) >> + if (strstart(filename, "/dev/fd", &p) && p[0] != '/') { >> prio = 50; >> + } >> >> fd = qemu_open(filename, O_RDONLY | O_NONBLOCK); >> if (fd < 0) { > -- Regards, Corey