summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Support default block interfaces per QEMUMachineChristian Borntraeger2012-12-1117-57/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are QEMUMachines that have neither IF_IDE nor IF_SCSI as a default/standard interface to their block devices / drives. Therefore, this patch introduces a new field default_block_type per QEMUMachine struct. The prior use_scsi field becomes thereby obsolete and is replaced through .default_block_type = IF_SCSI. This patch also changes the default for s390x to IF_VIRTIO and removes an early hack that converts IF_IDE drives. Other parties have already claimed interest (e.g. IF_SD for exynos) To create a sane default, for machines that dont specify a default_block_type, this patch makes IF_IDE = 0 and IF_NONE = 1. I checked all users of IF_NONE (blockdev.c and ww/device-hotplug.c) as well as IF_IDE and it seems that it is ok to change the defines - in other words, I found no obvious (to me) assumption in the code regarding IF_NONE==0. IF_NONE is only set if there is an explicit if=none. Without if=* the interface becomes IF_DEFAULT. I would suggest to have some additional care, e.g. by letting this patch sit some days in the block tree. Based on an initial patch from Einar Lueck <elelueck@de.ibm.com> Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com> CC: Igor Mitsyanko <i.mitsyanko@samsung.com> CC: Markus Armbruster <armbru@redhat.com> CC: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Alexander Graf <agraf@suse.de> Acked-by: Igor Mitsyanko <i.mitsyanko@samsung.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
* raw-posix: inline paio_ioctl into hdev_aio_ioctlPaolo Bonzini2012-12-111-17/+10
| | | | | | | | | | | | | | | | | clang now warns about an unused function: CC block/raw-posix.o block/raw-posix.c:707:26: warning: unused function paio_ioctl [-Wunused-function] static BlockDriverAIOCB *paio_ioctl(BlockDriverState *bs, int fd, ^ 1 warning generated. because the only use of paio_ioctl() is inside a #if defined(__linux__) guard and it is static now. Reported-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
* block: vpc support for ~2 TB disksCharles Arnold2012-12-111-4/+13
| | | | | | | | | | | | | | | | | | | | The VHD specification allows for up to a 2 TB disk size. The current implementation in qemu emulates EIDE and ATA-2 hardware which only allows for up to 127 GB. This disk size limitation can be overridden by allowing up to 255 heads instead of the normal 4 bit limitation of 16. Doing so allows disk images to be created of up to nearly 2 TB. This change does not violate the VHD format specification nor does it change how smaller disks (ie, <=127GB) are defined. [Charles Arnold also writes: "In analyzing a 160 GB VHD fixed disk image created on Windows 2008 R2, it appears that MS is also ignoring the CHS values in the footer geometry field in whatever driver they use for accessing the image. The CHS values are set at 65535,16,255 which obviously doesn't represent an image size of 160 GB." -- Stefan] Signed-off-by: Charles Arnold <carnold@suse.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
* block: vpc initialize the uuid footer fieldCharles Arnold2012-12-111-1/+6
| | | | | | | | Initialize the uuid field in the footer with a generated uuid. Signed-off-by: Charles Arnold <carnold@suse.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
* virtio-blk: Remove duplicate property definitionDavid Gibson2012-12-112-2/+0
| | | | | | | | | | | | | | | | | | | For the virtio-blk device (via virtio-pci) the property "config-wce" is defined in two places. First, it's defined from the DEFINE_VIRTIO_BLK_FEATURES macro, second it's defined directly in virtio-pci, just two lines above the call to that macro. The direct definition in virtio-pci.c is broken, since it operates on the 'config_wce' field of VirtIOBlkConf, which is never used anywhere else. Therefore, this patch removes both the extra property definition and the redundant field it works on. Cc: Kevin Wolf <kwolf@redhat.com> Cc: Anthony Liguori <aliguori@us.ibm.com> Cc: Paul 'Rusty' Russell <rusty@rustcorp.com.au> Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
* block: Avoid second open for format probingKevin Wolf2012-12-111-28/+38
| | | | | | | | This fixes problems that are caused by the additional open/close cycle of the existing format probing, for example related to qemu-nbd without -t option or file descriptor passing. Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* block: Factor out bdrv_open_flagsKevin Wolf2012-12-111-14/+21
| | | | Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* aio: Get rid of qemu_aio_flush()Kevin Wolf2012-12-116-20/+5
| | | | | | | There are no remaining users, and new users should probably be using bdrv_drain_all() in the first place. Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* block: Improve bdrv_aio_co_cancel_emKevin Wolf2012-12-111-1/+18
| | | | | | | Instead of waiting for all requests to complete, wait just for the specific request that should be cancelled. Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* tests: avoid qemu_aio_flush() in test-thread-pool.cStefan Hajnoczi2012-12-111-6/+14
| | | | | | | | | | | | | We need to eliminate calls to qemu_aio_flush() since the function is being removed. Most callers will use bdrv_drain_all() instead but test-thread-pool.c is lower level. Since the test uses the global AioContext we can loop on qemu_aio_wait() to wait for aio and bh activity to complete. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Acked-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* tests: use aio_poll() instead of aio_flush() in test-aio.cStefan Hajnoczi2012-12-111-16/+15
| | | | | | | | | | | | | There has been confusion between various aio wait and flush functions. It's time to get rid of qemu_aio_flush() but in the aio test cases we really do want this low-level functionality. Therefore declare a local wait_for_aio() helper for the test cases. Drop the aio_flush() test case. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Acked-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* Merge remote-tracking branch 'afaerber/qom-cpu' into stagingAnthony Liguori2012-12-1016-132/+149
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * afaerber/qom-cpu: target-i386: Postpone cpuid_level update to realize time target-i386: Use define for cpuid vendor string size target-i386: Separate feature string parsing from CPU model lookup target-i386/cpu.c: Coding style fixes qdev: qdev_create(): use error_report() instead of hw_error() sysemu.h: Include qemu-types.h instead of qemu-common.h Create qemu-types.h for struct typedefs qlist.h: Do not include qemu-common.h qga/channel-posix.c: Include headers it needs qapi/qmp-registry.c: Include headers it needs ui/vnc-palette.c: Include headers it needs user: Rename qemu-types.h to qemu-user-types.h user: Move *-user/qemu-types.h to main directory Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
| * target-i386: Postpone cpuid_level update to realize timeIgor Mammedov2012-12-071-3/+5
| | | | | | | | | | | | | | | | | | | | Delay capping cpuid_level to 7 to realize time so property setters for cpuid_7_0_ebx_features and "level" could be used in any order/time between x86_cpu_initfn() and x86_cpu_realize(). Signed-off-by: Igor Mammedov <imammedo@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
| * target-i386: Use define for cpuid vendor string sizeIgor Mammedov2012-12-062-3/+5
| | | | | | | | | | | | Signed-off-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
| * target-i386: Separate feature string parsing from CPU model lookupEduardo Habkost2012-12-061-23/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of parsing the whole cpu_model string inside cpu_x86_find_by_name(), first split it into the CPU model name and the full feature string, then parse the feature string into pieces. When using CPU model classes, those two pieces of information will be used at different moments (CPU model name will be used to find CPU class, feature string will be used after CPU object was created), so making the split in two steps will make it easier to refactor the code later. This should also help on the CPU properties work, that will just need to replace the cpu_x86_parse_featurestr() logic (and can keep the CPU model lookup code as-is). Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Reviewed-by: Igor Mammedov <imammedo@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
| * target-i386/cpu.c: Coding style fixesEduardo Habkost2012-12-061-14/+16
| | | | | | | | | | | | | | | | | | - Use spaces instead of tabs on cpu_x86_cpuid(). - Use braces on 'if' statement cpu_x86_find_by_name(). Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Reviewed-by: Igor Mammedov <imammedo@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
| * qdev: qdev_create(): use error_report() instead of hw_error()Eduardo Habkost2012-12-061-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | hw_error() is specific for fatal hardware emulation errors, not for internal errors related to the qdev object/class abstraction or object initialization. Replace it with an error_report() call, followed by abort(). This will also help reduce dependencies of the qdev code (as hw_error() is from cpus.o, and depends on the CPU list from exec.o). Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
| * sysemu.h: Include qemu-types.h instead of qemu-common.hEduardo Habkost2012-12-061-1/+1
| | | | | | | | | | | | | | | | It just needs the Monitor and DeviceState typedefs, so it doesn't need all of qemu-common.h. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
| * Create qemu-types.h for struct typedefsEduardo Habkost2012-12-063-61/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of keeping all those struct typedefs in qemu-common.h, move it to a header that can be safely included by other headers, containing only the struct typedefs and not pulling in other dependencies. Also, move some of the qdev-core.h typedefs to the new file, too, so other headers don't need to include qdev-core.h only because of DeviceState and other typedefs. This will help us remove qemu-common.h dependencies from some headers later. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
| * qlist.h: Do not include qemu-common.hEduardo Habkost2012-12-061-1/+0
| | | | | | | | | | | | | | | | I don't know why it was including it, as I don't see any code that depends on anything from qemu-common.h. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
| * qga/channel-posix.c: Include headers it needsEduardo Habkost2012-12-061-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Include: - <errno.h> for errno - <unistd.h> & <fcntl.h> for fcntl() - <stdlib.h> for exit() - "osdep.h" for qemu_open() Some of those headers were probably being included by accident because some other headers were including qemu-common.h, but those headers should eventually stop including qemu-common.h. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Igor Mammedov <imammedo@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
| * qapi/qmp-registry.c: Include headers it needsEduardo Habkost2012-12-061-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | Include: - <glib.h> for g_malloc0() - <string.h> for strcmp() Some of those headers were probably being included by accident because some other headers were including qemu-common.h, but those headers should eventually stop including qemu-common.h. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
| * ui/vnc-palette.c: Include headers it needsEduardo Habkost2012-12-061-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | Include: - <glib.h> for g_malloc0() - <string.h> for memset() Some of those headers were probably being included by accident because some other headers were including qemu-common.h, but those headers should eventually stop including qemu-common.h. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
| * user: Rename qemu-types.h to qemu-user-types.hEduardo Habkost2012-12-064-3/+3
| | | | | | | | | | | | | | | | The header file is specific for *-user, but I plan to introduce a more generic qemu-types.h file, so I'm renaming it. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
| * user: Move *-user/qemu-types.h to main directoryEduardo Habkost2012-12-062-24/+0
| | | | | | | | | | | | | | | | | | | | | | The bsd-user/qemu-types.h and linux-user/qemu-types.h files are almost the same, but linux-user has the additional definitions of tswapal(). This moves the linux-user file to the main directory, so the same file can be used by linux-user and bsd-user. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
* | Merge remote-tracking branch 'stefanha/trivial-patches' into stagingAnthony Liguori2012-12-1019-48/+32
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stefanha/trivial-patches: pc_sysfw: Plug memory leak on pc_fw_add_pflash_drv() error path qemu-options: Fix space at EOL Fix spelling in comments and documentation Clean up pci_drive_hot_add()'s use of BlockInterfaceType arm: a9mpcore: remove un-used ptimer_iomem field target-sparc: Remove t0, t1 from CPUSPARCState target-m68k: Remove t1 from CPUM68KState target-alpha: Remove t0, t1 from CPUAlphaState s390x: Spelling fixes (endianess -> endianness, occured -> occurred) Fix comments (adress -> address, layed -> laid, wierd -> weird) Fix spelling (prefered -> preferred) configure: Remove stray debug output sd: Send debug printfery to stderr not stdout Conflicts: configure Resolve spelling conflict in configure. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
| * | pc_sysfw: Plug memory leak on pc_fw_add_pflash_drv() error pathMarkus Armbruster2012-12-071-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | Harmless, because we the error inevitably leads to another, fatal one in pc_system_flash_init(): PC system firmware (pflash) not available. Fix it anyway. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
| * | qemu-options: Fix space at EOLMichal Privoznik2012-12-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There's no need to add a space at the end of line. Moreover, it can make problems in some projects that store the help output into a file (and run couple of tests based on that) and have space at EOL forbidden. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
| * | Fix spelling in comments and documentationStefan Weil2012-12-072-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These spelling bugs were found by codespell: supressing -> suppressing transfered -> transferred Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
| * | Clean up pci_drive_hot_add()'s use of BlockInterfaceTypeMarkus Armbruster2012-12-073-13/+8
| | | | | | | | | | | | | | | | | | | | | | | | pci_drive_hot_add() parameter type has the wrong type: int instead of BlockInterfaceType. It's actually redundant, so we can just drop it. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
| * | arm: a9mpcore: remove un-used ptimer_iomem fieldPeter Crosthwaite2012-12-071-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | I'm guessing this is a hangover from a previous coreification of the mptimer sub-module. This field is completely unused - removed. Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
| * | target-sparc: Remove t0, t1 from CPUSPARCStateRichard Henderson2012-12-071-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | These fields are no longer used. Cc: Blue Swirl <blauwirbel@gmail.com> Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
| * | target-m68k: Remove t1 from CPUM68KStateRichard Henderson2012-12-071-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | This field is no longer used. Cc: Paul Brook <paul@codesourcery.com> Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
| * | target-alpha: Remove t0, t1 from CPUAlphaStateRichard Henderson2012-12-071-7/+0
| | | | | | | | | | | | | | | | | | | | | These fields are no longer (or were never?) used. Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
| * | s390x: Spelling fixes (endianess -> endianness, occured -> occurred)Stefan Weil2012-12-072-4/+4
| | | | | | | | | | | | | | | | | | | | | Replace also "write into" by "write to". Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
| * | Fix comments (adress -> address, layed -> laid, wierd -> weird)Stefan Weil2012-12-073-5/+5
| | | | | | | | | | | | | | | | | | | | | Remove also a duplicated 'the'. Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
| * | Fix spelling (prefered -> preferred)Stefan Weil2012-12-072-4/+5
| | | | | | | | | | | | | | | Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
| * | configure: Remove stray debug outputPeter Maydell2012-12-071-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | Rather than printing a message saying we're silently falling back to gthread coroutines when running on MacOS, actually do it silently. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
| * | sd: Send debug printfery to stderr not stdoutPeter Crosthwaite2012-12-071-2/+2
| |/ | | | | | | | | | | | | | | | | Some debug printfs for SD are coming up in stdout. Redirected them to stderr instead. Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
* | Merge remote-tracking branch 'kraxel/acpi.1' into stagingAnthony Liguori2012-12-1011-415/+317
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * kraxel/acpi.1: acpi: drop debug port q35: update lpc pci config space according to configured devices apci: switch piix4 pci hotplug to memory api acpi: remove acpi_gpe_blk apci: switch piix4 gpe to memory api acpi: fix piix4 smbus mapping acpi: switch smbus to memory api acpi: cleanup ich9 memory region apci: switch ich9 smi to memory api apci: switch ich9 gpe to memory api acpi: cleanup vt82c686 memory region acpi: cleanup piix4 memory region apci: switch evt to memory api apci: switch cnt to memory api apci: switch timer to memory api apci: switch vt82c686 to memory api apci: switch ich9 to memory api apci: switch piix4 to memory api Conflicts: hw/lpc_ich9.c Resolved merge conflict due to apm_init adding an argument. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
| * | acpi: drop debug portGerd Hoffmann2012-12-041-9/+0
| | | | | | | | | | | | | | | | | | | | | | | | I'm pretty sure this isn't needed any more. I think this predates the switch to seabios, and the seabios DSDT table has a DBUG() aml macro which writes stuff to the seabios debug port (0x402). Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * | q35: update lpc pci config space according to configured devicesGerd Hoffmann2012-12-043-12/+30
| | | | | | | | | | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * | apci: switch piix4 pci hotplug to memory apiGerd Hoffmann2012-12-041-8/+29
| | | | | | | | | | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * | acpi: remove acpi_gpe_blkGerd Hoffmann2012-12-044-11/+0
| | | | | | | | | | | | | | | | | | With gpe being switched to memory api this is no longer needed. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * | apci: switch piix4 gpe to memory apiGerd Hoffmann2012-12-041-6/+18
| | | | | | | | | | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * | acpi: fix piix4 smbus mappingGerd Hoffmann2012-12-041-1/+19
| | | | | | | | | | | | | | | | | | Make write to the smbus base register and enable bit actually work. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * | acpi: switch smbus to memory apiGerd Hoffmann2012-12-045-50/+33
| | | | | | | | | | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * | acpi: cleanup ich9 memory regionGerd Hoffmann2012-12-041-124/+1
| | | | | | | | | | | | | | | | | | | | | Nothing left to do, everything handled by subregions, we can zap the reaw/write handlers now. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * | apci: switch ich9 smi to memory apiGerd Hoffmann2012-12-042-10/+37
| | | | | | | | | | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * | apci: switch ich9 gpe to memory apiGerd Hoffmann2012-12-042-10/+29
| | | | | | | | | | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
OpenPOWER on IntegriCloud