Commit Graph

21127 Commits

Author SHA1 Message Date
Corey Bryant 34309d2b12 net: Add interface to bridge when SIOCBRADDIF isn't available
The bridge helper uses the SIOCBRADDIF ioctl to add an inteface to
a bridge.  SIOCBRADDIF is not available on old Linux versions.  This
patch adds support to use the SIOCDEVPRIVATE ioctl with BRCTL_ADD_IF
if SIOCBRADDIF is not available.

Reported-by: Fabien Chouteau <chouteau@adacore.com>
Signed-off-by: Corey Bryant <coreyb@linux.vnet.ibm.com>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2012-08-01 12:28:51 +01:00
Peter Maydell 0b22ef0f57 configure: -I\$(SRC_PATH) goes in QEMU_INCLUDES not QEMU_CFLAGS
If the smartcard configure check passes, add '-I\$(SRC_PATH)/libcacard'
to QEMU_INCLUDES, not QEMU_CFLAGS. Otherwise the unexpanded SRC_PATH
will cause a warning in every following configure test.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-07-31 20:06:03 +00:00
Peter Maydell 3014ee001d configure: Fix compile warning in utimensat/futimens test
Fix compile warning in the utimensat/futimens test ("implicit
declaration of function 'utimensat'", ditto futimens) by
adding a missing include.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-07-31 20:06:01 +00:00
Peter Maydell fea08e0803 configure: Fix warnings in VDE library probe
Fix compile warnings in the VDE library probe ("passing argument 1 of
'vde_open_real' discards 'const' qualifier from pointer target type",
ditto argument 2).

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-07-31 20:05:54 +00:00
Peter Maydell 7edc3fed5e configure: Fix compile warning in PNG test
Fix compile warning (variable 'png_ptr' set but not used) in the
PNG detection test code.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-07-31 20:05:52 +00:00
Stefan Weil 7ace252a6a configure: Fix errors in test for__sync_fetch_and_and
The old test code raises two compiler warnings which are errors since
commit 417c9d72d4.

These errors could result in compilations with compiler flag
-march486 (so all nice features of newer processors got lost).

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-07-31 20:05:41 +00:00
Peter Maydell caa50971f2 configure: -march=i486 belongs in QEMU_CFLAGS, not CFLAGS
The distinction between QEMU_CFLAGS and CFLAGS is that the
former is for flags without which QEMU can't compile, whereas
the latter is for flags like "-g -O2" which the user can
safely override. "-march=i486" is in the former category, and
so belongs in QEMU_CFLAGS.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-07-31 20:05:40 +00:00
Stefan Weil 1e845c78c7 configure: Replace bash code by standard shell code
"+=" does not work with dash and other simple /bin/sh implementations.

The new code prepends the flag while the old code either did not work
(it continued after an error message which typically was not read) or
appended the flag. That difference should not matter here.

Reported-by: Olaf Hering <olaf@aepfle.de>
Signed-off-by: Stefan Weil <sw@weilnetz.de>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-07-31 20:05:38 +00:00
Stefan Weil cc9397435f configure: Fix build with capabilities
Since commit 417c9d72d4 all configure tests
normally run with -Werror. Some of these tests now fail because they
raised a compiler warning.

This patch fixes support for capabilities.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-07-31 20:05:37 +00:00
Stefan Weil e35bcb0cab configure: Fix build with ALSA audio driver
Since commit 417c9d72d4,
all configure tests normally run with -Werror.

Some of these tests now fail because they raised a compiler warning.

Here a build breakage for ALSA (configure --audio-drv-list=alsa) is fixed.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-07-31 20:05:36 +00:00
Peter Maydell 6ca026cb37 configure: Don't run configure tests with -Werror enabled
Don't run configure tests with -Werror in the compiler flags. The idea
of -Werror is that it makes problems very obvious to developers, so
they get fixed quickly. However, when running configure tests, failures
due to -Werror are far from obvious -- they simply result in the test
quietly failing when it should have passed. Not using -Werror is in
line with recommended practice in the Autoconf world.

This commit is essentially backing out the changes in commit 417c9d72.
Instead we fix the problem that commit was trying to address in a
different way: we add -Werror only for the test of the nss headers,
with a comment that this is specifically intended to detect a bug
in some releases of nss.

We also have to clean up a bug in the smartcard test where it was
trying to include smartcard_cflags in the test compile flags: this
would always result in a failure with -Werror, because they include
an escaped "$(SRC_PATH)" which is only valid when used in the final
makefile.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-07-31 20:05:34 +00:00
Peter Maydell 06d71fa148 configure: Split valgrind test into pragma test and valgrind.h test
Split the configure test that checks for valgrind into two, one
part checking whether we have the gcc pragma to disable unused-but-set
variables, and the other part checking for the existence of valgrind.h.
The first of these has to be compiled with -Werror and the second
does not and shouldn't generate any warnings.

This (a) allows us to enable "make errors in configure tests be
build failures" and (b) enables use of valgrind on systems with
a gcc which doesn't know about -Wunused-but-set-varibale, like
Debian squeeze.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-07-31 20:04:42 +00:00
Anthony Liguori 5e3bc7144e Merge remote-tracking branch 'mst/tags/for_anthony' into staging
* mst/tags/for_anthony:
  msi/msix: added API to set MSI message address and data
  pci: Add INTx routing notifier
  pci: Add pci_device_route_intx_to_irq
  pci: Unregister BARs before device exit
  pci: convert PCIUnregisterFunc to void
  msix: Switch msix_uninit to return void
  msix: Allow full specification of MSIX layout
  msix: Split PBA into it's own MemoryRegion
  msix: Note endian TODO item
  msix: Move msix_mmio_read
  virtio: Convert to msix_init_exclusive_bar() interface
  ivshmem: Convert to msix_init_exclusive_bar() interface
  msix: Add simple BAR allocation MSIX setup functions
  msix: fix PCIDevice naming inconsistency
  msix: drop unused msix_bar_size, require valid bar_size
2012-07-30 10:00:48 -05:00
Anthony Liguori 4dd533aa03 Merge remote-tracking branch 'bonzini/nbd-next' into staging
* bonzini/nbd-next:
  qemu-nbd: add --cache and --aio options
  qemu-nbd: reorganize help message
2012-07-30 09:59:38 -05:00
Anthony Liguori d4a06f466a Merge remote-tracking branch 'bonzini/scsi-next' into staging
* bonzini/scsi-next: (32 commits)
  virtio-scsi: enable MSI-X support
  virtio-scsi: add ioeventfd support
  virtio-scsi: report parameter change events
  virtio-scsi: do not report dropped events after reset
  virtio-scsi: Report missed events
  virtio-scsi: Implement hotplug support for virtio-scsi
  scsi: report parameter changes to HBA drivers
  scsi-disk: report resized disk via sense codes
  scsi: establish precedence levels for unit attention
  scsi: introduce hotplug() and hot_unplug() interfaces for SCSI bus
  scsi: add tracepoint for scsi_req_cancel
  scsi-disk: removable hard disks support load/eject
  scsi-disk: Fail medium writes with proper sense for readonly LUNs
  scsi-disk: improve the lba-out-of-range tests for read/write/verify
  scsi-disk: rd/wr/vr-protect !=0 is an error
  scsi-disk: support toggling the write cache
  scsi-disk: parse MODE SELECT commands and parameters
  scsi-disk: fix changeable values for MODE_PAGE_R_W_ERROR
  scsi-disk: adjust offsets in MODE SENSE by 2
  scsi-disk: support emulated TO_DEV requests
  ...
2012-07-30 09:59:23 -05:00
Anthony Liguori e6a7671998 Merge commit 'quintela/migration-next-v5' into staging
* commit '6c779f22a93cc6e4565b940ef616e3efc5b50ba5':
  Change ram_save_block to return -1 if there are no more changes
  ram: save_live_setup() we don't need to synchronize the dirty bitmap.
  ram: iterate phase
  ram: save_live_complete() only do one loop
  ram: save_live_setup() don't need to sent pages
  savevm: split save_live into stage2 and stage3
  savevm: split save_live_setup from save_live_state
  savevm: introduce is_active method
  savevm: Refactor cancel operation in its own operation
  savevm: remove SaveLiveStateHandler
  savevm: remove SaveSetParamsHandler
  savevm: Live migration handlers register the struct directly
  savevm: Use a struct to pass all handlers
2012-07-30 09:58:48 -05:00
Michael S. Tsirkin 5e59b02435 Merge branch pci into master
Merge master and pci branch, resolve build breakage in hw/esp.c
introduced by f90c2bcd.

Conflicts:
	hw/esp.c
2012-07-29 17:05:35 +03:00
Vitaly Chipounov 7162ab21fe x86: Fixed incorrect segment base address addition in 64-bits mode
According to the Intel manual
"Intel® 64 and IA-32 Architectures Software Developer’s Manual
Volume 3", "3.4.4 Segment Loading Instructions in IA-32e Mode":

"When in compatibility mode, FS and GS overrides operate as defined by
32-bit mode behavior regardless of the value loaded into the upper 32
linear-address bits of the hidden descriptor register base field.
Compatibility mode ignores the upper 32 bits when calculating an effective address."

However, the code misses the 64-bit mode case, where an instruction with
address and segment size override would be translated incorrectly. For example,
inc dword ptr gs:260h[ebx*4] gets incorrectly translated to:

(uint32_t)(gs.base + ebx * 4 + 0x260)
instead of
gs.base + (uint32_t)(ebx * 4 + 0x260)

Signed-off-by: Vitaly Chipounov <vitaly.chipounov@epfl.ch>
Reviewed-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-07-29 08:45:57 +00:00
Paolo Bonzini e6d91ab66b place qemu-sockets.c contributions since 2012-01-13 under GPLv2+
Past contributions since 2012-01-13 were only made by Red Hat people,
so they are already available under GPLv2+.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-07-29 08:44:00 +00:00
Dunrong Huang 54c2e50205 build: Fix linking failure for qemu-ga
This patch will fix the following linking failed:

  LINK  qemu-ga
gcc: error: qga/../qapi-generated/qga-qapi-types.o: No such file or directory
gcc: error: qga/../qapi-generated/qga-qapi-visit.o: No such file or directory
gcc: error: qga/../qapi-generated/qga-qmp-marshal.o: No such file or directory
make: *** [qemu-ga] Error 1

Commit cdc976b040 changes the
dependencies of qemu-ga to depend "../qapi-generated/qga-qapi-types.o",
which will be expanded to "qga/../qapi-generated/qga-qapi-types.o" when
building qemu-ga.

In top-level Makefile, we defined a target "qapi-generated/qga-qapi-types.o"
which was not equal to "qga/../qapi-generated/qga-qapi-types" in the
Makefile world. So "No such file" error happened when qemu-ga was linking.

The easy approach to fix is to change the target name to
"qga/../qapi-generated/qga-qapi-types.o", but it is weird.

So, in order to solve it more graciously, I move those temporary
files(qga-qapi-*.{c,h}) qemu-ga depends on to qemu-ga/qapi-generated,
this makes dependencies more clearer.

Signed-off-by: Dunrong Huang <riegamaths@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-07-29 08:41:53 +00:00
Blue Swirl b595c14a7b Avoid redefining inline
System headers (e.g. gutils.h) may define 'inline', #undefine it
before #defining.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-07-28 09:23:20 +00:00
Blue Swirl 0ed8b6f67f Avoid returning void
It's silly and non-conforming to standards to return void,
don't do it.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-07-28 09:23:11 +00:00
Peter Maydell 16fd921bd3 hw/escc: Drop duplicate definition of 'disabled' property
Drop a duplicate definition of the 'disabled' property from
the escc qdev property list: this redefinition is currently
effectively ignored but will become an error. (The duplication
was inadvertently introduced in 2009 in commit ec02f7dec2.)

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Acked-by: Andreas Frber <afaerber@suse.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-07-28 09:18:25 +00:00
Paolo Bonzini 1435ddb89c build: get dependency file directories from object file names
After commit dcff25f2cd, Dependency file
are taken from the directories that have a Makefile.objs file.  This is
not enough, since files can be included from other directories.
So, pick them from directories that have an object file in them.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-07-28 09:16:09 +00:00
Paolo Bonzini cdc976b040 build: include qapi-generated/ files in qga/Makefile.objs
No reason to leave them out, and it will ensure that the dependencies
are picked up.  Later we can perhaps move the files to another
directory to avoid ../ usage.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-07-28 09:15:29 +00:00
Eduardo Habkost 14117c7ba1 tests: Makefile: include dependency files
Otherwise 'make check' won't recompile files that need to be recompiled
because of header changes.

To reproduce the bug, run:

 $ make check  # succeeds
 $ echo B0RKED > hw/mc146818rtc_regs.h
 $ make check  # is supposed to try to rebuild tests/rtc-test.o and fail

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-07-28 09:13:49 +00:00
Peter Maydell 52d06136bd vl.c: Don't print errno after failed qemu_chr_new()
The qemu_chr_new() function doesn't set errno on failure, so
don't print strerror(errno) on the error handling path when
dealing with the -serial, -parallel and -virtioconsole arguments.
This avoids nonsensical error messages like:
  $ ./arm-softmmu/qemu-system-arm -serial wombat
  qemu: could not open serial device 'wombat': Success

We also rephrase the message slightly to make it a little clearer
that we're expecting the name of a QEMU chr backend rather than
a host or guest serial/parallel/etc device.

Reported-by: Christian Müller <christian.mueller@heig-vd.ch>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-07-28 09:08:12 +00:00
Max Filippov 7ff7563fc1 target-xtensa: fix big-endian BBS/BBC implementation
Quote from ISA, 2.1:

For most Xtensa instructions, bit numbering is irrelevant; only the BBC
and BBS instructions assign bit numbers to values on which the processor
operates. The BBC/BBS instructions use big-endian bit ordering (0 is the
most-significant bit) on a big-endian processor configuration.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-07-28 09:06:40 +00:00
Jia Liu d901eff3e6 target-or32: Add testcases
Add testcases for OpenRISC.

Signed-off-by: Jia Liu <proljc@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-07-27 21:13:06 +00:00
Jia Liu d962783e98 target-or32: Add linux user support
Add QEMU OpenRISC linux user support.

Signed-off-by: Jia Liu <proljc@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-07-27 21:13:05 +00:00
Jia Liu a8720299f1 target-or32: Add linux syscall, signal and termbits
Add OpenRISC linux syscall, signal and termbits.

Signed-off-by: Jia Liu <proljc@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-07-27 21:13:05 +00:00
Jia Liu fc04355bb8 target-or32: Add gdb stub support
Add OpenRISC gdb stub support.

Signed-off-by: Jia Liu <proljc@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-07-27 21:13:04 +00:00
Jia Liu 4dd044c6ba target-or32: Add system instructions
Add OpenRISC system instructions.

Signed-off-by: Jia Liu <proljc@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-07-27 21:13:03 +00:00
Jia Liu ce6e1e9ec9 target-or32: Add a IIS dummy board
Add a IIS dummy board.

Signed-off-by: Jia Liu <proljc@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-07-27 21:13:02 +00:00
Jia Liu 99f575edcc target-or32: Add timer support
Add OpenRISC timer support.

Signed-off-by: Jia Liu <proljc@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-07-27 21:13:02 +00:00
Jia Liu dd29c7fb01 target-or32: Add PIC support
Add OpenRISC Programmable Interrupt Controller support.

Signed-off-by: Jia Liu <proljc@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-07-27 21:13:01 +00:00
Jia Liu bbe418f25d target-or32: Add instruction translation
Add OpenRISC instruction tanslation routines.

Signed-off-by: Jia Liu <proljc@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-07-27 21:13:00 +00:00
Jia Liu 5b5695073b target-or32: Add float instruction helpers
Add OpenRISC float instruction helpers.

Signed-off-by: Jia Liu <proljc@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-07-27 21:13:00 +00:00
Jia Liu e54a5aff13 target-or32: Add int instruction helpers
Add OpenRISC int instruction helpers.

Signed-off-by: Jia Liu <proljc@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-07-27 21:12:59 +00:00
Jia Liu 1d7d403469 target-or32: Add exception support
Add OpenRISC exception support.

Signed-off-by: Jia Liu <proljc@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-07-27 21:12:58 +00:00
Jia Liu b6a71ef7e0 target-or32: Add interrupt support
Add OpenRISC interrupt support.

Signed-off-by: Jia Liu <proljc@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-07-27 21:12:57 +00:00
Jia Liu 726fe04572 target-or32: Add MMU support
Add OpenRISC MMU support.

Signed-off-by: Jia Liu <proljc@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-07-27 21:12:56 +00:00
Jia Liu e67db06e9f target-or32: Add target stubs and QOM cpu
Add OpenRISC target stubs, QOM cpu and basic machine.

Signed-off-by: Jia Liu <proljc@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-07-27 21:12:55 +00:00
Paolo Bonzini 4c205d0cb1 virtio-scsi: enable MSI-X support
While virtio-scsi does support multiqueue, the default number of
interrupt vectors is not enough to actually enable usage of
multiple queues in the driver; this is because with only 2
vectors the driver will not be able to use a separate
interrupt for each request queue.  Derive the desired number
of vectors from the number of request queues.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-07-27 15:47:30 +02:00
Paolo Bonzini 3f910904ec virtio-scsi: add ioeventfd support
Probably due to bad merge months ago, virtio-scsi-pci did not have
ioeventfd support.  Fix this and enable it by default, as is the
case for other virtio-pci devices.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-07-27 14:36:07 +02:00
Paolo Bonzini feda01e40f virtio-scsi: report parameter change events
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-07-27 08:25:27 +02:00
Paolo Bonzini 2baa1beb1e virtio-scsi: do not report dropped events after reset
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-07-27 08:25:27 +02:00
Paolo Bonzini 64f64855d0 virtio-scsi: Report missed events
When an event is reported but no buffers are present in the event vq,
we can set a flag and report a dummy event as soon as one is added.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-07-27 08:25:27 +02:00
Cong Meng b6866fee58 virtio-scsi: Implement hotplug support for virtio-scsi
Implement the hotplug() and hot_unplug() interfaces in virtio-scsi, by signal
the virtio_scsi.ko in guest kernel via event virtual queue.

The counterpart patch of virtio_scsi.ko will be sent soon in another thread.

Signed-off-by: Sen Wang <senwang@linux.vnet.ibm.com>
Signed-off-by: Cong Meng <mc@linux.vnet.ibm.com>
[ Add memset, fix LUN field, placate checkpatch - Paolo ]
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-07-27 08:25:26 +02:00
Paolo Bonzini 53200fad0e scsi: report parameter changes to HBA drivers
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-07-27 08:25:26 +02:00