summaryrefslogtreecommitdiff
path: root/hw
AgeCommit message (Collapse)AuthorFilesLines
2016-01-11Merge remote-tracking branch ↵Peter Maydell11-34/+19
'remotes/mjt/tags/pull-trivial-patches-2016-01-11' into staging trivial patches for 2016-01-11 # gpg: Signature made Mon 11 Jan 2016 08:39:32 GMT using RSA key ID A4C3D7DB # gpg: Good signature from "Michael Tokarev <mjt@tls.msk.ru>" # gpg: aka "Michael Tokarev <mjt@corpit.ru>" # gpg: aka "Michael Tokarev <mjt@debian.org>" * remotes/mjt/tags/pull-trivial-patches-2016-01-11: hw/s390x: Remove superfluous return statements hw/core/qdev: Remove superfluous return statement hw/acpi: Remove superfluous return statement hw/ide: Remove superfluous return statements osdep.h: Include glib-compat.h in osdep.h rather than qemu-common.h scripts/checkpatch.pl: Don't allow special cases of unspaced operators PCI Bonito: QOMify and cleanup SH PCI Host: convert to realize() gt64120: convert to realize() Add missing syscall nrs. according to more recent Linux kernels hw/misc/edu: Convert to realize() configure: fix trace backend check xen/Makefile.objs: simplify crypto: Fix typo in example MAINTAINERS: Add the correct device_tree.h file iscsi: fix readcapacity error message net: convert qemu_log to error_report, fix message linux-user: enable sigaltstack for all architectures unicore32: convert get_sp_from_cpustate from macro to inline Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2016-01-11Merge remote-tracking branch 'remotes/jasowang/tags/net-pull-request' into ↵Peter Maydell6-88/+250
staging # gpg: Signature made Mon 11 Jan 2016 05:22:16 GMT using RSA key ID 398D6211 # gpg: Good signature from "Jason Wang (Jason Wang on RedHat) <jasowang@redhat.com>" # gpg: WARNING: This key is not certified with sufficiently trusted signatures! # gpg: It is not certain that the signature belongs to the owner. # Primary key fingerprint: 215D 46F4 8246 689E C77F 3562 EF04 965B 398D 6211 * remotes/jasowang/tags/net-pull-request: (24 commits) ether/slirp: Avoid redefinition of the same constants l2tpv3: fix cookie decoding net: ne2000: fix bounds check in ioport operations net: rocker: fix an incorrect array bounds check vmxnet3: Introduce 'x-disable-pcie' back-compat property vmxnet3: Report the Device Serial Number capability vmxnet3: The vmxnet3 device is a PCIE endpoint vmxnet3: coding: Introduce VMXNET3Class vmxnet3: Introduce 'x-old-msi-offsets' back-compat property vmxnet3: Change the offset of the MSIX PBA table vmxnet3: Change offsets of msi/msix pci capabilities net/filter: fix nf->netdev_id leak net/dump: fix nfds->filename leak net/vmxnet3: rename VMXNET3_DEVICE_VERSION to VMXNET3_UPT_REVISION net/vmxnet3: return 0 on unknown command net/vmxnet3: return correct value for VMXNET3_CMD_GET_DEV_EXTRA_INFO net/vmxnet3: return correct value for VMXNET3_CMD_GET_DID_* command net/vmxnet3: return 1 on device activation failure MAINTAINERS: Add an entry for the net/slirp.c file net: vmxnet3: avoid memory leakage in activate_device ... Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2016-01-11Merge remote-tracking branch 'remotes/dgibson/tags/ppc-for-2.6-20160111' ↵Peter Maydell3-129/+146
into staging ppc patch queue 2016-01-11 Biggest content is a thorough cleanups of spapr machine type handling. Also contains several other minor cleanups, bugfixes and extensions. # gpg: Signature made Mon 11 Jan 2016 04:34:38 GMT using RSA key ID 20D9B392 # gpg: Good signature from "David Gibson <david@gibson.dropbear.id.au>" # gpg: aka "David Gibson (Red Hat) <dgibson@redhat.com>" # gpg: aka "David Gibson (ozlabs.org) <dgibson@ozlabs.org>" # gpg: WARNING: This key is not certified with sufficiently trusted signatures! # gpg: It is not certain that the signature belongs to the owner. # Primary key fingerprint: 75F4 6586 AE61 A66C C44E 87DC 6C38 CACA 20D9 B392 * remotes/dgibson/tags/ppc-for-2.6-20160111: hw/ppc/spapr: fix spapr->kvm_type leak spapr vio: fix to incomplete QOMify hw/ppc/spapr: Use XHCI as host controller for new spapr machines pseries: Add pseries-2.6 machine type pseries: Improve setting of default machine version pseries: Restructure class_options functions pseries: DEFINE_SPAPR_MACHINE pseries: Use SET_MACHINE_COMPAT Move SET_MACHINE_COMPAT macro to boards.h pseries: Remove versions from mc->desc pseries: Remove redundant calls to spapr_machine_initfn() pseries: Rearrange versioned machine type code pseries: Remove redundant setting of mc->name for pseries-2.5 machine spapr: Add /system-id target-ppc: Define kvmppc_read_int_dt() hw/ppc/spapr_rtc: Remove bad class_size value Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2016-01-11hw/s390x: Remove superfluous return statementsThomas Huth2-5/+0
The "return;" statements at the end of functions do not make much sense, so let's remove them. Cc: Cornelia Huck <cornelia.huck@de.ibm.com> Cc: Christian Borntraeger <borntraeger@de.ibm.com> Cc: Alexander Graf <agraf@suse.de> Cc: Richard Henderson <rth@twiddle.net> Signed-off-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2016-01-11hw/core/qdev: Remove superfluous return statementThomas Huth1-1/+0
The "return;" statement at the end of device_set_realized() does not make much sense, so let's remove it. Signed-off-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2016-01-11hw/acpi: Remove superfluous return statementThomas Huth1-1/+0
The "return;" statement at the end of acpi_memory_plug_cb() does not make much sense, so let's remove it. Cc: "Michael S. Tsirkin" <mst@redhat.com> Cc: Igor Mammedov <imammedo@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2016-01-11hw/ide: Remove superfluous return statementsThomas Huth2-3/+0
The "return;" statements at the end of functions do not make much sense, so let's remove them. Cc: qemu-block@nongnu.org Signed-off-by: Thomas Huth <thuth@redhat.com> Reviewed-by: John Snow <jsnow@redhat.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2016-01-11PCI Bonito: QOMify and cleanupCao jin1-11/+12
Also clear the code Signed-off-by: Cao jin <caoj.fnst@cn.fujitsu.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2016-01-11SH PCI Host: convert to realize()Cao jin1-3/+2
Signed-off-by: Cao jin <caoj.fnst@cn.fujitsu.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2016-01-11gt64120: convert to realize()Cao jin1-4/+2
Signed-off-by: Cao jin <caoj.fnst@cn.fujitsu.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2016-01-11hw/misc/edu: Convert to realize()Cao jin1-4/+2
for educational PCI device Signed-off-by: Cao jin <caoj.fnst@cn.fujitsu.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2016-01-11xen/Makefile.objs: simplifyCao jin1-2/+1
merge last two lines, keep alphabetic order. Signed-off-by: Cao jin <caoj.fnst@cn.fujitsu.com> Reviewed-by: Stefan Weil <sw@weilnetz.de> Reviewed-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2016-01-11hw/ppc/spapr: fix spapr->kvm_type leakDavid Gibson1-0/+8
Cc: David Gibson <david@gibson.dropbear.id.au> Cc: Alexander Graf <agraf@suse.de> Cc: qemu-ppc@nongnu.org Signed-off-by: Li Zhijian <lizhijian@cn.fujitsu.com> [fixed return type of spapr_machine_finalizefn()] Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2016-01-11spapr vio: fix to incomplete QOMifyCao jin1-7/+5
Signed-off-by: Cao jin <caoj.fnst@cn.fujitsu.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2016-01-11hw/ppc/spapr: Use XHCI as host controller for new spapr machinesThomas Huth1-1/+8
The OHCI has some bugs and performance issues, so for newer machines it's preferable to use XHCI instead. Signed-off-by: Thomas Huth <thuth@redhat.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2016-01-11pseries: Add pseries-2.6 machine typeDavid Gibson1-2/+20
Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Reviewed-by: Alexey Kardashevskiy <aik@ozlabs.ru>
2016-01-11pseries: Improve setting of default machine versionDavid Gibson1-10/+10
This tweaks the way the default machine version is controlled, so that there will be a bit less churn when each new version is introduced. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Reviewed-by: Alexey Kardashevskiy <aik@ozlabs.ru>
2016-01-11pseries: Restructure class_options functionsDavid Gibson1-4/+17
Currently each of the *_class_options() functions for the pseries-2.1 .. pseries-2.5 machine types are standalone. This will become harder to maintain as new versions are added. This patch restructures them similarly to x86 where each function calls the one from the next version, then overrides anything necessary for compatibility with the specific version and older. The default behaviour - that for the most recent machine are set up in the base class initializer spapr_machine_class_init(). Previously it had some things set up to default to older behaviour with the more recent machines overriding it. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Reviewed-by: Alexey Kardashevskiy <aik@ozlabs.ru>
2016-01-11pseries: DEFINE_SPAPR_MACHINEDavid Gibson1-70/+49
At the moment all the class_init functions and TypeInfo structures for the various versioned pseries machine types are open-coded. As more versions are created this is getting increasingly clumsy. This patch borrows the approach used in PC, using a DEFINE_SPAPR_MACHINE() macro to construct most of the boilerplate from simpler 'class_options' and 'instance_options' functions. This patch makes a small semantic change - the versioned machine types are now registered through machine_init() instead of type_init(). Since the new way is how PC already did it, I'm assuming that's correct. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Reviewed-by: Sam Bobroff <sam.bobroff@au1.ibm.com> Reviewed-by: Alexey Kardashevskiy <aik@ozlabs.ru>
2016-01-11pseries: Use SET_MACHINE_COMPATDavid Gibson1-20/+4
To make the spapr_machine_*_class_init() functions a little less bulky. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Reviewed-by: Thomas Huth <thuth@redhat.com> Reviewed-by: Alexey Kardashevskiy <aik@ozlabs.ru>
2016-01-11pseries: Remove versions from mc->descDavid Gibson1-5/+1
Currently, the versioned spapr machine types put the machine type version into the description string. PC does not do this, using just the name itself to distinguish. Doing the same lets us move setting the description into the common base class, simplifying the code slightly. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Reviewed-by: Thomas Huth <thuth@redhat.com> Reviewed-by: Alexey Kardashevskiy <aik@ozlabs.ru>
2016-01-11pseries: Remove redundant calls to spapr_machine_initfn()David Gibson1-3/+0
The instance_init() functions for several of the pseries-x.y versioned machine types explicitly call spapr_machine_initfn(). But that's the instance_init function for the common parent of all those machine types, so will already have been called beforehand by the QOM infrastructure. Remove the redundant calls. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Reviewed-by: Thomas Huth <thuth@redhat.com> Reviewed-by: Alexey Kardashevskiy <aik@ozlabs.ru>
2016-01-11pseries: Rearrange versioned machine type codeDavid Gibson1-82/+98
hw/ppc/spapr.c has a number of definitions related to the various versioned machine types ("pseries-2.1" .. "pseries-2.5") it defines. These are mostly arranged by type of function first, then machine version second, and it's not consistent about whether it goes in increasing or decreasing version order. This rearranges the code to keep all the definitions for a particular machine version together, and arrange then consistently in order most recent to least recent. This brings us closer to matching the way PC does things, and makes later cleanups easier to follow. Apart from adding some comments marking each section, this is a pure mechanical rearrangement with no semantic changes. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Reviewed-by: Thomas Huth <thuth@redhat.com> Reviewed-by: Alexey Kardashevskiy <aik@ozlabs.ru>
2016-01-11pseries: Remove redundant setting of mc->name for pseries-2.5 machineDavid Gibson1-1/+0
98cec76 "machine: Set MachineClass::name automatically" removed the setting of mc->name for the pseries machine types, since it can be derived automatically from the type names constructed with MACHINE_TYPE_NAME(). Unfortunately fb0fc8f "spapr: Create pseries-2.5 machine" went in later and brought one of them back. This removes it again. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Reviewed-by: Thomas Huth <thuth@redhat.com> Reviewed-by: Alexey Kardashevskiy <aik@ozlabs.ru>
2016-01-11spapr: Add /system-idAlexey Kardashevskiy1-0/+3
Section B.6.2.1 Root Node Properties of PAPR specification defines a set of properties which shall be present in the device tree root, one of these properties is "system-id" which "should be unique across all systems and all manufacturers". Since UUID is meant to be unique, it makes sense to use it as "system-id". This adds "system-id" property to the device tree root when not empty. Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2016-01-11ether/slirp: Avoid redefinition of the same constantsDr. David Alan Gilbert1-1/+0
eth.h and slirp.h both define ETH_ALEN and ETH_P_IP rtl8139.c and eth.h both define ETH_HLEN Move the related constant (ETH_P_ARP) from slirp.h to eth.h, and remove the duplicates; make slirp.h include eth.h Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Signed-off-by: Jason Wang <jasowang@redhat.com>
2016-01-11net: ne2000: fix bounds check in ioport operationsPrasad J Pandit1-4/+6
While doing ioport r/w operations, ne2000 device emulation suffers from OOB r/w errors. Update respective array bounds check to avoid OOB access. Reported-by: Ling Liu <liuling-it@360.cn> Cc: qemu-stable@nongnu.org Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org> Signed-off-by: Jason Wang <jasowang@redhat.com>
2016-01-11net: rocker: fix an incorrect array bounds checkPrasad J Pandit1-4/+4
While processing transmit(tx) descriptors in 'tx_consume' routine the switch emulator suffers from an off-by-one error, if a descriptor was to have more than allowed(ROCKER_TX_FRAGS_MAX=16) fragments. Fix an incorrect bounds check to avoid it. Reported-by: Qinghao Tang <luodalongde@gmail.com> Cc: qemu-stable@nongnu.org Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org> Signed-off-by: Jason Wang <jasowang@redhat.com>
2016-01-11vmxnet3: Introduce 'x-disable-pcie' back-compat propertyShmulik Ladkani1-0/+2
Following the previous patch which changed vmxnet3 to be a pci express device, this patch introduces a boolean property 'x-disable-pcie' whose default is false. Setting 'x-disable-pcie' to 'on' preserves the old 'pci device' (non express) behavior. This allows migration to older versions. Signed-off-by: Shmulik Ladkani <shmulik.ladkani@ravellosystems.com> Signed-off-by: Jason Wang <jasowang@redhat.com>
2016-01-11vmxnet3: Report the Device Serial Number capabilityShmulik Ladkani1-2/+26
Report the DSN extended PCI capability at 0x100. DSN value is a transformation of device MAC address, as calculated by VMware virtual hardware. DSN is reported only if device is pcie. Signed-off-by: Shmulik Ladkani <shmulik.ladkani@ravellosystems.com> Signed-off-by: Jason Wang <jasowang@redhat.com>
2016-01-11vmxnet3: The vmxnet3 device is a PCIE endpointShmulik Ladkani1-1/+52
Report the 'express endpoint' capability if on a PCIE bus. Signed-off-by: Shmulik Ladkani <shmulik.ladkani@ravellosystems.com> Signed-off-by: Jason Wang <jasowang@redhat.com>
2016-01-11vmxnet3: coding: Introduce VMXNET3ClassShmulik Ladkani1-0/+10
Introduce a class type for vmxnet3, and the usual DEVICE_CLASS/DEVICE_GET_CLASS macros. No semantic change. Signed-off-by: Shmulik Ladkani <shmulik.ladkani@ravellosystems.com> Signed-off-by: Jason Wang <jasowang@redhat.com>
2016-01-11vmxnet3: Introduce 'x-old-msi-offsets' back-compat propertyShmulik Ladkani1-0/+2
Following the previous patches, where vmxnet3's pci's msi/msix capability offsets and msix's PBA table offsets have been changed, this patch introduces a boolean property 'x-old-msi-offsets' to vmxnet3, whose default is false. Setting 'x-old-msi-offsets' to 'on' preserves the old offsets behavior, which allows migration to older versions. Signed-off-by: Shmulik Ladkani <shmulik.ladkani@ravellosystems.com> Signed-off-by: Jason Wang <jasowang@redhat.com>
2016-01-11vmxnet3: Change the offset of the MSIX PBA tableShmulik Ladkani1-2/+3
Place the PBA table at 0x1000, as placed by VMware virtual hardware. Signed-off-by: Shmulik Ladkani <shmulik.ladkani@ravellosystems.com> Signed-off-by: Jason Wang <jasowang@redhat.com>
2016-01-11vmxnet3: Change offsets of msi/msix pci capabilitiesShmulik Ladkani1-3/+15
Place device reported PCI capabilities at the same offsets as placed by the VMware virtual hardware: MSI at [84], MSI-X at [9c]. Signed-off-by: Shmulik Ladkani <shmulik.ladkani@ravellosystems.com> Signed-off-by: Jason Wang <jasowang@redhat.com>
2016-01-11net/vmxnet3: rename VMXNET3_DEVICE_VERSION to VMXNET3_UPT_REVISIONMiao Yan1-2/+2
VMXNET3_DEVICE_VERSION is used as return value for accessing UPT Revision Report and Selection register. So rename it to VMXNET3_UPT_REVISION. Signed-off-by: Miao Yan <yanmiaoebest@gmail.com> Reviewed-by: Dmitry Fleytman <dmitry@daynix.com> Signed-off-by: Jason Wang <jasowang@redhat.com>
2016-01-11net/vmxnet3: return 0 on unknown commandMiao Yan1-1/+1
Return 0 on unknown command, this is what esxi (5.x+) behaves. Signed-off-by: Miao Yan <yanmiaobest@gmail.com> Reviewed-by: Dmitry Fleytman <dmitry@daynix.com> Signed-off-by: Jason Wang <jasowang@redhat.com>
2016-01-11net/vmxnet3: return correct value for VMXNET3_CMD_GET_DEV_EXTRA_INFOMiao Yan1-0/+5
VMXNET3_CMD_GET_DEV_EXTRA_INFO should return 0 for emulation mode This behavior can be observed by the following steps: 1) run a Linux distro on esxi server (5.x+) 2) modify vmxnet3 Linux driver to read the register: VMXNET3_WRITE_BAR1_REG(adapter, VMXNET3_REG_CMD, VMXNET3_CMD_GET_DEV_EXTRA_INFO); ret = VMXNET3_READ_BAR1_REG(adapter, VMXNET3_REG_CMD); pr_info("vmxnet3 dev_info: 0x%x\n", ret); The kernel log will have some like the following message: [ 7005.111170] vmxnet3 dev_info: 0x0 Signed-off-by: Miao Yan <yanmiaobest@gmail.com> Reviewed-by: Dmitry Fleytman <dmitry@daynix.com> Signed-off-by: Jason Wang <jasowang@redhat.com>
2016-01-11net/vmxnet3: return correct value for VMXNET3_CMD_GET_DID_* commandMiao Yan1-0/+16
VMXNET3_CMD_GET_DID_LO should return PCI ID of the device and VMXNET3_CMD_GET_DID_HI should return vmxnet3 revision ID. This behavior can be observed by the following steps: 1) run a Linux distro on esxi server (5.x+) 2) modify vmxnet3 Linux driver to read DID_HI and DID_LO: VMXNET3_WRITE_BAR1_REG(adapter, VMXNET3_REG_CMD, VMXNET3_CMD_GET_DID_LO); lo = VMXNET3_READ_BAR1_REG(adapter, VMXNET3_REG_CMD); VMXNET3_WRITE_BAR1_REG(adapter, VMXNET3_REG_CMD, VMXNET3_CMD_GET_DID_HI); high = VMXNET3_READ_BAR1_REG(adapter, VMXNET3_REG_CMD); pr_info("vmxnet3 DID lo: 0x%x, high: 0x%x\n", lo, high); The kernel log will have something like the following message: [ 7005.111170] vmxnet3 DID lo: 0x7b0, high: 0x1 Signed-off-by: Miao Yan <yanmiaobest@gmail.com> Reviewed-by: Dmitry Fleytman <dmitry@daynix.com> Signed-off-by: Jason Wang <jasowang@redhat.com>
2016-01-11net/vmxnet3: return 1 on device activation failureMiao Yan1-1/+1
When reading device status, 0 means device is successfully activated and 1 means error. This behavior can be observed by the following steps: 1) run a Linux distro on esxi server (5.5+) 2) modify vmxnet3 Linux driver to give it an invalid address to 'adapter->shared_pa' which is the shared memory for guest/host communication This will trigger device activation failure and kernel log will have the following message: [ 7138.403256] vmxnet3 0000:03:00.0 eth1: Failed to activate dev: error 1 So return 1 on device activation failure instead of -1; Signed-off-by: Miao Yan <yanmiaobest@gmail.com> Reviewed-by: Dmitry Fleytman <dmitry@daynix.com> Signed-off-by: Jason Wang <jasowang@redhat.com>
2016-01-11net: vmxnet3: avoid memory leakage in activate_deviceP J P1-8/+16
Vmxnet3 device emulator does not check if the device is active before activating it, also it did not free the transmit & receive buffers while deactivating the device, thus resulting in memory leakage on the host. This patch fixes both these issues to avoid host memory leakage. Reported-by: Qinghao Tang <luodalongde@gmail.com> Reviewed-by: Dmitry Fleytman <dmitry@daynix.com> Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org> Cc: qemu-stable@nongnu.org Signed-off-by: Jason Wang <jasowang@redhat.com>
2016-01-11net/vmxnet3: remove redundant VMW_SHPRN(...) definitionMiao Yan1-4/+1
Macro VMW_SHPRN(...) is already defined vmxnet3_debug.h, so remove the duplication Signed-off-by: Miao Yan <yanmiaobest@gmail.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Dmitry Fleytman <dmitry@daynix.com> Signed-off-by: Jason Wang <jasowang@redhat.com>
2016-01-11net/vmxnet3: fix debug macro pattern for vmxnet3Miao Yan1-53/+86
Vmxnet3 uses the following debug macro style: #ifdef SOME_DEBUG # define debug(...) do{ printf(...); } while (0) # else # define debug(...) do{ } while (0) #endif If SOME_DEBUG is undefined, then format string inside the debug macro will never be checked by compiler. Code is likely to break in the future when SOME_DEBUG is enabled because of lack of testing. This patch changes this to the following: #define debug(...) \ do { if (SOME_DEBUG_ENABLED) printf(...); } while (0) Signed-off-by: Miao Yan <yanmiaobest@gmail.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Dmitry Fleytman <dmitry@daynix.com> Signed-off-by: Jason Wang <jasowang@redhat.com>
2016-01-11net/vmxnet3: use %zu for size_t in printfMiao Yan1-3/+3
Use %zu specifier for size_t in printf, otherwise build would fail on platforms where size_t is not unsigned long Signed-off-by: Miao Yan <yanmiaobest@gmail.com> Reviewed-by: Dmitry Fleytman <dmitry@daynix.com> Signed-off-by: Jason Wang <jasowang@redhat.com>
2016-01-11net/vmxnet3: fix a build error when enabling debug outputMiao Yan1-1/+1
Macro MAC_FMT and MAC_ARG are not defined, but used in vmxnet3_net_init(). This will cause build error when debug level is raised in vmxnet3_debug.h (enable all VMXNET3_DEBUG_xxx). Use VMXNET_MF and VXMNET_MA instead. Signed-off-by: Miao Yan <yanmiaobest@gmail.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Dmitry Fleytman <dmitry@daynix.com> Signed-off-by: Jason Wang <jasowang@redhat.com>
2016-01-11hw/ppc/spapr_rtc: Remove bad class_size valueThomas Huth1-1/+0
class_size = sizeof(XICSStateClass) does not make much sense in the RTC code and likely was just a copy-n-paste error. Let's simply remove it. Signed-off-by: Thomas Huth <thuth@redhat.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2016-01-09virtio: fix error message for number of queuesCornelia Huck1-1/+1
There's no such thing as "PCI queues" in the virtio core. Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2016-01-09ivshmem: Store file descriptor for vhost-user negotiationTetsuya Mukawa1-2/+7
If virtio-net driver allocates memory in ivshmem shared memory, vhost-net will work correctly, but vhost-user will not work because a fd of shared memory will not be sent to vhost-user backend. This patch fixes ivshmem to store file descriptor of shared memory. It will be used when vhost-user negotiates vhost-user backend. Signed-off-by: Tetsuya Mukawa <mukawa@igel.co.jp> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2016-01-09migration/virtio: Remove simple .get/.put useDr. David Alan Gilbert1-68/+19
The 'virtqueue_state' and 'ringsize' can be saved using VMSTATE macros rather than hand coded .get/.put Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Amit Shah <amit.shah@redhat.com>
2016-01-09i386/pc: expose identifying the floppy controllerRoman Kagan1-18/+26
Factor out and expose the function to locate the floppy controller in the system. It will allow to dynamically populate the relevant objects in the ACPI tables. Signed-off-by: Roman Kagan <rkagan@virtuozzo.com> Cc: "Michael S. Tsirkin" <mst@redhat.com> Cc: Eduardo Habkost <ehabkost@redhat.com> Cc: Igor Mammedov <imammedo@redhat.com> Cc: John Snow <jsnow@redhat.com> Cc: Kevin Wolf <kwolf@redhat.com> Cc: Paolo Bonzini <pbonzini@redhat.com> Cc: Richard Henderson <rth@twiddle.net> Cc: qemu-block@nongnu.org Cc: qemu-stable@nongnu.org Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>