summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* util: add socket_set_fast_reuse function which will replace setting SO_REUSEADDRSebastian Ottlik2013-10-023-0/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | If a socket is closed it remains in TIME_WAIT state for some time. On operating systems using BSD sockets the endpoint of the socket may not be reused while in this state unless SO_REUSEADDR was set on the socket. On windows on the other hand the default behaviour is to allow reuse (i.e. identical to SO_REUSEADDR on other operating systems) and setting SO_REUSEADDR on a socket allows it to be bound to a endpoint even if the endpoint is already used by another socket independently of the other sockets state. This can even result in undefined behaviour. Many sockets used by QEMU should not block the use of their endpoint after being closed while they are still in TIME_WAIT state. Currently QEMU sets SO_REUSEADDR for such sockets, which can lead to problems on Windows. This patch introduces the function socket_set_fast_reuse that should be used instead of setting SO_REUSEADDR when fast socket reuse is desired and behaves correctly on all operating systems. As a failure of this function can only be caused by bad QEMU internal errors, an assertion handles these situations. The return value is still passed on, to minimize changes in client code and prevent unused variable warnings if NDEBUG is defined. Signed-off-by: Sebastian Ottlik <ottlik@fzi.de> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Stefan Weil <sw@weilnetz.de>
* Merge remote-tracking branch 'kraxel/seabios-1.7.3.2' into stagingAnthony Liguori2013-09-304-0/+0
|\ | | | | | | | | | | | | | | | | # By Gerd Hoffmann # Via Gerd Hoffmann * kraxel/seabios-1.7.3.2: update seabios from 1.7.2.2 to 1.7.3.2 Message-id: 1380533055-24960-1-git-send-email-kraxel@redhat.com
| * update seabios from 1.7.2.2 to 1.7.3.2Gerd Hoffmann2013-09-304-0/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 'git shortlog d4f7d90f..ece025f5' says: Alex Williamson (4): seabios q35: Enable all PIRQn IRQs at startup seabios q35: Add new PCI slot to irq routing function seabios: Add a dummy PCI slot to irq mapping function pciinit: Enable default VGA device Asias He (2): virtio-scsi: Set _DRIVER_OK flag before scsi target scanning virtio-scsi: Pack struct virtio_scsi_{req_cmd,resp_cmd} Avik Sil (1): USB-EHCI: Fix null pointer assignment Christian Gmeiner (5): geodevga: fix errors in geode_fp_* functions geodevga: move framebuffer setup geodevga: move output setup to own function geodevga: add debug to msr functions geodevga: fix wrong define name David Woodhouse (26): Add macros for pushing and popping struct bregs Clean up #if in pirtable.c. CONFIG_PIRTABLE can't be set if CONFIG_COREBOOT is post: Export functions which will be used individually by CSM Export callrom() for CSM to use Export copy_smbios() from biostables.c Import LegacyBios.h from OVMF Complete and checksum EFI_COMPATIBILITY16_TABLE at build time Add pic_save_mask() and pic_restore_mask() functions Add CSM support Add README.CSM Add find_pmtimer() function Enable PMTIMER for CSM build Fix rom_reserve()/rom_confirm() for CSM oprom dispatch Don't calibrate TSC if PMTIMER is already set up Move find_pmtimer() to ACPI table setup where it logically belongs Use find_pmtimer() after copying Xen ACPI tables Use find_pmtimer() after copying coreboot ACPI tables Unify return path for CSM to go via csm_return() Make CONFIG_OPTIONROMS_DEPLOYED depend on CONFIG_QEMU Implement !CONFIG_OPTIONROMS support for CSM Implement !CONFIG_BOOT for CSM Enable VGA output when settings bochs-specific mode Disable CONFIG_THREAD_OPTIONROMS for CSM build Fix return type of le64_to_cpu() and be64_to_cpu() Rename find_pmtimer() to find_acpi_features() Add acpi_reboot() reset method using RESET_REG Gerd Hoffmann (6): config: allow DEBUG_IO for !QEMU coreboot: add qemu detection tweak coreboot qemu detection apm: fix shutdown ahci: add missing check for allocation failure fix buildversion.sh Hu Tao (1): Add pvpanic device driver Kevin O'Connor (101): pmm: Use 'struct segoff_s' in pmm header. Minor: Update README - variable changes are now reset on soft-reboots. Normalize POST initialization function name suffixes. POST: Reorganize post init functions for better grouping and reusability. Fix rebase error in commit 8a0a972f that broke LOWMEM variables. Support calling a function other than maininit() from reloc_preinit(). Ensure exported symbols are visible in the final link POST: Move QEMU specific ramsize and BIOS table setup to paravirt.c. POST: Reorganize post entry and "preinit" functions. POST: Move cpu caching and dma setup to platform_hardware_setup(). Undo incorrect assumptions about Xen in commit 6ca0460f. Determine century during init and store in VARLOW mem during runtime. No need to check both CONFIG_THREADS and CONFIG_THREAD_OPTIONROMS. Add runningOnQEMU() and runningOnXen() for runtime platform detection. Consistently use CONFIG_COREBOOT, CONFIG_QEMU, and runningOnXen(). Convert kvm_para_available() to runningOnKVM(). Minor - move definitions to paravirt.c from paravirt.h. Only perform SMP setup on QEMU. Start device_hardware_setup in mainint even with CONFIG_THREAD_OPTIONROMS. The mathcp setup touches the PIC and thus move to the "setup" phase. Update tools/acpi_extract.py to handle iasl 20130117 release. Support skipping content when reading from QEMU fw_cfg romfile entries. Convert fw_cfg ACPI entries into romfile entries. Convert fw_cfg SMBIOS entries into romfile entries. Convert basic integer fw_cfg entries into romfile entries. Convert fw_cfg NUMA entries into a romfile entry. Process fw_cfg e820 entries during the fw_cfg setup stage. Integrate qemu_cfg_preinit() into qemu_romfile_init(). Group QEMU platform setup together and move to paravirt.c. vgabios: Bochs/QEMU vgabios support should depend on CONFIG_QEMU. Warn on unaligned PCI ROM structure in option roms. Fix Makefile - don't reference "out/" directly, instead use "$(OUT)". build: Don't require $(OUT) to be a sub-directory of the main directory. Rename rom_get_top() to rom_get_max(). Report on f-segment UMB ram also. Clarify build generated "zone low" values. Verify CC is valid during build tests. Disable handle_post() on CSM builds. Remove unnecessary "export" declarations from assembler functions. Minor assembler enhancements to __csm_return. Introduce VARFSEG for variables that will reside in the f-segment. Convert VAR16VISIBLE, VAR16EXPORT, and VAR32VISIBLE to VARFSEG. Don't relocate "varlow" variable references at runtime. Move malloc's ZoneFSeg and ZoneLow setup to malloc_init. Calculate "RamSize" needed by 16bit interface dynamically. Eliminate separate BiosTableSpace[] space for f-segment allocations. Use CONFIG_ prefix for Kconfig variables; use BUILD_ for others. Try to detect an unsuccessful hard-reboot to prevent soft-reboot loops. Minor - fix confusing final_sec32low_start name in layoutrom.py. Minor - introduce numeric defines for the IVT offset of hw irqs. Separate out 16bit PCI-BIOS entry point from regular int 0x1a entry point. Support using the "extra stack" for all 16bit irq entry points. Minor - improve comments and grouping of handle_08(). floppy: Introduce 'struct floppy_pio_s' for floppy PIO ops. floppy: Cleanup floppy irq wait handling. floppy: Clean up Check Interrupt Status code. floppy: Move recalibration and results parsing to floppy_cmd(). floppy: Improve floppy_pio() error checking. floppy: Implement media format sensing. floppy: Actually do controller reset in floppy_reset(). Minor - note that passing QEMU config via cmos is deprecated. Cache boot-fail-wait to avoid romfile access after POST. Rename src/ssdt-susp.dsl to src/ssdt-misc.dsl. acpi: Eliminate BDAT parameter passing to DSDT code. Add additional dependency checks to Makefile. Don't use __FILE__ in virtio-ring.c. shadow: Don't use PCIDevices list in make_bios_readonly(). smm: Don't use PCIDevices list in smm_setup(). Add VARVERIFY32INIT attribute for variables only available during "init". Use VARVERIFY32INIT on global variables that point to "tmp" memory. vgabios: Fix stdvga_perform_gray_scale_summing(). vgabios: Fix cirrus memory clear on mode switch. Minor - add missing newline to floppy debug statement. Fix bug in NUMA node setup - don't create SRAT if NUMA not present. Update README - copy *.aml files for QEMU. Add dependencies to vgafixup.py and buildversion.sh scripts. Set ZF prior to keyboard read call in check_for_keystroke(). mptable: Don't describe pci-to-pci bridges. mptable: Use same PCI irqs as ACPI code. Cleanup QEMU_CFG_NUMA fw_cfg processing - split into two romfile entries. Use container_of on romfile entries. acpi: Move ACPI table definitions from acpi.c to acpi.h. acpi: Remove dead code with descriptions of bit flags. acpi: Use cpu_to_leXX() consistently. Minor - explicitly close files in buildrom.py. Minor - move "tracked memory alloc" code in pmm.c. Introduce and convert pmm code to use standard list helpers. Minor - relocate code in stacks.c to keep low-level thread code together. Introduce helper function have_threads() in stacks.c. Convert stacks.c to use standard list manipulation code. Convert boot.c to use standard list manipulation code. Convert pciinit.c to use standard list manipulation code. Convert PCIDevices list to use standard list manipultion code. Revert "Convert pciinit.c to use standard list manipulation code." Fix error in hlist_for_each_entry_safe macro. Convert pciinit.c to use standard list manipulation code. make qemu_cfg_init depend on QEMU_HARDWARE instead of QEMU Another fix for hlist_for_each_entry_safe. Minor - remove debugging dprintf added to pciinit.c. Fix USB EHCI detection that was broken in hlist conversion of PCIDevices. Fix bug in CBFS file walking with compressed files. Laszlo Ersek (1): Enable VGA output when setting Cirrus-specific mode Michael S. Tsirkin (2): acpi: make default DSDT optional acpi: sync FADT flags from PIIX4 to Q35 Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* | Merge remote-tracking branch 'kraxel/roms.1' into stagingAnthony Liguori2013-09-307-92/+87
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | # By Gerd Hoffmann # Via Gerd Hoffmann * kraxel/roms.1: roms: add support for building sgabios roms: enable parallel seabios / seavgabios builds roms: enable ipxe cross builds roms: add rules to build slof roms: rewrite scripts/refresh-pxe-roms.sh roms: parallel ipxe builds roms: build lgplvgabios isavga variant roms: enable parallel builds for 'make lgplvgabios' roms: add 'make clean' Message-id: 1380532378-22138-1-git-send-email-kraxel@redhat.com
| * | roms: add support for building sgabiosGerd Hoffmann2013-09-301-0/+9
| | | | | | | | | | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * | roms: enable parallel seabios / seavgabios buildsGerd Hoffmann2013-09-306-10/+19
| | | | | | | | | | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * | roms: enable ipxe cross buildsGerd Hoffmann2013-09-301-0/+3
| | |
| * | roms: add rules to build slofGerd Hoffmann2013-09-301-0/+22
| | | | | | | | | | | | | | | | | | | | | | | | Add some logic to detect cross compilers. Add support for "make slof", which should JustWork[tm] if you are on a ppx64 machine or have a ppc64 cross compiler installed somewhere in your path. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * | roms: rewrite scripts/refresh-pxe-roms.shGerd Hoffmann2013-09-301-74/+6
| | | | | | | | | | | | | | | | | | Just use the Makefile in roms/ Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * | roms: parallel ipxe buildsGerd Hoffmann2013-09-301-6/+12
| | | | | | | | | | | | | | | | | | | | | Enable parallel ipxe builds. Reduce the recursive make calls. Call recursive make properly using $(MAKE) $(MAKEFLAGS). Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * | roms: build lgplvgabios isavga variantGerd Hoffmann2013-09-301-2/+4
| | | | | | | | | | | | | | | | | | Add logic to also build+install the isavga vgabios variant. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * | roms: enable parallel builds for 'make lgplvgabios'Gerd Hoffmann2013-09-301-2/+7
| | | | | | | | | | | | | | | | | | | | | Recurse into vgabios once, adjust dependencies, call make using $(MAKE) $(MAKEFLAGS) so jobserver mode works. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * | roms: add 'make clean'Gerd Hoffmann2013-09-301-0/+7
| |/ | | | | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* | Merge remote-tracking branch 'mst/tags/for_anthony' into stagingAnthony Liguori2013-09-3014-120/+359
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | pc,pci,virtio fixes and cleanups This includes pc and pci cleanups and enhancements, and a virtio-net bugfix related to softmac programming. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> # gpg: Signature made Sun 29 Sep 2013 01:51:16 AM CDT using RSA key ID D28D5469 # gpg: Can't check signature: public key not found # By Michael S. Tsirkin (8) and others # Via Michael S. Tsirkin * mst/tags/for_anthony: smbios: Factor out smbios_maybe_add_str() smbios: Make multiple -smbios type= accumulate sanely smbios: Improve diagnostics for conflicting entries smbios: Convert to QemuOpts smbios: Normalize smbios_entry_add()'s error handling to exit(1) virtio-net: fix up HMP NIC info string on reset pci: remove explicit check to 64K ioport size piix4: disable io on reset piix: use 64 bit window programmed by guest q35: use 64 bit window programmed by guest pci: add helper to retrieve the 64-bit range range: add min/max operations on ranges range: add Range to typedefs q35: make pci window address/size match guest cfg Message-id: 1380437951-21788-1-git-send-email-mst@redhat.com
| * | smbios: Factor out smbios_maybe_add_str()Markus Armbruster2013-09-281-36/+25
| | | | | | | | | | | | | | | | | | Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * | smbios: Make multiple -smbios type= accumulate sanelyMarkus Armbruster2013-09-285-65/+94
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, -smbios type=T,NAME=VAL,... adds one field (T,NAME) with value VAL to fw_cfg for each unique NAME. If NAME occurs multiple times, the last one's VAL is used (before the QemuOpts conversion, the first one was used). Multiple -smbios can add multiple fields with the same (T, NAME). SeaBIOS reads all of them from fw_cfg, but uses only the first field (T, NAME). The others are ignored. "First one wins, subsequent ones get ignored silently" isn't nice. We commonly let the last option win. Useful, because it lets you -readconfig first, then selectively override with command line options. Clean up -smbios to work the common way. Accumulate the settings, with later ones overwriting earlier ones. Put the result into fw_cfg (no more useless duplicates). Bonus cleanup: qemu_uuid_parse() no longer sets SMBIOS system uuid by side effect. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * | smbios: Improve diagnostics for conflicting entriesMarkus Armbruster2013-09-281-26/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We allow either tables or fields for the same type. Makes sense, because SeaBIOS uses fields only when no tables are present. We do this by searching the SMBIOS blob for a previously added table or field. Error messages look like this: qemu-system-x86_64: -smbios type=1,serial=42: SMBIOS type 1 table already defined, cannot add field User needs to know that "table" is defined by -smbios file=..., and "field" by -smbios type=... Instead of searching the blob, record additions of interest, and check that. Simpler, and makes better error messages possible: qemu-system-x86_64: -smbios file=smbios_type_1.bin: Can't mix file= and type= for same type qemu-system-x86_64: -smbios type=1,serial=42,serial=99: This is the conflicting setting Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * | smbios: Convert to QemuOptsMarkus Armbruster2013-09-285-43/+179
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | So that it can be set in config file for -readconfig. This tightens parsing of -smbios, and makes it more consistent with other options: unknown parameters are rejected, numbers with trailing junk are rejected, when a parameter is given multiple times, last rather than first wins, ... MST: drop one chunk to fix build errors Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * | smbios: Normalize smbios_entry_add()'s error handling to exit(1)Markus Armbruster2013-09-283-9/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | It exits on all error conditions but one, where it returns -1. Normalize, and return void. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * | virtio-net: fix up HMP NIC info string on resetMichael S. Tsirkin2013-09-221-0/+1
| | | | | | | | | | | | | | | | | | | | | When mac is updated on reset, info string has stale data. Fix it up. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * | pci: remove explicit check to 64K ioport sizeHervé Poussineau2013-09-151-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This check is useless, as bigger addresses will be ignored when added to 'io' MemoryRegion, which has a size of 64K. However, some architectures don't use the 'io' MemoryRegion, like the alpha and versatile platforms. They create a PCI I/O region bigger than 64K, so let them handle PCI I/O BARs in the higher range. MST: reinstated work-around for BAR sizing. Signed-off-by: Hervé Poussineau <hpoussin@reactos.org> Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * | piix4: disable io on resetMichael S. Tsirkin2013-09-151-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | io base register at 0x40 is cleared on reset, but io is not disabled until some other event happens to call pm_io_space_update. Invoke pm_io_space_update directly to make this consistent. Cc: qemu-stable@nongnu.org Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * | piix: use 64 bit window programmed by guestMichael S. Tsirkin2013-09-151-4/+10
| | | | | | | | | | | | | | | | | | | | | Detect the 64 bit window programmed by firmware and configure properties accordingly. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * | q35: use 64 bit window programmed by guestMichael S. Tsirkin2013-09-151-4/+10
| | | | | | | | | | | | | | | | | | | | | Detect the 64 bit window programmed by firmware and configure properties accordingly. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * | pci: add helper to retrieve the 64-bit rangeMichael S. Tsirkin2013-09-152-0/+51
| | | | | | | | | | | | Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * | range: add min/max operations on rangesMichael S. Tsirkin2013-09-151-0/+18
| | | | | | | | | | | | Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * | range: add Range to typedefsMichael S. Tsirkin2013-09-152-1/+2
| | | | | | | | | | | | | | | | | | will help simplify header dependencies. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * | q35: make pci window address/size match guest cfgMichael S. Tsirkin2013-09-151-0/+10
| | | | | | | | | | | | | | | | | | | | | For Q35, MMCFG address and size are guest configurable. Update w32 property to make it behave accordingly. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* | | Merge remote-tracking branch 'kwolf/for-anthony' into stagingAnthony Liguori2013-09-3075-425/+575
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | # By Max Reitz (10) and others # Via Kevin Wolf * kwolf/for-anthony: (30 commits) qcow2: Remove useless count_contiguous_clusters() parameter qcow2: COMPRESSED on count_contiguous_clusters qcow2: count_contiguous_clusters and compression qcow2: Free only newly allocated clusters on error qcow2: Always use error path in l2_allocate qcow2: Don't put invalid L2 table into cache qemu-iotests: Preallocated zero clusters in 061 qcow2: Correct bitmap size in zero expansion qemu-iotests: Quote $TEST_IMG* and $TEST_DIR usage qemu-iotests: Add basic ability to use binary sample images qemu-iotests: fix qmp.py search path block: use DIV_ROUND_UP in bdrv_co_do_readv qcow2: Assert against currently impossible overflow block: qed - use QEMU_PACKED for on-disk structures block: qcow2 - used QEMU_PACKED for on-disk structures block: vpc - use QEMU_PACKED for on-disk structures block: vdi - use QEMU_PACKED for on-disk structures rbd: avoid qemu_rbd_snap_list() memory leaks qdict: Extract qdict_extract_subqdict block: Fix compiler warning (-Werror=uninitialized) ... Message-id: 1380296370-14523-1-git-send-email-kwolf@redhat.com
| * | | qcow2: Remove useless count_contiguous_clusters() parameterKevin Wolf2013-09-271-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | All callers pass start = 0, and it's doubtful if any other value would actually do what you expect. Remove the parameter. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Jeff Cody <jcody@redhat.com>
| * | | qcow2: COMPRESSED on count_contiguous_clustersMax Reitz2013-09-271-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Compressed clusters can never be contiguous, therefore the corresponding flag does not need to be given explicitly to count_contiguous_clusters. Signed-off-by: Max Reitz <mreitz@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
| * | | qcow2: count_contiguous_clusters and compressionMax Reitz2013-09-271-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The function is not intended to be used on compressed clusters and will not work correctly, if used anyway, since L2E_OFFSET_MASK is not the right mask for determining the offset of compressed clusters. Therefore, assert that the first cluster is not compressed and always include the compression flag in the mask of significant flags, i.e., stop the search as soon as a compressed cluster occurs. Signed-off-by: Max Reitz <mreitz@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
| * | | qcow2: Free only newly allocated clusters on errorMax Reitz2013-09-271-6/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In expand_zero_clusters_in_l1, a new cluster is only allocated if it was not already preallocated. On error, such preallocated clusters should not be freed, but only the newly allocated ones. Signed-off-by: Max Reitz <mreitz@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
| * | | qcow2: Always use error path in l2_allocateMax Reitz2013-09-271-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Just returning -errno in some cases prevents trace_qcow2_l2_allocate_done from being executed (and, in one case, also the unused allocated L2 table from being freed). Always going down the error path fixes this. Signed-off-by: Max Reitz <mreitz@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
| * | | qcow2: Don't put invalid L2 table into cacheMax Reitz2013-09-271-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In l2_allocate, the fail path is executed if qcow2_cache_flush fails. However, the L2 table has not yet been fetched from the L2 table cache. The qcow2_cache_put in the fail path therefore basically gives an undefined argument as the L2 table address (in this case). Signed-off-by: Max Reitz <mreitz@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
| * | | qemu-iotests: Preallocated zero clusters in 061Max Reitz2013-09-272-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a test case for zero cluster expansion on an image completely filled with preallocated zero clusters to test 061. Signed-off-by: Max Reitz <mreitz@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
| * | | qcow2: Correct bitmap size in zero expansionMax Reitz2013-09-271-11/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since the expanded_clusters bitmap is addressed using host offsets in the underlying image file, the correct size to use for allocating the bitmap is not determined by the guest disk image but by the underlying host image file. Furthermore, this size may change during the expansion due to cluster allocations on growable image files. In this case, the bitmap needs to be resized as well to reflect the growth. Signed-off-by: Max Reitz <mreitz@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
| * | | qemu-iotests: Quote $TEST_IMG* and $TEST_DIR usageJeff Cody2013-09-2749-337/+337
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A lot of image filename and paths are used unquoted. Quote these to make sure that directories / filenames with spaces are not problematic. Signed-off-by: Jeff Cody <jcody@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
| * | | qemu-iotests: Add basic ability to use binary sample imagesJeff Cody2013-09-273-0/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For image formats that are not "QEMU native", but supported for compatibility, it is useful to verify that an image created with the 'gold standard' native tool can be read / written to successfully by QEMU. In addition to testing non-native images, this could also be useful to test against image files created by older versions of QEMU. This provides a directory to store small sample images, for use by scripts in tests/qemu-iotests. Image files should be compressed with bzip2. To use a sample image from a bash script, the _use_sample_img function will copy and decompress the image into $TEST_DIR, and set $TEST_IMG to be the decompressed sample image copy. To cleanup, call _cleanup_test_img as normal. Signed-off-by: Jeff Cody <jcody@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
| * | | qemu-iotests: fix qmp.py search pathFam Zheng2013-09-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | QMP/qmp.py is renamed to scripts/qmp/qmp.py, fix the search path in iotests.py. Signed-off-by: Fam Zheng <famz@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
| * | | block: use DIV_ROUND_UP in bdrv_co_do_readvFam Zheng2013-09-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Fam Zheng <famz@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
| * | | qcow2: Assert against currently impossible overflowMax Reitz2013-09-251-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If qcow2_alloc_cluster_link_l2 is called with a QCowL2Meta describing a request crossing L2 boundaries, a buffer overflow will occur. This is impossible right now since such requests are never generated (every request is shortened to L2 boundaries before) and probably also completely unintended (considering the name "QCowL2Meta"), however, it is still worth an assertion. Signed-off-by: Max Reitz <mreitz@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
| * | | block: qed - use QEMU_PACKED for on-disk structuresJeff Cody2013-09-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QEDHeader is read, and written, directly from on-disk images via bdrv_pread()/write(). To avoid any unintentional padding, these structs should be packed. Signed-off-by: Jeff Cody <jcody@redhat.com> Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
| * | | block: qcow2 - used QEMU_PACKED for on-disk structuresJeff Cody2013-09-252-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QCowHeader and QCowExtension are structs that reside in the on-disk image format, and are read and written directly via bdrv_pread()/write(), and as such should be packed to avoid any unintentional struct padding. Signed-off-by: Jeff Cody <jcody@redhat.com> Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
| * | | block: vpc - use QEMU_PACKED for on-disk structuresJeff Cody2013-09-251-14/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The VHD footer and header structs (vhd_footer and vhd_dyndisk_header) are on-disk structures for the image format, and as such should be packed. Go ahead and make these typedefs as well, with the preferred QEMU naming convention, so that the packed attribute is used consistently with the struct. Signed-off-by: Jeff Cody <jcody@redhat.com> Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
| * | | block: vdi - use QEMU_PACKED for on-disk structuresJeff Cody2013-09-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The header struct VdiHeader is an on-disk structure for the image format, and as such should be packed. Signed-off-by: Jeff Cody <jcody@redhat.com> Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
| * | | rbd: avoid qemu_rbd_snap_list() memory leaksStefan Hajnoczi2013-09-251-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When there are no snapshots qemu_rbd_snap_list() returns 0 and the snapshot table pointer is NULL. Don't forget to free the snaps buffer we allocated for librbd rbd_snap_list(). When the function succeeds don't forget to free the snaps buffer after calling rbd_snap_list_end(). Cc: qemu-stable@nongnu.org Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
| * | | qdict: Extract qdict_extract_subqdictBenoît Canet2013-09-253-21/+25
| | | | | | | | | | | | | | | | | | | | Signed-off-by: Benoit Canet <benoit@irqsave.net> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
| * | | block: Fix compiler warning (-Werror=uninitialized)Stefan Weil2013-09-251-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The patch fixes a warning from gcc (Debian 4.6.3-14+rpi1) 4.6.3: block/stream.c:141:22: error: ‘copy’ may be used uninitialized in this function [-Werror=uninitialized] This is not a real bug - a better compiler would not complain. Now 'copy' has always a defined value, so the check for ret >= 0 can be removed. Signed-off-by: Stefan Weil <sw@weilnetz.de> Acked-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
| * | | block: introduce BlockDriver.bdrv_needs_filename to enable some drivers.Benoît Canet2013-09-258-2/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some drivers will have driver specifics options but no filename. This new bool allow the block layer to treat them correctly. The .bdrv_needs_filename is set in drivers not having .bdrv_parse_filename and not having .bdrv_open. The first exception to this rule will be the quorum driver. Signed-off-by: Benoit Canet <benoit@irqsave.net> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
OpenPOWER on IntegriCloud