1. 25 9月, 2015 2 次提交
  2. 14 9月, 2015 15 次提交
  3. 11 9月, 2015 2 次提交
  4. 08 9月, 2015 1 次提交
  5. 05 9月, 2015 5 次提交
  6. 02 9月, 2015 1 次提交
    • W
      block: more check for replaced node · e12f3784
      Wen Congyang 提交于
      We use mirror+replace to fix quorum's broken child. bs/s->common.bs
      is quorum, and to_replace is the broken child. The new child is target_bs.
      Without this patch, the replace node can be any node, and it can be
      top BDS with BB, or another quorum's child. We just check if the broken
      child is part of the quorum BDS in this patch.
      Signed-off-by: NWen Congyang <wency@cn.fujitsu.com>
      Message-id: 55A86486.1000404@cn.fujitsu.com
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      e12f3784
  7. 14 8月, 2015 1 次提交
    • K
      mirror: Fix coroutine reentrance · e424aff5
      Kevin Wolf 提交于
      This fixes a regression introduced by commit dcfb3beb ("mirror: Do zero
      write on target if sectors not allocated"), which was reported to cause
      aborts with the message "Co-routine re-entered recursively".
      
      The cause for this bug is the following code in mirror_iteration_done():
      
          if (s->common.busy) {
              qemu_coroutine_enter(s->common.co, NULL);
          }
      
      This has always been ugly because - unlike most places that reenter - it
      doesn't have a specific yield that it pairs with, but is more
      uncontrolled.  What we really mean here is "reenter the coroutine if
      it's in one of the four explicit yields in mirror.c".
      
      This used to be equivalent with s->common.busy because neither
      mirror_run() nor mirror_iteration() call any function that could yield.
      However since commit dcfb3beb this doesn't hold true any more:
      bdrv_get_block_status_above() can yield.
      
      So what happens is that bdrv_get_block_status_above() wants to take a
      lock that is already held, so it adds itself to the queue of waiting
      coroutines and yields. Instead of being woken up by the unlock function,
      however, it gets woken up by mirror_iteration_done(), which is obviously
      wrong.
      
      In most cases the code actually happens to cope fairly well with such
      cases, but in this specific case, the unlock must already have scheduled
      the coroutine for wakeup when mirror_iteration_done() reentered it. And
      then the coroutine happened to process the scheduled restarts and tried
      to reenter itself recursively.
      
      This patch fixes the problem by pairing the reenter in
      mirror_iteration_done() with specific yields instead of abusing
      s->common.busy.
      
      Cc: qemu-stable@nongnu.org
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      Reviewed-by: NPaolo Bonzini <pbonzini@redhat.com>
      Reviewed-by: NStefan Hajnoczi <stefanha@redhat.com>
      Reviewed-by: NJeff Cody <jcody@redhat.com>
      Message-id: 1439455310-11263-1-git-send-email-kwolf@redhat.com
      Signed-off-by: NJeff Cody <jcody@redhat.com>
      e424aff5
  8. 06 8月, 2015 1 次提交
    • S
      block/mirror: limit qiov to IOV_MAX elements · cae98cb8
      Stefan Hajnoczi 提交于
      If mirror has more free buffers than IOV_MAX, preadv(2)/pwritev(2)
      EINVAL failures may be encountered.
      
      It is possible to trigger this by setting granularity to a low value
      like 8192.
      
      This patch stops appending chunks once IOV_MAX is reached.
      
      The spurious EINVAL failure can be reproduced with a qcow2 image file
      and the following QMP invocation:
      
        qmp.command('drive-mirror', device='virtio0', target='/tmp/r7.s1',
                    granularity=8192, sync='full', mode='absolute-paths',
                    format='raw')
      
      While the guest is running dd if=/dev/zero of=/var/tmp/foo oflag=direct
      bs=4k.
      
      Cc: Jeff Cody <jcody@redhat.com>
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      Reviewed-by: NPaolo Bonzini <pbonzini@redhat.com>
      Message-id: 1435761950-26714-1-git-send-email-stefanha@redhat.com
      Signed-off-by: NJeff Cody <jcody@redhat.com>
      cae98cb8
  9. 05 8月, 2015 1 次提交
  10. 28 7月, 2015 2 次提交
    • R
      block/ssh: Avoid segfault if inet_connect doesn't set errno. · 325e3904
      Richard W.M. Jones 提交于
      On some (but not all) systems:
      
        $ qemu-img create -f qcow2 overlay -b ssh://xen/
        Segmentation fault
      
      It turns out this happens when inet_connect returns -1 in the
      following code, but errno == 0.
      
        s->sock = inet_connect(s->hostport, errp);
        if (s->sock < 0) {
            ret = -errno;
            goto err;
        }
      
      In the test case above, no host called "xen" exists, so getaddrinfo fails.
      
      On Fedora 22, getaddrinfo happens to set errno = ENOENT (although it
      is *not* documented to do that), so it doesn't segfault.
      
      On RHEL 7, errno is not set by the failing getaddrinfo, so ret =
      -errno = 0, so the caller doesn't know there was an error and
      continues with a half-initialized BDRVSSHState struct, and everything
      goes south from there, eventually resulting in a segfault.
      
      Fix this by setting ret to -EIO (same as block/nbd.c and
      block/sheepdog.c).  The real error is saved in the Error** errp
      struct, so it is printed correctly:
      
        $ ./qemu-img create -f qcow2 overlay -b ssh://xen/
        qemu-img: overlay: address resolution failed for xen:22: No address associated with hostname
      Signed-off-by: NRichard W.M. Jones <rjones@redhat.com>
      Reported-by: Jun Li
      BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1147343Signed-off-by: NJeff Cody <jcody@redhat.com>
      325e3904
    • H
      sheepdog: serialize requests to overwrapping area · 6a55c82c
      Hitoshi Mitake 提交于
      Current sheepdog driver only serializes create requests in oid
      unit. This mechanism isn't enough for handling requests to
      overwrapping area spanning multiple oids, so it can result bugs like
      below:
      https://bugs.launchpad.net/sheepdog-project/+bug/1456421
      
      This patch adds a new serialization mechanism for the problem. The
      difference from the old one is:
      1. serialize entire aiocb if their targetting areas overwrap
      2. serialize all requests (read, write, and discard), not only creates
      
      This patch also removes the old mechanism because the new one can be
      an alternative.
      
      Cc: Kevin Wolf <kwolf@redhat.com>
      Cc: Stefan Hajnoczi <stefanha@redhat.com>
      Cc: Teruaki Ishizaki <ishizaki.teruaki@lab.ntt.co.jp>
      Cc: Vasiliy Tolstov <v.tolstov@selfip.ru>
      Signed-off-by: NHitoshi Mitake <mitake.hitoshi@lab.ntt.co.jp>
      Tested-by: NVasiliy Tolstov <v.tolstov@selfip.ru>
      Signed-off-by: NJeff Cody <jcody@redhat.com>
      6a55c82c
  11. 27 7月, 2015 1 次提交
    • J
      block: vpc - prevent overflow if max_table_entries >= 0x40000000 · b15deac7
      Jeff Cody 提交于
      When we allocate the pagetable based on max_table_entries, we multiply
      the max table entry value by 4 to accomodate a table of 32-bit integers.
      However, max_table_entries is a uint32_t, and the VPC driver accepts
      ranges for that entry over 0x40000000.  So during this allocation:
      
      s->pagetable = qemu_try_blockalign(bs->file, s->max_table_entries * 4);
      
      The size arg overflows, allocating significantly less memory than
      expected.
      
      Since qemu_try_blockalign() size argument is size_t, cast the
      multiplication correctly to prevent overflow.
      
      The value of "max_table_entries * 4" is used elsewhere in the code as
      well, so store the correct value for use in all those cases.
      
      We also check the Max Tables Entries value, to make sure that it is <
      SIZE_MAX / 4, so we know the pagetable size will fit in size_t.
      
      Cc: qemu-stable@nongnu.org
      Reported-by: NRichard W.M. Jones <rjones@redhat.com>
      Signed-off-by: NJeff Cody <jcody@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      b15deac7
  12. 22 7月, 2015 1 次提交
  13. 15 7月, 2015 4 次提交
  14. 14 7月, 2015 3 次提交