eepro100: Allocate a larger buffer for regname()
This should avoid truncating the register name when debugging.
Signed-off-by: David Benjamin <davidben@mit.edu>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Remove rule for config-devices.h
Since commit a992fe3d0fc185112677286f7a02204d8245b61econfig-devices.h is no longer used.
So there is no need to keep the dependency rulesany longer.
Signed-off-by: Stefan Weil <weil@mail.berlios.de>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Fix compile error when LSI_DEBUG is defined
This patch fixes the follow error when LSI_DEBUG is set.
CC libhw64/lsi53c895a.occ1: warnings being treated as errorsqemu/hw/lsi53c895a.c: In function 'lsi_io_mapfunc':qemu/hw/lsi53c895a.c:1932: error: format '%08x' expects type 'unsigned int', but argument 2 has type 'pcibus_t'...
qemu-img: Fix memory leak
Signed-off-by: Kevin Wolf <kwolf@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
posix-aio-compat: Fix error check
Checking for nbytes < 0 is pointless as long as it's a size_t. If we want touse negative numbers for error codes, we should use signed types.
multiboot: Use signed type for negative error numbers
In mb_mod_length a return value is stored that is negative in error case. Withan unsigned type the check goes wrong.
Fix build for mingw32 on windows ($@ in macro)
Make using mingw32 on windows does not preserve $@ in macroswhen they are modified using this pattern:target: macro += something
This behaviour results in an error when QEMU_CFLAGS containing"-MMD -MP -MT $@" is modified for compilation of source files...
Fix build for mingw32 on windows ($$ expansion)
Make using mingw32 on windows fails when running grep "=y$$".The command is expanded to grep "=y$ and the missing " results in an error.
I don't expect a file config-devices.mak with =y somewhere inthe middle of a line (they are always at the end of the line),...
Fix description of size parameter in qemu-img's help text
Valid description taken from qemu-img.texi, although it would be betterto have this information recorded in only one place.
Signed-off-by: Pierre Riteau <Pierre.Riteau@irisa.fr>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Fix recently introduced bugs in -usbdevice host
Commit 26a9e82a has the following flaws:
Make -kernel for linux work with bochsbios
While trying to run -kernel with -bios pc-bios/pcbios.bin, I realizedthat I was actually writing data to %es, but only set up %ds to a 32-bitsegment we want to write to.
So at the end of the day the data hasn't actually been copied. Oops....
multiboot: Fix module loading and setting of mmap.
Signed-off-by: Adam Lackorzynski <adam@os.inf.tu-dresden.de>Acked-by: Alexander Graf <agraf@suse.de>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
e1000: Fix warning from code review
A code review run by Steve Grubb complained about code in e1000.c:
In hw/e1000.c at line 89, vlan is declared to be 4 bytes.At line 382 is an attempt to do a memmove over it with a size of 12.
This was fixed by splitting the memmove in two calls and...
kvm: x86: Add support for VCPU event states
This patch extends the qemu-kvm state sync logic with support forKVM_GET/SET_VCPU_EVENTS, giving access to yet missing exception,interrupt and NMI states.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
SCSI: Fix Standard INQUIRY data
Vendor identification, product identification and product revision levelshould be padded with spaces without a terminating NULL character, seeSCSI-2 standard, 8.2.5.1 Standard INQUIRY data.
Signed-off-by: Laszlo Ast <laszlo.ast@siemens-enterprise.com>...
Rename DriveInfo.onerror to on_write_error
Either rename variables and functions to refer to write errors (which is whatthey actually do) or introduce a parameter to distinguish reads and writes.
Suppress optionrom build on Solaris x86
To avoid the build failing with:
gcc Wall -Wstrict-prototypes -Werror -fomit-frame-pointer -fnobuiltin -I/export/home/andreas/QEMU/qemu -Wall -Wstrict-prototypes -Werror -fomit-frame-pointer -fno-builtin -I/export/home/andreas/QEMU/...
kvm: x86: Fix merge artifact of f8d926e9 about mp_state
targe-ppc: Sync CPU state for KVM
Some recent change made PPC guests always start at address 0x0 because envisn't synced to kvm_state on first bootup.
I'm not sure if this is the correct bugfix, but at least it makes PPC bootagain with KVM enabled.
Signed-off-by: Alexander Graf <agraf@suse.de>...
target-ppc: Get MMU state on register sync
While x86 only needs to sync cr0-4 to know all about its MMU state and enableqemu to resolve virtual to physical addresses, we need to sync all of thesegment registers on PPC to know which mapping we're in.
So let's grab the segment register contents to be able to use the "x" monitor...
qcow2: Fix some more qemu_malloc fallout
Oh joy...
qemu-img: There is more than one host device driver
I haven't heard yet of anyone using qemu-img to copy an image to a real floppy,but it's a valid use case.
Don't leak file descriptors
We're leaking file descriptors to child processes. Set FD_CLOEXEC on filedescriptors that don't need to be passed to children to stop this misbehaviour.
qemu: make cirrus init value pci spec compliant
PCI memory should be disabled at reset, otherwisewe might claim transactions at address 0.I/O should also be disabled, although for cirrusit is harmless to enable it as we do nothave I/O bar.
Note: bios fix needed for this patch to work...
qemu: cleanup unused macros in cirrus
Cirrus vga has a copy of many PCI macros,and it doesn't even use them. Clean up.We also don't need to override header typeas it is NORMAL by default.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>Acked-by: Juan Quintela <quintela@redhat.com>...
live migration: Serialize vmstate saving in stage 2
The effect of this patch with current block migration is that its stage2, ie. the first full walk-through of the block devices will beperformed completely before RAM migration starts. This ensures that...
qemu-opts: Release id on deletion
The opts id is always allocated via qemu_strdup, so it need not beconst, but it has to be released on opts deletion.
ram migration: Properly reset statistics
As we may do more than one migration (cancellation, live backup), resetbytes_transferred on stage 1.
Introduce rerror option for drives
rerror controls the action to be taken when an error occurs while accessing theguest image file. It corresponds to werror which already controls the actiontake for write errors.
This purely introduces parsing rerror command line option into the right...
ide: Implement rerror option
virtio-blk: Implement rerror option
qcow2: Store exact backing format length
Currently qcow2 unnecessarily rounds up the length of the backing format stringto the next multiple of 8. At the same time, the array in BlockDriverState canonly hold 15 characters, so in effect backing formats with 9 characters or more...
block migration: Skip zero-sized disks
No need to migrate emptiness (risking divide by zero later on).
block migration: Add support for restore progress reporting
Inject progress report in percentage into the block live stream. Thiscan be read out and displayed easily on restore.
block migration: Increase dirty chunk size to 1M
4K is too small for efficiently saving and restoring multi-GB blockdevices.
block migration: Clean up use of total_sectors
We already save total_sectors in BlkMigDevState, let's use this valueduring the migration and avoid to recalculate it needlessly.
block migration: Consolidate mig_read_device_bulk into mig_save_device_bulk
Both functions share a lot of code, so make them one.
block migration: Consolidate block transmission
Based on the original patch by Pierre Riteau: Use a common blk_sendfunction to transmit a block.
block migration: Add error handling/propagation
ram migration: Stop loading on error
Besides catching real errors, this also allows to interrrupt the qemuprocess during restore.
live migration: Allow cleanup after cancellation or error
Introduce qemu_savevm_state_cancel and inject a stage -1 to cancel alive migration. This gives the involved subsystems a chance to clean updynamically allocated resources. Namely, the block migration layer can...
block migration: Report overall migration progress
So far progress reporting only works for the first block device. Fixthis by keeping an overall sum of sectors to be migratated, calculatingthe sum of all processed sectors, and finally basing the progress...
live migration: Propagate output monitor to callback handler
In order to allow proper progress reporting to the monitor thatinitiated the migration, forward the monitor reference through themigration layer down to SaveLiveStateHandler.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>...
block migration: Fix outgoing progress output
Report progress of an outgoing live migration to the monitor instead ofstdout.
block migration: Report progress also via info migration
block migration: Fix coding style and whitespaces
No functional changes.
block migration: Rework constants API
Instead of duplicating the definition of constants or introducingtrivial retrieval functions move the SECTOR constants into the publicblock API. This also obsoletes sector_per_block in BlkMigState.
block migration: Cleanup dirty tracking code
This switches the dirty bitmap to a true bitmap, reducing its footprint(specifically in caches). It moreover fixes off-by-one bugs inset_dirty_bitmap (nb_sectors+1 were marked) and bdrv_get_dirty (limitcheck allowed one sector behind end of drive). And is drops redundant...
block migration: Avoid large stack buffer
Move a potentially large buffer from stack to heap.
block migration: Avoid indirection of block_mig_state
No need to push block_mig_state to the heap and, thus, establish anindirection.
block migration: Drop dead code
Import a simple queue implementation from NetBSD
Signed-off-by: Pierre Riteau <Pierre.Riteau@irisa.fr>Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
block migration: Switch device and block lists to QSIMPLEQ
Based on the original patch by Pierre Riteau.
block migration: Initialize remaining BlkMigState fields
In case we restart a migration, submitted, read_done, transferred, andprint_completion need to be reinitialized to 0.
migration: Fix use of file after release
qemu_fclose frees the passed file structure, but do_migrate_set_speedmay access it later on. Fix it by setting file NULL inmigrate_fd_cleanup and checking for this.
migration: Catch multiple start commands
savevm: Port to qdev.vmsd all devices that have qdev
Signed-off-by: Juan Quintela <quintela@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
pci: vmstate_register() already assign consecutive numbers starting at 0
qdev: enable vmstate_unregister() support
Now vmstate_unregister have the right type
vmstate: Add support for VBUFFERS
Support for buffer that are pointed by a pointer (i.e. not embedded)where the size that we want to use is a field in the state.We also need a new place to store where to start in the middle of thebuffer, as now it is a pointer, not the offset of the 1st field....
vmstate: Introduce VMSTATE_STRUCT_TEST
vmstate: Introduce VMSTATE_STRUCT_POINTER_TEST
vmstate: Introduce UINT16_TEST support
vmstate: remove usused VMSTATE_STRUCT_ARRAY_SIZE_UINT8
vmstate: Add support for multiplying size for a constant
When the size that we want to transmit is in another field, but in anunit different that bytes
vmstate: Avoid seeking
Seeking on vmstate save/load does not work if the underlying file is astream. We could try to make all QEMUFile* forward-seek-aware, but firstattempts in this direction indicated that it's saner to convert the fewqemu_fseek-on-vmstates users to plain reads/writes....
vmstate: Fix info field of VMSTATE_MACADDR
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>Signed-off-by: Juan Quintela <quintela@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
vmstate: fix missing ARRAY_OF_POINTERS support on save state
lsi53c895a: Use alternative address when already reselected
See SCRIPTS, 3.2.17 SELECT.
Signed-off-by: Laszlo Ast <laszlo.ast@siemens-enterprise.com>Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
lsi53c895a: Implement IRQ on reselection
The critical part of this change is how to deal with simultaneaousgeneration of interrupts. The only (normal) case when this happens inthe emulation is near simultaneous reselection + selection. If selectioncomes first, there is no problem, since the target attempting...
scsi-disk: restruct emulation: GET_CONFIGURATION
Move GET_CONFIGURATION emulation from scsi_send_command() toscsi_disk_emulate_command().
Also add GET_CONFIGURATION to scsi-defs.h and scsi_command_name().
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>...
scsi-disk: restruct emulation: SERVICE_ACTION_IN
Move SERVICE_ACTION_IN emulation from scsi_send_command() toscsi_disk_emulate_command().
Also add SERVICE_ACTION_IN to scsi-defs.h and scsi_command_name().
scsi-disk: restruct emulation: REPORT_LUNS
Move REPORT_LUNS emulation from scsi_send_command() toscsi_disk_emulate_command().
Also add REPORT_LUNS to scsi-defs.h and scsi_command_name().
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
scsi-disk: restruct emulation: VERIFY
Move VERIFY emulation from scsi_send_command() toscsi_disk_emulate_command().
scsi: add read/write 16 commands.
Add READ_16 + friends to scsi-defs.h, scsi_command_name() and therequest parsing helper functions.
Use them in scsi-disk.c too.
lsi53c895a: Whitespace and typo fixes
lsi53c895a: Add support for LSI53C700 Family Compatibility bit
lsi53c895a: Fix message code of DISCONNECT
See SCSI-2, 6.5 Message system description/message codes.
lsi53c895a: Fix SDID in SELECT ID command
See SCRIPTS Programming Guide, 3.2.17 SELECT.
scsi-disk: restruct emulation: INQUIRY
Move INQUIRY emulation from scsi_send_command() toscsi_disk_emulate_command(). Also split the longish INQUITY emulationcode into the new scsi_disk_emulate_inquiry() function. Serial numberhandling is slightly changed, we don't copy it any more but look it up...
scsi-disk: restruct emulation: RESERVE+RELEASE
Move RESERVE+RELEASE emulation from scsi_send_command() toscsi_disk_emulate_command().
scsi-disk: restruct emulation: MODE_SENSE
Move MODE_SENSE emulation from scsi_send_command() toscsi_disk_emulate_command(). Create two helper functions:mode_sense_page() which writes the actual mode pages andscsi_disk_emulate_mode_sense() which holds the longish MODE_SENSE...
scsi-disk: restruct emulation: START_STOP
Move START_STOP emulation from scsi_send_command() toscsi_disk_emulate_command().
scsi-disk: restruct emulation: ALLOW_MEDIUM_REMOVAL
Move ALLOW_MEDIUM_REMOVAL emulation from scsi_send_command() toscsi_disk_emulate_command().
scsi-disk: restruct emulation: READ_CAPACITY
Move READ_CAPACITY emulation from scsi_send_command() toscsi_disk_emulate_command().
scsi-disk: restruct emulation: SYNCHRONIZE_CACHE
Move SYNCHRONIZE_CACHE emulation from scsi_send_command() toscsi_disk_emulate_command().
scsi-disk: restruct emulation: READ_TOC
Move READ_TOC emulation from scsi_send_command() toscsi_disk_emulate_command(). Add scsi_disk_emulate_read_toc() functionwhich holds the longisch READ_TOC emulation code.
scsi: add scsi_req_print()
Handy for debugging.
scsi-disk: restruct emulation: core + TEST_UNIT_READY.
Add new scsi_disk_emulate_command() function, which will -- whenfinished -- handle all scsi disk command emulation except actual I/O(READ+WRITE commands) which goes to the block layer. The function...
scsi-disk: restruct emulation: REQUEST_SENSE
Move REQUEST_SENSE emulation from scsi_send_command() toscsi_disk_emulate_command().
scsi: add xfer mode
scsi: move sense to SCSIDevice, create SCSISense struct.
scsi: move dinfo to SCSIDevice
scsi: move status to SCSIRequest.
Also add and use the scsi_req_complete() helper function for calling thecompletion callback.
scsi: move blocksize from SCSIGenericState to SCSIDevice
scsi: add scsi-defs.h
Largely based on <scsi/scsi.h> from linux. Added into the tree so wecan use the defines everywhere, not just in scsi-generic.c (which islinux-specific).
scsi: move type from SCSIGenericState to SCSIDevice
scsi: add request parsing helpers to common code.
Add helper functions for scsi request parsing to common code. Gettingcommand length, transfer size, and linear block address is handled.
scsi: use command defines in scsi-disk.c