1. 17 Nov, 2014 1 commit
  2. 02 Nov, 2014 1 commit
  3. 09 Oct, 2014 2 commits
  4. 03 Oct, 2014 1 commit
    • Markus Armbruster's avatar
      util: Emancipate id_wellformed() from QemuOpts · f5bebbbb
      Markus Armbruster authored
      IDs have long spread beyond QemuOpts: not everything with an ID
      necessarily goes through QemuOpts.  Commit 9aebf3b8 is about such a
      case: block layer names are meant to be well-formed IDs, but some of
      them don't go through QemuOpts, and thus weren't checked.  The commit
      fixed that the straightforward way: rename the internal QemuOpts
      helper id_wellformed() to qemu_opts_id_wellformed() and give it
      external linkage.
      
      Instead of using it directly in block.c, the commit adds wrapper
      bdrv_is_valid_name(), probably to hide the connection to QemuOpts.
      
      Go one logical step further: emancipate IDs from QemuOpts.  Rename the
      function back to id_wellformed(), and put it in another file.  While
      there, clean up its value to bool.  Peel off the bdrv_is_valid_name()
      wrapper.
      
      [Replaced stray return 0 with return false to match bool returns used
      elsewhere in id_wellformed().
      --Stefan]
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Signed-off-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
      f5bebbbb
  5. 26 Sep, 2014 1 commit
  6. 25 Sep, 2014 1 commit
    • Kevin Wolf's avatar
      block: Validate node-name · 9aebf3b8
      Kevin Wolf authored
      The device_name of a BlockDriverState is currently checked because it is
      always used as a QemuOpts ID and qemu_opts_create() checks whether such
      IDs are wellformed.
      
      node-name is supposed to share the same namespace, but it isn't checked
      currently. This patch adds explicit checks both for device_name and
      node-name so that the same rules will still apply even if QemuOpts won't
      be used any more at some point.
      
      qemu-img used to use names with spaces in them, which isn't allowed any
      more. Replace them with underscores.
      Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
      Reviewed-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
      9aebf3b8
  7. 16 Sep, 2014 1 commit
    • Peter Maydell's avatar
      util/qemu-sockets.c: Support specifying IPv4 or IPv6 in socket_dgram() · 8287fea3
      Peter Maydell authored
      Currently you can specify whether you want a UDP chardev backend
      to be IPv4 or IPv6 using the ipv4 or ipv6 options if you use the
      QemuOpts parsing code in inet_dgram_opts(). However the QMP struct
      parsing code in socket_dgram() doesn't provide this flexibility
      (which in turn prevents us from converting the UDP backend handling
      to the new style QAPI framework).
      
      Use the existing inet_addr_to_opts() function to convert the
      remote->inet address to option strings; this handles ipv4 and
      ipv6 flags as well as host and port. (It will also convert any
      'to' specification, which is harmless as it is ignored in this
      context.)
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      Message-id: 1409653457-27863-3-git-send-email-peter.maydell@linaro.org
      8287fea3
  8. 09 Sep, 2014 2 commits
  9. 24 Aug, 2014 1 commit
  10. 15 Aug, 2014 2 commits
  11. 18 Jul, 2014 2 commits
  12. 14 Jul, 2014 1 commit
    • Kevin Wolf's avatar
      dma-helpers: Fix too long qiov · 58f423fb
      Kevin Wolf authored
      If the size of the scatter/gather list isn't a multiple of 512, the
      number of sectors for the block layer request is rounded down, resulting
      in a qiov that doesn't match the request length. Truncate the qiov to the
      new length of the request.
      
      This fixes the IDE qtest case /x86_64/ide/bmdma/short_prdt.
      Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
      Reviewed-by: default avatarEric Blake <eblake@redhat.com>
      58f423fb
  13. 10 Jul, 2014 1 commit
    • Stefan Weil's avatar
      oslib-posix: Fix new compiler error with -Wclobbered · b7bf8f56
      Stefan Weil authored
      Newer versions of gcc report a warning (or an error with -Werror) when
      compiler option -Wclobbered (or -Wextra) is active:
      
      util/oslib-posix.c:372:12: error:
       variable ‘hpagesize’ might be clobbered by ‘longjmp’ or ‘vfork’ [-Werror=clobbered]
      
      The rewritten code fixes this warning: variable 'hpagesize' is now set and
      used in a block without any call of sigsetjmp or similar functions.
      Signed-off-by: default avatarStefan Weil <sw@weilnetz.de>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      b7bf8f56
  14. 26 Jun, 2014 1 commit
    • Michal Privoznik's avatar
      qemu_opts_append: Play nicely with QemuOptsList's head · a7607150
      Michal Privoznik authored
      When running a libvirt test suite I've noticed the qemu-img is
      crashing occasionally. Tracing the problem down led me to the
      following valgrind output:
      
      qemu.git $ valgrind -q ./qemu-img create -f qed -obacking_file=/dev/null,backing_fmt=raw qed
      ==14881== Invalid write of size 8
      ==14881==    at 0x1D263F: qemu_opts_create (qemu-option.c:692)
      ==14881==    by 0x130782: bdrv_img_create (block.c:5531)
      ==14881==    by 0x118DE0: img_create (qemu-img.c:462)
      ==14881==    by 0x11E7E4: main (qemu-img.c:2830)
      ==14881==  Address 0x11fedd38 is 24 bytes inside a block of size 232 free'd
      ==14881==    at 0x4C2CA5E: realloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
      ==14881==    by 0x592D35E: g_realloc (in /usr/lib64/libglib-2.0.so.0.3800.2)
      ==14881==    by 0x1D38D8: qemu_opts_append (qemu-option.c:1129)
      ==14881==    by 0x13075E: bdrv_img_create (block.c:5528)
      ==14881==    by 0x118DE0: img_create (qemu-img.c:462)
      ==14881==    by 0x11E7E4: main (qemu-img.c:2830)
      ==14881==
      Formatting 'qed', fmt=qed size=0 backing_file='/dev/null' backing_fmt='raw' cluster_size=65536
      ==14881== Invalid write of size 8
      ==14881==    at 0x1D28BE: qemu_opts_del (qemu-option.c:750)
      ==14881==    by 0x130BF3: bdrv_img_create (block.c:5638)
      ==14881==    by 0x118DE0: img_create (qemu-img.c:462)
      ==14881==    by 0x11E7E4: main (qemu-img.c:2830)
      ==14881==  Address 0x11fedd38 is 24 bytes inside a block of size 232 free'd
      ==14881==    at 0x4C2CA5E: realloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
      ==14881==    by 0x592D35E: g_realloc (in /usr/lib64/libglib-2.0.so.0.3800.2)
      ==14881==    by 0x1D38D8: qemu_opts_append (qemu-option.c:1129)
      ==14881==    by 0x13075E: bdrv_img_create (block.c:5528)
      ==14881==    by 0x118DE0: img_create (qemu-img.c:462)
      ==14881==    by 0x11E7E4: main (qemu-img.c:2830)
      ==14881==
      
      The problem is apparently in the qemu_opts_append(). Well, if it
      gets called twice or more. On the first call, when @dst is NULL
      some initialization is done during which @dst->head list gets
      initialized. The list is initialized in a way, so that the list
      tail points at the list head. However, the next time
      qemu_opts_append() is called for new options to be added,
      g_realloc() may move @dst to a new address making the old list tail
      point at an invalid address. If that's the case, we must update the
      list pointers.
      Signed-off-by: default avatarMichal Privoznik <mprivozn@redhat.com>
      Reviewed-by: default avatarEric Blake <eblake@redhat.com>
      Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
      a7607150
  15. 23 Jun, 2014 4 commits
  16. 21 Jun, 2014 1 commit
  17. 19 Jun, 2014 2 commits
  18. 18 Jun, 2014 1 commit
  19. 16 Jun, 2014 14 commits