OSDN Git Service

qmiga/qemu.git
10 years agoMerge remote-tracking branch 'qemu-kvm/uq/master' into staging
Anthony Liguori [Sat, 7 Dec 2013 15:35:25 +0000 (07:35 -0800)]
Merge remote-tracking branch 'qemu-kvm/uq/master' into staging

# By Alex Williamson (1) and others
# Via Paolo Bonzini
* qemu-kvm/uq/master:
  target-i386: fix cpuid leaf 0x0d
  qemu: mempath: prefault pages manually (v4)
  kvm: Query KVM for available memory slots

Message-id: 1386345276-9803-1-git-send-email-pbonzini@redhat.com
Signed-off-by: Anthony Liguori <aliguori@amazon.com>
10 years agoMerge remote-tracking branch 'kraxel/tags/pull-seabios-31b8b4e-1' into staging
Anthony Liguori [Sat, 7 Dec 2013 15:35:16 +0000 (07:35 -0800)]
Merge remote-tracking branch 'kraxel/tags/pull-seabios-31b8b4e-1' into staging

Update seabios to master snapshot (pre-1.7.4).
Update vgabios, switch from lgplvgabios to seavgabios.
Update build process to build both 128k and 256k bios versions.
Use 256k bios for pc-*-2.0+ machine types.

# gpg: Signature made Fri 06 Dec 2013 12:01:24 AM PST using RSA key ID D3E87138
# gpg: Can't check signature: public key not found

# By Gerd Hoffmann
# Via Gerd Hoffmann
* kraxel/tags/pull-seabios-31b8b4e-1:
  pc: switch 2.0 machine types to large seabios binary
  roms: update vgabios binaries
  roms: update seabios binaries
  roms: enable seabios cross builds
  roms: build two seabios binaries
  roms: update seabios submodule to 31b8b4eea9d9ad58a73b22a6060d3ac1c419c26d
  add firmware to machine options
  add pc-{i440fx,q35}-2.0 machine types

Message-id: 1386322527-23148-1-git-send-email-kraxel@redhat.com
Signed-off-by: Anthony Liguori <aliguori@amazon.com>
10 years agoMerge remote-tracking branch 'otubo/seccomp' into staging
Anthony Liguori [Sat, 7 Dec 2013 15:35:01 +0000 (07:35 -0800)]
Merge remote-tracking branch 'otubo/seccomp' into staging

# By Paul Moore
# Via Eduardo Otubo
* otubo/seccomp:
  seccomp: add kill() to the syscall whitelist

Message-id: 1386075077-3240-1-git-send-email-otubo@linux.vnet.ibm.com
Signed-off-by: Anthony Liguori <aliguori@amazon.com>
10 years agoMerge remote-tracking branch 'kwolf/tags/for-anthony' into staging
Anthony Liguori [Fri, 6 Dec 2013 20:59:58 +0000 (12:59 -0800)]
Merge remote-tracking branch 'kwolf/tags/for-anthony' into staging

Block patches for 2.0 (flushing block-next)

# gpg: Signature made Fri 29 Nov 2013 08:43:18 AM PST using RSA key ID C88F2FD6
# gpg: Can't check signature: public key not found

# By Peter Lieven (17) and others
# Via Kevin Wolf
* kwolf/tags/for-anthony: (41 commits)
  qemu-iotests: Add sample image and test for VMDK version 3
  vmdk: Allow read only open of VMDK version 3
  qemu-iotests: Filter out 'qemu-io> ' prompt
  qemu-iotests: Filter qemu-io output in 025
  block: Use BDRV_O_NO_BACKING where appropriate
  qemu-iotests: Test snapshot mode
  block: Enable BDRV_O_SNAPSHOT with driver-specific options
  qemu-iotests: Make test case 030, 040 and 055 deterministic
  qemu-iotest: Add pause_drive and resume_drive methods
  blkdebug: add "remove_break" command
  qemu-iotests: Drop local version of cancel_and_wait from 040
  sheepdog: support user-defined redundancy option
  sheepdog: refactor do_sd_create()
  qdict: Optimise qdict_do_flatten()
  qdict: Fix memory leak in qdict_do_flatten()
  MAINTAINERS: add sheepdog development mailing list
  COW: Extend checking allocated bits to beyond one sector
  COW: Speed up writes
  qapi: Change BlockDirtyInfo to list
  block: per caller dirty bitmap
  ...

Message-id: 1385743555-27888-1-git-send-email-kwolf@redhat.com
Signed-off-by: Anthony Liguori <aliguori@amazon.com>
10 years agoMerge remote-tracking branch 'sstabellini/xen-2013-12-01' into staging
Anthony Liguori [Fri, 6 Dec 2013 20:58:28 +0000 (12:58 -0800)]
Merge remote-tracking branch 'sstabellini/xen-2013-12-01' into staging

# By Paul Durrant (1) and Wei Liu (1)
# Via Stefano Stabellini
* sstabellini/xen-2013-12-01:
  xen-pvdevice: make device-id property compulsory
  xen: fix two errors when debug is enabled

Message-id: alpine.DEB.2.02.1312011829000.3198@kaball.uk.xensource.com
Signed-off-by: Anthony Liguori <aliguori@amazon.com>
10 years agoMerge remote-tracking branch 'rth/auxv-2' into staging
Anthony Liguori [Fri, 6 Dec 2013 20:57:21 +0000 (12:57 -0800)]
Merge remote-tracking branch 'rth/auxv-2' into staging

# By Richard Henderson
# Via Richard Henderson
* rth/auxv-2:
  linux-user: Use qemu_getauxval for AT_EXECFD
  util: Use qemu_getauxval in linux qemu_cache_utils_init
  tcg-s390: Use qemu_getauxval in query_facilities
  tcg-arm: Use qemu_getauxval
  tcg-ppc64: Use qemu_getauxval
  osdep: Create qemu_getauxval and qemu_init_auxval

Message-id: 1385757754-10702-1-git-send-email-rth@twiddle.net
Signed-off-by: Anthony Liguori <aliguori@amazon.com>
10 years agoMerge remote-tracking branch 'riku/linux-user-for-upstream' into staging
Anthony Liguori [Fri, 6 Dec 2013 20:56:51 +0000 (12:56 -0800)]
Merge remote-tracking branch 'riku/linux-user-for-upstream' into staging

# By Erik de Castro Lopo (2) and others
# Via Riku Voipio
* riku/linux-user-for-upstream:
  linux-user: pass correct parameter to do_shmctl()
  linux-user: create target_structs header to place ipc_perm and shmid_ds
  flatload: fix non-GOT relocations
  linux-user: Implement handling of 5 POSIX timer syscalls.
  linux-user: Add target struct defs needed for POSIX timer syscalls.

