From patchwork Sun Aug 8 20:08:18 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: adq X-Patchwork-Id: 61232 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id B4C951007D1 for ; Mon, 9 Aug 2010 06:10:36 +1000 (EST) Received: from localhost ([127.0.0.1]:53343 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OiCCX-0003Jp-B1 for incoming@patchwork.ozlabs.org; Sun, 08 Aug 2010 16:10:33 -0400 Received: from [140.186.70.92] (port=54381 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OiCAf-0003HQ-FX for qemu-devel@nongnu.org; Sun, 08 Aug 2010 16:08:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OiCAd-0007hS-Al for qemu-devel@nongnu.org; Sun, 08 Aug 2010 16:08:36 -0400 Received: from mail-qw0-f45.google.com ([209.85.216.45]:56480) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OiCAd-0007cl-8M for qemu-devel@nongnu.org; Sun, 08 Aug 2010 16:08:35 -0400 Received: by qwi4 with SMTP id 4so1685252qwi.4 for ; Sun, 08 Aug 2010 13:08:18 -0700 (PDT) MIME-Version: 1.0 Received: by 10.229.65.25 with SMTP id g25mr6438134qci.196.1281298098380; Sun, 08 Aug 2010 13:08:18 -0700 (PDT) Received: by 10.229.245.196 with HTTP; Sun, 8 Aug 2010 13:08:18 -0700 (PDT) X-Originating-IP: [82.71.49.12] In-Reply-To: <4C5EACF8.1010101@redhat.com> References: <4C5EACF8.1010101@redhat.com> Date: Sun, 8 Aug 2010 21:08:18 +0100 Message-ID: Subject: Re: [Qemu-devel] [patch] fix scsi-generic From: adq To: Kevin Wolf X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) Cc: qemu-devel@nongnu.org X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org On 8 August 2010 14:11, Kevin Wolf wrote: > Am 07.08.2010 02:55, schrieb adq: >> Hi, I've been tracking down why scsi generic devices (using SG_IO) >> don't work any more. After adding debug, I can see that it actually >> submits the scsi CDB in hw/scsi-generic.c/execute_command(), but that >> the hw/scsi-generic.c/scsi_read_complete() callback is never called. >> >> This is because these are done with ioctls, and the posix async ioctl >> code is, I think, broken right now. Some more debugging, led me to >> posix-aio-compat.c/posix_aio_process_queue(): >> >>             if (acb->async_context_id != async_context_id) { >> >> The async_context_ids don't match, so the request is never handled. >> This is because the acb->async_context_id field is not initialised in >> posix-aio-compat.c/paio_ioctl() (compare with >> posix-aio-compat.c/paio_submit()). The attached patch adds the missing >> line in. >> >> This seems to fix the problem. Of course, /now/ I'm getting other >> weird problems (as I'm trying to see if I can get slysoft anydvd >> working in a KVM winXP vm), but they need further investigation and >> likely other fixes. >> >> Please forgive me if I'm mistaken in this, I've only just started >> looking at the qemu code. > > The patch looks correct to me. > > Please use git format-patch to generate the patch, so that it contains a > decent commit message and I can apply it with git am. Also, please don't > forget the Signed-off-by line, otherwise we can't accept it. Hi, please find it attached; I've not used format-patch before, hope this is correct! From db3cfa4f12ca7e3ed300304ba8a4db15e49b4189 Mon Sep 17 00:00:00 2001 From: Andrew de Quincey Date: Sun, 8 Aug 2010 21:04:50 +0100 Subject: [PATCH] Set the async_context_id field when queuing an async ioctl call Signed-off-by: Andrew de Quincey --- posix-aio-compat.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/posix-aio-compat.c b/posix-aio-compat.c index a67ffe3..efc5968 100644 --- a/posix-aio-compat.c +++ b/posix-aio-compat.c @@ -599,6 +599,7 @@ BlockDriverAIOCB *paio_ioctl(BlockDriverState *bs, int fd, acb->aio_type = QEMU_AIO_IOCTL; acb->aio_fildes = fd; acb->ev_signo = SIGUSR2; + acb->async_context_id = get_async_context_id(); acb->aio_offset = 0; acb->aio_ioctl_buf = buf; acb->aio_ioctl_cmd = req; -- 1.7.2.1