diff options
author | Marcelo Tosatti <mtosatti@redhat.com> | 2012-08-31 12:43:17 -0300 |
---|---|---|
committer | Marcelo Tosatti <mtosatti@redhat.com> | 2012-08-31 12:43:17 -0300 |
commit | 1cc707b10567b0ebf2670e39f4a3c01da664fd6a (patch) | |
tree | 16cdc115c50e38a550915ca1ca2a014abce4d569 /hw/megasas.c | |
parent | 352183cdb01761ba813576b3bc559947cbccbae8 (diff) | |
parent | 01fd4b8e9e28b92f124556a5889167820c52635f (diff) |
Merge branch 'upstream-merge'qemu-kvm-1.2.0-rc2
* upstream-merge: (47 commits)
w32: Fix broken build
Update version for 1.2.0-rc2
scsi-disk: Fix typo (uint32 -> uint32_t)
msix: make [un]use vectors on reset/load optional
kvm: get/set PV EOI MSR
linux-headers: update to 3.6-rc3
target-i386: disable pv eoi to fix migration across QEMU versions
reset PMBA and PMREGMISC PIIX4 registers.
qemu-ga: Fix null pointer passed to unlink in failure branch
memory: Fix copy&paste mistake in memory_region_iorange_write
ivshmem: remove redundant ioeventfd configuration
hw/arm_gic.c: Define .class_size in arm_gic_info TypeInfo
tcg/mips: fix broken CONFIG_TCG_PASS_AREG0 code
Update OpenBIOS PPC image
target-ppc: fix altivec instructions
audio/winwave: previous audio buffer should be flushed
iscsi: Set number of blocks to 0 for blank CDROM devices
scsi: more fixes to properties for passthrough devices
esp: support 24-bit DMA
megasas: Add 'hba_serial' property
...
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'hw/megasas.c')
-rw-r--r-- | hw/megasas.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/hw/megasas.c b/hw/megasas.c index c35a15db4..c728aea69 100644 --- a/hw/megasas.c +++ b/hw/megasas.c @@ -38,6 +38,7 @@ #define MEGASAS_MAX_SECTORS 0xFFFF /* No real limit */ #define MEGASAS_MAX_ARRAYS 128 +#define MEGASAS_HBA_SERIAL "QEMU123456" #define NAA_LOCALLY_ASSIGNED_ID 0x3ULL #define IEEE_COMPANY_LOCALLY_ASSIGNED 0x525400 @@ -93,6 +94,7 @@ typedef struct MegasasState { int boot_event; uint64_t sas_addr; + char *hba_serial; uint64_t reply_queue_pa; void *reply_queue; @@ -698,8 +700,7 @@ static int megasas_ctrl_get_info(MegasasState *s, MegasasCmd *cmd) } memcpy(info.product_name, "MegaRAID SAS 8708EM2", 20); - snprintf(info.serial_number, 32, "QEMU%08lx", - (unsigned long)s & 0xFFFFFFFF); + snprintf(info.serial_number, 32, "%s", s->hba_serial); snprintf(info.package_version, 0x60, "%s-QEMU", QEMU_VERSION); memcpy(info.image_component[0].name, "APP", 3); memcpy(info.image_component[0].version, MEGASAS_VERSION "-QEMU", 9); @@ -2132,6 +2133,9 @@ static int megasas_scsi_init(PCIDevice *dev) s->sas_addr |= (PCI_SLOT(dev->devfn) << 8); s->sas_addr |= PCI_FUNC(dev->devfn); } + if (!s->hba_serial) { + s->hba_serial = g_strdup(MEGASAS_HBA_SERIAL); + } if (s->fw_sge >= MEGASAS_MAX_SGE - MFI_PASS_FRAME_SIZE) { s->fw_sge = MEGASAS_MAX_SGE - MFI_PASS_FRAME_SIZE; } else if (s->fw_sge >= 128 - MFI_PASS_FRAME_SIZE) { @@ -2166,6 +2170,7 @@ static Property megasas_properties[] = { MEGASAS_DEFAULT_SGE), DEFINE_PROP_UINT32("max_cmds", MegasasState, fw_cmds, MEGASAS_DEFAULT_FRAMES), + DEFINE_PROP_STRING("hba_serial", MegasasState, hba_serial), DEFINE_PROP_HEX64("sas_address", MegasasState, sas_addr, 0), #ifdef USE_MSIX DEFINE_PROP_BIT("use_msix", MegasasState, flags, |