Message-id: cover.1385732338.git.riku.voipio@linaro.org
Signed-off-by: Anthony Liguori <aliguori@amazon.com>
10 years agoMerge remote-tracking branch 'kraxel/tags/pull-usb-1' into staging
Anthony Liguori [Fri, 6 Dec 2013 20:54:35 +0000 (12:54 -0800)]
Merge remote-tracking branch 'kraxel/tags/pull-usb-1' into staging

Improvements for usb3 bulk stream (usb core, xhci).
Bugfixes for uas emulation.
Add remote wakeup support for ehci.
Add suspend support for xhci.
Misc minor tweaks and fixes.

# gpg: Signature made Thu 28 Nov 2013 11:44:49 PM PST using RSA key ID D3E87138
# gpg: Can't check signature: public key not found

# By Hans de Goede (11) and others
# Via Gerd Hoffmann
* kraxel/tags/pull-usb-1:
  usb: move usb_{hi,lo} helpers to header file.
  usb: add vendor request defines
  trace-events: Clean up after removal of old usb-host code
  Revert "usb-tablet: Don't claim wakeup capability for USB-2 version"
  ehci: implement port wakeup
  xhci: Call usb_device_alloc/free_streams
  usb: Add usb_device_alloc/free_streams
  usb: Add max_streams attribute to endpoint info
  uas: s/ui/iu/
  uas: Fix response iu struct definition
  uas: Bounds check tags when using streams
  uas: Streams are numbered 1-y, rather then 0-x
  uas: Fix / cleanup usb_uas_task error handling
  uas: Only use report iu-s for task_mgmt status reporting
  scsi: Add 2 new sense codes needed by uas
  xhci: add support for suspend/resume
  xhci: Add a few missing checks for disconnected devices

Message-id: 1385712381-30918-1-git-send-email-kraxel@redhat.com
Signed-off-by: Anthony Liguori <aliguori@amazon.com>
10 years agoMerge remote-tracking branch 'mjt/trivial-patches' into staging
Anthony Liguori [Fri, 6 Dec 2013 20:52:50 +0000 (12:52 -0800)]
Merge remote-tracking branch 'mjt/trivial-patches' into staging

# By Stefan Weil (9) and others
# Via Michael Tokarev
* mjt/trivial-patches:
  eeprom93xx: fix coding style
  hw/ppc/mac.h: remove unused BIOS_FILENAME definition
  Don't crash on keyboard input with no handler
  libcacard/vcard_emul_nss: Remove unused statement (value stored is never read)
  libcacard/cac: Remove unused statement (value stored is never read)
  virtio-net: fix the indent
  misc: Replace 'struct QEMUTimer' by 'QEMUTimer'
  qobject: Fix compiler warning (missing gnu_printf format attribute)
  acpi-build: Fix compiler warning (missing gnu_printf format attribute)
  .gitignore: Ignore config.status
  gtk: Replace conditional debug messages by trace methods
  console: Replace conditional debug messages by trace methods
  trace: Remove trace.h from hw/usb/hcd-ehci.h (less dependencies)
  trace: Remove trace.h from console.h (less dependencies)

Message-id: 1385408466-13183-1-git-send-email-mjt@msgid.tls.msk.ru
Signed-off-by: Anthony Liguori <aliguori@amazon.com>
10 years agoeeprom93xx: fix coding style
Antony Pavlov [Wed, 4 Dec 2013 06:27:29 +0000 (10:27 +0400)]
eeprom93xx: fix coding style

scripts/checkpatch.pl reports about some style problems,
this commit fixes some of them:

