adding Irix (and, to a lesser extent, Solaris) userland emulation to QEMU
Go to file
Markus Armbruster 1f51470d04 Revert "qemu-char: Print strerror message on failure" and deps
The commit's purpose is laudable:

    The only way for chardev drivers to communicate an error was to
    return a NULL pointer, which resulted in an error message that
    said _that_ something went wrong, but not _why_.

It attempts to achieve it by changing the interface to return 0/-errno
and update qemu_chr_open_opts() to use strerror() to display a more
helpful error message.  Unfortunately, it has serious flaws:

1. Backends "socket" and "udp" return bogus error codes, because
qemu_chr_open_socket() and qemu_chr_open_udp() assume that
unix_listen_opts(), unix_connect_opts(), inet_listen_opts(),
inet_connect_opts() and inet_dgram_opts() fail with errno set
appropriately.  That assumption is wrong, and the commit turns
unspecific error messages into misleading error messages.  For
instance:

    $ qemu-system-x86_64 -nodefaults -vnc :0 -chardev socket,id=bar,host=xxx
    inet_connect: host and/or port not specified
    chardev: opening backend "socket" failed: No such file or directory

ENOENT is what happens to be in my errno when the backend returns
-errno.  Let's put ERANGE there just for giggles:

    $ qemu-system-x86_64 -nodefaults -vnc :0 -chardev socket,id=bar,host=xxx -drive if=none,iops=99999999999999999999
    inet_connect: host and/or port not specified
    chardev: opening backend "socket" failed: Numerical result out of range

Worse: when errno happens to be zero, return -errno erroneously
signals success, and qemu_chr_new_from_opts() dies dereferencing
uninitialized chr.  I observe this with "-serial unix:".

2. All qemu_chr_open_opts() knows about the error is an errno error
code.  That's simply not enough for a decent message.  For instance,
when inet_dgram() can't resolve the parameter host, which errno code
should it use?  What if it can't resolve parameter localaddr?

Clue: many backends already report errors in their open methods.
Let's revert the flawed commit along with its dependencies, and fix up
the silent error paths instead.

This reverts commit 6e1db57b2a.

Conflicts:

	console.c
	hw/baum.c
	qemu-char.c

This reverts commit aad04cd024.

