block/cow.c: fix warnings with _FORTIFY_SOURCE
CC block/cow.occ1: warnings being treated as errorsblock/cow.c: In function 'cow_create':block/cow.c:251: error: ignoring return value of 'write', declared with attribute warn_unused_resultblock/cow.c:253: error: ignoring return value of 'ftruncate', declared with attribute warn_unused_result...
block/qcow.c: fix warnings with _FORTIFY_SOURCE
CC block/qcow.occ1: warnings being treated as errorsblock/qcow.c: In function 'qcow_create':block/qcow.c:804: error: ignoring return value of 'write', declared with attribute warn_unused_resultblock/qcow.c:806: error: ignoring return value of 'write', declared with attribute warn_unused_result...
block/vmdk.o: fix warnings with _FORTIFY_SOURCE
CC block/vmdk.occ1: warnings being treated as errorsblock/vmdk.c: In function 'vmdk_snapshot_create':block/vmdk.c:236: error: ignoring return value of 'ftruncate', declared with attribute warn_unused_result...
block/vvfat.c: fix warnings with _FORTIFY_SOURCE
CC block/vvfat.occ1: warnings being treated as errorsblock/vvfat.c: In function 'commit_one_file':block/vvfat.c:2259: error: ignoring return value of 'ftruncate', declared with attribute warn_unused_result...
qcow2: Fix error handling in qcow2_grow_l1_table
Return the appropriate error value instead of always using EIO. Don't free theL1 table on errors, we still need it.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
qcow2: Fix error handling in qcow_save_vmstate
Don't assume success but pass the bdrv_pwrite return value on.
qcow2: Return 0/-errno in get_cluster_table
Switching to 0/-errno allows it to distinguish different error cases.
qcow2: Return 0/-errno in qcow2_alloc_cluster_offset
Returning 0/-errno allows it to distingush different errors classes. Thecluster offset of newly allocated clusters is now returned in the QCowL2Metastruct.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>...
block: Return original error codes in bdrv_pread/write
Don't assume -EIO but return the real error.
qcow2: Fix error handling in grow_refcount_table
Return the appropriate error code instead of -EIO.
qcow2: Improve error handling in update_refcount
If update_refcount fails, try to undo any changes made so far to avoidinconsistencies in the image file.
qcow2: Allow updating no refcounts
There's absolutely no problem with updating the refcounts of 0 clusters.At least snapshot code is doing this and would fail once the result ofupdate_refcount isn't ignored any more.
qcow2: Don't ignore update_refcount return value
update_refcount can return errors that need to be handled by the callers.
qcow2: Don't ignore qcow2_alloc_clusters return value
Now that qcow2_alloc_clusters can return error codes, we must handle them inthe callers of qcow2_alloc_clusters.
Introduce qemu_write_full()
A variant of write(2) which handles partial write.
Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>Signed-off-by: Juan Quintela <quintela@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
force to test result for qemu_write_full()
Signed-off-by: Juan Quintela <quintela@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
posix-aio-compat.c: fix warning with _FORTIFY_SOURCE
CC posix-aio-compat.occ1: warnings being treated as errorsposix-aio-compat.c: In function 'aio_signal_handler':posix-aio-compat.c:505: error: ignoring return value of 'write', declared with attribute warn_unused_result...
monitor: convert do_physical_memory_save() to QError
Signed-off-by: Markus Armbruster <armbru@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
QError: New QERR_INVALID_CPU_INDEX
monitor: convert do_cpu_set() to QObject, QError
monitor: Don't check for mon_get_cpu() failure
mon_get_cpu() can't return null pointer, because it passes its returnvalue to cpu_synchronize_state() first, which crashes if its argumentis null.
Remove the (pretty cheesy) handling of this non-existing error....
QError: New QERR_OPEN_FILE_FAILED
monitor: convert do_memory_save() to QError
json: escape u0000 .. u001F when outputting json
Markus Armbruster pointed out:
JSON requires control characters in strings to be escaped. RFC 4627section 2.5:
A string begins and ends with quotation marks. All Unicode characters may be placed within the quotation marks except for the...
Sparc64: fix initrd
Fix HdrS offsets for Sparc64. The initrd address must be offset byKERNBASE.
Use rom_ptr mechanism to actually write to the kernel image.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
pflash: Dont open memarea for full IO if already done.
When wcycle is non zero the area is already opened for readable IO.Avoiding the re-registration of the memarea significantly speeds upthe flash emulation. In particular for flashes connected through 8 or...
pflash: Reduce writebuf len for 8-bit flashes.
Flashes connected through an 8 bit bus cannot handle write bufferslarger than 256 bytes.
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@petalogix.com>
pflash: Remove dead code, no functional changes.
microblaze: The petalogix s3adsp board uses intel flashes
Support --sysconfdir in configure to specify path to configuration files
The default value is ${prefix}/etc/qemu. --sysconfdir can be used to overridethe default to an absolute path. The expectation is that when installed to/usr, --sysconfdir=/etc/qemu will be used....
Move out option lookup into a separate function
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Load global config files by default
A new option, nodefconfig is introduced to prevent loading from the defaultconfig location. Otherwise, two configuration files will be searched for,qemu.conf and target<TARGET_NAME>.conf.
To ensure that the default configuration is overridden by a user specified...
Sparc32: fix free-run timer
According to Sun4M System Architecture Manual chapter 5.3.2, a limitof 0 will not generate interrupts.
Musicpal: Fix descriptor walk in eth_send
Commit 930c86820e introduced a regression to eth_send: eth_tx_desc_putmanipulates the host's tx descriptor copy before writing it back, buttwo lines down the descriptor is evaluated again, leaving us with aninvalid next address if host and guest endianness differ. So this was...
Musicpal: Fix wm8750 I2C address
Commit b3a219883e uncovered that we attached the Wolfson with an I2Caddress shifted left by one. Fixing this makes sound work again forthe Musicpal.
Signed-off-by: Jan Kiszka <jan.kiszka@web.de>Signed-off-by: malc <av1474@comtv.ru>
sparc32 fix np dereference in do_unassigned_access
fix a potential null pointer dereference introduced incommit 576c2cdc767ab9e2dc038fa4c99f22e53287a3de
Signed-off-by: Artyom Tarasenko <atar4qemu@gmail.com>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Sparc64: fix PCI probe problems
Byte swap PCI config values.
Remove old bogus PCI config mechanism so that device 0:0.0 can be probed.This requires OpenBIOS r667.
Revert "block: prevent multiwrite_merge from creating too large iovecs"
This reverts commit 0076bc0c1d93adcbc7f1af184e04902cf37e9ab8.
Kevin Wolf pointed out that this breaks the mingw32 build.
make: qemu-img depends on config-host.h
Fixes mingw32 build out of tree.
reduce number of reinjects on ACK
Windows 7 BSODs under load with HAL_RTC_IRQF_WILL_NOT_CLEAR error.
It happens here:hal!HalpRtcUnmaskClock:8281b93a 8bff mov edi,edi8281b93c 56 push esi8281b93d 33f6 xor esi,esi...
block: prevent multiwrite_merge from creating too large iovecs
If we go over the maximum number of iovecs support by syscall we getback EINVAL from the kernel which translate to I/O errors for the guest.
Signed-off-by: Christoph Hellwig <hch@lst.de>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
block: fix cache flushing in bdrv_commit
virtio: Remove duplicate macro definition for max. virtqueues, bump up the max
VIRTIO_PCI_QUEUE_MAX is redefined in hw/virtio.c. Let's just keep it inhw/virtio.h.
Also, bump up the value of the maximum allowed virtqueues to 64. This isin preparation to allow multiple ports per virtio-console device....
virtio-console: qdev conversion, new virtio-serial-bus
This commit converts the virtio-console device to create a newvirtio-serial bus that can host console and generic serial ports. Thefile hosting this code is now called virtio-serial-bus.c.
The virtio console is now a very simple qdev device that sits on the...
virtio-serial-bus: Maintain guest and host port open/close state
Via control channel messages, the guest can tell us whether a port gotopened or closed. Similarly, we can also indicate to the guest of hostport open/close events.
Signed-off-by: Amit Shah <amit.shah@redhat.com>...
virtio-serial-bus: Add a port 'name' property for port discovery in guests
The port 'id' or number is internal state between the guest kernel andour bus implementation. This is invocation-dependent and isn't part ofthe guest-host ABI.
To correcly enumerate and map ports between the host and the guest, the...
virtio-serial-bus: Add ability to hot-unplug ports
Signed-off-by: Amit Shah <amit.shah@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
virtio-serial: Add a 'virtserialport' device for generic serial port support
This commit adds a simple chardev-based serial port. Any data the guestsends is forwarded to the chardev and vice-versa.
Sample uses for such a device can be obtaining info from the guest like...
Move virtio-serial to Makefile.objs
There's nothing target-dependent in the virtio-serial code so allow itto be compiled just once for all the targets.
virtio-serial: Use MSI vectors for port virtqueues
This commit enables the use of MSI interrupts for virtqueuenotifications for ports. We use nr_ports + 1 (for control channel) msientries for the ports, as only the in_vq operations need an interrupt on...
net: Make inet_strfamily() public
So that it can be used by other subsystems.
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
net: inet_strfamily(): Better unknown family report
Returning "????" is a bit meaningless, let's call it "unknown".
vnc: Use inet_strfamily()
QMP: Fix asynchronous events delivery
Commit f039a563f200beee80cc10fd70b21ea396979dab introducesa regression as monitor_protocol_event() will return inthe first user Monitor it finds in the QLIST_FOREACH()loop.
The right thing to do is to only delivery an asynchronous...
Documentation: Add missing documentation for qdev related command line options
The command line options -device, -nodefaults, -readconfig,-writeconfig had entries for command line help, butdocumentation for texi and derived formats (man, html, info)was missing....
Make CDROM a read-only drive
Signed-off-by: Naphtali Sprei <nsprei@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Clean-up a little bit the RW related bits of BDRV_O_FLAGS. BDRV_O_RDONLY gone (and so is BDRV_O_ACCESS). Default value for bdrv_flags (0/zero) is READ-ONLY. Need to explicitly request READ-WRITE.
Instead of using the field 'readonly' of the BlockDriverState struct for passing the request,...
Added drives' readonly option
Disable fall-back to read-only when cannot open drive's file for read-write
QMP: Introduce VNC_INITIALIZED event
It's emitted when a VNC client session is activated by QEMU,client's information such as port, IP and auth ID (if thesession is authenticated) are provided.
Event example:
{ "event": "VNC_INITIALIZED", "timestamp": {"seconds": 1263475302, "microseconds": 150772},...
Fix QEMU_WARN_UNUSED_RESULT
Since commit 747bbdf7 QEMU_WARN_UNUSED_RESULT is never defined as it isconditional on a define from config-host.h which is included only later.Include that file earlier to get the warnings back.
Reactivating it unfortunately leads to some warnings about unused qdev_init...
QMP: Emit asynchronous events on all QMP monitors
When using a control/QMP monitor in tandem with a regular monitor, asynchronousmessages can get lost depending on the order of the QEMU program arguments.QEMU events issued by monitor_protocol_event() always go to cur_mon. If the...
ide: device version property
This patch adds a new property named 'ver' to ide-drive which allows tospecify the version which the virtual disk/cdrom should report to theguest. By default this is the qemu version (i.e. 0.12). usage:
-drive if=none,id=disk,file=......
scsi: device version property
This patch adds a new property named 'ver' to scsi-disk which allows tospecify the version which the virtual disk/cdrom should report to theguest. By default this is the qemu version (i.e. 0.12). usage:
pc: add driver version compat properties
This patch adds compat property entries for ide-disk.ver andscsi-disk.ver to pc-0.10 and pc-0.11. With this patch appliedthe scsi and ide disks report "0.10" and "0.11" as version whenyou start qemu with "-M pc-0.10" or "-M pc-0.11"....
fix wrong indentation
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
clean up env->current_tb
There are three paths from the innermost while loop of cpu_execto the top of the outermost for loop. Two do not resetenv->current_tb. Fix this.
add assertions about env->current_tb
By virtue of the previous patch env->current_tb will always be NULL atthe top of cpu_exec's outermost for loop, and at the end of the innermostwhile loop.
change while to if
The while loop will be executed exactly 0 or 1 times, depending onenv->exit_request.
remove assertions
avoid unreachable statement after break
raw-posix: Detect CDROM via ioctl on linux
Current CDROM detection is hardcoded based on source file name.Make this smarter on linux by attempting a CDROM specific ioctl.
This makes '-cdrom /dev/sr0' succeed with no media present.
v2: Give ioctl check higher priority than filename check....
raw-posix: Detect legacy floppy via ioctl on linux
Current legacy floppy detection is hardcoded based on source filename. Make this smarter on linux by attempting a floppy specificioctl.
v2: Give ioctl check higher priority than filename check s/IDE/legacy/...
char: Remove redundant qemu_chr_generic_open() call.
qemu_chr_open_fd() calls qemu_chr_generic_open(),so qemu_chr_open_tty() doesn't need to call it.
Signed-off-by: Kusanagi Kouichi <slash@ac.auone-net.jp>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
VNC: Use 'enabled' key instead of 'status'
Currently the 'status' key is a string whose value can be"disabled" or "enabled", change it to the QMP's standard'enabled' key, which is a bool.
Note that 'status' in being dropped and this wouldn't beallowed if QMP were stable....
VNC: Make 'auth' key mandatory
There is no reason to have it as optional and the codein the server and client gets slightly simpler if thekey is mandatory.
While there also do some cleanup on how the server info iscollected.
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>...
VNC: Rename client's 'username' key
It's the SASL username, so it's better to call it 'sasl_username'to be consistent.
Note that this change wouldn't be allowed if QMP were stable.
VNC: Add 'family' key
It contains the socket adress family name, like "ipv4" or"ipv6".
This is useful for clients so that they can interpret the'host' key reliably.
VNC: Cache client info at connection time
When a disconnection happens the client's socket on QEMUside may become invalid, this way it won't be possibleto query it to get client information, which is going tobe needed by the future QMP VNC_DISCONNECTED event....
QMP: Introduce VNC_CONNECTED event
It's emitted when a VNC client connects to QEMU, client's informationsuch as port and IP address are provided.
Note that this event is emitted right when the connection isestablished. This means that it happens before authentication...
QMP: Introduce VNC_DISCONNECTED event
It's emitted when a VNC client disconnects from QEMU, client'sinformation such as port and IP address are provided.
{ "event": "VNC_DISCONNECTED", "timestamp": { "seconds": 1262976601, "microseconds": 975795 },...
eepro100: Fix multicast support
This patch is a step to synchronize my maintainer versionof eepro100.c (git://repo.or.cz/qemu/ar7.git) with the...
rtl8139: fix clang reporting unused assignment of VLAN tagging data
Currently we do not implement VLAN tagging for rtl8139(C+),still data is read from ring buffer headers.
- augment unused assignment with TODO item- cast txdw1 to void for now
Signed-off-by: Igor V. Kovalenko <igor.v.kovalenko@gmail.com>...
remove dead code from target-i386/exec.h
These are unused since edea5f0 (no need to define global registers incpu-exec.c, 2008-05-10).
kill regs_to_env and env_to_regs
eepro100: Restructure code (new function tx_command)
Handling of transmit commands is rather complex,so about 80 lines of code were moved from functionaction_command to the new function tx_command.
The two new values "tx" and "cb_address" in theeepro100 status structure made this possible without...
Sparc32: Update OpenBIOS image to r666
Fixes the boot problem introduced by r665 image in694b9309462f07307d16f492961f01271f10c245.
Sparc: improve CPU register dump
Common: * Remove unnecessary 0x prefix * Print %y * Fix NZVC flag print order to match CPU bit order
Sparc64 specific: * Print registers without line wrapping * Print %f40-%f63 * Pretty print CCR flags * Print %fsr and %fprs in full precision...
fix linux-user microblaze ELF_ARCH definition
Signed-off-by: Mike Frysinger <vapier@gentoo.org>Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
audio: include more information into audio_bug's output
Signed-off-by: malc <av1474@comtv.ru>
Revert "sdlaudio: make it suck less"
This reverts commit 4839abe78fd466a3cf06faa7c362154afd5404f1.
The commit was badly broken, Gentoo has sdl as the default driver,consequently 5 gentoo users have hit the breakage and were kind enoughto report, so thank you:...
Sparc32: improve DMA controller IRQ debugging
ESP: improve IRQ debugging
sparc32 do not clear interrupts when masking
Update Sparc OpenBIOS images to r665
sparc32 do_unassigned_access overhaul v2
According to pages 9-31 - 9-34 of "SuperSPARC & MultiCache ControllerUser's Manual":
1. "A lower priority fault may not overwrite the MFSR status of a higher priority fault." 2. The MFAR is overwritten according to the policy defined for the MFSR...
tcg/x86_64: Avoid unnecessary REX.B prefixes.
The existing P_REXB internal opcode flag unconditionally emitsthe REX prefix. Technically it's not needed if the register inquestion is %al, %bl, %cl, %dl.
Eliding the prefix requires splitting the P_REXB flag into two,...
nand: Correct random data reads.
Random reading depends on having the last row/page latched and not beeingclobbered between read and any following random reads.
Also, s->iolen must be updated when loading the io/data register withrandomly accessed flash data....
Makefile: Fix message for missing configure
When make is called without a valid configuration,it should tell the user what to do.
Revision 0e8c9214ba1d4128cf92442cd343bc3733478261was a regression which resulted in a messagewhich was no longer user friendly...
target-m68k: fix a typo in 'P' packet processing
Attached is a patch to fix a typo in 'P' packet processing for M68K.
Without this patch, QEMU fails to honor GDB's P packets from GDB(writing to registers) for the address registers (A0 - A7).
The problem is because of an obvious typo. Notice that the second...