1. 12 Sep, 2012 9 commits
    • Benoît Canet's avatar
      qemu-img: Add json output option to the info command. · c054b3fd
      Benoît Canet authored
      This option --output=[human|json] make qemu-img info output on
      human or JSON representation at the choice of the user.
      
      example:
      {
          "snapshots": [
              {
                  "vm-clock-nsec": 637102488,
                  "name": "vm-20120821145509",
                  "date-sec": 1345553709,
                  "date-nsec": 220289000,
                  "vm-clock-sec": 20,
                  "id": "1",
                  "vm-state-size": 96522745
              },
              {
                  "vm-clock-nsec": 28210866,
                  "name": "vm-20120821154059",
                  "date-sec": 1345556459,
                  "date-nsec": 171392000,
                  "vm-clock-sec": 46,
                  "id": "2",
                  "vm-state-size": 101208714
              }
          ],
          "virtual-size": 1073741824,
          "filename": "snap.qcow2",
          "cluster-size": 65536,
          "format": "qcow2",
          "actual-size": 985587712,
          "dirty-flag": false
      }
      Signed-off-by: default avatarBenoit Canet <benoit@irqsave.net>
      Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
      c054b3fd
    • Benoît Canet's avatar
      qapi: Add SnapshotInfo and ImageInfo. · c249ee68
      Benoît Canet authored
      Signed-off-by: default avatarBenoit Canet <benoit@irqsave.net>
      Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
      c249ee68
    • Jason Baron's avatar
      ahci: properly reset PxCMD on HBA reset · 2a4f4f34
      Jason Baron authored
      While testing q35, I found that windows 7 (specifically, windows 7 ultimate
      with sp1 x64), wouldn't install because it can't find the cdrom or disk drive.
      The failure message is: 'A required cd/dvd device driver is missing. If you
      have a driver floppy disk, CD, DVD, or USB flash drive, please insert it now.'
      This can also be reproduced on piix by adding an ahci controller, and
      observing that windows 7 does not see any devices behind it.
      
      The problem is that when windows issues a HBA reset, qemu does not reset the
      individual ports' PxCMD register. Windows 7 then reads back the PxCMD register
      and presumably assumes that the ahci controller has already been initialized.
      Windows then never sets up the PxIE register to enable interrupts, and thus it
      never gets irqs back when it sends ata device inquiry commands.
      
      This change brings qemu into ahci 1.3 specification compliance.
      
      Section 10.4.3 HBA Reset:
      
      "
      When GHC.HR is set to '1', GHC.AE, GHC.IE, the IS register, and all port
      register fields (except PxFB/PxFBU/PxCLB/PxCLBU) that are not HwInit in the
      HBA's register memory space are reset.
      "
      
      I've also re-tested Fedora 16 and 17 to verify that they continue to work with
      this change.
      Signed-off-by: default avatarJason Baron <jbaron@redhat.com>
      Acked-by: default avatarAlexander Graf <agraf@suse.de>
      Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
      2a4f4f34
    • Pavel Hrdina's avatar
      block: fix block tray status · 9ca11154
      Pavel Hrdina authored
      The tray status should change also if you eject empty block device.
      Signed-off-by: default avatarPavel Hrdina <phrdina@redhat.com>
      Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
      9ca11154
    • Stefan Weil's avatar
      vdi: Fix warning from clang · 514f21a5
      Stefan Weil authored
      ccc-analyzer reports these warnings:
      
      block/vdi.c:704:13: warning: Dereference of null pointer
                  bmap[i] = VDI_UNALLOCATED;
                  ^
      block/vdi.c:702:13: warning: Dereference of null pointer
                  bmap[i] = i;
                  ^
      
      Moving some code into the if block fixes this.
      It also avoids calling function write with 0 bytes of data.
      Signed-off-by: default avatarStefan Weil <sw@weilnetz.de>
      Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
      514f21a5
    • Stefan Weil's avatar
      block/curl: Fix wrong free statement · 45724d6d
      Stefan Weil authored
      Report from smatch:
      block/curl.c:546 curl_close(21) info: redundant null check on s->url calling free()
      
      The check was redundant, and free was also wrong because the memory
      was allocated using g_strdup.
      Signed-off-by: default avatarStefan Weil <sw@weilnetz.de>
      Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
      45724d6d
    • Stefan Weil's avatar
      ide: Fix error messages from static code analysis (no real error) · 1e53537f
      Stefan Weil authored
      Report from smatch:
      hw/ide/core.c:1472 ide_exec_cmd(423) error: buffer overflow 'smart_attributes' 8 <= 29
      hw/ide/core.c:1474 ide_exec_cmd(425) error: buffer overflow 'smart_attributes' 8 <= 29
      hw/ide/core.c:1475 ide_exec_cmd(426) error: buffer overflow 'smart_attributes' 8 <= 29
      ...
      
      The upper limit of 30 was never reached because both for loops terminated
      when 'smart_attributes' reached end of list, so there was no real buffer
      overflow.
      
      Nevertheless, changing the code not only fixes the error report, but also
      reduces the size of smart_attributes and simplifies the for loops.
      Signed-off-by: default avatarStefan Weil <sw@weilnetz.de>
      Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
      1e53537f
    • Ronnie Sahlberg's avatar
      ATAPI: STARTSTOPUNIT only eject/load media if powercondition is 0 · ce560dcf
      Ronnie Sahlberg authored
      The START STOP UNIT command will only eject/load media if
      power condition is zero.
      
      If power condition is !0 then LOEJ and START will be ignored.
      
      From MMC (sbc contains similar wordings too)
        The Power Conditions field requests the block device to be placed
        in the power condition defined in
        Table 558. If this field has a value other than 0h then the Start
        and LoEj bits shall be ignored.
      Signed-off-by: default avatarRonnie Sahlberg <ronniesahlberg@gmail.com>
      Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
      ce560dcf
    • MORITA Kazutaka's avatar
      sheepdog: fix savevm and loadvm · 1f7a48de
      MORITA Kazutaka authored
      This patch sets data to be sent to Sheepdog correctly and fixes savevm
      and loadvm operations on a Sheepdog image.
      Signed-off-by: default avatarMORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
      Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
      1f7a48de
  2. 11 Sep, 2012 10 commits
  3. 10 Sep, 2012 21 commits