From patchwork Fri Sep 27 15:39:17 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Wolf X-Patchwork-Id: 278620 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 057152C012E for ; Sat, 28 Sep 2013 01:47:06 +1000 (EST) Received: from localhost ([::1]:37243 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VPaG0-00072J-36 for incoming@patchwork.ozlabs.org; Fri, 27 Sep 2013 11:47:04 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55035) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VPa9A-0006NK-PV for qemu-devel@nongnu.org; Fri, 27 Sep 2013 11:40:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VPa95-0007Rm-PF for qemu-devel@nongnu.org; Fri, 27 Sep 2013 11:40:00 -0400 Received: from mx1.redhat.com ([209.132.183.28]:33346) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VPa95-0007R3-BH for qemu-devel@nongnu.org; Fri, 27 Sep 2013 11:39:55 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r8RFdrnH015817 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 27 Sep 2013 11:39:54 -0400 Received: from dhcp-200-207.str.redhat.com (dhcp-192-197.str.redhat.com [10.33.192.197]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r8RFdXrA004831; Fri, 27 Sep 2013 11:39:53 -0400 From: Kevin Wolf To: anthony@codemonkey.ws Date: Fri, 27 Sep 2013 17:39:17 +0200 Message-Id: <1380296370-14523-18-git-send-email-kwolf@redhat.com> In-Reply-To: <1380296370-14523-1-git-send-email-kwolf@redhat.com> References: <1380296370-14523-1-git-send-email-kwolf@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: kwolf@redhat.com, qemu-devel@nongnu.org Subject: [Qemu-devel] [PULL 17/30] block: qed - use QEMU_PACKED for on-disk structures 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 From: Jeff Cody QEDHeader is read, and written, directly from on-disk images via bdrv_pread()/write(). To avoid any unintentional padding, these structs should be packed. Signed-off-by: Jeff Cody Reviewed-by: Richard Henderson Signed-off-by: Kevin Wolf --- block/qed.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/qed.h b/block/qed.h index 2b4dded..5d65bea 100644 --- a/block/qed.h +++ b/block/qed.h @@ -100,7 +100,7 @@ typedef struct { /* if (features & QED_F_BACKING_FILE) */ uint32_t backing_filename_offset; /* in bytes from start of header */ uint32_t backing_filename_size; /* in bytes */ -} QEDHeader; +} QEMU_PACKED QEDHeader; typedef struct { uint64_t offsets[0]; /* in bytes */