qcow2: Add refcount update reason to all callers
This adds a refcount update reason to all callers of update_refcounts(),so that a follow-up patch can use this information to decide whetherclusters that reach a refcount of 0 should be discarded in the image...
ide: Convert DMA read/write commands to ide_cmd_table handler
Signed-off-by: Kevin Wolf <kwolf@redhat.com>Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
ide: Convert READ NATIVE MAX ADDRESS to ide_cmd_table handler
ide: Convert CHECK POWER MDOE to ide_cmd_table handler
ide: Convert SET FEATURES to ide_cmd_table handler
ide: Convert FLUSH CACHE to ide_cmd_table handler
ide: Convert SEEK to ide_cmd_table handler
ide: Convert ATAPI commands to ide_cmd_table handler
ide: Convert CF-ATA commands to ide_cmd_table handler
ide: Convert SMART commands to ide_cmd_table handler
ide: Clean up ide_exec_cmd()
All commands are now converted to ide_cmd_table handlers, so it can beunconditional now and the old switch block can go.
Revert "block: Disable driver-specific options for 1.5"
This reverts commit 8ec7d390b0d50b5e5b4b1d8dba7ba40d64a70875.
ide: Add handler to ide_cmd_table
As a preparation for moving all IDE commands into their own functionlike in the ATAPI code, introduce a 'handler' callback to ide_cmd_table.
Commands using this new infrastructure get some things handledautomatically:...
ide: Convert WIN_DSM to ide_cmd_table handler
ide: Convert WIN_IDENTIFY to ide_cmd_table handler
ide: Convert cmd_nop commands to ide_cmd_table handler
cmd_nop handles all commands that don't really do anything in ourimplementation except setting status register flags.
ide: Convert verify commands to ide_cmd_table handler
ide: Convert read/write multiple commands to ide_cmd_table handler
ide: Convert PIO read/write commands to ide_cmd_table handler
Merge remote-tracking branch 'bonzini/iommu-for-anthony' into staging
Merge remote-tracking branch 'kiszka/queues/slirp' into staging
Message-id: cover.1371638848.git.jan.kiszka@siemens.com...
dma: eliminate DMAContext
The DMAContext is a simple pointer to an AddressSpace that is now alwaysalready available. Make everyone hold the address space directly,and clean up the DMA API to use the AddressSpace directly.
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>...
memory: give name to every AddressSpace
The "info mtree" command in QEMU console prints only "memory" and "I/O" address spaces while there are actually a lot more other AddressSpacestructs created by PCI and VIO devices. Those devices do not normallyhave names and therefore not present in "info mtree" output....
memory: Fix comment typo
s/ajacent/adjacent
Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
memory: as_update_topology_pass: Improve comments
These comments were a little difficult to read. First one hadincorrect parenthesis. The part about attributes changing isreally applicable to the region being 'in both' rather than 'innew'
Second comment has an obscure parenthetic about 'Logging may have...
memory: render_memory_region: factor out fr constant setters
These 4 replicated lines set properties of fr that are constant overthe course of the function. Factor out their repeated setting (and alsoguards against them being set multiple times in the loop below)....
spapr_vio: take care of creating our own AddressSpace/DMAContext
Fetch the root region from the sPAPRTCETable, and use it to buildan AddressSpace and DMAContext.
Now, everywhere we have a DMAContext we also have access to thecorresponding AddressSpace (either because we create it just before...
exec: reorganize mem_add to match Int128 version
When adding support for 2^64-byte sections, we will have to changethe structure of mem_add to avoid failures in int128_get64.Reorganize the code now before introducing Int128.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
memory: make section size a 128-bit integer
So far, the size of all regions passed to listeners could fit in 64 bits,because artificial regions (containers and aliases) are eliminated bythe memory core, leaving only device regions which have reasonable sizes...
memory: iommu support
Add a new memory region type that translates addresses it is given,then forwards them to a target address space. This is similar toan alias, except that the mapping is more flexible than a lineartranslation and trucation, and also less efficient since the...
memory: Add iommu map/unmap notifiers
This patch adds a NotifierList to MemoryRegions which represent IOMMUsallowing other parts of the code to register interest in mappings orunmappings from the IOMMU. All IOMMU implementations will need to callmemory_region_notify_iommu() to inform those waiting on the notifier list,...
vfio: abort if an emulated iommu is used
vfio doesn't support guest iommus yet, indicate it to the userby gently depositing a core on their disk.
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>Signed-off-by: Avi Kivity <avi.kivity@gmail.com>Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
spapr: convert TCE API to use an opaque type
The TCE table is currently returned as a DMAContext, and non-type-safeAPIs are called later passing back the DMAContext. Since we want to moveaway from DMAContext, use an opaque type instead, and add an accessor...
spapr: make IOMMU translation go through IOMMUTLBEntry
The next step is to introduce the translation code that will be used forIOMMU MemoryRegions, but still do the actual translation in a DMAContext.
Acked-by: David Gibson <david@gibson.dropbear.id.au>...
spapr: use memory core for iommu support
Now we can stop using a "translating" DMAContext, but we do not yet modifythe sPAPRTCETable users to get an AddressSpace; they keep using the tablevia a DMAContext.
dma: eliminate old-style IOMMU support
The translate function in the DMAContext is now always NULL.Remove every reference to it.
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
pci: use memory core for iommu support
Use the new iommu support in the memory core for iommu support. The onlyuser, spapr, is also converted, but it still provides a DMAContextinterface until the non-PCI bits switch to AddressSpace.
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>...
exec.c: address_space_translate: handle access to addr 0 of 2^64 sized region
The memory API allows a MemoryRegion's size to be 2^64, as a specialcase (otherwise the size always fits in a 64 bit integer). This meantthat attempts to access address zero in a 2^64 sized region would...
memory: Introduce address_space_lookup_region
This introduces a wrapper for phys_page_find (before we complicateaddress_space_translate with IOMMU translation). This function willalso encapsulate locking and reference counting when we introduceBQL-free dispatching....
memory: move private types to exec.c
exec: Allow unaligned address_space_rw
This will be needed for some corner cases with para-virtual I/O ports.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
exec: Resolve subpages in one step except for IOTLB fills
Except for the case of setting the IOTLB entry in TCG mode, we can avoidthe subpage dispatching handlers and do the resolution directly onaddress_space_lookup_region. An IOTLB entry describes a full page, not...
exec: Implement subpage_read/write via address_space_rw
This will allow to add support for unaligned memory regions: the subpagecontainer region can activate unaligned support unconditionally becausethe read/write handler will now ensure that accesses are split as...
exec: return MemoryRegion from address_space_translate
Only address_space_translate_for_iotlb needs to return the section.Every caller of address_space_translate now uses only section->mr,return it directly.
Revert "memory: limit sections in the radix tree to the actual address space size"
This reverts commit 86a8623692b1b559a419a92eb8b6897c221bca74.
Revert "s390x: reduce TARGET_PHYS_ADDR_SPACE_BITS to 62"
This reverts commit 311f83ca08c011b048c063c2fd3038a8957970bc.
doc: Drop ref to Bochs from -no-fd-bootchk documentation
Manual page and qemu-doc on talk about "Bochs BIOS". We use SeaBIOS,and it implements the feature. Replace by just "BIOS", and drop theTODO line wondering about the Bochs reference.
Signed-off-by: Markus Armbruster <armbru@redhat.com>...
pc: Make -no-fd-bootchk stick across boot order changes
Option -no-fd-bootchk asks the BIOS to attempt booting from a floppyeven when the boot sector signature isn't there, by setting a bit inRTC CMOS. It was added back in 2006 (commit 52ca8d6a).
Two years later, commit 0ecdffbb added monitor command boot_set....
qemu-option: check_params() is now unused, drop it
Signed-off-by: Markus Armbruster <armbru@redhat.com>Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>Message-id: 1371208516-7857-3-git-send-email-armbru@redhat.comSigned-off-by: Anthony Liguori <aliguori@us.ibm.com>
vl: Fix -boot order and once regressions, and related bugs
Option "once" sets up a different boot order just for the initialboot. Boot order reverts back to normal on reset. Option "order" changes the normal boot order.
The reversal is implemented by reset handler restore_boot_devices(),...
vl: Rename *boot_devices to *boot_order, for consistency
Signed-off-by: Markus Armbruster <armbru@redhat.com>Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>Message-id: 1371208516-7857-5-git-send-email-armbru@redhat.comSigned-off-by: Anthony Liguori <aliguori@us.ibm.com>
vl: Clean up parsing of -boot option argument
Commit 3d3b8303 threw in some QemuOpts parsing without replacing theexisting ad hoc parser, resulting in a confusing mess. Clean it up.
Two user-visible changes:
1. Invalid options are reported more nicely. Before:...
fix -net user checks by reordering checks
reorder slirp config options. first check the dns-server-address,then check the first-dhcp-address. the original code was comparingthe first-dhcp-address with the default dns-server-address, notthe configured dns-server-address....
make user networking hostfwd work with restrict=y
This patch allows the hostfwd option to override the restrict=y setting inthe user network stack, as explicitly stated in the documentation on therestrict option:
restrict=on|off If this option is enabled, the guest will be isolated, i.e. it...
wdt_i6300esb: fix vmstate versioning
When this VMSD was introduced it's version fields were set tosizeof(I6300State), making them essentially random from build to build,version to version.
To fix this, we lock in a high version id and low minimum version id to...
Merge remote-tracking branch 'bonzini/scsi-next' into staging
Merge remote-tracking branch 'bonzini/nbd-next' into staging
virtio-rng: Fix crash with non-default backend
'default_backend' isn't always set, but 'rng' is, so use that.
$ ./x86_64-softmmu/qemu-system-x86_64 -object rng-random,id=rng0,filename=/dev/random -device virtio-rng-pci,rng=rng0Segmentation fault (core dumped)...
scsi: reset cdrom tray statuses on scsi_disk_reset
Tray statuses should be also reset. Some guests may lock the tray andright after resetting the guest it should be unlocked and closed. Thisis done on power-on, reset and resume from suspend/hibernate on bare-metal....
scsi-generic: fix sign extension of READ CAPACITY data
Issuing the READ CAPACITY command in the guest will cause QEMUto update its knowledge of the maximum accessible LBA in the disk.The recorded maximum LBA will be wrong if the disk is bigger than...
scsi-generic: check the return value of bdrv_aio_ioctl in execute_command
This fixes the bug introduced by this commit ad54ae80c73f.The bdrv_aio_ioctl() still could return null and we should return an errorin that case.
Cc: qemu-stable@nongnu.orgSigned-off-by: Pavel Hrdina <phrdina@redhat.com>...
scsi-disk: scsi-block device for scsi pass-through should not be removable
This patch adds a new SCSI_DISK_F_NO_REMOVABLE_DEVOPS feature. By thisfeature we can set that the scsi-block (scsi pass-through) device will stillbe removable from the guest side, but from monitor it cannot be removed....
vhost-scsi: fix k->set_guest_notifiers() NULL dereference
Coverity picked up a copy-paste bug. In vhost_scsi_start() we check for!k->set_guest_notifiers and error out. The check probably got copiedbut instead of erroring we actually use the function pointer!...
iscsi: simplify freeing of tasks
Always free them in the iscsi_aio_*_acb functions and remove thechecks in their callers. Remove ifs when the task struct waspreviously dereferenced (spotted by Coverity).
Cc: qemu-stable@nongnu.orgSigned-off-by: Paolo Bonzini <pbonzini@redhat.com>
iscsi: reorganize iscsi_readcapacity_sync
Avoid the goto, and use the same retry logic for the 10- and 16-byte versions.
nbd: strip braces from literal IPv6 address in URI
Otherwise they would get passed to getaddrinfo and fail with:address resolution failed for [::1]:1234: Name or service not known
(Broken by commit v1.4.0-736-gf17c90b)
Signed-off-by: Ján Tomko <jtomko@redhat.com>...
qemu-socket: allow hostnames starting with a digit
According to RFC 1123 [1], hostnames can start with a digit too.
[1] http://tools.ietf.org/html/rfc1123#page-13
Signed-off-by: Ján Tomko <jtomko@redhat.com>Cc: qemu-stable@nongnu.org[Use strspn, not strcspn. - Paolo]...
intc/xilinx_intc: Handle level interrupt retriggering
Acking a level sensitive interrupt should have no effect if theinterrupt pin is still asserted. The current implementation requiresand edge condition to occur for setting a level sensitive IRQ, which...
intc/xilinx_intc: Inhibit write to ISR when HIE
When the Hardware Interrupt Enable (HIE) bit is set, software cannotchange ISR. Add write guard accordingly.
Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
intc/xilinx_intc: Dont lower IRQ when HIE cleared
This is a little strange. It is lowering the parent IRQ pin on inputwhen HIE is cleared. There is no such behaviour in the real hardware.
ISR changes based on interrupt pin state are already guarded on HIE...
microblaze/petalogix_s3adsp1800_mmu: Fix UART IRQ
The UART IRQ is edge sensitive, whereas the machine was registering itas level sensitive. Fix.
intc/xilinx_intc: Don't clear level sens. IRQs without ACK
For level sensitive interrupts, ISR bits are cleared when the input pinis lowered. This is incorrect. Only software can clear ISR bits (viaIAR or direct write to ISR with !MER).
Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>...
Merge remote-tracking branch 'luiz/queue/qmp' into staging
Merge remote-tracking branch 'kwolf/for-anthony' into staging
Merge remote-tracking branch 'rth/fix-ppc64' into staging
tcg-ppc64: bswap64 rotates output 32 bits
If our input and output is in the same register, bswap64 tries toundo a rotate of the input. This just ends up rotating the output.
Cc: qemu-stable@nongnu.orgSigned-off-by: Anton Blanchard <anton@samba.org>Signed-off-by: Richard Henderson <rth@twiddle.net>
tcg-ppc64: Fix add2_i64
add2_i64 was adding the lower double word to the upper double wordof each input. Fix this so we add the lower double words, then theupper double words with carry propagation.
Cc: qemu-stable@nongnu.orgSigned-off-by: Anton Blanchard <anton@samba.org>...
tcg-ppc64: rotr_i32 rotates wrong amount
rotr_i32 calculates the amount to left shift and puts it into atemporary, but then doesn't use it when doing the shift.
tcg-ppc64: Fix RLDCL opcode
The rldcl instruction doesn't have an sh field, so the minor opcodeis shifted 1 bit. We were using the XO30 macro which shifted theminor opcode 2 bits.
Remove XO30 and add MD30 and MDS30 macros which match thePower ISA categories....
block/curl.c: Refuse to open the handle for writes.
Signed-off-by: Richard W.M. Jones <rjones@redhat.com>Signed-off-by: Fam Zheng <famz@redhat.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
vmdk: byteswap VMDK4Header.desc_offset field
Remember to byteswap VMDK4Header.desc_offset on big-endian machines.
Cc: qemu-stable@nongnu.orgSigned-off-by: Stefan Hajnoczi <stefanha@redhat.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
curl: Don't set curl options on the handle just before it's going to be deleted.
(Found by Kamil Dudka)
Signed-off-by: Richard W.M. Jones <rjones@redhat.com>Cc: Michael Tokarev <mjt@tls.msk.ru>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
NVMe: Initial commit for new storage interface
Initial commit for emulated Non-Volatile-Memory Express (NVMe) pcistorage device.
NVMe is an open, industry driven storage specification definingan optimized register and command set designed to deliver the full...
vmdk: Allow reading variable size descriptor files
the hard-coded 2k buffer on the stack won't allow reading big descriptorfiles which can be generated when storing big images. For example 500Gvmdk splitted to 2G chunks.
Signed-off-by: Evgeny Budilovsky <evgeny.budilovsky@ravellosystems.com>...
sheepdog: fix snapshot tag initialization
This is an old and obvious bug. We should pass snapshot_id to thetag. Or simple command like 'qemu-img snapshot -a tag sheepdog:image' will fail
Cc: qemu-devel@nongnu.orgCc: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>...
sheepdog: support 'qemu-img snapshot -a'
Just call sd_create_branch() in the snapshot_goto to rollback the image is goodenough. With this patch, 'loadvm' process for sheepdog is modified:
Suppose we have a snapshot chain A --> B --> C, we do 'loadvm A' so as to get...
error: add error_setg_file_open() helper
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>Acked-by: Kevin Wolf <kwolf@redhat.com>
rng-random: use error_setg_file_open()
block: mirror_complete(): use error_setg_file_open()
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>Acked-by: Kevin Wolf <kwolf@redhat.com>
blockdev: use error_setg_file_open()
cpus: use error_setg_file_open()
dump: qmp_dump_guest_memory(): use error_setg_file_open()
savevm: qmp_xen_save_devices_state(): use error_setg_file_open()
block: bdrv_reopen_prepare(): don't use QERR_OPEN_FILE_FAILED
The call to drv->bdrv_reopen_prepare() can fail due to reasonsother than an open failure. Unfortunately, we can't use errnonor -ret, cause they are not always set.
Stick to a generic error message then....
qerror: drop QERR_OPEN_FILE_FAILED macro
Not used since the last commit.
Merge remote-tracking branch 'pmaydell/configury.next' into staging
Merge remote-tracking branch 'mjt/trivial-patches' into staging
Message-id: 1371455050-9523-1-git-send-email-mjt@msgid.tls.msk.ru...
char/serial: fix copy&paste error (fifo8_is_full vs empty)
Copy&paste error in serial.c causes a crash when attemptingto read from UART (if there is no data to be read)
Signed-off-by: Vladimir Senkov <hangup@gmail.com>Reviewed-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>...
vl: always define no_frame
Commit 047d4e151dd46 "Unbreak -no-quit for GTK, validate SDL options" brokebuild of qemu without sdl, by referencing `no_frame' variable which is definedinside #if SDL block. Fix that by defining that variable unconditionally....
gtk: Fix compiler warning (GTK 3 deprecated function)
With GTK 3, the function gdk_cursor_unref is deprecated:
qemu/ui/gtk.c: In function ‘gd_cursor_define’:qemu/ui/gtk.c:380:5: error: ‘gdk_cursor_unref’ is deprecated (declared at /usr/include/gtk-3.0/gdk/gdkcursor.h:233): Use 'g_object_unref' instead [-Werror=deprecated-declarations]...