ERROR: space prohibited before open square bracket '['
+    .fields      = (VMStateField []) {

ERROR: space prohibited after that '!' (ctx:BxW)
+    if (! eeprom->eecs && eecs) {
         ^

ERROR: space prohibited after that '!' (ctx:WxW)
+    } else if (eeprom->eecs && ! eecs) {
                                ^

ERROR: space prohibited after that '!' (ctx:WxW)
+    } else if (eecs && ! eeprom->eesk && eesk) {
                        ^

ERROR: switch and case should be at the same indent
                     switch (address >> (eeprom->addrbits - 2)) {
+                        case 0:
[...]
+                        case 1:
[...]
+                        case 2:
[...]
+                        case 3:

ERROR: return is not a function, parentheses are not required
+    return (eeprom->eedo);

ERROR: switch and case should be at the same indent
     switch (nwords) {
+        case 16:
+        case 64:
[...]
+        case 128:
+        case 256:
[...]
+        default:

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Cc: Stefan Weil <sw@weilnetz.de>
Reviewed-by: Stefan Weil <sw@weilnetz.de>
Cc: qemu-trivial@nongnu.org
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
10 years agopc: switch 2.0 machine types to large seabios binary
Gerd Hoffmann [Mon, 2 Dec 2013 11:52:04 +0000 (12:52 +0100)]
pc: switch 2.0 machine types to large seabios binary

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agoroms: update vgabios binaries
Gerd Hoffmann [Mon, 2 Dec 2013 12:01:20 +0000 (13:01 +0100)]
roms: update vgabios binaries

This also switches from lgplvgabios to seavgabios.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agoroms: update seabios binaries
Gerd Hoffmann [Mon, 2 Dec 2013 11:58:45 +0000 (12:58 +0100)]
roms: update seabios binaries

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agoroms: enable seabios cross builds
Gerd Hoffmann [Tue, 15 Oct 2013 15:05:55 +0000 (17:05 +0200)]
roms: enable seabios cross builds

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agoroms: build two seabios binaries
Gerd Hoffmann [Mon, 30 Sep 2013 09:37:12 +0000 (11:37 +0200)]
roms: build two seabios binaries

Adding xhci support to seabios made it jump over the 128k line.
Changing the bios size breaks migration, so we have to keep a
128k seabios binary for old machine types.  New machine types can
use a large 256k bios which should be big enougth for a while.

This patch updates the seabios build process to build seabios twice,
once full featured and once with xen and xhci turned off so the
resulting binary is small enougth to fit into 128k.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agoroms: update seabios submodule to 31b8b4eea9d9ad58a73b22a6060d3ac1c419c26d
Gerd Hoffmann [Tue, 15 Oct 2013 15:02:19 +0000 (17:02 +0200)]
roms: update seabios submodule to 31b8b4eea9d9ad58a73b22a6060d3ac1c419c26d

Updates seabios to git master snapshot.  seabios is in freeze now,
update to final 1.7.4 will follow later this year.

Summary of major changes:

 * Support for acpi table loading from qemu.
 * Support for the xhci host adapter.
 * Support for the pvscsi HBA.
 * Various minor bug fixes.
 * Lots of cleanups.

Full shortlog since 1.7.3 (note that some of these changes have been
cherry-picked into 1.7.3-stable):

Evgeny Budilovsky (1):
      Add pvscsi boot support

Gerd Hoffmann (27):
      coreboot: add cbmem console support
      Add CONFIG_DEBUG_COREBOOT config option
      apm: fix shutdown
      ahci: add missing check for allocation failure
      bochsvga: fallback to stdvga if dispi interface isn't present
      Add generic qemu detection
      Drop coreboot qemu detection
      Add qemu detection to csm
      uas: add (temporary) superspeed stopgap
      usb: add usb_update_pipe()
      usb: add xhci support
      fix buildversion.sh
      build: simplify cross builds
      build: create output dirs in do-kconfig
      build: explicitly set ROM size
      Add qemu_cfg_e820 function.
      Add support for etc/e820 fw_cfg file
      pci: don't reorder entries when moving to 64bit list
      pci: don't map usb host adapters above 4G
      pci: align 64bit pci regions to 1G
      pci: tweak + comment minimum allocations
      pci: log pci windows
      pci: map 64-bit BARs at location provided by emulator
      ahci: zap real mode macros
      ahci: remote some parentheses
      ahci: alloc structs in high memory
      add hw/serialio.c to SRC32SEG

Jonathan A. Kollasch (1):
      vgahooks: add SM720 VGA BIOS hooks for WIN Enterprises MB-60470

Kevin O'Connor (80):
      Fix USB EHCI detection that was broken in hlist conversion of PCIDevices.
      Update README to include info on VARLOW variables.
      PIC code cleanups.
      Move internal timer code from clock.c to a new file timer.c.
      Don't pass khz to pmtimer_setup - it's always PM_TIMER_FREQUENCY.
      Add helper functions to convert timer irqs to milliseconds.
      Improve accuracy of internal timers.
      Rename cpu_khz to TimerKHz.
      Shift CPU TSC down to reduce need for 64bit variables.
      Rename check_timer() function (and similar) to irqtimer_check().
      Rename check_tsc() (and similar) to timer_check() and use u32.
      Separate out timer setup code.
      Unify pmtimer_read() and pittimer_read() code.
      Default unused UMB areas to be read-only.
      Add missing mathcp_setup() call to CSM code.
      Fix bug in CBFS file walking with compressed files.
      Support custom boot menu prompt and custom boot menu key.
      Minor cleanups to smm assembler.
      Add config option to support memory allocations in 9-segment.
      Minor - no need to declare MaxCountCPUs as VARFSEG.
      Minor - simplify rom_reserve().
      Rename tools/ directory to scripts/ directory.
      Update kconfig to latest version.
      build: Don't use vpath makefile directive.
      Move code centered around specific hardware devices to src/hw/
      Move code cenetered around firmware initialization to src/fw/
      build: Reorder makefile source list to group like files together.
      README: Update readme to note scripts/ directory rename and vgasrc/ directory.
      vgabios: Rename stdvga_bpp_factor to stdvga_vram_ratio.
      vgabios: Limit the range of the VBE number of "pages" parameter.
      readme: Minor - fix typo in readme.
      Split x86 specific functions out of util.c/h to new files x86.c/h.
      Move keyboard calling code from util.c to boot.c.
      Rename util.c to string.c and introduce string.h.
      build: Perform compile checking on vgasrc code.
      Move stacks.c definitions from util.h to new file stacks.h.
      Move romfile definitions from util.h to new file romfile.h.
      Move malloc code from pmm.c to new files malloc.c and malloc.h.
      Move function definitions for output.c from util.h to new file output.h.
      Move definition of struct segoff_s from farptr.h to types.h.
      build: Fix import of gcc dependency files.
      Move pirtable definitions from hw/pci.h to std/pirtable.h and util.h.
      Move optionroms.h to std/optionrom.h and util.h.
      Move vbe.h to std/vbe.h.
      Move fw/LegacyBios.h to std/LegacyBios.h and remove csm.h.
      Move fw/smbios.h to std/smbios.h.
      Move fw/mptable.h to std/mptable.h.
      Move fw/acpi.h to std/acpi.h.
      Move pnpbios definition to new file std/pnpbios.h.
      Move pmm definitions to new file std/pmm.h.
      Split disk.h into block.h and std/disk.h.
      Move standard bda type info from biosvar.h to std/bda.h.
      Merge bmp.h, boot.h, jpeg.h, and post.h into util.h.
      Sort the sections of util.h.
      Move PIT setup from clock.c to hw/timer.c.
      Rename hw/cmos.h to hw/rtc.h and copy RTC code from clock.c to hw/rtc.c.
      Move dma code to new file hw/dma.c.
      Remove ioport.h; disperse its contents to other header files.
      Minor - update file comments in src/malloc.c.
      Rename fields of 'struct chs_s' and use in floppy lba2chs().
      Rearrange stack_hop_back() call in wait_irq, check_irqs, and _farcall16.
      Minor - move call16 assembler in romlayout.S.
      Make __call16 use C calling convention and support two passed parameters.
      Update _farcall16() to pass segment of callregs explicitly.
      Support call16() calls after entering 32bit mode from call32().
      Run ahci code entirely in 32bit mode.
      Build different final files for QEMU, coreboot, and CSM.
      Convert op->drive_g from a 16bit pointer to a 32 bit "GLOBALFLAT" pointer.
      megasas: Don't attempt to access 'struct pci_device' at runtime.
      Minor - eliminate the SET_GLOBAL macro.
      Move low-level hardware writing from output.c to new file hw/serialio.c.
      vgabios: Load the DAC palette in "packed" modes on Cirrus and BochsVGA.
      vgabios: Support custom fonts in vga framebuffer text writing.
      vgabios: Add bochsvga "HDTV" resolutions.
      vgabios: Avoid possible divide by zero in bochsvga_set_displaystart.
      vgabios: Work around lack of support for "calll" in x86emu emulation.
      Minor - update file comment on bootsplash.c.
      vgabios: Support allocating an extra stack for vgabios calls and default on.
      vgabios: Move initialization code to new file vgainit.c.
      floppy: Minor - add warnings if timeouts occur.

Michael S. Tsirkin (6):
      acpi: sync FADT flags from PIIX4 to Q35
      acpi_extract.py: document DEVICE directives
      biostables: support looking up RSDP
      romfile_loader: utility to patch in-memory ROM files
      acpi: load and link tables through romfile loader
      acpi: strip compiler info in built-in DSDT if any

Paul Menzel (2):
      ACPI DSDT: Make control method `IQCR` serialized
      hw/usb-xhci.c: Code refactoring to not override initializers in `speed_from_xhci[16]`

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agotarget-i386: fix cpuid leaf 0x0d
Liu Jinsong [Mon, 2 Dec 2013 20:17:50 +0000 (04:17 +0800)]
target-i386: fix cpuid leaf 0x0d

Fix cpuid leaf 0x0d which incorrectly parsed eax and ebx.

However, before this patch the CPUID worked fine -- the .offset
field contained the size _and_ was stored in the register that
is supposed to hold the size (eax), and likewise the .size field
contained the offset _and_ was stored in the register trhat is
supposed to hold the offset (ebx).

Signed-off-by: Liu Jinsong <jinsong.liu@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
10 years agoseccomp: add kill() to the syscall whitelist
Paul Moore [Thu, 21 Nov 2013 15:40:15 +0000 (10:40 -0500)]
seccomp: add kill() to the syscall whitelist

The kill() syscall is triggered with the following command:

 # qemu -sandbox on -monitor stdio \
        -device intel-hda -device hda-duplex -vnc :0

The resulting syslog/audit message:

 # ausearch -m SECCOMP
 ----
 time->Wed Nov 20 09:52:08 2013
 type=SECCOMP msg=audit(1384912328.482:6656): auid=0 uid=0 gid=0 ses=854
  subj=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 pid=12087
  comm="qemu-kvm" sig=31 syscall=62 compat=0 ip=0x7f7a1d2abc67 code=0x0
 # scmp_sys_resolver 62
 kill

Reported-by: CongLi <coli@redhat.com>
Tested-by: CongLi <coli@redhat.com>
Signed-off-by: Paul Moore <pmoore@redhat.com>
Acked-by: Eduardo Otubo <otubo@linux.vnet.ibm.com>
10 years agohw/ppc/mac.h: remove unused BIOS_FILENAME definition
Michael Tokarev [Mon, 2 Dec 2013 17:17:19 +0000 (21:17 +0400)]
hw/ppc/mac.h: remove unused BIOS_FILENAME definition

This definition has been moved to prep.c.

Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
10 years agoDon't crash on keyboard input with no handler
Don Koch [Tue, 19 Nov 2013 20:01:59 +0000 (15:01 -0500)]
Don't crash on keyboard input with no handler

Prevent a call to put_kbd if null.

On shutdown of some OSes, the keyboard handler goes away before the
system is down. If a key is typed during this window, qemu crashes.

Signed-off-by: Don Koch <dkoch@verizon.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
10 years agolibcacard/vcard_emul_nss: Remove unused statement (value stored is never read)
Stefan Weil [Sun, 17 Nov 2013 21:12:18 +0000 (22:12 +0100)]
libcacard/vcard_emul_nss: Remove unused statement (value stored is never read)

Warning from ccc-analyzer:

libcacard/vcard_emul_nss.c:937:9: warning:
 Value stored to 'cert_count' is never read
        cert_count = options->vreader[i].cert_count;
        ^            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
10 years agolibcacard/cac: Remove unused statement (value stored is never read)
Stefan Weil [Sun, 17 Nov 2013 21:11:23 +0000 (22:11 +0100)]
libcacard/cac: Remove unused statement (value stored is never read)

Warning from ccc-analyzer:

libcacard/cac.c:192:13: warning: Value stored to 'ret' is never read
            ret = VCARD_DONE;
            ^     ~~~~~~~~~~

Here 'ret' is assigned a value inside of a switch statement and also after
that switch statement.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
10 years agovirtio-net: fix the indent
Zhi Yong Wu [Wed, 27 Nov 2013 07:35:26 +0000 (15:35 +0800)]
virtio-net: fix the indent

Signed-off-by: Zhi Yong Wu <wuzhy@linux.vnet.ibm.com>
Reviewed-by: Fam Zheng <famz@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
10 years agomisc: Replace 'struct QEMUTimer' by 'QEMUTimer'
Stefan Weil [Sun, 1 Dec 2013 07:49:47 +0000 (08:49 +0100)]
misc: Replace 'struct QEMUTimer' by 'QEMUTimer'

Most code already used QEMUTimer without the redundant 'struct' keyword.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Reviewed-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
10 years agoqobject: Fix compiler warning (missing gnu_printf format attribute)
Stefan Weil [Sun, 17 Nov 2013 18:00:42 +0000 (19:00 +0100)]
qobject: Fix compiler warning (missing gnu_printf format attribute)

gcc 4.8.2 reports this warning when extra warnings are enabled (-Wextra):

  CC    qobject/qerror.o
qobject/qerror.c: In function â€˜qerror_from_info’:
qobject/qerror.c:53:5: error:
 function might be possible candidate for â€˜gnu_printf’ format attribute [-Werror=suggest-attribute=format]
     qerr->err_msg = g_strdup_vprintf(fmt, *va);
     ^

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
10 years agoacpi-build: Fix compiler warning (missing gnu_printf format attribute)
Stefan Weil [Sun, 17 Nov 2013 18:00:22 +0000 (19:00 +0100)]
acpi-build: Fix compiler warning (missing gnu_printf format attribute)

gcc 4.8.2 reports this warning when extra warnings are enabled (-Wextra):

  CC    m68k-softmmu/hw/m68k/mcf5206.o
hw/i386/acpi-build.c: In function â€˜build_append_nameseg’:
hw/i386/acpi-build.c:294:5: error:
 function might be possible candidate for â€˜gnu_printf’ format attribute [-Werror=suggest-attribute=format]
     g_string_vprintf(s, format, args);
     ^

When this warning is fixed, there is a new compiler warning:

  CC    i386-softmmu/hw/i386/acpi-build.o
hw/i386/acpi-build.c: In function â€˜build_append_notify’:
hw/i386/acpi-build.c:632:5: error:
 format not a string literal and no format arguments [-Werror=format-security]
     build_append_nameseg(method, name);
     ^

This is fixed here, too.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
10 years ago.gitignore: Ignore config.status
Fam Zheng [Fri, 22 Nov 2013 06:39:56 +0000 (14:39 +0800)]
.gitignore: Ignore config.status

Signed-off-by: Fam Zheng <famz@redhat.com>
Reviewed-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
10 years agogtk: Replace conditional debug messages by trace methods
Stefan Weil [Sun, 10 Nov 2013 15:24:02 +0000 (16:24 +0100)]
gtk: Replace conditional debug messages by trace methods

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
10 years agoconsole: Replace conditional debug messages by trace methods
Stefan Weil [Sun, 10 Nov 2013 15:04:16 +0000 (16:04 +0100)]
console: Replace conditional debug messages by trace methods

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
10 years agotrace: Remove trace.h from hw/usb/hcd-ehci.h (less dependencies)
Stefan Weil [Sun, 10 Nov 2013 13:20:17 +0000 (14:20 +0100)]
trace: Remove trace.h from hw/usb/hcd-ehci.h (less dependencies)

This reduces the dependencies on trace.h.
Only one source file which needs hcd-ehci.h also needs trace.h.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
10 years agotrace: Remove trace.h from console.h (less dependencies)
Stefan Weil [Sun, 10 Nov 2013 13:20:16 +0000 (14:20 +0100)]
trace: Remove trace.h from console.h (less dependencies)

This reduces the dependencies on trace.h.
Only two source files which need console.h also need trace.h.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
10 years agoadd firmware to machine options
Gerd Hoffmann [Tue, 15 Oct 2013 14:57:45 +0000 (16:57 +0200)]
add firmware to machine options

This patch adds firmware to the machine options.  -bios <file> becomes a
shortcut for -machine firmware=<file>.  Advantage is that the firmware
can be specified via config file as -machine is parsed using QemuOpts
and it is also possible to use different defaults for different
machine types (via QEMUMachine->default_machine_opts).

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agoadd pc-{i440fx,q35}-2.0 machine types
Gerd Hoffmann [Mon, 2 Dec 2013 11:47:29 +0000 (12:47 +0100)]
add pc-{i440fx,q35}-2.0 machine types

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agoxen-pvdevice: make device-id property compulsory
Paul Durrant [Wed, 13 Nov 2013 15:25:07 +0000 (15:25 +0000)]
xen-pvdevice: make device-id property compulsory

The intention of the Xen PV device is that it is used as a parent
device for PV drivers in Xen HVM guests and the set of PV drivers that
bind to the device is determined by its device ID (and possibly
vendor ID and revision). As such, the device should not have a default
device ID, it should always be supplied by the Xen toolstack.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
10 years agoxen: fix two errors when debug is enabled
Wei Liu [Mon, 14 Oct 2013 12:53:53 +0000 (13:53 +0100)]
xen: fix two errors when debug is enabled

This patch fixes:
1. build error in xen_pt.c when XEN_PT_LOGGING_ENABLED is defined
2. debug output format string error when DEBUG_XEN is defined

In the second case I also have the output info in consistent with the
output in mapping function - that is, print start_addr instead of
phys_offset.

Signed-off-by: Sander Eikelenboom <linux@eikelenboom.it>
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
10 years agolinux-user: Use qemu_getauxval for AT_EXECFD
Richard Henderson [Tue, 15 Oct 2013 22:00:36 +0000 (15:00 -0700)]
linux-user: Use qemu_getauxval for AT_EXECFD

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <rth@twiddle.net>
10 years agoutil: Use qemu_getauxval in linux qemu_cache_utils_init
Richard Henderson [Mon, 10 Jun 2013 16:05:09 +0000 (09:05 -0700)]
util: Use qemu_getauxval in linux qemu_cache_utils_init

With this we no longer pass down envp, and thus all systems can have
the same void prototype.  So also eliminate a useless thunk.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <rth@twiddle.net>
10 years agotcg-s390: Use qemu_getauxval in query_facilities
Richard Henderson [Fri, 7 Jun 2013 14:43:33 +0000 (07:43 -0700)]
tcg-s390: Use qemu_getauxval in query_facilities

No need to set up a SIGILL signal handler for detection anymore.

Remove a ton of sanity checks that must be true, given that we're
requiring a 64-bit build (the note about 31-bit KVM is satisfied
by configuring with TCI).

Signed-off-by: Richard Henderson <rth@twiddle.net>
10 years agotcg-arm: Use qemu_getauxval
Richard Henderson [Fri, 7 Jun 2013 14:26:20 +0000 (07:26 -0700)]
tcg-arm: Use qemu_getauxval

Allow host detection on linux systems without glibc 2.16 or later.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <rth@twiddle.net>
10 years agotcg-ppc64: Use qemu_getauxval
Richard Henderson [Tue, 4 Jun 2013 18:37:17 +0000 (11:37 -0700)]
tcg-ppc64: Use qemu_getauxval

Allow host detection on linux systems without glibc 2.16 or later.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <rth@twiddle.net>
10 years agoosdep: Create qemu_getauxval and qemu_init_auxval
Richard Henderson [Tue, 4 Jun 2013 18:24:49 +0000 (11:24 -0700)]
osdep: Create qemu_getauxval and qemu_init_auxval

Abstract away dependence on a system implementation of getauxval.

Signed-off-by: Richard Henderson <rth@twiddle.net>
10 years agoqemu-iotests: Add sample image and test for VMDK version 3
Fam Zheng [Thu, 28 Nov 2013 01:48:04 +0000 (09:48 +0800)]
qemu-iotests: Add sample image and test for VMDK version 3

Signed-off-by: Fam Zheng <famz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
10 years agovmdk: Allow read only open of VMDK version 3
Fam Zheng [Thu, 28 Nov 2013 01:48:03 +0000 (09:48 +0800)]
vmdk: Allow read only open of VMDK version 3

Signed-off-by: Fam Zheng <famz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
10 years agoqemu-iotests: Filter out 'qemu-io> ' prompt
Fam Zheng [Mon, 18 Nov 2013 07:13:01 +0000 (15:13 +0800)]
qemu-iotests: Filter out 'qemu-io> ' prompt

This removes "qemu-io> " prompt from qemu-io output in _filter_qemu_io,
and updates all the output files with the following command:

 cd tests/qemu-iotests && sed -i "s/qemu-io> //g" *.out

Signed-off-by: Fam Zheng <famz@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
10 years agoqemu-iotests: Filter qemu-io output in 025
Fam Zheng [Mon, 18 Nov 2013 07:10:58 +0000 (15:10 +0800)]
qemu-iotests: Filter qemu-io output in 025

Signed-off-by: Fam Zheng <famz@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
10 years agoblock: Use BDRV_O_NO_BACKING where appropriate
Kevin Wolf [Thu, 28 Nov 2013 10:58:02 +0000 (11:58 +0100)]
block: Use BDRV_O_NO_BACKING where appropriate

If you open an image temporarily just because you want to check its size
or get it flushed, there's no real reason to open the whole backing file
chain.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Fam Zheng <famz@redhat.com>
Reviewed-by: Benoit Canet <benoit@irqsave.net>
10 years agoqemu-iotests: Test snapshot mode
Kevin Wolf [Fri, 15 Nov 2013 16:00:41 +0000 (17:00 +0100)]
qemu-iotests: Test snapshot mode

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
10 years agoblock: Enable BDRV_O_SNAPSHOT with driver-specific options
Kevin Wolf [Thu, 14 Nov 2013 14:37:12 +0000 (15:37 +0100)]
block: Enable BDRV_O_SNAPSHOT with driver-specific options

In the case of snapshot=on, don't rely on the backing file path in the
temporary image any more, but override the backing file with the given
set of options. This way, block drivers that don't use a file name can
be accessed with snapshot=on, for example:

    -drive file.driver=nbd,file.host=localhost,snapshot=on

Which becomes internally something like:

    file.filename=/tmp/vl.AWQZCu,backing.file.driver=nbd,backing.file.host=localhost

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
10 years agoqemu-iotests: Make test case 030, 040 and 055 deterministic
Fam Zheng [Wed, 20 Nov 2013 02:01:56 +0000 (10:01 +0800)]
qemu-iotests: Make test case 030, 040 and 055 deterministic

Pause the drive and start the block job, so we won't miss the block job.

Signed-off-by: Fam Zheng <famz@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agoqemu-iotest: Add pause_drive and resume_drive methods
Fam Zheng [Wed, 20 Nov 2013 02:01:55 +0000 (10:01 +0800)]
qemu-iotest: Add pause_drive and resume_drive methods

They wrap blkdebug "break" and "remove_break".

Add optional argument "resume" to cancel_and_wait().

Signed-off-by: Fam Zheng <famz@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agoblkdebug: add "remove_break" command
Fam Zheng [Wed, 20 Nov 2013 02:01:54 +0000 (10:01 +0800)]
blkdebug: add "remove_break" command

This adds "remove_break" command which is the reverse of blkdebug
command "break": it removes all breakpoints with given tag and resumes
all the requests.

Signed-off-by: Fam Zheng <famz@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agoqemu-iotests: Drop local version of cancel_and_wait from 040
Fam Zheng [Wed, 20 Nov 2013 02:01:53 +0000 (10:01 +0800)]
qemu-iotests: Drop local version of cancel_and_wait from 040

iotests.py already has one.

Signed-off-by: Fam Zheng <famz@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agosheepdog: support user-defined redundancy option
Liu Yuan [Thu, 7 Nov 2013 14:56:38 +0000 (22:56 +0800)]
sheepdog: support user-defined redundancy option

Sheepdog support two kinds of redundancy, full replication and erasure coding.

# create a fully replicated vdi with x copies
 -o redundancy=x (1 <= x <= SD_MAX_COPIES)

# create a erasure coded vdi with x data strips and y parity strips
 -o redundancy=x:y (x must be one of {2,4,8,16} and 1 <= y < SD_EC_MAX_STRIP)

E.g, to convert a vdi into sheepdog vdi 'test' with 8:3 erasure coding scheme

$ qemu-img convert -o redundancy=8:3 linux-0.2.img sheepdog:test

Cc: Kevin Wolf <kwolf@redhat.com>
Cc: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Liu Yuan <namei.unix@gmail.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agosheepdog: refactor do_sd_create()
Liu Yuan [Thu, 7 Nov 2013 14:56:37 +0000 (22:56 +0800)]
sheepdog: refactor do_sd_create()

We can actually use BDRVSheepdogState *s to pass most of the parameters.

Cc: Kevin Wolf <kwolf@redhat.com>
Cc: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Liu Yuan <namei.unix@gmail.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agoqdict: Optimise qdict_do_flatten()
Kevin Wolf [Wed, 20 Nov 2013 12:09:21 +0000 (13:09 +0100)]
qdict: Optimise qdict_do_flatten()

Nested QDicts used to be both entered recursively in order to move their
entries to the target QDict and also be moved themselves to the target
QDict like all other objects. This is harmless because for the top
level, qdict_do_flatten() will encounter the (now empty) QDict for a
second time and then delete it, but at the same time it's obviously
unnecessary overhead. Just delete nested QDicts directly after moving
all of their entries.

Reported-by: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agoqdict: Fix memory leak in qdict_do_flatten()
Kevin Wolf [Wed, 20 Nov 2013 12:09:20 +0000 (13:09 +0100)]
qdict: Fix memory leak in qdict_do_flatten()

Reported-by: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agoMAINTAINERS: add sheepdog development mailing list
Liu Yuan [Wed, 20 Nov 2013 07:51:59 +0000 (15:51 +0800)]
MAINTAINERS: add sheepdog development mailing list

This will help people find mailing list relevant to sheepdog.

Cc: Stefan Hajnoczi <stefanha@redhat.com>
Cc: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Liu Yuan <namei.unix@gmail.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agoCOW: Extend checking allocated bits to beyond one sector
Charlie Shepherd [Fri, 15 Nov 2013 18:47:02 +0000 (19:47 +0100)]
COW: Extend checking allocated bits to beyond one sector

cow_co_is_allocated() only checks one sector's worth of allocated bits
before returning. This is allowed but (slightly) inefficient, so extend
it to check all of the file's metadata sectors.

Signed-off-by: Charlie Shepherd <charlie@ctshepherd.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
[kwolf: silenced compiler warning (-Wmaybe-uninitialized for changed)]
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
10 years agoCOW: Speed up writes
Charlie Shepherd [Fri, 15 Nov 2013 18:47:01 +0000 (19:47 +0100)]
COW: Speed up writes

Process a whole sector's worth of COW bits by reading a sector, setting
the bits after skipping any already set bits, then writing it out again.
Make sure we only flush once before writing metadata, and only if we
need to write metadata.

Signed-off-by: Charlie Shepherd <charlie@ctshepherd.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agoqapi: Change BlockDirtyInfo to list
Fam Zheng [Wed, 13 Nov 2013 10:29:44 +0000 (18:29 +0800)]
qapi: Change BlockDirtyInfo to list

We have multiple dirty bitmaps in BDS now, switch QAPI to allow query
it (BlockInfo.dirty_bitmaps), and also drop old BlockInfo.dirty.

Signed-off-by: Fam Zheng <famz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
10 years agoblock: per caller dirty bitmap
Fam Zheng [Wed, 13 Nov 2013 10:29:43 +0000 (18:29 +0800)]
block: per caller dirty bitmap

Previously a BlockDriverState has only one dirty bitmap, so only one
caller (e.g. a block job) can keep track of writing. This changes the
dirty bitmap to a list and creates a BdrvDirtyBitmap for each caller, the
lifecycle is managed with these new functions:

    bdrv_create_dirty_bitmap
    bdrv_release_dirty_bitmap

Where BdrvDirtyBitmap is a linked list wrapper structure of HBitmap.

In place of bdrv_set_dirty_tracking, a BdrvDirtyBitmap pointer argument
is added to these functions, since each caller has its own dirty bitmap:

    bdrv_get_dirty
    bdrv_dirty_iter_init
    bdrv_get_dirty_count

bdrv_set_dirty and bdrv_reset_dirty prototypes are unchanged but will
internally walk the list of all dirty bitmaps and set them one by one.

Signed-off-by: Fam Zheng <famz@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
10 years agolinux-user: pass correct parameter to do_shmctl()
Petar Jovanovic [Wed, 30 Oct 2013 13:46:32 +0000 (14:46 +0100)]
linux-user: pass correct parameter to do_shmctl()

Fix shmctl issue by passing correct parameter buf to do_shmctl().

Signed-off-by: Petar Jovanovic <petar.jovanovic@imgtec.com>
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
10 years agolinux-user: create target_structs header to place ipc_perm and shmid_ds
Petar Jovanovic [Wed, 30 Oct 2013 13:46:31 +0000 (14:46 +0100)]
linux-user: create target_structs header to place ipc_perm and shmid_ds

Creating target_structs header in linux-user/$arch/ and making
target_ipc_perm and target_shmid_ds its first inhabitants.
The struct defintions may/should be further fine-tuned by arch maintainers.

Signed-off-by: Petar Jovanovic <petar.jovanovic@imgtec.com>
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
10 years agoflatload: fix non-GOT relocations
Corey J. Boyle [Sat, 5 Oct 2013 11:46:31 +0000 (07:46 -0400)]
flatload: fix non-GOT relocations

Use target address rather than host address when performing
non-GOT relocations

Signed-off-by: Corey J. Boyle <corey@kansanian.com>
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
10 years agolinux-user: Implement handling of 5 POSIX timer syscalls.
Erik de Castro Lopo [Fri, 29 Nov 2013 07:39:23 +0000 (18:39 +1100)]
linux-user: Implement handling of 5 POSIX timer syscalls.

Implement timer_create, timer_settime, timer_gettime, timer_getoverrun
and timer_delete.

Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
10 years agolinux-user: Add target struct defs needed for POSIX timer syscalls.
Erik de Castro Lopo [Fri, 29 Nov 2013 07:39:22 +0000 (18:39 +1100)]
linux-user: Add target struct defs needed for POSIX timer syscalls.

Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
10 years agousb: move usb_{hi,lo} helpers to header file.
Gerd Hoffmann [Wed, 20 Nov 2013 06:33:28 +0000 (07:33 +0100)]
usb: move usb_{hi,lo} helpers to header file.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agousb: add vendor request defines
Gerd Hoffmann [Tue, 19 Nov 2013 11:37:58 +0000 (12:37 +0100)]
usb: add vendor request defines

Add defines for vendor specific usb control requests.
Group defines by Device / Interface / Endpoint while
being at it.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agotrace-events: Clean up after removal of old usb-host code
Markus Armbruster [Mon, 25 Nov 2013 12:08:18 +0000 (13:08 +0100)]
trace-events: Clean up after removal of old usb-host code

Commit b5613fd neglected to drop the trace events along with the code.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agoRevert "usb-tablet: Don't claim wakeup capability for USB-2 version"
Gerd Hoffmann [Wed, 20 Nov 2013 13:32:27 +0000 (14:32 +0100)]
Revert "usb-tablet: Don't claim wakeup capability for USB-2 version"

This reverts commit aa1c9e971e80d25b92908dce3dec7c38b49480ea.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agoehci: implement port wakeup
Gerd Hoffmann [Wed, 20 Nov 2013 13:10:19 +0000 (14:10 +0100)]
ehci: implement port wakeup

Update portsc register and raise irq in case a suspended
port is woken up, so remote wakeup works on our ehci ports.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agoblock/stream: Don't stream unbacked devices
Max Reitz [Wed, 13 Nov 2013 19:37:58 +0000 (20:37 +0100)]
block/stream: Don't stream unbacked devices

If a block device is unbacked, a streaming blockjob should immediately
finish instead of beginning to try to stream, then noticing the backing
file does not contain even the first sector (since it does not exist)
and then finishing normally.

Signed-off-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Wenchao Xia <xiawenc@linux.vnet.ibm.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
10 years agosheepdog: implement .bdrv_get_allocated_file_size
Liu Yuan [Wed, 7 Aug 2013 08:59:53 +0000 (16:59 +0800)]
sheepdog: implement .bdrv_get_allocated_file_size

With this patch, qemu-img info sheepdog:image will show disk size for sheepdog
images.

Cc: Kevin Wolf <kwolf@redhat.com>
Cc: Stefan Hajnoczi <stefanha@redhat.com>
Cc: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
Signed-off-by: Liu Yuan <namei.unix@gmail.com>
Reviewed-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
10 years agoTest coroutine execution order
Charlie Shepherd [Thu, 8 Aug 2013 02:23:14 +0000 (03:23 +0100)]
Test coroutine execution order

This patch adds a test for coroutine execution order in test-coroutine -
this catches a bug in the CPC coroutine implementation.

Signed-off-by: Charlie Shepherd <charlie@ctshepherd.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
10 years agoutil/error: Save errno from clobbering
Max Reitz [Thu, 7 Nov 2013 19:10:29 +0000 (20:10 +0100)]
util/error: Save errno from clobbering

There may be calls to error_setg() and especially error_setg_errno()
which blindly (and until now wrongly) assume these functions not to
clobber errno (e.g., they pass errno to error_setg_errno() and return
-errno afterwards). Instead of trying to find and fix all of these
constructs, just make sure error_setg() and error_setg_errno() indeed do
not clobber errno.

Suggested-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Benoit Canet <benoit@irqsave.net
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agoqemu-img: conditionally zero out target on convert
Peter Lieven [Thu, 24 Oct 2013 10:07:06 +0000 (12:07 +0200)]
qemu-img: conditionally zero out target on convert

If the target has_zero_init = 0, but supports efficiently
writing zeroes by unmapping we call bdrv_make_zero to
avoid fully allocating the target. This currently works
only for iscsi.  It can be extended to raw with
BLKDISCARDZEROES for example.

Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Peter Lieven <pl@kamp.de>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agoqemu-img: add support for fully allocated images
Peter Lieven [Thu, 24 Oct 2013 10:07:05 +0000 (12:07 +0200)]
qemu-img: add support for fully allocated images

Signed-off-by: Peter Lieven <pl@kamp.de>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agoblock/get_block_status: fix BDRV_BLOCK_ZERO for unallocated blocks
Peter Lieven [Thu, 24 Oct 2013 10:07:04 +0000 (12:07 +0200)]
block/get_block_status: fix BDRV_BLOCK_ZERO for unallocated blocks

this patch does 2 things:
a) only do additional call outs if BDRV_BLOCK_ZERO is not already set.
b) use the newly introduced bdrv_unallocated_blocks_are_zero()
   to return the zero state of an unallocated block. the used callout
   to bdrv_has_zero_init() is only valid right after bdrv_create.

Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Peter Lieven <pl@kamp.de>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agoblock: introduce bdrv_make_zero
Peter Lieven [Thu, 24 Oct 2013 10:07:03 +0000 (12:07 +0200)]
block: introduce bdrv_make_zero

this patch adds a call to completely zero out a block device.
the operation is sped up by checking the block status and
only writing zeroes to the device if they currently do not
return zeroes. optionally the zero writing can be sped up
by setting the flag BDRV_REQ_MAY_UNMAP to emulate the zero
write by unmapping if the driver supports it.

Signed-off-by: Peter Lieven <pl@kamp.de>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agoiscsi: add bdrv_co_write_zeroes
Peter Lieven [Thu, 24 Oct 2013 10:07:02 +0000 (12:07 +0200)]
iscsi: add bdrv_co_write_zeroes

Signed-off-by: Peter Lieven <pl@kamp.de>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agoiscsi: simplify iscsi_co_discard
Peter Lieven [Thu, 24 Oct 2013 10:07:01 +0000 (12:07 +0200)]
iscsi: simplify iscsi_co_discard

now that bdrv_co_discard can handle limits we do not need
the request split logic here anymore.

Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Peter Lieven <pl@kamp.de>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agoiscsi: set limits in BlockDriverState
Peter Lieven [Thu, 24 Oct 2013 10:07:00 +0000 (12:07 +0200)]
iscsi: set limits in BlockDriverState

Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Peter Lieven <pl@kamp.de>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agoblock: honour BlockLimits in bdrv_co_discard
Peter Lieven [Thu, 24 Oct 2013 10:06:59 +0000 (12:06 +0200)]
block: honour BlockLimits in bdrv_co_discard

Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Peter Lieven <pl@kamp.de>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agoblock: honour BlockLimits in bdrv_co_do_write_zeroes
Peter Lieven [Thu, 24 Oct 2013 10:06:58 +0000 (12:06 +0200)]
block: honour BlockLimits in bdrv_co_do_write_zeroes

Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Peter Lieven <pl@kamp.de>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agoblock/raw: copy BlockLimits on raw_open
Peter Lieven [Thu, 24 Oct 2013 10:06:57 +0000 (12:06 +0200)]
block/raw: copy BlockLimits on raw_open

Signed-off-by: Peter Lieven <pl@kamp.de>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agoblock: add BlockLimits structure to BlockDriverState
Peter Lieven [Thu, 24 Oct 2013 10:06:56 +0000 (12:06 +0200)]
block: add BlockLimits structure to BlockDriverState

this patch adds BlockLimits which introduces discard and write_zeroes
limits and alignment information to the BlockDriverState.

Signed-off-by: Peter Lieven <pl@kamp.de>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agoblock/iscsi: add .bdrv_get_info
Peter Lieven [Thu, 24 Oct 2013 10:06:55 +0000 (12:06 +0200)]
block/iscsi: add .bdrv_get_info

Signed-off-by: Peter Lieven <pl@kamp.de>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agoblock: add wrappers for logical block provisioning information
Peter Lieven [Thu, 24 Oct 2013 10:06:54 +0000 (12:06 +0200)]
block: add wrappers for logical block provisioning information

This adds 2 wrappers to read the unallocated_blocks_are_zero and
can_write_zeroes_with_unmap info from the BDI. The wrappers are
required to check for the existence of a backing_hd and
if the devices are opened with the correct flags.

Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Peter Lieven <pl@kamp.de>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agoblock: add logical block provisioning info to BlockDriverInfo
Peter Lieven [Thu, 24 Oct 2013 10:06:53 +0000 (12:06 +0200)]
block: add logical block provisioning info to BlockDriverInfo

Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Peter Lieven <pl@kamp.de>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agoblock: introduce BDRV_REQ_MAY_UNMAP request flag
Peter Lieven [Thu, 24 Oct 2013 10:06:52 +0000 (12:06 +0200)]
block: introduce BDRV_REQ_MAY_UNMAP request flag

Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Peter Lieven <pl@kamp.de>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agoblock: add flags to bdrv_*_write_zeroes
Peter Lieven [Thu, 24 Oct 2013 10:06:51 +0000 (12:06 +0200)]
block: add flags to bdrv_*_write_zeroes

Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Peter Lieven <pl@kamp.de>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agoblock: make BdrvRequestFlags public
Peter Lieven [Thu, 24 Oct 2013 10:06:50 +0000 (12:06 +0200)]
block: make BdrvRequestFlags public

Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Peter Lieven <pl@kamp.de>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10 years agoOpen 2.0 development tree
Anthony Liguori [Wed, 27 Nov 2013 22:02:45 +0000 (14:02 -0800)]
Open 2.0 development tree

Signed-off-by: Anthony Liguori <aliguori@amazon.com>
10 years agoUpdate version for 1.7.0 release
Anthony Liguori [Wed, 27 Nov 2013 19:30:46 +0000 (11:30 -0800)]
Update version for 1.7.0 release

Signed-off-by: Anthony Liguori <aliguori@amazon.com>
10 years agoqemu-iotests: Fix test 041
Max Reitz [Mon, 25 Nov 2013 19:28:56 +0000 (20:28 +0100)]
qemu-iotests: Fix test 041

Performing multiple drive-mirror blockjobs on the same qemu instance
results in the image file used for the block device being replaced by
the newly mirrored file, which is not what we want.

Fix this by performing one dedicated test per sync mode.

Signed-off-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-id: 1385407736-13941-3-git-send-email-mreitz@redhat.com
Signed-off-by: Anthony Liguori <aliguori@amazon.com>
10 years agoblock/drive-mirror: Reuse backing HD for sync=none
Max Reitz [Mon, 25 Nov 2013 19:28:55 +0000 (20:28 +0100)]
block/drive-mirror: Reuse backing HD for sync=none

For "none" sync mode in "absolute-paths" mode, the current image should
be used as the backing file for the newly created image.

The current behavior is:
a) If the image to be mirrored has a backing file, use that (which is
   wrong, since the operations recorded by "none" are applied to the
   image itself, not to its backing file).
b) If the image to be mirrored lacks a backing file, the target doesn't
   have one either (which is not really wrong, but not really right,
   either; "none" records a set of operations executed on the image
   file, therefore having no backing file to apply these operations on
   seems rather pointless).

