From patchwork Tue Jul 31 14:13:11 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 174261 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 752F52C00AF for ; Wed, 1 Aug 2012 00:13:35 +1000 (EST) Received: from localhost ([::1]:60393 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SwDCX-00074p-5p for incoming@patchwork.ozlabs.org; Tue, 31 Jul 2012 10:13:33 -0400 Received: from eggs.gnu.org ([208.118.235.92]:53736) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SwDCL-00073g-JM for qemu-devel@nongnu.org; Tue, 31 Jul 2012 10:13:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SwDCJ-0004Sh-Pe for qemu-devel@nongnu.org; Tue, 31 Jul 2012 10:13:21 -0400 Received: from mail-pb0-f45.google.com ([209.85.160.45]:46347) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SwDCJ-0004Sc-Fx for qemu-devel@nongnu.org; Tue, 31 Jul 2012 10:13:19 -0400 Received: by pbbro12 with SMTP id ro12so11179546pbb.4 for ; Tue, 31 Jul 2012 07:13:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type; bh=PRj8gOP6DPQ9XE8oGKhde4ASRAmctsj0+crvwGGZ0Sg=; b=imd3UVDZw9rtM4/nMB0MuWpg8QiaTlC76UW24XuFILphYVxsoyVdg6Pe9NuyO0i2QL 6JCHIvPMC+isWa2BdP2GDMXRIljU/8ctm5R3l8lWk8mYWIdI0jcSSduzN/44G0M1+HOK x4pIRubq+qFt0p36NQa8RNtlNlLKZaXWRfHiAGB8Uur/yR/DdxV5ifxQCEq8aqR5CF8y mrgcLdlh9/uWc0Gb5zCq/ee/GEUjik46th9LdTBmZpvS5pVOVNCZ1BcTRVk3YyuV85Rd QZkYMnrUc9hsSTTpcZ0Iaw09fs8nyAVvPvWSKKOzqGbk196tLaBvRlTuV2ELBkcwV67n xAKw== Received: by 10.68.190.102 with SMTP id gp6mr44222227pbc.5.1343743998781; Tue, 31 Jul 2012 07:13:18 -0700 (PDT) Received: from yakj.usersys.redhat.com (93-34-169-1.ip50.fastwebnet.it. [93.34.169.1]) by mx.google.com with ESMTPS id qp9sm368327pbc.9.2012.07.31.07.13.14 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 31 Jul 2012 07:13:16 -0700 (PDT) Message-ID: <5017E7F7.6060602@redhat.com> Date: Tue, 31 Jul 2012 16:13:11 +0200 From: Paolo Bonzini User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:13.0) Gecko/20120615 Thunderbird/13.0.1 MIME-Version: 1.0 To: Gerhard Wiesinger References: <50177589.3020703@wiesinger.com> In-Reply-To: <50177589.3020703@wiesinger.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.85.160.45 Cc: qemu-devel@nongnu.org Subject: Re: [Qemu-devel] Compile errors on latest checkout 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 Il 31/07/2012 08:04, Gerhard Wiesinger ha scritto: > Hello, > > I'm getting the following compile errors: > > /root/download/qemu/git/qemu/hw/megasas.c: In function > ‘megasas_class_init’: > /root/download/qemu/git/qemu/hw/megasas.c:2155:14: error: assignment > from incompatible pointer type [-Werror] > pc->exit = megasas_scsi_uninit; See http://permalink.gmane.org/gmane.comp.emulators.qemu/162607 for this. > With #define DEBUG_SCSI > hw/scsi-disk.c: In function ‘scsi_write_complete’: > hw/scsi-disk.c:450:9: error: format ‘%d’ expects argument of type ‘int’, > but argument 3 has type ‘size_t’ [-Werror=format] > hw/scsi-disk.c: In function ‘scsi_disk_emulate_read_data’: > hw/scsi-disk.c:1274:9: error: format ‘%zd’ expects argument of type > ‘signed size_t’, but argument 2 has type ‘int’ [-Werror=format] > hw/scsi-disk.c: In function ‘scsi_disk_emulate_write_data’: > hw/scsi-disk.c:1452:9: error: format ‘%zd’ expects argument of type > ‘signed size_t’, but argument 2 has type ‘int’ [-Werror=format] > hw/scsi-disk.c: In function ‘scsi_new_request’: > hw/scsi-disk.c:2091:5: error: format ‘%x’ expects a matching ‘unsigned > int’ argument [-Werror=format] > hw/scsi-disk.c:2094:25: error: ‘r’ undeclared (first use in this function) > hw/scsi-disk.c:2094:25: note: each undeclared identifier is reported > only once for each function it appears in See attached patch. Paolo > Please fix it. > > gcc (GCC) 4.6.3 20120306 (Red Hat 4.6.3-2) > > Thnx. > > Ciao, > Gerhard > > > From 8d64c6b73c8385107a9cc7aa25069ebb1aedd1c3 Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Tue, 31 Jul 2012 16:10:23 +0200 Subject: [PATCH] scsi-disk: fix compilation with DEBUG_SCSI Reported-by: Gerhard Wiesinger Signed-off-by: Paolo Bonzini --- hw/scsi-disk.c | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/hw/scsi-disk.c b/hw/scsi-disk.c index e2ec177..a9c7279 100644 --- a/hw/scsi-disk.c +++ b/hw/scsi-disk.c @@ -447,7 +447,7 @@ static void scsi_write_complete(void * opaque, int ret) return; } else { scsi_init_iovec(r, SCSI_DMA_BUF_SIZE); - DPRINTF("Write complete tag=0x%x more=%d\n", r->req.tag, r->qiov.size); + DPRINTF("Write complete tag=0x%x more=%zd\n", r->req.tag, r->qiov.size); scsi_req_data(&r->req, r->qiov.size); } @@ -1277,7 +1277,7 @@ static void scsi_disk_emulate_read_data(SCSIRequest *req) int buflen = r->iov.iov_len; if (buflen) { - DPRINTF("Read buf_len=%zd\n", buflen); + DPRINTF("Read buf_len=%d\n", buflen); r->iov.iov_len = 0; r->started = true; scsi_req_data(&r->req, buflen); @@ -1455,7 +1455,7 @@ static void scsi_disk_emulate_write_data(SCSIRequest *req) if (r->iov.iov_len) { int buflen = r->iov.iov_len; - DPRINTF("Write buf_len=%zd\n", buflen); + DPRINTF("Write buf_len=%d\n", buflen); r->iov.iov_len = 0; scsi_req_data(&r->req, buflen); return; @@ -2093,23 +2093,24 @@ static SCSIRequest *scsi_new_request(SCSIDevice *d, uint32_t tag, uint32_t lun, const SCSIReqOps *ops; uint8_t command; + command = buf[0]; + ops = scsi_disk_reqops_dispatch[command]; + if (!ops) { + ops = &scsi_disk_emulate_reqops; + } + req = scsi_req_alloc(ops, &s->qdev, tag, lun, hba_private); + #ifdef DEBUG_SCSI - DPRINTF("Command: lun=%d tag=0x%x data=0x%02x", lun, buf[0]); + DPRINTF("Command: lun=%d tag=0x%x data=0x%02x", lun, tag, buf[0]); { int i; - for (i = 1; i < r->req.cmd.len; i++) { + for (i = 1; i < req->cmd.len; i++) { printf(" 0x%02x", buf[i]); } printf("\n"); } #endif - command = buf[0]; - ops = scsi_disk_reqops_dispatch[command]; - if (!ops) { - ops = &scsi_disk_emulate_reqops; - } - req = scsi_req_alloc(ops, &s->qdev, tag, lun, hba_private); return req; } -- 1.7.10.4