From patchwork Fri Nov 18 13:59:09 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 126411 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id A58DBB725D for ; Sat, 19 Nov 2011 00:59:33 +1100 (EST) Received: from localhost ([::1]:57239 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RROyU-0006uT-P9 for incoming@patchwork.ozlabs.org; Fri, 18 Nov 2011 08:59:26 -0500 Received: from eggs.gnu.org ([140.186.70.92]:41646) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RROyL-0006u6-JP for qemu-devel@nongnu.org; Fri, 18 Nov 2011 08:59:21 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RROyH-0002D6-Hg for qemu-devel@nongnu.org; Fri, 18 Nov 2011 08:59:17 -0500 Received: from mx1.redhat.com ([209.132.183.28]:31216) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RROyG-0002C3-Ve for qemu-devel@nongnu.org; Fri, 18 Nov 2011 08:59:13 -0500 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id pAIDxBXn014751 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 18 Nov 2011 08:59:11 -0500 Received: from yakj.usersys.redhat.com (ovpn-112-23.ams2.redhat.com [10.36.112.23]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id pAIDxAkm008477; Fri, 18 Nov 2011 08:59:10 -0500 Message-ID: <4EC664AD.9080307@redhat.com> Date: Fri, 18 Nov 2011 14:59:09 +0100 From: Paolo Bonzini User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:7.0.1) Gecko/20110930 Thunderbird/7.0.1 MIME-Version: 1.0 To: =?ISO-8859-15?Q?Andreas_F=E4rber?= References: <1321363722-23687-1-git-send-email-pbonzini@redhat.com> <1321374998-18214-1-git-send-email-pbonzini@redhat.com> <4EC65126.9000206@redhat.com> <4EC65F58.6060500@suse.de> In-Reply-To: <4EC65F58.6060500@suse.de> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 X-MIME-Autoconverted: from 8bit to quoted-printable by mx1.redhat.com id pAIDxBXn014751 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 209.132.183.28 Cc: Kevin Wolf , qemu-devel@nongnu.org Subject: Re: [Qemu-devel] [PATCH 1.0 v2] scsi: fix fw path X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org On 11/18/2011 02:36 PM, Andreas Färber wrote: > Am 18.11.2011 13:35, schrieb Kevin Wolf: >> Am 15.11.2011 17:36, schrieb Paolo Bonzini: >>> The pre-1.0 firmware path for SCSI devices already included the LUN >>> using the suffix argument to add_boot_device_path. I missed that when >>> making channel and LUN customizable. Avoid that it is included twice, and >>> convert the colons to commas for consistency with other kinds of devices >>> >>> Signed-off-by: Paolo Bonzini >>> --- >>> v1->v2: include scsi-disk hunk too >> >> Thanks, applied to the block-stable branch (for 1.0) > > Did you guys check the consistency part against OpenFirmware syntax? I > didn't get around to that yet. No, I wasn't aware about the existence of an OF spec for that (only that fw_dev_path design was roughly corresponding to OF). Based on http://www.openfirmware.org/ofwg/practice/spi/spi1_0.ps it looks like this (followup) patch would be preferrable: Kevin, how do you want to proceed? Paolo diff --git a/hw/scsi-bus.c b/hw/scsi-bus.c index b4e6e29..4c33583 100644 --- a/hw/scsi-bus.c +++ b/hw/scsi-bus.c @@ -1304,7 +1304,7 @@ static char *scsibus_get_fw_dev_path(DeviceState *dev) SCSIDevice *d = DO_UPCAST(SCSIDevice, qdev, dev); char path[100]; - snprintf(path, sizeof(path), "%s@%d,%d,%d", qdev_fw_name(dev), + snprintf(path, sizeof(path), "scsi@%x/%s@%x,%x", qdev_fw_name(dev), d->channel, d->id, d->lun); return strdup(path);