This patch adds three devices to qemu:
intel-hda
Intel HD Audio Controller, the PCI device. Provides a HDA bus.
Emulates ICH6 at the moment. Adding a ICH9 PCIE
variant shouldn't be hard.
hda-duplex
HDA Codec. Attaches to the HDA bus. Supports 16bit stereo,
rates 16k -> 96k, playback, recording and volume control
(with CONFIG_MIXEMU=y).
hda-output
HDA Codec without recording support. Subset of the hda-duplex
codec. Use this if you don't want your guests access your mic.
Usage: add '-device intel-hda -device hda-duplex' to your command line.
Tested guests:
* Linux works.
* Win7 works.
* DOS (mpxplay) works.
* WinXP doesn't work.
[ v2 changes ]
* Fixed endianess, big endian hosts work now.
* Fixed some emulation bugs.
* Added immediate command emulation.
* Added vmstate support.
* Make it behave like all other sound card drivers:
- can be configured via '--audio-card-list=hda'
- can be added to a VM using '-soundhw hda'
* Code style fixups.
* Zapped guest-triggerable asserts.
* Handle partial reads/writes of audio data correctly.
Cc: malc <av1474@comtv.ru>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: malc <av1474@comtv.ru>
No need to include stdlib.h for BSD as it is included by
qemu-common.h, windows.h is handled by sysemu.h and osdep.c no longer
needs malloc.h
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
This consolidates the duplicated oom_check() functions, as well as
splitting them into OS dependant versions to avoid the #ifdef
grossness that was present in the old osdep.c version.
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
TRUE/FALSE are generally reserved keywords and shouldn't be defined in
a driver like this. Rename the macros to SDP_TRUE and SDP_FALSE
respectively.
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
This moves library functions used by both QEMU and the QEMU tools,
such as qemu-img, qemu-nbd etc. from osdep.c to oslib-{posix,win32}.c
In addition it introduces oslib-obj.y to the Makefile set to be
included by the various targets, instead of relying on these library
functions magically getting included via block-obj-y.
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
fprintf_function uses format checking with GCC_FMT_ATTR.
Format errors were fixed in
* target-i386/helper.c
* target-mips/translate.c
* target-ppc/translate.c
Cc: Blue Swirl <blauwirbel@gmail.com>
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
fprintf_function uses format checking with GCC_FMT_ATTR.
It is declared in qemu-common.h and used in cpu-all.h
(which is included from cpu.h), so qemu-common.h must
be included earlier. Some redundant include statements
for standard include files were removed.
Fix also two format errors (ptrdiff_t needs %td).
Cc: Blue Swirl <blauwirbel@gmail.com>
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
fprintf_function uses format checking with GCC_FMT_ATTR.
Cc: Blue Swirl <blauwirbel@gmail.com>
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
This kind of function pointers is used very often in qemu.
The new data type uses format checking with GCC_FMT_ATTR
and will be used in later patches.
Cc: Blue Swirl <blauwirbel@gmail.com>
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
config write handlers should be idempotent.
So no need for complex range checks: a simple
one checking that we are touching the relevant capability
will do.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
- save/restore must not check w1c bits
since they are in fact guest controlled
- clear w1c bits on reset
Note: for express there are different kinds of
reset, some leave part of config space alone.
We will likely need a sticky bit mask to implement this.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Simplify logic for hotplug notification, by tracking state of the
logical interrupt condition. We then simply use this variable to make
the interrupt decision, according to spec.
API is made cleaner as we no longer force users to pass in
old slot control value.
Includes fixes by Isaku Yamahata.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Simplify code slighly by reversing the polarity
for the range check
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Extract range functions from pci.h. These will be used by later patches
by non-PCI devices. Adjust current users.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
(cherry picked from commit bf1b007123)
All files include qemu-options.h which pulls in qemu-options.def from
the root directory. Thus generating qemu-options.def from Makefile.objs
under the target directory is not effective.
Further, people expect .def file to get cleaned with make clean:
it does not have state so no reason to defer removing it
until distclean. Also add a rule to remove old files that might
be around.
This fixes the error: ‘QEMU_OPTION_spice’ undeclared
(first use in this function) error that some people reported
which is really down to an out of date .def file.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
When hanlding fd/vhostfd form command line through net_handle_fd_param(),
we need to check mon and return value of strtol() otherwise we could
get segmentation fault or invalid fd when user type an illegal fd/vhostfd.
This patch is based on the suggestions from
Luiz Capitulino <lcapitulino@redhat.com>.
Signed-off-by: Jason Wang <jasowang@redhat.com>
Reviewed-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Checking available index upon load instead of
only when vm is running makes is easier to
debug failures.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
host_from_stream_offset returns NULL on error,
return error instead of trying to use that address,
to avoid segfault on invalid stream.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
- 0ff9051 Update version to 0.6.1
- 9c000e6 Support Samsung SE-S084 USB DVD drive (and probably many others)
- eebe949 pciinit: remove unused variable, old_addr, in pci_set_io_region_addr().
- 06644f4 Minor - indentation change to jpeg.c.
- 2dcd9fa Enhance tools/readserial.py to support reading from a pipe.
- 7ce09ae Make tools/transdump.py more resilient to unknown input.
- 6039fc5 Update qemu_cfg_read to use "rep insb".
- 9a01a9c Only show bootsplash during boot menu.
- 5feb83c add write support to virtio-blk
- 22f6378 Don't try to talk to APIC on 486
- e2074bf Add ACPI SSDT/DSDT support for CPU hotplug.
- eb6dc78 Add additional debug status messages to bootsplash code.
- c8e4e88 Allow qemu to use bootsplash code via fwcfg interface.
- 597040d Add tools/trandump.py tool for converting hexdump() output.
- 48f5f8b Default bootsplash on (for coreboot users).
- 8d85eb1 Autodetect video mode based on bootsplash jpeg dimensions.
- b2b9d4a Rename "decdata" to "jpeg" in bootsplash - to be consistent with jpeg.c.
- bbc4722 Breakup jpeg_decode into parsing and displaying phases.
- 2976dd4 Avoid using BSS variables in jpeg.c.
- cc9e1bf Add FUNC16() helper macro for converting a 16bit func to a segoff_s.
- b4525a0 Handle unaligned sizes in iomemcpy().
- 0e27e19 Cleanup bootsplash vesa signature detection.
- cadaf0e Be sure to disable bootsplash on all BIOS boot cases.
- 2641186 Add call16_int10 helper to bootsplash.c.
- 6dc76f4 Don't do "double buffering" in bootsplash code.
- 227dc3e Check that malloc succeeds in bootsplash code.
- a576c9c Bootsplash fixes and cleanups.
- 9fd4851 Minor - clarify bit logic in mptable.c.
- abf31d3 Fix integer truncating bug in calc_future_timer().
- 1d5c333 seabios: pciinit: fix 64bit bar initilization.
- ae6924d Minor - introduce GDT_GRANLIMIT macro.
- 0f78889 Avoid code addresses >64K in big real mode.
- aec19c9 seabios: smm: move out piix4 specific smram logic to dev-i440fx.c
- 08328e7 seabios: shadow: make device finding more generic.
- 4c67f90 seabios: acpi: clean up of finding pm device.
- fe54a53 seabios: acpi: split out piix4 pm logic.
- d06afb4 seabios: acpi: move acpi definitions to acpi.h from acpi.c
- 2f54bb4 seabios: acpi: move out endian conversion helper function.
- 23173ac seabios: pci: introduce helper function to find device from table and initialize it.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Move timer init functions to a new file, qemu-timer-common.c. Make other
critical timer functions inlined to preserve performance in
qemu-timer.c, also move muldiv64() (used by the inline functions)
to qemu-timer.h.
Adjust block/raw-posix.c and simpletrace.c to use get_clock() directly.
Remove a similar/duplicate definition in qemu-tool.c.
Adjust hw/omap_clk.c to include qemu-timer.h because muldiv64() is used
there.
After this change, tracing can be used also for user code and
simpletrace on Win32.
Cc: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Acked-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
1) compute path to i386 compiler from configure. If it is found, run
the i386 tests. I use macros so that this approach could be applied
for other arches as well.
2) provide an easily extensible way to add tests
Most tests fail, but at least "make test" does something meaningful.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
path.c grew quite a few new dependencies (mostly via cutils.c),
include them.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Many other tests fail, but this has an infinite loop with both
qemu-i386 and native execution (albeit on x86_64), so there is
something more going on. I'm not going to debug it now, so just
disable the test.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
RAM registration used incorrect offset.
Fix by using the offset obtained previously for this purpose.
Spotted by GCC 4.6.0 20100925 warning, which is also avoided.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Replace the remaining format attribute printf by macro
GCC_FMT_ATTR which uses gnu_printf (if supported).
v2
* Removal of dyngen specific code is now done in a separate patch.
* Handle attribute in new ui/spice-display.c, too.
Cc: Blue Swirl <blauwirbel@gmail.com>
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
The formerly used dyngen code did not work with
system include files like stdio.h.
Tests with Linux, OSX and Win32 show that this
restriction is no longer needed.
So we hopefully can remove that special piece of code.
This results in cleaner code and allows better use of
the new GCC_FMT_ATTR macro.
Cc: Blue Swirl <blauwirbel@gmail.com>
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
The werror option now affects not only write requests, but also flush requests.
Previously, it was not possible to stop a VM on a failed flush.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>