1. 28 3月, 2017 10 次提交
    • M
      rbd: Clean up after the previous commit · 8efb339d
      Markus Armbruster 提交于
      This code in qemu_rbd_parse_filename()
      
          found_str = qemu_rbd_next_tok(p, '\0', &p);
          p = found_str;
      
      has no effect.  Drop it, and simplify qemu_rbd_next_tok().
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NMax Reitz <mreitz@redhat.com>
      Reviewed-by: NJeff Cody <jcody@redhat.com>
      Message-id: 1490691368-32099-5-git-send-email-armbru@redhat.com
      Signed-off-by: NJeff Cody <jcody@redhat.com>
      8efb339d
    • M
      rbd: Don't limit length of parameter values · 730b00bb
      Markus Armbruster 提交于
      We laboriously enforce that parameter values are between one and some
      arbitrary limit in length.  Only RBD_MAX_IMAGE_NAME_SIZE comes from
      librbd.h, and I'm not sure it applies.  Where the other limits come
      from is unclear.
      
      Drop the length checking.  The limits librbd actually imposes must be
      checked by librbd anyway.
      
      There's one minor complication: BDRVRBDState member name is a
      fixed-size array.  Depends on the length limit.  Make it a pointer to
      a dynamically allocated string.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NMax Reitz <mreitz@redhat.com>
      Reviewed-by: NJeff Cody <jcody@redhat.com>
      Message-id: 1490691368-32099-4-git-send-email-armbru@redhat.com
      Signed-off-by: NJeff Cody <jcody@redhat.com>
      730b00bb
    • M
      rbd: Fix to cleanly reject -drive without pool or image · f51c363c
      Markus Armbruster 提交于
      qemu_rbd_open() neglects to check pool and image are present.  Missing
      image is caught by rbd_open(), but missing pool crashes.  Reproducer:
      
          $ qemu-system-x86_64 -nodefaults -drive driver=rbd,id=rbd,image=i,...
          terminate called after throwing an instance of 'std::logic_error'
            what():  basic_string::_M_construct null not valid
          Aborted (core dumped)
      
      where ... is a working server.0.{host,port} configuration.
      
      Doesn't affect -drive with file=..., because qemu_rbd_parse_filename()
      always sets both pool and image.
      
      Doesn't affect -blockdev, because pool and image are mandatory in the
      QAPI schema.
      
      Fix by adding the missing checks.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NMax Reitz <mreitz@redhat.com>
      Reviewed-by: NJeff Cody <jcody@redhat.com>
      Message-id: 1490691368-32099-3-git-send-email-armbru@redhat.com
      Signed-off-by: NJeff Cody <jcody@redhat.com>
      f51c363c
    • M
      rbd: Reject -blockdev server.*.{numeric, to, ipv4, ipv6} · eb87203b
      Markus Armbruster 提交于
      We use InetSocketAddress in the QAPI schema.  However, the code
      doesn't use inet_connect_saddr(), but formats "host" and "port" into a
      configuration string for rados_conf_set().  Thus, members "numeric",
      "to", "ipv4" and "ipv6" are silently ignored.  Not nice.  Example:
      
          -blockdev rbd,node-name=nn,pool=p,image=i,server.0.host=h0,server.0.port=12345,server.0.ipv4=off
      
      Factor a suitable InetSocketAddressBase out of InetSocketAddress, and
      use that.  "numeric", "to", "ipv4" and "ipv6" are now rejected.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NMax Reitz <mreitz@redhat.com>
      Reviewed-by: NJeff Cody <jcody@redhat.com>
      Message-id: 1490691368-32099-2-git-send-email-armbru@redhat.com
      Signed-off-by: NJeff Cody <jcody@redhat.com>
      eb87203b
    • P
      Merge remote-tracking branch 'remotes/stefanha/tags/block-pull-request' into staging · 142b9ca5
      Peter Maydell 提交于
      # gpg: Signature made Tue 28 Mar 2017 11:07:02 BST
      # gpg:                using RSA key 0x9CA4ABB381AB73C8
      # gpg: Good signature from "Stefan Hajnoczi <stefanha@redhat.com>"
      # gpg:                 aka "Stefan Hajnoczi <stefanha@gmail.com>"
      # Primary key fingerprint: 8695 A8BF D3F9 7CDA AC35  775A 9CA4 ABB3 81AB 73C8
      
      * remotes/stefanha/tags/block-pull-request:
        parallels: wrong call to bdrv_truncate
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      142b9ca5
    • D
      parallels: wrong call to bdrv_truncate · dc62da88
      Denis V. Lunev 提交于
      Parallels driver should not call bdrv_truncate if the image was opened
      in the read-only mode. Without the patch
          qemu-img check harddisk.hds
      asserts with
          bdrv_truncate: Assertion `child->perm & BLK_PERM_RESIZE' failed.
      
      Parameters used on the write path are not needed if the image is opened
      in the read-only mode.
      Signed-off-by: NDenis V. Lunev <den@openvz.org>
      Reported-by: NEdgar Kaziahmedov <edos@virtuozzo.mipt.ru>
      Message-id: 1490625488-7980-1-git-send-email-den@openvz.org
      CC: Stefan Hajnoczi <stefanha@redhat.com>
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      dc62da88
    • P
      Merge remote-tracking branch 'remotes/gkurz/tags/for-upstream' into staging · 8c9ee217
      Peter Maydell 提交于
      This series fixes potential memory/fd leaks in 9pfs and a crash when
      running tests/virtio-9p-test on SPARC hosts.
      
      # gpg: Signature made Tue 28 Mar 2017 09:44:05 BST
      # gpg:                using DSA key 0x02FC3AEB0101DBC2
      # gpg: Good signature from "Greg Kurz <groug@kaod.org>"
      # gpg:                 aka "Greg Kurz <groug@free.fr>"
      # gpg:                 aka "Greg Kurz <gkurz@linux.vnet.ibm.com>"
      # gpg:                 aka "Gregory Kurz (Groug) <groug@free.fr>"
      # gpg:                 aka "[jpeg image of size 3330]"
      # gpg: WARNING: This key is not certified with a trusted signature!
      # gpg:          There is no indication that the signature belongs to the owner.
      # Primary key fingerprint: 2BD4 3B44 535E C0A7 9894  DBA2 02FC 3AEB 0101 DBC2
      
      * remotes/gkurz/tags/for-upstream:
        tests/virtio-9p-test: Don't call le*_to_cpus on fields of packed struct
        9pfs: fix file descriptor leak
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      8c9ee217
    • P
      tests/virtio-9p-test: Don't call le*_to_cpus on fields of packed struct · 34ef723c
      Peter Maydell 提交于
      For a packed struct like 'P9Hdr' the fields within it may not be
      aligned as much as the natural alignment for their types.  This means
      it is not valid to pass the address of such a field to a function
      like le32_to_cpus() which operate on uint32_t* and assume alignment.
      Doing this results in a SIGBUS on hosts like SPARC which have strict
      alignment requirements.
      
      Use ldl_le_p() instead, which is specified to correctly handle
      unaligned pointers.
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      Reviewed-by: NGreg Kurz <groug@kaod.org>
      Signed-off-by: NGreg Kurz <groug@kaod.org>
      34ef723c
    • L
      9pfs: fix file descriptor leak · d63fb193
      Li Qiang 提交于
      The v9fs_create() and v9fs_lcreate() functions are used to create a file
      on the backend and to associate it to a fid. The fid shouldn't be already
      in-use, otherwise both functions may silently leak a file descriptor or
      allocated memory. The current code doesn't check that.
      
      This patch ensures that the fid isn't already associated to anything
      before using it.
      Signed-off-by: NLi Qiang <liqiang6-s@360.cn>
      (reworded the changelog, Greg Kurz)
      Signed-off-by: NGreg Kurz <groug@kaod.org>
      d63fb193
    • P
      Merge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into staging · eb06c9e2
      Peter Maydell 提交于
      * MTTCG fix for win32
      * virtio-scsi assertion failure
      * mem-prealloc coverity fix
      * x86 migration revert which requires more thought
      * x86 instruction limit (avoids >2 page translation blocks)
      * nbd dead code cleanup
      * small memory.c logic fix
      
      # gpg: Signature made Mon 27 Mar 2017 17:03:04 BST
      # gpg:                using RSA key 0xBFFBD25F78C7AE83
      # gpg: Good signature from "Paolo Bonzini <bonzini@gnu.org>"
      # gpg:                 aka "Paolo Bonzini <pbonzini@redhat.com>"
      # Primary key fingerprint: 46F5 9FBD 57D6 12E7 BFD4  E2F7 7E15 100C CD36 69B1
      #      Subkey fingerprint: F133 3857 4B66 2389 866C  7682 BFFB D25F 78C7 AE83
      
      * remotes/bonzini/tags/for-upstream:
        scsi-generic: Fill in opt_xfer_len in INQUIRY reply if it is zero
        Revert "apic: save apic_delivered flag"
        nbd: drop unused NBDClientSession.is_unix field
        win32: replace custom mutex and condition variable with native primitives
        mem-prealloc: fix sysconf(_SC_NPROCESSORS_ONLN) failure case.
        tcg/i386: Check the size of instruction being translated
        virtio-scsi: Fix acquire/release in dataplane handlers
        virtio-scsi: Make virtio_scsi_acquire/release public
        clear pending status before calling memory commit
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      eb06c9e2
  2. 27 3月, 2017 17 次提交
  3. 24 3月, 2017 13 次提交