Change requested in launchpad bug #1288352
[packages/centos6/qemu.git] / 0180-srp-Don-t-use-QEMU_PACKED-for-single-elements-of-a-s.patch
1 From 66cbaa761bc0f6d528957f9e3bc5762acb7f5f1c Mon Sep 17 00:00:00 2001
2 From: Stefan Weil <sw@weilnetz.de>
3 Date: Fri, 10 Aug 2012 22:03:27 +0200
4 Subject: [PATCH] srp: Don't use QEMU_PACKED for single elements of a
5  structured type
6
7 QEMU_PACKED results in a MinGW compiler warning when it is
8 used for single structure elements:
9
10 warning: 'gcc_struct' attribute ignored
11
12 Using QEMU_PACKED for the whole structure avoids the compiler warning
13 without changing the memory layout.
14
15 Signed-off-by: Stefan Weil <sw@weilnetz.de>
16 Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
17 (cherry picked from commit 93d3ad2a8048469d2b2bb157697425b66b2a37aa)
18
19 Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
20 ---
21  hw/srp.h | 8 ++++----
22  1 file changed, 4 insertions(+), 4 deletions(-)
23
24 diff --git a/hw/srp.h b/hw/srp.h
25 index 3009bd5..5e0cad5 100644
26 --- a/hw/srp.h
27 +++ b/hw/srp.h
28 @@ -177,13 +177,13 @@ struct srp_tsk_mgmt {
29      uint8_t    reserved1[6];
30      uint64_t   tag;
31      uint8_t    reserved2[4];
32 -    uint64_t   lun QEMU_PACKED;
33 +    uint64_t   lun;
34      uint8_t    reserved3[2];
35      uint8_t    tsk_mgmt_func;
36      uint8_t    reserved4;
37      uint64_t   task_tag;
38      uint8_t    reserved5[8];
39 -};
40 +} QEMU_PACKED;
41  
42  /*
43   * We need the packed attribute because the SRP spec only aligns the
44 @@ -198,14 +198,14 @@ struct srp_cmd {
45      uint8_t    data_in_desc_cnt;
46      uint64_t   tag;
47      uint8_t    reserved2[4];
48 -    uint64_t   lun QEMU_PACKED;
49 +    uint64_t   lun;
50      uint8_t    reserved3;
51      uint8_t    task_attr;
52      uint8_t    reserved4;
53      uint8_t    add_cdb_len;
54      uint8_t    cdb[16];
55      uint8_t    add_data[0];
56 -};
57 +} QEMU_PACKED;
58  
59  enum {
60      SRP_RSP_FLAG_RSPVALID = 1 << 0,
61 -- 
62 1.7.12.1
63