docs: Add QED image format specification
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
qed: Add QEMU Enhanced Disk image format
This patch introduces the qed on-disk layout and implements imagecreation. Later patches add read/write and other functionality.
qed: Table, L2 cache, and cluster functions
This patch adds code to look up data cluster offsets in the image viathe L1/L2 tables. The L2 tables are writethrough cached in memory forperformance (each read/write requires a lookup so it is essential tocache the tables)....
qed: Read/write support
This patch implements the read/write state machine. Operations arefully asynchronous and multiple operations may be active at any time.
Allocating writes lock tables to ensure metadata updates do notinterfere with each other. If two allocating writes need to update the...
ahci: set SATA Mode Select
Set SATA Mode Select to AHCI in the Address Map Register.
Signed-off-by: Sebastian Herbszt <herbszt@gmx.de>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
ide: honor ncq for atapi
ATAPI also can do ncq, so let's expose the capability.
This patch makes CD-ROM support work on Windows 7 for me.
Signed-off-by: Alexander Graf <agraf@suse.de>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
qemu-img: Call error_set_progname
Call error_set_progname during the qemu-img initialization, so that errormessages printed with error_report() use the right prefix.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
qemu-img.c: Re-factor img_create()
This patch re-factors img_create() moving the code doing the actualwork into block.c where it can be shared with QEMU. This is needed tobe able to create images from QEMU to be used for live snapshots.
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>...
Introduce do_snapshot_blkdev() and monitor command to handle it.
The monitor command is:snapshot_blkdev <device> [snapshot-file] [format]
Default format is qcow2. For now snapshots without a snapshot-file, eginternal snapshots, are not supported.
Prevent creating an image with the same filename as backing file
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
bdrv_img_create() use proper errno return values
Kevin suggested to have bdrv_img_create() return proper -errno valueson error.
qemu.img.c: Use error_report() instead of own error() implementation
Remove NULL checks for bdrv_new return value
It's an indirect call to qemu_malloc, which never returns an error.
ide: Register vm change state handler once only
We register the vm change state handler in a PCI BAR map() function.This function can be called multiple times throughout the lifetime of aPCI IDE device. This results in duplicate vm change state handlers...
block: add discard support
Add a new bdrv_discard method to free blocks in a mapping image, and a newdrive property to set the granularity for these discard. If no discardgranularity support is set discard support is disabled.
Signed-off-by: Christoph Hellwig <hch@lst.de>...
scsi-disk: support WRITE SAME (16) with unmap bit
Support discards via the WRITE SAME command with the unmap bit set, andtell the initiator about the support for it via the block limit and thenew thin provisioning EVPD pages. Also fix the comment which incorrectly...
qemu-io: Add discard command
discard [-Cq] off len -- discards a number of bytes at a specifiedoffset
discards a range of bytes from the given offset
Example: 'discard 512 1k' - discards 1 kilobyte from 512 bytes into the file
Discards a segment of the currently open file....
raw-posix: add discard support
Add support to discard blocks in a raw image residing on an XFS filesystemby calling the XFS_IOC_UNRESVSP64 ioctl to punch holes. Support for otherhole punching mechanisms can be added when they become available.
qemu-io: Fix typo in help texts
ide: add ncq identify data for ahci sata drives
I modified ide_identify() to include the zero-based queue lengthvalue in word 75, and set bit 8 in word 76 to signal NCQ supportin the identify data for AHCI SATA drives.
Signed-off-by: Roland Elek <elek.roland@gmail.com>...
pci: add storage class for sata
This patch adds the storage sata class id.
pci: add ich9 pci id
We need a PCI ID for our new AHCI adapter. I just picked an ICH-9because that's the one in the Q35 chipset.
This patch adds a PCI ID define for an ICH-9 AHCI adapter.
ahci: add ahci emulation
This patch adds an emulation layer for an ICH-9 AHCI controller. For nowthis controller does not do IDE legacy emulation. It is a pure AHCI controller.
config: move ide core and pci to pci.mak
Every device that can do PCI should also be able to do IDE. So let's movethe IDE definitions over to pci.mak.
config: add ahci for pci capable machines
This patch enables AHCI for all machines supporting PCI.
ide: Split out BMDMA code from ATA core
The ATA core is currently heavily intertwined with BMDMA code. Let's loosenthat a bit, so we can happily replace the DMA backend with differentimplementations.
ide: move transfer_start after variable modification
We hook into transfer_start and immediately call the end functionfor ahci. This means that everything needs to be in place for theend function when we start the transfer, so let's move the functiondown to where all state is in place....
ide: split ide command interpretation off
The ATA command interpretation code can be used for PATA and SATAinterfaces alike. So let's split it out into a separate function.
ide: fix whitespace gap in ide_exec_cmd
Now that we have the function split out, we have to reindent it.In order to increase the readability of the actual functional change,this is split out.
blockdev: check dinfo ptr before using
If a user decides to punish a guest by revoking its block device viadrive_del, and subsequently also attempts to remove the pci devicebacking it, and the device is using blockdev_auto_del() then we get asegfault when we attempt to access dinfo->auto_del.[1]...
block: Introduce path_has_protocol() function
The bdrv_find_protocol() function returns NULL if an unknown protocolname is given. It returns the "file" protocol when the filenamecontains no protocol at all. This makes it difficult to distinguishbetween paths which contain a protocol and those which do not....
block: Fix the use of protocols in backing files
Backing filenames may contain a protocol. The code currently doesn'tconsider this case and produces filenames that embed "<protocol>:".Don't combine filenames if the backing filename contains a protocol....
Introduce strtosz_suffix()
This introduces strtosz_suffix() which allows the caller to specify adefault suffix in case the non default of MB is wanted.
strtosz() is kept as a wrapper for strtosz_suffix() which keeps it'scurrent default of MB.
qemu-img.c: Clean up handling of image size in img_create()
This cleans up the handling of image size in img_create() by parsingthe value early, and then only setting it once if a value has beenadded as the last argument to the command line.
Merge remote branch 'arm/for-anthony' into staging
Merge remote branch 'kwolf/for-anthony' into staging
Merge remote branch 'qmp/for-anthony' into staging
Merge remote branch 'jvrao/for-anthony' into staging
Merge remote branch 'mst/for_anthony' into staging
block: Make bdrv_create_file() ':' handling consistent
Filenames may start with "<protocol>:" to explicitly use a protocol likenbd. Filenames with unknown protocols are rejected in most of QEMUexcept for bdrv_create_file(). Even if a file with an invalid filename...
Add missing tracing to qemu_mallocz()
Use qemu_mallocz() instead of calloc() in img_convert()
img_convert(): Only try to free bs[] entries if bs is valid.
This allows for jumping to 'out:' consistently for error exit.
Consolidate printing of block driver options
This consolidates the printing of block driver options inprint_block_option_help() which is called from both img_create() andimg_convert().
This allows for the "?" detection to be done just after the parsing of...
Fix formatting and missing braces in qemu-img.c
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Fail if detecting an unknown option
This patch changes qemu-img to exit if an unknown option is detected,instead of trying to continue with a set of arguments which may beincorrect.
Make error handling more consistent in img_create() and img_resize()
ceph/rbd block driver for qemu-kvm
RBD is an block driver for the distributed file system Ceph(http://ceph.newdream.net/). This driver uses librados (which is partof the Ceph server) for direct access to the Ceph object store and isrunning entirely in userspace (Yehuda also wrote a driver for the...
qemu-img: Deprecate obsolete -6 and -e options
If -6 or -e is specified, an error message is printed and we exit. Itdoes not print help() to avoid the error message getting lost in thenoise.
qemu-option: Don't reinvent append_option_parameters()
parse_option_parameters() may need to create a new option parameter listfrom a template list. Use append_option_parameters() instead ofduplicating the code.
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>...
qemu-option: Fix parse_option_parameters() documentation typo
Yoda said, "list is the templace is". Fix this.
qemu-img: Free option parameter lists in img_create()
Free option parameter lists in the img_create() error return path.
qemu-img: Fail creation if backing format is invalid
The qemu-img create command should check the backing format to ensureonly image files with valid backing formats are created. By checking inqemu-img.c we can print a useful error message.
Watchdog: disable watchdog timer when hard-rebooting a guest.
This commit causes the watchdog timer to be reset when a guest ishard-rebooted.
The failure case previously was as follows:
(a) guest boots, watchdog is enabled
(b) guest does a reset eg:...
Add notifier that will be called when machine is fully created.
Action that depends on fully initialized device model should registerwith this notifier chain.
Signed-off-by: Gleb Natapov <gleb@redhat.com>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Pass boot device list to firmware.
Add bootindex for option roms.
Extend -option-rom command to have additional parameter ,bootindex=.
Add bootindex parameter to net/block/fd device
If bootindex is specified on command line a string that describes devicein firmware readable way is added into sorted list. Later this list willbe passed into firmware to control boot order.
Signed-off-by: Gleb Natapov <gleb@redhat.com>...
Change fw_cfg_add_file() to get full file path as a parameter.
Change fw_cfg_add_file() to get full file path as a parameter insteadof building one internally. Two reasons for that. First caller may needto know how file is named. Second this moves policy of file naming out...
Add get_fw_dev_path callback to scsi bus.
Record which USBDevice USBPort belongs too.
Ports on root hub will have NULL here. This is needed to reconstructpath from device to its root hub to build device path.
Add get_fw_dev_path callback for usb bus.
Add get_fw_dev_path callback for pci bus.
Add get_fw_dev_path callback for system bus.
Prints out mmio or pio used to access child device.
Add get_fw_dev_path callback to IDE bus.
Add get_fw_dev_path callback to ISA bus in qdev.
Use device ioports to create unique device path.
Store IDE bus id in IDEBus structure for easy access.
Keep track of ISA ports ISA device is using in qdev.
Store all io ports used by device in ISADevice structure.
Introduce new BusInfo callback get_fw_dev_path.
New get_fw_dev_path callback will be used for build device path usableby firmware in contrast to qdev qemu internal device path.
Introduce fw_name field to DeviceInfo structure.
Add "fw_name" to DeviceInfo to use in device path building. Incontrast to "name" "fw_name" should refer to functionality deviceprovides instead of particular device model like "name" does.
monitor: implement x86 info mem for PAE and long modes
'info mem' didn't show correct information for PAE mode andx86_64 long mode.
Fix by implementing the output for missing modes.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
monitor: implement x86 info tlb for PAE and long modes
'info tlb' didn't show correct information for PAE mode andx86_64 long mode.
Implement the missing modes. Also print NX bit for PAE and long modes.Fix off-by-one error in 32 bit mode mask.
wdt_i6300esb: register a reset function
The device shall set its default hardware state after each reset.This includes that the timer is stopped which is especially importantif the guest does a reboot independantly of a watchdog bite. I movedthe initialization of the state variables completely from the init...
isa-bus.c: use hw_error instead of fprintf
Minor clean-up in isa-bus.c. Using hw_error is more consistent.There is a difference however: hw_error dumps the cpu state.
Signed-off-by: Tristan Gingold <gingold@adacore.com>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
uninorth: Get rid of bswap
There's no need to bswap once we correctly set the mmio to be little endian.
Signed-off-by: Alexander Graf <agraf@suse.de>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
e1000: Make little endian
The e1000 has compatibility code to handle big endianness which makes itmandatory to be recompiled on different targets.
With the generic mmio endianness solution, there's no need for that anymore.We just declare all mmio to be little endian and call it a day....
prep: Declare as little endian
This patch replaces explicit bswaps with endianness hints to themmio layer.
versatile_pci: Declare as little endian
ppc4xx_pci: Declare as little endian
openpic: Replace explicit byte swap with endian hints
rtl8139: Declare as little endian
Because we don't depend on the target endianness anymore, we can alsomove the driver over to Makefile.objs.
Signed-off-by: Alexander Graf <agraf@suse.de>...
heathrow_pic: Declare as little endian
isa_mmio: Always use little endian
This patch converts the ISA MMIO bridge code to always use little endian mmio.All bswap code that existed was only there to convert from native cpuendianness to little endian ISA devices.
usb_ohci: Always use little endian
exec: introduce endianness swapped mmio
The way we're currently modeling mmio is too simplified. We assume thatevery device has the same endianness as the target CPU. In reality,most devices are little endian (all PCI and ISA ones I'm aware of). Someare big endian (special system devices) and a very little fraction is...
Add endianness as io mem parameter
As stated before, devices can be little, big or native endian. Thetarget endianness is not of their concern, so we need to push thingsdown a level.
This patch adds a parameter to cpu_register_io_memory that allows adevice to choose its endianness. For now, all devices simply choose...
Make simple io mem handler endian aware
As an alternative to the 3 individual handlers, there is also a simplifiedio mem hook function. To be consistent, let's add an endianness parameterthere too.
dbdma: Make little endian
The device is only used on big endian systems, but always byte swaps. That'sa very good indicator that it's actually a little endian device ;-).
pci-host: Delegate bswap to mmio layer
The only reason we have bswap versions of the pci host code is thatmost pci host devices are little endian. The ppc e500 is the onlyodd one here, being big endian.
So let's directly pass the endianness down to the mmio layer and not...
noaudio: fix return value for read()
Read should return bytes instead of samples.
Signed-off-by: Michael Walle <michael@walle.cc>Signed-off-by: malc <av1474@comtv.ru>
pci/aer: factor out common code
Same logic is used to assert interruptsand send msix messages, so add a static functin for this.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
pci/aer: remove dead code
Remove some unused variables and return values.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
pci/aer: fix interrupt on config write
config write handling for aer seems broken:For example, it won't clear a level interruptwhen command register is set to 0.
Make it match the spec: level should equalthe logical or of enabled bits, msi onlybe sent when the logical or changes....
pci/aer: fix error injection
Fix the injection logic upon aer message to follow 6.2.4.1.2 moreclosely: specifically only send an msi interrupt when the logical or ofthe enabled bits changed, not when a bit which was previously clearbecomes set.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>...
Makefile: make msix/msi depend on CONFIG_PCI
Possible now that pci is not depending on these.
pci: untangle pci/msi dependency
msi depends on pci but pci should not depend on msi.The only dependency we have is a recent additionof pci_msi_ functions, IMO they add little enough toopen-code in the small number of users.
Follow-up patches add more cleanups....
migration/savevm: no need to flush requests
There's no need to flush requests after vmstopas vmstop does it for us automatically now.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>Tested-by: Jason Wang <jasowang@redhat.com>
virtio-net: don't dma while vm is stopped
DMA into memory while VM is stopped makes ithard to debug migration (consequitive savesresult in different files).Fixing this completely is a large effort,this patch does this for virtio-net.
virtio-net: stop/start bh when appropriate
Avoid sending out packets, and modifyingmemory, when VM is stopped.Add assert statements to verify this does not happen.
Avoid scheduling bh when vhost-net is started.
Stop bh when driver disabled bus mastering...
pci: make command SERR bit writable
pcie aer needs SERR bit to be writable, and the PCI spec requiresthis as well. For compatibility, introduce compat global propertycommand_serr_enable and make this bit readonly for a pre 0.14 pcmachine.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>...