The parts of commit db418a0a "Add stdio char device on windows" that
depend on the reverted change fixed up.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-02-24 09:06:56 -06:00
QMP qom: add test tools 2012-02-22 12:18:26 -06:00
audio Fix spelling in comments, documentation and messages 2011-12-14 11:09:44 +00:00
block sheepdog: fix co_recv coroutine context 2012-02-09 16:17:51 +01:00
bsd-user elf: Improve symbol lookup (optimize, fix for bsd-user) 2012-01-10 18:40:09 +01:00
darwin-user
default-configs jazz-led: compile it only twice 2012-02-22 09:02:19 -06:00
docs docs: describe live block operations 2012-01-26 14:49:18 +01:00
fpu
fsdev fsdev: Fix parameter parsing for proxy helper 2012-01-30 10:54:16 +05:30
gdb-xml
hw Revert "qemu-char: Print strerror message on failure" and deps 2012-02-24 09:06:56 -06:00
include/qemu qom: Document ways to retrieve child object added by object_property_add_child() 2012-02-22 09:02:18 -06:00
libcacard make: Remove duplicate use of GLIB_CFLAGS 2012-02-09 20:44:38 +04:00
linux-headers PPC: KVM: Update HIOR code to new interface 2012-02-02 02:47:45 +01:00
linux-user linux-user: brk() debugging 2012-02-10 10:48:09 +00:00
net net: remove extra spaces in help messages 2012-02-10 10:44:52 +00:00
pc-bios optionroms: Silence intermediate file removal 2012-02-01 14:45:02 -06:00
qapi qapi: add string-based visitors 2012-02-21 10:21:05 +01:00
qga guest agent: add supported command list to guest-info RPC 2011-12-12 17:06:21 -06:00
qom qom: In function object_set_link_property(), first call object_ref(), then object_unref(). 2012-02-22 13:24:30 -06:00
roms pseries: SLOF PCI flag day 2012-01-21 05:17:02 +01:00
scripts qerror: add check-qerror.sh to verify alphabetical order 2012-01-18 10:23:39 -02:00
slirp slirp: Prevent sending ICMP error replies to source-only addresses 2012-02-08 10:07:54 +01:00
sysconfigs/target cpu defs: uncomment empty extfeatures_ecx definition for Opteron_G1 (v2) 2012-02-22 13:24:30 -06:00
target-alpha
target-arm target-arm/helper.c: tb_flush() on CPU reset 2012-02-17 08:34:43 +01:00
target-cris cris: Handle conditional stores on CRISv10 2011-12-12 11:38:31 +01:00
target-i386 cpu defs: use Intel flag names for Intel models (v2) 2012-02-22 13:24:28 -06:00
target-lm32
target-m68k
target-microblaze microblaze: Break the tb at memory barriers 2012-01-12 13:54:17 +01:00
target-mips Fix spelling in comments, documentation and messages 2011-12-14 11:09:44 +00:00
target-ppc ppc: remove unused variables 2012-02-11 11:03:50 +00:00
target-s390x s390: fix cpu hotplug / cpu activity on interrupts 2012-01-04 02:48:14 +01:00
target-sh4 target-sh4: ignore ocbp and ocbwb instructions 2012-01-10 18:20:10 +01:00
target-sparc target-sparc: Fix mixup of uint64 and uint64_t 2012-01-22 09:55:35 +00:00
target-unicore32
target-xtensa
tcg tcg-arm: fix a typo in comments 2012-01-13 10:36:59 +00:00
tests qapi: add tests for string-based visitors 2012-02-21 10:21:05 +01:00
trace g_thread_init users: don't call it if glib >= 2.31 2011-12-20 15:44:31 -06:00
ui Revert "qemu-char: Print strerror message on failure" and deps 2012-02-24 09:06:56 -06:00
.gitignore qapi: add tests for string-based visitors 2012-02-21 10:21:05 +01:00
.gitmodules
.mailmap Add a .mailmap to map pre-git-conversion authors to friendly names 2011-12-12 17:06:21 -06:00
CODING_STYLE CODING_STYLE: Clarify style for enum and function type names 2012-02-10 10:44:51 +00:00
COPYING
COPYING.LIB
Changelog Fix spelling in comments, documentation and messages 2011-12-14 11:09:44 +00:00
HACKING HACKING: clarify allocation/free recommendations 2011-12-15 09:27:23 -06:00
LICENSE LICENSE: There is no libqemu.a anymore 2011-12-09 11:25:22 +00:00
MAINTAINERS split SCSI and LSI, add myself as SCSI maintainer 2012-02-22 13:24:27 -06:00
Makefile Makefile: Add dependency to fix linux-user-only build 2012-02-22 09:02:52 -06:00
Makefile.dis
Makefile.hw make: Remove duplicate use of GLIB_CFLAGS 2012-02-09 20:44:38 +04:00
Makefile.objs jazz-led: compile it only twice 2012-02-22 09:02:19 -06:00
Makefile.target jazz-led: compile it only twice 2012-02-22 09:02:19 -06:00
Makefile.user
README Update README 2011-12-11 17:50:43 -06:00
TODO
VERSION
a.out.h
acl.c
acl.h
aes.c
aes.h
aio.c prepare for future GPLv2+ relicensing 2012-01-13 10:55:56 -06:00
alpha-dis.c
alpha.ld
arch_init.c pcspk: Convert to qdev 2012-02-17 09:58:22 -06:00
arch_init.h audio: remove unused parameter isa_pic 2011-12-20 15:44:31 -06:00
arm-dis.c
arm-semi.c
arm.ld
async.c
balloon.c qapi: Convert balloon 2011-12-06 11:40:01 -02:00
balloon.h qapi: Convert balloon 2011-12-06 11:40:01 -02:00
bitmap.c
bitmap.h
bitops.c
bitops.h
block-migration.c prepare for future GPLv2+ relicensing 2012-01-13 10:55:56 -06:00
block-migration.h
block.c block: perform zero-detection during copy-on-read 2012-02-09 16:17:50 +01:00
block.h block: add .bdrv_co_write_zeroes() interface 2012-02-09 16:17:50 +01:00
block_int.h block: add .bdrv_co_write_zeroes() interface 2012-02-09 16:17:50 +01:00
blockdev.c blockdev: allow read-only pflash devices 2012-02-22 09:02:17 -06:00
blockdev.h qapi: Convert block_set_io_throttle 2012-01-18 10:23:39 -02:00
bswap.h
bt-host.c bt-host: add missing break statement 2012-01-13 10:37:00 +00:00
bt-host.h
bt-vhci.c
buffered_file.c prepare for future GPLv2+ relicensing 2012-01-13 10:55:56 -06:00
buffered_file.h
cache-utils.c
cache-utils.h
check-qdict.c check-qdict: convert to gtest 2012-01-12 10:05:37 -06:00
check-qfloat.c check-qfloat: convert to gtest 2012-01-12 10:05:37 -06:00
check-qint.c check-qint: convert to gtest 2012-01-12 10:05:37 -06:00
check-qjson.c check-qjson: enable disabled tests 2012-01-12 10:05:38 -06:00
check-qlist.c check-qlist: convert to gtest 2012-01-12 10:05:38 -06:00
check-qstring.c check-qstring: remove check.h include 2012-01-12 11:33:22 -06:00
cmd.c
cmd.h
compatfd.c prepare for future GPLv2+ relicensing 2012-01-13 10:55:56 -06:00
compatfd.h
compiler.h rewrite QEMU_BUILD_BUG_ON 2012-02-09 16:17:51 +01:00
config.h
configure configure: Remove OpenBSD workaround for curses probe 2012-02-17 09:58:21 -06:00
console.c Revert "qemu-char: Print strerror message on failure" and deps 2012-02-24 09:06:56 -06:00
console.h Revert "qemu-char: Print strerror message on failure" and deps 2012-02-24 09:06:56 -06:00
coroutine-gthread.c g_thread_init users: don't call it if glib >= 2.31 2011-12-20 15:44:31 -06:00
coroutine-ucontext.c coroutine: switch to QSLIST 2012-02-17 08:33:33 -06:00
coroutine-win32.c
cpu-all.h Remove IO_MEM_SHIFT 2012-01-04 13:34:50 +02:00
cpu-common.h Remove IO_MEM_SHIFT 2012-01-04 13:34:50 +02:00
cpu-defs.h fix win32 build 2011-12-15 09:20:50 -06:00
cpu-exec.c cpu-exec.c: Correct comment about this file and indentation cleanup 2012-02-10 10:44:52 +00:00
cpus.c apic: Inject external NMI events via LINT1 2012-01-19 12:14:40 +01:00
cpus.h
cris-dis.c cris-dis: Clean memory allocation 2012-01-10 09:36:43 +01:00
cursor.c
cursor_hidden.xpm
cursor_left_ptr.xpm
cutils.c cutils: extract buffer_is_zero() from qemu-img.c 2012-02-09 16:17:50 +01:00
def-helper.h
device_tree.c
device_tree.h
dis-asm.h
disas.c
disas.h
dma-helpers.c dma: the passed io_func does not return NULL 2011-12-15 12:40:08 +01:00
dma.h
dyngen-exec.h tcg/arm: Use r6 as TCG_AREG0 to avoid clash with Thumb framepointer 2012-01-10 17:52:49 +01:00
elf.h
envlist.c
envlist.h
error.c
error.h
error_int.h
event_notifier.c prepare for future GPLv2+ relicensing 2012-01-13 10:55:56 -06:00
event_notifier.h prepare for future GPLv2+ relicensing 2012-01-13 10:55:56 -06:00
exec-all.h Direct dispatch through MemoryRegion 2012-01-04 13:34:50 +02:00
exec-memory.h
exec-obsolete.h memory: change dirty getting API to take a size 2012-02-04 12:45:10 +00:00
exec.c exec.c: Clarify comment about tlb_flush() flush_global parameter 2012-02-01 14:45:01 -06:00
gdbstub.c gdbstub: Fix fd leak in gdbserver_open() error path 2012-01-06 15:07:14 +00:00
gdbstub.h
gen-icount.h
hmp-commands.hx qmp: add block_job_cancel command 2012-01-26 14:49:18 +01:00
hmp.c qmp: add query-block-jobs 2012-01-26 14:49:18 +01:00
hmp.h qmp: add query-block-jobs 2012-01-26 14:49:18 +01:00
host-utils.c
host-utils.h
hppa-dis.c
hppa.ld
i386-dis.c
i386.ld
ia64-dis.c
ia64.ld
input.c input: send kbd+mouse events only to running guests. 2012-02-17 11:02:55 -06:00
int128.h
iohandler.c
ioport-user.c
ioport.c
ioport.h
iorange.h
iov.c prepare for future GPLv2+ relicensing 2012-01-13 10:55:56 -06:00
iov.h
json-lexer.c Add 'fall through' comments to case statements without break 2012-01-13 10:36:59 +00:00
json-lexer.h
json-parser.c
json-parser.h
json-streamer.c
json-streamer.h
kvm-all.c kvm: Implement kvm_irqchip_in_kernel like kvm_enabled 2012-02-08 15:57:50 -02:00
kvm-stub.c kvm: Implement kvm_irqchip_in_kernel like kvm_enabled 2012-02-08 15:57:50 -02:00
kvm.h kvm: Implement kvm_irqchip_in_kernel like kvm_enabled 2012-02-08 15:57:50 -02:00
libfdt_env.h
linux-aio.c block: qemu_aio_get does not return NULL 2011-12-15 12:40:08 +01:00
m68k-dis.c
m68k-semi.c
m68k.ld
main-loop.c main-loop: For tools, initialize timers as part of qemu_init_main_loop() 2012-02-01 14:45:02 -06:00
main-loop.h main-loop: For tools, initialize timers as part of qemu_init_main_loop() 2012-02-01 14:45:02 -06:00
memory.c memory-region: Report if region is read-only or write-only on info mtree 2012-02-11 10:49:07 +00:00
memory.h memory: change dirty getting API to take a size 2012-02-04 12:45:10 +00:00
microblaze-dis.c
migration-exec.c prepare for future GPLv2+ relicensing 2012-01-13 10:55:56 -06:00
migration-fd.c prepare for future GPLv2+ relicensing 2012-01-13 10:55:56 -06:00
migration-tcp.c prepare for future GPLv2+ relicensing 2012-01-13 10:55:56 -06:00
migration-unix.c prepare for future GPLv2+ relicensing 2012-01-13 10:55:56 -06:00
migration.c notifier: switch to QLIST 2012-02-17 08:33:32 -06:00
migration.h Merge remote-tracking branch 'stefanha/trivial-patches-next' into staging 2011-12-14 07:59:21 -06:00
mips-dis.c
mips.ld
module.c prepare for future GPLv2+ relicensing 2012-01-13 10:55:56 -06:00
module.h qom: Unify type registration 2012-02-15 09:39:21 -06:00
monitor.c Add SPICE support to add_client monitor command 2012-02-21 10:36:05 +01:00
monitor.h qmp: add block_job_cancel command 2012-01-26 14:49:18 +01:00
nbd.c qemu-nbd: throttle requests 2011-12-22 11:53:59 +01:00
nbd.h qemu-nbd: move client handling to nbd.c 2011-12-22 11:53:59 +01:00
net.c w32: Fix build with new net bridge code 2012-02-04 11:49:34 +00:00
net.h Add support for net bridge 2012-02-01 16:24:40 -06:00
notify.c notifier: switch to QLIST 2012-02-17 08:33:32 -06:00
notify.h notifier: switch to QLIST 2012-02-17 08:33:32 -06:00
os-posix.c keep the PID file locked for the lifetime of the process 2012-02-01 16:23:57 -06:00
os-win32.c link the main loop and its dependencies into the tools 2011-12-22 11:53:58 +01:00
osdep.c move corking functions to osdep.c 2011-12-22 11:53:58 +01:00
osdep.h
oslib-posix.c link the main loop and its dependencies into the tools 2011-12-22 11:53:58 +01:00
oslib-win32.c link the main loop and its dependencies into the tools 2011-12-22 11:53:58 +01:00
path.c
pci-ids.txt
pflib.c prepare for future GPLv2+ relicensing 2012-01-13 10:55:56 -06:00
pflib.h
poison.h
posix-aio-compat.c prepare for future GPLv2+ relicensing 2012-01-13 10:55:56 -06:00
ppc-dis.c
ppc.ld PPC: Fix linker scripts on ppc hosts 2012-01-10 18:23:58 +01:00
ppc64.ld PPC: Fix linker scripts on ppc hosts 2012-01-10 18:23:58 +01:00
qapi-schema-guest.json Merge remote-tracking branch 'stefanha/trivial-patches-next' into staging 2011-12-14 07:59:21 -06:00
qapi-schema-test.json Introduce test-qmp-output-visitor 2011-12-06 11:40:00 -02:00
qapi-schema.json qom: move properties from qdev to object 2012-02-03 10:41:08 -06:00
qbool.c
qbool.h
qdict-test-data.txt
qdict.c
qdict.h
qemu-aio.h
qemu-barrier.h
qemu-bridge-helper.c Add cap reduction support to enable use as SUID 2012-02-01 16:24:39 -06:00
qemu-char.c Revert "qemu-char: Print strerror message on failure" and deps 2012-02-24 09:06:56 -06:00
qemu-char.h qdev: nuke qdev_init_chardev() 2012-02-03 10:41:08 -06:00
qemu-common.h cutils: extract buffer_is_zero() from qemu-img.c 2012-02-09 16:17:50 +01:00
qemu-config.c Make kernel, initrd and append be machine_opts 2012-02-22 09:02:52 -06:00
qemu-config.h
qemu-coroutine-int.h coroutine: switch to QSLIST 2012-02-17 08:33:33 -06:00
qemu-coroutine-io.c sheepdog: move coroutine send/recv function to generic code 2011-12-22 11:53:53 +01:00
qemu-coroutine-lock.c
qemu-coroutine-sleep.c coroutine: add co_sleep_ns() coroutine sleep function 2012-01-26 11:45:26 +01:00
qemu-coroutine.c
qemu-coroutine.h coroutine: add co_sleep_ns() coroutine sleep function 2012-01-26 11:45:26 +01:00
qemu-doc.texi iSCSI: add configuration variables for iSCSI 2012-02-09 16:17:50 +01:00
qemu-error.c error: Add an accessor for progname 2011-12-15 09:27:22 -06:00
qemu-error.h error: Add an accessor for progname 2011-12-15 09:27:22 -06:00
qemu-file.h vmstate: extract declarations out of hw/hw.h 2012-01-13 10:20:51 -06:00
qemu-ga.c Spelling fixes in comments and documentation 2012-01-13 10:36:59 +00:00
qemu-img-cmds.hx Documentation: Add qemu-img -t parameter in man page 2011-12-15 12:40:08 +01:00
qemu-img.c cutils: extract buffer_is_zero() from qemu-img.c 2012-02-09 16:17:50 +01:00
qemu-img.texi Documentation: Add qemu-img -t parameter in man page 2011-12-15 12:40:08 +01:00
qemu-io.c qemu-io: add write -z option for bdrv_co_write_zeroes 2012-02-09 16:17:50 +01:00
qemu-lock.h
qemu-log.h
qemu-nbd.c open /dev/nbd in nbd_client_thread 2012-02-17 12:41:59 +01:00
qemu-nbd.texi
qemu-objects.h
qemu-option.c qemu-option: Add support for merged QemuOptsLists 2012-02-17 09:08:22 +01:00
qemu-option.h qemu-option: Add support for merged QemuOptsLists 2012-02-17 09:08:22 +01:00
qemu-options-wrapper.h vl.c: In qemu -h output, only print options for the arch we are running as 2011-12-19 10:27:33 -06:00
qemu-options.h vl.c: Move option generation logic into a wrapper file 2011-12-19 10:27:33 -06:00
qemu-options.hx Merge remote-tracking branch 'qemu-kvm/uq/master' into staging 2012-02-15 18:41:28 -06:00
qemu-os-posix.h
qemu-os-win32.h
qemu-progress.c
qemu-queue.h qemu-queue: drop QCIRCLEQ 2012-02-17 08:33:33 -06:00
qemu-sockets.c
qemu-tech.texi qemu-tech.texi: Remove libqemu related stuff from the document 2011-12-09 10:10:12 +00:00
qemu-thread-posix.c qemu-thread: implement joinable threads for POSIX 2011-12-12 17:06:22 -06:00
qemu-thread-posix.h
qemu-thread-win32.c w32: Initialise critical section before starting thread (fix #922131) 2012-02-07 18:11:41 +01:00
qemu-thread-win32.h fix win32 build 2011-12-15 09:20:50 -06:00
qemu-thread.h qemu-thread: add API for joinable threads 2011-12-12 17:06:22 -06:00
qemu-timer-common.c
qemu-timer.c notifier: switch to QLIST 2012-02-17 08:33:32 -06:00
qemu-timer.h ptimer: move declarations to ptimer.h 2012-01-13 10:20:50 -06:00
qemu-tls.h Rename get_tls to tls_var 2011-12-06 10:07:04 +00:00
qemu-tool.c main-loop: For tools, initialize timers as part of qemu_init_main_loop() 2012-02-01 14:45:02 -06:00
qemu-x509.h
qemu-xattr.h
qemu.sasl
qemu_socket.h move corking functions to osdep.c 2011-12-22 11:53:58 +01:00
qerror.c qdev: print error message before aborting 2012-02-14 18:57:33 +00:00
qerror.h qdev: print error message before aborting 2012-02-14 18:57:33 +00:00
qfloat.c
qfloat.h
qint.c
qint.h
qjson.c
qjson.h
qlist.c
qlist.h
qmp-commands.hx Add SPICE support to add_client monitor command 2012-02-21 10:36:05 +01:00
qmp.c qom: add QObject-based property get/set wrappers 2012-02-07 13:52:40 +01:00
qobject.h
qstring.c
qstring.h
range.h
readline.c
readline.h
rules.mak
s390-dis.c
s390.ld
savevm.c Fix vmstate_register_ram() for rom/device regions 2012-01-08 18:16:31 +02:00
sh4-dis.c
softmmu-semi.h
softmmu_defs.h
softmmu_exec.h
softmmu_header.h
softmmu_template.h Remove IO_MEM_SHIFT 2012-01-04 13:34:50 +02:00
sparc-dis.c
sparc.ld
sparc64.ld
spice-qemu-char.c Revert "qemu-char: Print strerror message on failure" and deps 2012-02-24 09:06:56 -06:00
sysemu.h mc146818rtc: Use lost_tick_policy property 2012-02-01 14:45:01 -06:00
targphys.h
tcg-runtime.c
tci-dis.c
tci.c
test-coroutine.c
test-qmp-commands.c
test-qmp-input-visitor.c qmp: Add missing gcc format attribute and fix format string 2012-01-18 10:23:39 -02:00
test-qmp-output-visitor.c Introduce test-qmp-output-visitor 2011-12-06 11:40:00 -02:00
test-string-input-visitor.c qapi: add tests for string-based visitors 2012-02-21 10:21:05 +01:00
test-string-output-visitor.c qapi: add tests for string-based visitors 2012-02-21 10:21:05 +01:00
thunk.c
thunk.h
trace-events jazz-led: use trace framework 2012-02-22 09:02:19 -06:00
translate-all.c
uboot_image.h
usb-bsd.c Merge remote-tracking branch 'kraxel/usb.38' into staging 2012-02-15 17:25:25 -06:00
usb-linux.c Merge remote-tracking branch 'kraxel/usb.38' into staging 2012-02-15 17:25:25 -06:00
usb-redir.c Merge remote-tracking branch 'kraxel/usb.38' into staging 2012-02-15 17:25:25 -06:00
usb-stub.c
user-exec.c
version.rc
vgafont.h
vl.c Make kernel, initrd and append be machine_opts 2012-02-22 09:02:52 -06:00
vmstate.h vmstate: extract declarations out of hw/hw.h 2012-01-13 10:20:51 -06:00
x86_64.ld
xen-all.c memory: change dirty setting APIs to take a size 2012-01-25 18:32:47 +00:00
xen-mapcache.c prepare for future GPLv2+ relicensing 2012-01-13 10:55:56 -06:00
xen-mapcache.h
xen-stub.c prepare for future GPLv2+ relicensing 2012-01-13 10:55:56 -06:00
xtensa-semi.c

README

Read the documentation in qemu-doc.html or on http://wiki.qemu.org

- QEMU team