Skip to content
Snippets Groups Projects
  1. Apr 26, 2022
  2. Apr 25, 2022
    • Richard Henderson's avatar
      Merge tag 'pull-block-2022-04-25' of https://gitlab.com/hreitz/qemu into staging · a1755db7
      Richard Henderson authored
      Block patches:
      - New @force parameter for blockdev-change-medium
      - Improvements to the iotests to help with debugging
      - Fix iotest 108 on systems without user_allow_other in fuse.conf
      
      # -----BEGIN PGP SIGNATURE-----
      #
      # iQJGBAABCAAwFiEEy2LXoO44KeRfAE00ofpA0JgBnN8FAmJmqyISHGhyZWl0ekBy
      # ZWRoYXQuY29tAAoJEKH6QNCYAZzf7uEP/RKNblyIuFjHkPgaMzWqdGUjHpbRzKBi
      # NFgO+ISRCSx/KXYBaanJP94qKLfpACJ1JHDUD3hipeO3kmVGmtF93cKypTQS4qhL
      # bGmX+h38AK1omSR2iWRhu4ue4VAPeu9gLoHNYJ5vZlylWD3eHdppN7K2KFf7Aeo5
      # /BnhwHiU2IQ7WkLlo5Pdb96+LqZfmCGYJGWO6eWx123+j+bpjLfpmV9+Kjzb1pDc
      # FN60OFlp8RozXHKpqh4ZoThtJ+t3sYdlo6yvg1K18Y5JcXTx5d4D24HGo1ZIRxqz
      # XgJbi+bSr8hnxCjvdUZlr3IpbjAE5DVbCjtDxyjGnim6vjIwhxCSWM7Bvzw2tm60
      # TYNl2zxyIe5831v6Xv/YfYJFqtos/orZf87TSqx/uWrfinbxZ1nN/8zi5z9lC8tg
      # S6IlNpKPK0wv33BmLVHcsnMABLY2YiJPx/Ngl0CvAEGvkQdaHzgcYGbmeEMrZTv7
      # hVpBb1t+AKmnXYYZdCh4ulfJLUg3R9mXf0oI3otbcpNMwExB6hqcVI23VYC00Ct5
      # m3Tb6bddIkBih25l9B7i6FPWfXG+0zu6Q4kIQiXmfNkqKseQ96aDY1aAU/GWoTZH
      # MOOPqIhmLRgyYpJ3+am9AseczaMybC4DIfx1VXzjwS/X3YwHvHEbZ7iPR6C0630Z
      # yslJbuH4ERl7
      # =url0
      # -----END PGP SIGNATURE-----
      # gpg: Signature made Mon 25 Apr 2022 07:07:30 AM PDT
      # gpg:                using RSA key CB62D7A0EE3829E45F004D34A1FA40D098019CDF
      # gpg:                issuer "hreitz@redhat.com"
      # gpg: Good signature from "Hanna Reitz <hreitz@redhat.com>" [undefined]
      # 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: CB62 D7A0 EE38 29E4 5F00  4D34 A1FA 40D0 9801 9CDF
      
      * tag 'pull-block-2022-04-25' of https://gitlab.com/hreitz/qemu
      
      :
        iotests/108: Fix when missing user_allow_other
        iotests: make qemu_io_log() check return codes by default
        iotests: remove qemu_io_silent() and qemu_io_silent_check().
        iotests: remove qemu_io_pipe_and_status()
        iotests/image-fleecing: switch to qemu_io()
        iotests/migration-permissions: use assertRaises() for qemu_io() negative test
        iotests: rebase qemu_io() on top of qemu_tool()
        iotests: create generic qemu_tool() function
        iotests/040: Fix TestCommitWithFilters test
        iotests/040: Don't check image pattern on zero-length image
        iotests: Don't check qemu_io() output for specific error strings
        iotests/163: Fix broken qemu-io invocation
        iotests: replace calls to log(qemu_io(...)) with qemu_io_log()
        block: add 'force' parameter to 'blockdev-change-medium' command
      
      Signed-off-by: default avatarRichard Henderson <richard.henderson@linaro.org>
      a1755db7
    • Richard Henderson's avatar
      Merge tag 'block-pull-request' of https://gitlab.com/stefanha/qemu into staging · c49abc84
      Richard Henderson authored
      Pull request
      
      Small contrib/vhost-user-blk, contrib/vhost-user-scsi, and tools/virtiofsd
      improvements.
      
      # -----BEGIN PGP SIGNATURE-----
      #
      # iQEzBAABCAAdFiEEhpWov9P5fNqsNXdanKSrs4Grc8gFAmJmYGYACgkQnKSrs4Gr
      # c8gNIAgAgCEeBMP61cdT8DGBBw26abmrNmCCjXYL3rNcR2GNsn0x9VbedBhSPt9O
      # z+/nej9UkRKHgQ/+V1LqWD2D/TU327nLQ74z1JJvGtjWhvM18XTTAeh1BQbVywKU
      # z+o6WSyP22Xx87cUIuOGGMgNDDfIY2j/t5sU8eR+lxXxDuKXx3tulTV65QlNSw9z
      # 19rb8eJkaau5YWhN5gPEI65O/YVgGUtA+c5z39AoBG85XAAhm+6+mTFfuy8J8gp/
      # wqr61+xB7bB3AxIOv1/0PWCl3F/+kPs7ybJRGkHMNtKyJtp34Y86kwsVEBtOMGVO
      # wm/ht7FMy2GhnaKGjNMtvJm29ZArqA==
      # =zZcV
      # -----END PGP SIGNATURE-----
      # gpg: Signature made Mon 25 Apr 2022 01:48:38 AM PDT
      # gpg:                using RSA key 8695A8BFD3F97CDAAC35775A9CA4ABB381AB73C8
      # gpg: Good signature from "Stefan Hajnoczi <stefanha@redhat.com>" [full]
      # gpg:                 aka "Stefan Hajnoczi <stefanha@gmail.com>" [full]
      
      * tag 'block-pull-request' of https://gitlab.com/stefanha/qemu
      
      :
        virtiofsd: Add docs/helper for killpriv_v2/no_killpriv_v2 option
        contrib/vhost-user-blk: add missing GOptionEntry NULL terminator
        Implements Backend Program conventions for vhost-user-scsi
      
      Signed-off-by: default avatarRichard Henderson <richard.henderson@linaro.org>
      c49abc84
    • Hanna Reitz's avatar
      iotests/108: Fix when missing user_allow_other · 348a0740
      Hanna Reitz authored
      
      FUSE exports' allow-other option defaults to "auto", which means that it
      will try passing allow_other as a mount option, and fall back to not
      using it when an error occurs.  We make no effort to hide fusermount's
      error message (because it would be difficult, and because users might
      want to know about the fallback occurring), and so when allow_other does
      not work (primarily when /etc/fuse.conf does not contain
      user_allow_other), this error message will appear and break the
      reference output.
      
      We do not need allow_other here, though, so we can just pass
      allow-other=off to fix that.
      
      Reported-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Signed-off-by: default avatarHanna Reitz <hreitz@redhat.com>
      Message-Id: <20220421142435.569600-1-hreitz@redhat.com>
      Tested-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Tested-by: default avatarEric Blake <eblake@redhat.com>
      348a0740
    • John Snow's avatar
      iotests: make qemu_io_log() check return codes by default · 40bfeae1
      John Snow authored
      
      Just like qemu_img_log(), upgrade qemu_io_log() to enforce a return code
      of zero by default.
      
      Tests that use qemu_io_log(): 242 245 255 274 303 307 nbd-reconnect-on-open
      
      Signed-off-by: default avatarJohn Snow <jsnow@redhat.com>
      Reviewed-by: default avatarEric Blake <eblake@redhat.com>
      Reviewed-by: default avatarHanna Reitz <hreitz@redhat.com>
      Message-Id: <20220418211504.943969-13-jsnow@redhat.com>
      Signed-off-by: default avatarHanna Reitz <hreitz@redhat.com>
      40bfeae1
    • John Snow's avatar
      iotests: remove qemu_io_silent() and qemu_io_silent_check(). · 72cfb937
      John Snow authored
      
      Like qemu-img, qemu-io returning 0 should be the norm and not the
      exception. Remove all calls to qemu_io_silent that just assert the
      return code is zero (That's every last call, as it turns out), and
      replace them with a normal qemu_io() call.
      
      qemu_io_silent_check() appeared to have been unused already.
      
      Signed-off-by: default avatarJohn Snow <jsnow@redhat.com>
      Reviewed-by: default avatarEric Blake <eblake@redhat.com>
      Reviewed-by: default avatarHanna Reitz <hreitz@redhat.com>
      Message-Id: <20220418211504.943969-12-jsnow@redhat.com>
      Signed-off-by: default avatarHanna Reitz <hreitz@redhat.com>
      72cfb937
    • John Snow's avatar
      iotests: remove qemu_io_pipe_and_status() · 23d44dcb
      John Snow authored
      
      I know we just added it, sorry. This is done in favor of qemu_io() which
      *also* returns the console output and status, but with more robust error
      handling on failure.
      
      Signed-off-by: default avatarJohn Snow <jsnow@redhat.com>
      Reviewed-by: default avatarEric Blake <eblake@redhat.com>
      Reviewed-by: default avatarHanna Reitz <hreitz@redhat.com>
      Message-Id: <20220418211504.943969-11-jsnow@redhat.com>
      Signed-off-by: default avatarHanna Reitz <hreitz@redhat.com>
      23d44dcb
    • John Snow's avatar
      iotests/image-fleecing: switch to qemu_io() · db1646a6
      John Snow authored
      
      This test expects failure ... but only sometimes. When? Why?
      
      It's for reads of a region not defined by a bitmap. Adjust the test to
      be more explicit about what it expects to fail and why.
      
      Signed-off-by: default avatarJohn Snow <jsnow@redhat.com>
      Reviewed-by: default avatarEric Blake <eblake@redhat.com>
      Reviewed-by: default avatarHanna Reitz <hreitz@redhat.com>
      Message-Id: <20220418211504.943969-10-jsnow@redhat.com>
      Signed-off-by: default avatarHanna Reitz <hreitz@redhat.com>
      db1646a6
    • John Snow's avatar
      iotests/migration-permissions: use assertRaises() for qemu_io() negative test · 7acb2ddf
      John Snow authored
      
      Modify this test to use assertRaises for its negative testing of
      qemu_io. If the exception raised does not match the one we tell it to
      expect, we get *that* exception unhandled. If we get no exception, we
      get a unittest assertion failure and the provided emsg printed to
      screen.
      
      If we get the CalledProcessError exception but the output is not what we
      expect, we re-raise the original CalledProcessError.
      
      Tidy.
      
      (Note: Yes, you can reference "with" objects after that block ends; it
      just means that ctx.__exit__(...) will have been called on it. It does
      not *actually* go out of scope. unittests expects you to want to inspect
      the Exception object, so they leave it defined post-exit.)
      
      Signed-off-by: default avatarJohn Snow <jsnow@redhat.com>
      Reviewed-by: default avatarEric Blake <eblake@redhat.com>
      Tested-by: default avatarEric Blake <eblake@redhat.com>
      Reviewed-by: default avatarHanna Reitz <hreitz@redhat.com>
      Message-Id: <20220418211504.943969-9-jsnow@redhat.com>
      Signed-off-by: default avatarHanna Reitz <hreitz@redhat.com>
      7acb2ddf
    • John Snow's avatar
      iotests: rebase qemu_io() on top of qemu_tool() · 6dede6a4
      John Snow authored
      
      Rework qemu_io() to be analogous to qemu_img(); a function that requires
      a return code of zero by default unless disabled explicitly.
      
      Tests that use qemu_io():
      030 040 041 044 055 056 093 124 129 132 136 148 149 151 152 163 165 205
      209 219 236 245 248 254 255 257 260 264 280 298 300 302 304
      image-fleecing migrate-bitmaps-postcopy-test migrate-bitmaps-test
      migrate-during-backup migration-permissions
      
      Test that use qemu_io_log():
      242 245 255 274 303 307 nbd-reconnect-on-open
      
      Copy-pastables for testing/verification:
      
      ./check -qcow2 030 040 041 044 055 056 124 129 132 151 152 163 165 209 \
                     219 236 242 245 248 254 255 257 260 264 274 \
                     280 298 300 302 303 304 307 image-fleecing \
                     migrate-bitmaps-postcopy-test migrate-bitmaps-test \
                     migrate-during-backup nbd-reconnect-on-open
      ./check -raw 093 136 148 migration-permissions
      ./check -nbd 205
      
      # ./configure configure --disable-gnutls --enable-gcrypt
      # this ALSO requires passwordless sudo.
      ./check -luks 149
      
      # Just the tests that were edited in this commit:
      ./check -qcow2 030 040 242 245
      ./check -raw migration-permissions
      ./check -nbd 205
      ./check -luks 149
      
      Signed-off-by: default avatarJohn Snow <jsnow@redhat.com>
      Message-Id: <20220418211504.943969-8-jsnow@redhat.com>
      Reviewed-by: default avatarEric Blake <eblake@redhat.com>
      Signed-off-by: default avatarHanna Reitz <hreitz@redhat.com>
      6dede6a4
    • John Snow's avatar
      iotests: create generic qemu_tool() function · b2d68a8e
      John Snow authored
      
      reimplement qemu_img() in terms of qemu_tool() in preparation for doing
      the same with qemu_io().
      
      Signed-off-by: default avatarJohn Snow <jsnow@redhat.com>
      Reviewed-by: default avatarEric Blake <eblake@redhat.com>
      Reviewed-by: default avatarHanna Reitz <hreitz@redhat.com>
      Message-Id: <20220418211504.943969-7-jsnow@redhat.com>
      Signed-off-by: default avatarHanna Reitz <hreitz@redhat.com>
      b2d68a8e
    • John Snow's avatar
      iotests/040: Fix TestCommitWithFilters test · 48976291
      John Snow authored
      
      Without this change, asserting that qemu_io always returns 0 causes this
      test to fail in a way we happened not to be catching previously:
      
       qemu.utils.VerboseProcessError: Command
        '('/home/jsnow/src/qemu/bin/git/tests/qemu-iotests/../../qemu-io',
        '--cache', 'writeback', '--aio', 'threads', '-f', 'qcow2', '-c',
        'read -P 4 3M 1M',
        '/home/jsnow/src/qemu/bin/git/tests/qemu-iotests/scratch/3.img')'
        returned non-zero exit status 1.
        ┏━ output ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
        ┃ qemu-io: can't open device
        ┃ /home/jsnow/src/qemu/bin/git/tests/qemu-iotests/scratch/3.img:
        ┃ Could not open backing file: Could not open backing file: Throttle
        ┃ group 'tg' does not exist
        ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
      
      The commit jobs changes the backing file string stored in the image file
      header belonging to the node above the commit’s top node to point to the
      commit target (the base node).  QEMU tries to be as accurate as
      possible, and so in these test cases will include the filter that is
      part of the block graph in that backing file string (by virtue of making
      it a json:{} description of the post-commit subgraph).  This makes
      little sense outside of QEMU, though: Specifically, the throttle node in
      that subgraph will dearly miss its supposedly associated throttle group
      object.
      
      When starting the commit job, we can specify a custom backing file
      string to write into said image file, so let’s use that feature to write
      the plain filename of the backing chain’s next actual image file there.
      
      Explicitly provide the backing file so that opening the file outside of
      QEMU (Where we will not have throttle groups) will succeed.
      
      Signed-off-by: default avatarHanna Reitz <hreitz@redhat.com>
      Signed-off-by: default avatarJohn Snow <jsnow@redhat.com>
      Reviewed-by: default avatarEric Blake <eblake@redhat.com>
      Message-Id: <20220418211504.943969-6-jsnow@redhat.com>
      48976291
    • John Snow's avatar
      iotests/040: Don't check image pattern on zero-length image · aaa0c0ef
      John Snow authored
      
      qemu-io fails on read/write beyond end-of-file on raw images, so skip
      these invocations when running the zero-length image tests.
      
      Signed-off-by: default avatarJohn Snow <jsnow@redhat.com>
      Reviewed-by: default avatarEric Blake <eblake@redhat.com>
      Reviewed-by: default avatarHanna Reitz <hreitz@redhat.com>
      Message-Id: <20220418211504.943969-5-jsnow@redhat.com>
      Signed-off-by: default avatarHanna Reitz <hreitz@redhat.com>
      aaa0c0ef
    • John Snow's avatar
      iotests: Don't check qemu_io() output for specific error strings · e9039c04
      John Snow authored
      
      A forthcoming commit updates qemu_io() to raise an exception on non-zero
      return by default, and changes its return type.
      
      In preparation, simplify some calls to qemu_io() that assert that
      specific error message strings do not appear in qemu-io's
      output. Asserting that all of these calls return a status code of zero
      will be a more robust way to guard against failure.
      
      Signed-off-by: default avatarJohn Snow <jsnow@redhat.com>
      Reviewed-by: default avatarEric Blake <eblake@redhat.com>
      Reviewed-by: default avatarHanna Reitz <hreitz@redhat.com>
      Message-Id: <20220418211504.943969-4-jsnow@redhat.com>
      Signed-off-by: default avatarHanna Reitz <hreitz@redhat.com>
      e9039c04
    • John Snow's avatar
      iotests/163: Fix broken qemu-io invocation · a1905249
      John Snow authored
      
      The 'read' commands to qemu-io were malformed, and this invocation only
      worked by coincidence because the error messages were identical. Oops.
      
      There's no point in checking the patterning of the reference image, so
      just check the empty image by itself instead.
      
      (Note: as of this commit, nothing actually enforces that this command
      completes successfully, but a forthcoming commit in this series will
      enforce that qemu_io() must have a zero status code.)
      
      Signed-off-by: default avatarJohn Snow <jsnow@redhat.com>
      Reviewed-by: default avatarEric Blake <eblake@redhat.com>
      Reviewed-by: default avatarHanna Reitz <hreitz@redhat.com>
      Message-Id: <20220418211504.943969-3-jsnow@redhat.com>
      Signed-off-by: default avatarHanna Reitz <hreitz@redhat.com>
      a1905249
    • John Snow's avatar
      iotests: replace calls to log(qemu_io(...)) with qemu_io_log() · 093a13ac
      John Snow authored
      
      This makes these callsites a little simpler, but the real motivation is
      a forthcoming commit will change the return type of qemu_io(), so removing
      users of the return value now is helpful.
      
      Signed-off-by: default avatarJohn Snow <jsnow@redhat.com>
      Reviewed-by: default avatarEric Blake <eblake@redhat.com>
      Reviewed-by: default avatarHanna Reitz <hreitz@redhat.com>
      Message-Id: <20220418211504.943969-2-jsnow@redhat.com>
      Signed-off-by: default avatarHanna Reitz <hreitz@redhat.com>
      093a13ac
    • Denis V. Lunev's avatar
      block: add 'force' parameter to 'blockdev-change-medium' command · 80dd5aff
      Denis V. Lunev authored
      
      'blockdev-change-medium' is a convinient wrapper for the following
      sequence of commands:
       * blockdev-open-tray
       * blockdev-remove-medium
       * blockdev-insert-medium
       * blockdev-close-tray
      and should be used f.e. to change ISO image inside the CD-ROM tray.
      Though the guest could lock the tray and some linux guests like
      CentOS 8.5 actually does that. In this case the execution if this
      command results in the error like the following:
        Device 'scsi0-0-1-0' is locked and force was not specified,
        wait for tray to open and try again.
      
      This situation is could be resolved 'blockdev-open-tray' by passing
      flag 'force' inside. Thus is seems reasonable to add the same
      capability for 'blockdev-change-medium' too.
      
      Signed-off-by: default avatarDenis V. Lunev <den@openvz.org>
      Reviewed-by: default avatarVladimir Sementsov-Ogievskiy <vsementsov@openvz.org>
      Acked-by: default avatar"Dr. David Alan Gilbert" <dgilbert@redhat.com>
      CC: Kevin Wolf <kwolf@redhat.com>
      CC: Hanna Reitz <hreitz@redhat.com>
      CC: Eric Blake <eblake@redhat.com>
      CC: Markus Armbruster <armbru@redhat.com>
      Message-Id: <20220412221846.280723-1-den@openvz.org>
      Reviewed-by: default avatarDaniel P. Berrangé <berrange@redhat.com>
      Signed-off-by: default avatarHanna Reitz <hreitz@redhat.com>
      80dd5aff
  3. Apr 22, 2022
Loading