aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2011-08-21esp: avoid structure holes spotted by paholeBlue Swirl1-5/+6
Report from pahole on amd64 host: struct ESPState { SysBusDevice busdev; /* 0 5648 */ /* --- cacheline 88 boundary (5632 bytes) was 16 bytes ago --- */ uint32_t it_shift; /* 5648 4 */ /* XXX 4 bytes hole, try to pack */ qemu_irq irq; /* 5656 8 */ uint8_t rregs[16]; /* 5664 16 */ uint8_t wregs[16]; /* 5680 16 */ /* --- cacheline 89 boundary (5696 bytes) --- */ int32_t ti_size; /* 5696 4 */ uint32_t ti_rptr; /* 5700 4 */ uint32_t ti_wptr; /* 5704 4 */ uint8_t ti_buf[16]; /* 5708 16 */ uint32_t status; /* 5724 4 */ uint32_t dma; /* 5728 4 */ /* XXX 4 bytes hole, try to pack */ SCSIBus bus; /* 5736 2120 */ /* --- cacheline 122 boundary (7808 bytes) was 48 bytes ago --- */ SCSIDevice * current_dev; /* 7856 8 */ SCSIRequest * current_req; /* 7864 8 */ /* --- cacheline 123 boundary (7872 bytes) --- */ uint8_t cmdbuf[16]; /* 7872 16 */ uint32_t cmdlen; /* 7888 4 */ uint32_t do_cmd; /* 7892 4 */ uint32_t dma_left; /* 7896 4 */ uint32_t dma_counter; /* 7900 4 */ uint8_t * async_buf; /* 7904 8 */ uint32_t async_len; /* 7912 4 */ /* XXX 4 bytes hole, try to pack */ ESPDMAMemoryReadWriteFunc dma_memory_read; /* 7920 8 */ ESPDMAMemoryReadWriteFunc dma_memory_write; /* 7928 8 */ /* --- cacheline 124 boundary (7936 bytes) --- */ void * dma_opaque; /* 7936 8 */ int dma_enabled; /* 7944 4 */ /* XXX 4 bytes hole, try to pack */ void (*dma_cb)(ESPState *); /* 7952 8 */ /* size: 7960, cachelines: 125 */ /* sum members: 7944, holes: 4, sum holes: 16 */ /* last cacheline: 24 bytes */ }; /* definitions: 1 */ Fix by rearranging the structure to avoid padding. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-08-21sun4m: avoid structure holes spotted by paholeBlue Swirl1-10/+10
Edited report from pahole on amd64 host: struct sun4c_hwdef { ... uint8_t nvram_machine_id; /* 112 1 */ /* XXX 1 byte hole, try to pack */ ... /* size: 136, cachelines: 3 */ /* sum members: 135, holes: 1, sum holes: 1 */ /* last cacheline: 8 bytes */ }; /* definitions: 1 */ struct sun4d_hwdef { ... uint8_t nvram_machine_id; /* 128 1 */ /* XXX 1 byte hole, try to pack */ ... /* size: 152, cachelines: 3 */ /* sum members: 151, holes: 1, sum holes: 1 */ /* last cacheline: 24 bytes */ }; /* definitions: 1 */ struct sun4m_hwdef { ... uint8_t nvram_machine_id; /* 260 1 */ /* XXX 1 byte hole, try to pack */ uint16_t machine_id; /* 262 2 */ uint32_t iommu_version; /* 264 4 */ /* XXX 4 bytes hole, try to pack */ ... /* size: 288, cachelines: 5 */ /* sum members: 283, holes: 2, sum holes: 5 */ /* last cacheline: 32 bytes */ }; /* definitions: 1 */ Fix by rearranging the structures to avoid padding. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-08-21tcx: avoid structure holes spotted by paholeBlue Swirl1-2/+2
Report from pahole on amd64 host: struct TCXState { SysBusDevice busdev; /* 0 5648 */ /* --- cacheline 88 boundary (5632 bytes) was 16 bytes ago --- */ target_phys_addr_t addr; /* 5648 8 */ DisplayState * ds; /* 5656 8 */ uint8_t * vram; /* 5664 8 */ uint32_t * vram24; /* 5672 8 */ uint32_t * cplane; /* 5680 8 */ ram_addr_t vram_offset; /* 5688 8 */ /* --- cacheline 89 boundary (5696 bytes) --- */ ram_addr_t vram24_offset; /* 5696 8 */ ram_addr_t cplane_offset; /* 5704 8 */ uint32_t vram_size; /* 5712 4 */ uint16_t width; /* 5716 2 */ uint16_t height; /* 5718 2 */ uint16_t depth; /* 5720 2 */ uint8_t r[256]; /* 5722 256 */ /* --- cacheline 93 boundary (5952 bytes) was 26 bytes ago --- */ uint8_t g[256]; /* 5978 256 */ /* --- cacheline 97 boundary (6208 bytes) was 26 bytes ago --- */ uint8_t b[256]; /* 6234 256 */ /* XXX 2 bytes hole, try to pack */ /* --- cacheline 101 boundary (6464 bytes) was 28 bytes ago --- */ uint32_t palette[256]; /* 6492 1024 */ /* --- cacheline 117 boundary (7488 bytes) was 28 bytes ago --- */ uint8_t dac_index; /* 7516 1 */ uint8_t dac_state; /* 7517 1 */ /* size: 7520, cachelines: 118 */ /* sum members: 7516, holes: 1, sum holes: 2 */ /* padding: 2 */ /* last cacheline: 32 bytes */ }; /* definitions: 1 */ Fix by rearranging the structure to avoid padding. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-08-21sun4m_iommu: avoid structure holes spotted by paholeBlue Swirl1-1/+1
Report from pahole on amd64 host: struct IOMMUState { SysBusDevice busdev; /* 0 5648 */ /* --- cacheline 88 boundary (5632 bytes) was 16 bytes ago --- */ uint32_t regs[4096]; /* 5648 16384 */ /* --- cacheline 344 boundary (22016 bytes) was 16 bytes ago --- */ target_phys_addr_t iostart; /* 22032 8 */ uint32_t version; /* 22040 4 */ /* XXX 4 bytes hole, try to pack */ qemu_irq irq; /* 22048 8 */ /* size: 22056, cachelines: 345 */ /* sum members: 22052, holes: 1, sum holes: 4 */ /* last cacheline: 40 bytes */ }; /* definitions: 1 */ Fix by rearranging the structure to avoid padding. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-08-21slavio_intctl: avoid structure holes spotted by paholeBlue Swirl1-4/+4
Report from pahole on amd64 host: struct SLAVIO_INTCTLState { SysBusDevice busdev; /* 0 5648 */ /* --- cacheline 88 boundary (5632 bytes) was 16 bytes ago --- */ uint32_t intregm_pending; /* 5648 4 */ uint32_t intregm_disabled; /* 5652 4 */ uint32_t target_cpu; /* 5656 4 */ /* XXX 4 bytes hole, try to pack */ qemu_irq cpu_irqs[16][16]; /* 5664 2048 */ /* --- cacheline 120 boundary (7680 bytes) was 32 bytes ago --- */ SLAVIO_CPUINTCTLState slaves[16]; /* 7712 384 */ /* --- cacheline 126 boundary (8064 bytes) was 32 bytes ago --- */ /* size: 8096, cachelines: 127 */ /* sum members: 8092, holes: 1, sum holes: 4 */ /* last cacheline: 32 bytes */ }; /* definitions: 1 */ struct SLAVIO_CPUINTCTLState { uint32_t intreg_pending; /* 0 4 */ /* XXX 4 bytes hole, try to pack */ struct SLAVIO_INTCTLState * master; /* 8 8 */ uint32_t cpu; /* 16 4 */ uint32_t irl_out; /* 20 4 */ /* size: 24, cachelines: 1 */ /* sum members: 20, holes: 1, sum holes: 4 */ /* last cacheline: 24 bytes */ }; /* definitions: 1 */ Fix by rearranging the structures to avoid padding. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-08-21slavio_misc: avoid structure holes spotted by paholeBlue Swirl1-1/+1
Report from pahole on amd64 host: struct MiscState { SysBusDevice busdev; /* 0 5648 */ /* --- cacheline 88 boundary (5632 bytes) was 16 bytes ago --- */ qemu_irq irq; /* 5648 8 */ uint32_t dummy; /* 5656 4 */ uint8_t config; /* 5660 1 */ uint8_t aux1; /* 5661 1 */ uint8_t aux2; /* 5662 1 */ uint8_t diag; /* 5663 1 */ uint8_t mctrl; /* 5664 1 */ uint8_t sysctrl; /* 5665 1 */ uint16_t leds; /* 5666 2 */ /* XXX 4 bytes hole, try to pack */ qemu_irq fdc_tc; /* 5672 8 */ /* size: 5680, cachelines: 89 */ /* sum members: 5676, holes: 1, sum holes: 4 */ /* last cacheline: 48 bytes */ }; /* definitions: 1 */ Fix by rearranging the structure to avoid padding. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-08-21slavio_timer: avoid structure holes spotted by paholeBlue Swirl1-3/+3
Report from pahole on amd64 host: struct SLAVIO_TIMERState { SysBusDevice busdev; /* 0 5648 */ /* --- cacheline 88 boundary (5632 bytes) was 16 bytes ago --- */ uint32_t num_cpus; /* 5648 4 */ /* XXX 4 bytes hole, try to pack */ CPUTimerState cputimer[17]; /* 5656 816 */ /* --- cacheline 101 boundary (6464 bytes) was 8 bytes ago --- */ uint32_t cputimer_mode; /* 6472 4 */ /* size: 6480, cachelines: 102 */ /* sum members: 6472, holes: 1, sum holes: 4 */ /* padding: 4 */ /* last cacheline: 16 bytes */ }; /* definitions: 1 */ struct CPUTimerState { qemu_irq irq; /* 0 8 */ ptimer_state * timer; /* 8 8 */ uint32_t count; /* 16 4 */ uint32_t counthigh; /* 20 4 */ uint32_t reached; /* 24 4 */ /* XXX 4 bytes hole, try to pack */ uint64_t limit; /* 32 8 */ uint32_t running; /* 40 4 */ /* size: 48, cachelines: 1 */ /* sum members: 40, holes: 1, sum holes: 4 */ /* padding: 4 */ /* last cacheline: 48 bytes */ }; /* definitions: 1 */ Fix by rearranging the structures to avoid padding. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-08-21monitor: Prevent sign-extension of 32-bit addresses printed by info tlbAustin Clements1-2/+2
This is the same fix that was recently applied to info mem. Before this change, info tlb output looked like: ffffffffffffc000: 000000000fffc000 --------W ffffffffffffd000: 000000000fffd000 --------W ffffffffffffe000: 000000000fffe000 --------W fffffffffffff000: 000000000ffff000 --------W With this change, it looks like 00000000ffffc000: 000000000fffc000 --------W 00000000ffffd000: 000000000fffd000 --------W 00000000ffffe000: 000000000fffe000 --------W 00000000fffff000: 000000000ffff000 --------W Signed-off-by: Austin Clements <amdragon@mit.edu> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-08-21Merge branch 'queues/slirp' of git://git.kiszka.org/qemuBlue Swirl2-6/+6
* 'queues/slirp' of git://git.kiszka.org/qemu: slirp: Fix bit field types in IP header structs
2011-08-21tcg-ia64: Fix typos in AREG0 setup in prologue.Richard Henderson1-2/+2
Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-08-21tcg-hppa: Fix CPU_TEMP_BUF_NLONGS oversight.Richard Henderson1-1/+1
Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-08-21tcg: Constant fold neg, andc, orc, eqv, nand, nor.Richard Henderson1-0/+27
Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-08-21tcg: Always define all of the TCGOpcode enum members.Richard Henderson14-1008/+837
By always defining these symbols, we can eliminate a lot of ifdefs. To allow this to be checked reliably, the semantics of the TCG_TARGET_HAS_* macros must be changed from def/undef to true/false. This allows even more ifdefs to be removed, converting them into C if statements. Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-08-21tcg: Add and use TCG_OPF_64BIT.Richard Henderson4-131/+67
This allows the simplification of the op_bits function from tcg/optimize.c. Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-08-21Check for presence of compiler -pthread flag.Brad1-1/+1
OpenBSD / FreeBSD and some other OS's require the use of cc -pthread to link threaded programs so have QEMU's configure script check for the presence of the flag and use it if so. Signed-off-by: Brad Smith <brad@comstyle.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-08-21Convert last qemu_free and qemu_malloc usesBlue Swirl3-5/+5
7267c0947d7e8ae5dff7bafd932c3bc285f43e5c missed a few cases, fix them. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-08-21monitor: Show combined protection bits in "info mem"Austin Clements1-3/+7
Previously, "info mem" considered and displayed only the last-level protection bits for a memory range, which doesn't accurrately represent the protection of that range. Now it shows the combined protection. Signed-off-by: Austin Clements <amdragon@mit.edu> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-08-21monitor: Fix "info mem" to print the last memory rangeAustin Clements1-0/+6
"info mem" groups its output into contiguous ranges with identical protection bits, but previously forgot to print the last range. Signed-off-by: Austin Clements <amdragon@mit.edu> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-08-21monitor: Prevent sign-extension of 32-bit addresses printed by info memAustin Clements1-2/+4
Previously, on 32-bit i386, info mem used signed 32-bit int's to store the page table indexes. As a result, address calculation was done in 32 bits and then incorrectly sign-extended to 64 bits, yielding output like ffffffffef000000-ffffffffef031000 0000000000031000 ur- ffffffffef7bc000-ffffffffef7bd000 0000000000001000 urw ffffffffef7bd000-ffffffffef7be000 0000000000001000 ur- This makes these indexes unsigned, which yields correct output 00000000ef000000-00000000ef031000 0000000000031000 ur- 00000000ef7bc000-00000000ef7bd000 0000000000001000 urw 00000000ef7bd000-00000000ef7be000 0000000000001000 ur- Signed-off-by: Austin Clements <amdragon@mit.edu> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-08-21w32: Fix format string regressionStefan Weil1-1/+1
Commit 953ffe0f935f40c0d6061d69e76e0339393b54f8 introduced FMT_pid which is wrong for w32 and w64 getpid(): those getpid() implementations always return an int value. Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-08-21w64: Add definition of FMT_pidStefan Weil1-0/+2
For mingw-w64, pid_t is _pid_t which is __int64, so this platform needs its own definition of FMT_pid. Reviewed-by: Andreas Färber <andreas.faerber@web.de> Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-08-21Fix conversions from pointer to tcg_target_longStefan Weil2-2/+2
tcg_gen_exit_tb takes a parameter of type tcg_target_long, so the type casts of pointer to long should be replaced by type casts of pointer to tcg_target_long. These changes are needed for build environments where sizeof(long) != sizeof(void *), especially for w64. See 4b4a72e55660abf7efe85aca78762dcfea5519ad which fixed the same issue for the other targets. Cc: Alexander Graf <agraf@suse.de> Cc: Guan Xuetao <gxt@mprc.pku.edu.cn> Acked-by: Guan Xuetao<gxt@mprc.pku.edu.cn> Acked-by: Alexander Graf <agraf@suse.de> Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-08-21Remove remenants of qemu_mallocAnthony Liguori2-5/+5
This covers the various check commands Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-08-21Update HACKING to refer to g_malloc instead of qemu_mallocAnthony Liguori1-3/+3
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-08-20Add trace points for g_malloc/g_free functionsAnthony Liguori1-0/+27
Derived from a patch submitted by Avi Kivity. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-08-20Remove qemu_malloc/qemu_freeAnthony Liguori5-107/+3
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-08-20Use glib memory allocation and free functionsAnthony Liguori357-1674/+1672
qemu_malloc/qemu_free no longer exist after this commit. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-08-20Make glib mandatory and fixup utils appropriatelyAnthony Liguori4-4/+7
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-08-21Reorder default ram_size initializationJan Kiszka1-5/+5
code_gen_alloc depends on it, and that is now called earlier via configure_accelerator. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2011-08-20scsi-disk: fix DPRINTFBlue Swirl1-2/+2
The variable 'status' does not exist anymore, adjust DPRINTF accordingly. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-08-20target-cris/opcode-cris.h: rename REG_PC/SP to CRIS_REG_PC/SPPeter Maydell1-6/+6
The REG_PC constant used in opcode-cris.h can clash with a similar define in system include files. In particular the Ubuntu Lucid SPARC signal.h will define REG_PC, and since qemu-common.h now includes signal.h this was causing compile failures. Rename the constants to avoid this issue. (NB that REG_SP is not actually used within QEMU.) Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2011-08-16scsi: do not overwrite memory on REQUEST SENSE commands with a large bufferPaolo Bonzini1-1/+2
Other scsi_target_reqops commands were careful about not using r->cmd.xfer directly, and instead always cap it to a fixed length. This was not done for REQUEST SENSE, and this patch fixes it. Reported-by: Blue Swirl <blauwirbel@gmail.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-08-14slirp: Fix bit field types in IP header structsJan Kiszka2-6/+6
-mms-bitfields prevents that the bitfields in current IP header structs are packed into a single byte as it is required. Fix this by using uint8_t as backing type. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
2011-08-14hw/scsi-bus.c: Fix use of uninitialised variablePeter Maydell1-1/+1
Don't use req before it has been initialised in scsi_req_new(). This fixes a compile failure due to gcc complaining about this. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Acked-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-08-12qapi: fix build issue due to missing newline in generated headerMichael Roth1-1/+1
Fixes a build issue on RHEL5, and potentially other distros, where gcc will generate an error due to us not writing a trailing "\n" when generating *qmp-commands.h Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-08-12memory: correct documentation typosAvi Kivity1-4/+4
Noted by Drew Jones. Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-08-12memory: add API for creating ROM/device regionsAvi Kivity2-2/+78
ROM/device regions act as mapped RAM for reads, can I/O memory for writes. This allow emulation of flash devices. Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-08-12memory: reclaim resources when a memory region is destroyed for goodAvi Kivity2-0/+25
Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-08-12build: Move QEMU_INCLUDES before QEMU_CFLAGSJiri Denemark1-4/+4
This patch fixes build when any of the include paths from QEMU_CFLAGS contains a header file with similar name to a header file in qemu sources. I hit it with error.h included by qapi/qapi-types-core.h. GCC decided to use /usr/include/alsa/error.h instead of qemu's error.h. Tested-by: Michael Roth <mdroth@linux.vnet.ibm.com> Signed-off-by: Jiri Denemark <jdenemar@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-08-12configure: Disable guest_agent for mingw32Stefan Weil1-0/+1
guest_agent is not supported for mingw32, so the default value should be 'no', not 'yes'. This removes the dependencies to glib-2.0 and python which makes native and cross builds for w32 much easier (no need to get and install these extra packages). It also avoids the problems caused by different bitfield alignment which is required by glib-2.0. It is still possible to set guest_agent=yes via configure option. Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-08-12scsi: add special traces for common commandsPaolo Bonzini2-0/+21
Can be useful when debugging the device scan phase. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-08-12scsi: report unit attention on resetPaolo Bonzini4-6/+7
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-08-12scsi: add support for unit attention conditionsPaolo Bonzini3-2/+94
Unit attention conditions override any sense data the device already has. Their signaling and clearing is handled entirely by the SCSIBus code, and they are completely transparent to the SCSIDevices. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-08-12scsi: add a bunch more common sense codesPaolo Bonzini2-0/+42
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-08-12scsi: move handling of REQUEST SENSE to common codePaolo Bonzini3-25/+12
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-08-12scsi: move handling of REPORT LUNS and invalid LUNs to common codePaolo Bonzini4-29/+177
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-08-12scsi: move request parsing to common codePaolo Bonzini4-30/+38
Also introduce the first occurrence of "independent" SCSIReqOps, to handle invalid commands in common code. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-08-12scsi: push lun field to SCSIDevicePaolo Bonzini3-4/+3
This will let SCSIBus detect requests sent to an invalid LUN, and handle them itself. However, there will be still support for only one LUN per target Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-08-12scsi: introduce SCSICommandPaolo Bonzini2-54/+58
This struct is currently unnamed. Give it a name and use it explicitly to decouple (some parts of) CDB parsing from SCSIRequest. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-08-12scsi: pass cdb already to scsi_req_newPaolo Bonzini6-15/+18
Right now the CDB is not passed to the SCSIBus until scsi_req_enqueue. Passing it to scsi_req_new will let scsi_req_new dispatch common requests through different reqops. Moving the memcpy to scsi_req_new is a hack that will go away as soon as scsi_req_new will also take care of the parsing. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>