For a, this is clearly a bugfix. For b, it is still a bugfix, although
it might break existing API - but since that case crashed qemu just
three weeks ago (before 1452686495922b81d6cf43edf025c1aef15965c0), we
can safely assume there is no such API relying on that case yet.

Suggested-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-id: 1385407736-13941-2-git-send-email-mreitz@redhat.com
Signed-off-by: Anthony Liguori <aliguori@amazon.com>
10 years agoxhci: Call usb_device_alloc/free_streams
Hans de Goede [Tue, 19 Nov 2013 13:36:58 +0000 (14:36 +0100)]
xhci: Call usb_device_alloc/free_streams

Note this code is not as KISS as I would like, the reason for this is that
the Linux kernel interface wants streams on eps belonging to one interface
to be allocated in one call. Things will also work if we do this one ep at a
time (as long as all eps support the same amount of streams), but lets stick
to the kernel API.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agousb: Add usb_device_alloc/free_streams
Hans de Goede [Tue, 19 Nov 2013 13:36:57 +0000 (14:36 +0100)]
usb: Add usb_device_alloc/free_streams

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agousb: Add max_streams attribute to endpoint info
Hans de Goede [Tue, 19 Nov 2013 13:36:56 +0000 (14:36 +0100)]
usb: Add max_streams attribute to endpoint info

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agouas: s/ui/iu/
Hans de Goede [Tue, 19 Nov 2013 13:37:04 +0000 (14:37 +0100)]
uas: s/ui/iu/

The various uas data structures are called IU-s, which is short for
Information Unit, rather then UI-s.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>