qcow2: rename two QCowAIOCB members
The n member is not very descriptive and very hard to grep, rename it tocur_nr_sectors to better indicate what it is used for. Also renamenb_sectors to remaining_sectors as that is what it is used for.
Signed-off-by: Christoph Hellwig <hch@lst.de>...
PCI: Convert pci_info() to QObject
The returned QObject is a QList of all buses. Each bus isrepresented by a QDict, which has a key with a QList of allPCI devices attached to it. Each device is represented bya QDict.
As has happended to other complex conversions, it's hard to...
PCI: do_pci_info(): PCI bridge devices support
This commit completes the do_pci_info() conversion toQObject by adding support to PCI bridge devices.
This is done by recursively adding devices in the"pci_bridge" key.
IMPORTANT: This code is being added separately because I could...
ide save/restore current transfer fields
If migration takes place between write of the bmdma address register andwrite of the command register (to initiate DMA), the destination willnot properly start the DMA op, hanging the guest:
ata1.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x6 frozen...
Fix generation of config-host.h
This patch improves Anthony patch a6a853c86275efd89996ce59612a000c5873db5d
Once there, it improves handling of object files for qemu tools
cc: Andreas Färber <andreas.faerber@web.de>Signed-off-by: Juan Quintela <quintela@redhat.com>...
virtio-console: Rename virtio-serial.c back to virtio-console.c
This file was renamed to ease the reviews of the recent changesthat went in.
Now that the changes are done, rename the file back to its originalname.
Signed-off-by: Amit Shah <amit.shah@redhat.com>...
virtio-console: Automatically use virtio-serial-bus for the older -virtioconsole invocation
These hunks got dropped off mysteriously during the rebasing of myvirtio-serial series. Thanks go to Markus for noticing it.
Without these fixes, -virtioconsole doesn't actually have any effect....
block: clean up bdrv_open2 structure a bit
Check the whitelist as early as possible instead of continuing thesetup, and move all the error handling code to the end of thefunction.
Signed-off-by: Christoph Hellwig <hch@lst.de>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
block: kill BDRV_O_CREAT
The BDRV_O_CREAT option is unused inside qemu and partially duplicatesthe bdrv_create method. Remove it, and the -C option to qemu-io whichisn't used in qemu-iotests anyway.
qdev: Add help for device properties
When called with property "?", a list of supportedproperties will be printed (instead of an error message).
This is useful for command lines like qemu -device e1000,?and was already standard for other options like model=?...
qdev: Add help for property value
When called with property value "?",a help text will be printed (instead of an error message).
This is useful for command lines like qemu -device e1000,mac=?and is already standard for other command line options....
Documentation: Improve command line help for -device option
Signed-off-by: Stefan Weil <weil@mail.berlios.de>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Documentation: Add missing texi description for command line options
Some more command line options had entries for command line help,but documentation for texi and derived formats (man, html, info)was missing.
For conditional options, the texi documentation was added...
No need anymoe for bdrv_set_read_only
Signed-off-by: Naphtali Sprei <nsprei@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Ask for read-write permissions when opening files
Found some places that seems needs this explicitly, now thatread-write is not the default.
Read-only device changed to opens it's file for read-only.
QList: Introduce QLIST_FOREACH_ENTRY()
Iterate over QList entries, it's needed to call qlist_entry_obj()to retrieve the stored QObject.
I'm not sure if it's ok to have this, because it's not as easy asqlist_iter() and the QListEntry data type is now exposed to the...
QDict: Introduce qdict_get_qdict()
A helper to retrieve a QDict from a QDict.
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
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...
block/qcow2.c: fix warnings with _FORTIFY_SOURCE
CC block/qcow2.occ1: warnings being treated as errorsblock/qcow2.c: In function 'qcow_create2':block/qcow2.c:829: error: ignoring return value of 'write', declared with attribute warn_unused_resultblock/qcow2.c:838: error: ignoring return value of 'write', declared with attribute warn_unused_result...
net/slirp.c: fix warning with _FORTIFY_SOURCE
CC net/slirp.occ1: warnings being treated as errorsnet/slirp.c: In function 'slirp_smb_cleanup':net/slirp.c:470: error: ignoring return value of 'system', declared with attribute warn_unused_resultmake: *** [net/slirp.o] Error 1...
usb-linux.c: fix warning with _FORTIFY_SOURCE
CC usb-linux.occ1: warnings being treated as errorsusb-linux.c: In function 'usb_host_read_file':usb-linux.c:1204: error: ignoring return value of 'fgets', declared with attribute warn_unused_resultmake: *** [usb-linux.o] Error 1...
vl.c: fix warning with _FORTIFY_SOURCE
CC i386-softmmu/vl.occ1: warnings being treated as errors/usr/src/RPM/BUILD/qemu-0.11.92/vl.c: In function 'qemu_event_increment':/usr/src/RPM/BUILD/qemu-0.11.92/vl.c:3404: error: ignoring return value of 'write', declared with attribute warn_unused_result...
monitor.c: fix warnings with _FORTIFY_SOURCE
CC i386-softmmu/monitor.occ1: warnings being treated as errors/usr/src/RPM/BUILD/qemu-0.11.92/monitor.c: In function 'do_memory_save':/usr/src/RPM/BUILD/qemu-0.11.92/monitor.c:1318: error: ignoring return value of 'fwrite', declared with attribute warn_unused_result...
linux-user/mmap.c: fix warnings with _FORTIFY_SOURCE
CC i386-linux-user/mmap.occ1: warnings being treated as errors/usr/src/RPM/BUILD/qemu-0.11.92/linux-user/mmap.c: In function 'mmap_frag':/usr/src/RPM/BUILD/qemu-0.11.92/linux-user/mmap.c:253: error: ignoring return value of 'pread', declared with attribute warn_unused_result...
check pipe() return value
Signed-off-by: Juan Quintela <quintela@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Enable _FORTIFY_SOURCE=2
_FORTIFY_SOURCE is a Glibc feature which adds memory and string functionprotection.
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>
Check availavility of -fstack-protector-all
mmap_frag() users only check for -1 error
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.
force to test result for qemu_write_full()
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.
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.
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.
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
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"....
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 },...