Skip to content
Snippets Groups Projects
  1. Jan 19, 2024
  2. Jan 17, 2024
  3. Jan 13, 2024
  4. Jan 12, 2024
  5. Jan 11, 2024
  6. Jan 08, 2024
  7. Jan 05, 2024
  8. Dec 26, 2023
  9. Dec 22, 2023
    • Kevin Wolf's avatar
      iotests: Basic tests for internal snapshots · 11b0730d
      Kevin Wolf authored
      
      We have a few test cases that include tests for corner case aspects of
      internal snapshots, but nothing that tests that they actually function
      as snapshots or that involves deleting a snapshot. Add a test for this
      kind of basic internal snapshot functionality.
      
      The error cases include a regression test for the crash we just fixed
      with snapshot operations on inactive images.
      
      Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
      Message-ID: <20231201142520.32255-4-kwolf@redhat.com>
      Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
      (cherry picked from commit bb6e2511eb48539b7dcbcb5f47772e156b9c45d1)
      Signed-off-by: default avatarMichael Tokarev <mjt@tls.msk.ru>
      11b0730d
    • Kevin Wolf's avatar
      vl: Improve error message for conflicting -incoming and -loadvm · 64537ff1
      Kevin Wolf authored
      
      Currently, the conflict between -incoming and -loadvm is only detected
      when loading the snapshot fails because the image is still inactive for
      the incoming migration. This results in a suboptimal error message:
      
      $ ./qemu-system-x86_64 -hda /tmp/test.qcow2 -loadvm foo -incoming defer
      qemu-system-x86_64: Device 'ide0-hd0' is writable but does not support snapshots
      
      Catch the situation already in qemu_validate_options() to improve the
      message:
      
      $ ./qemu-system-x86_64 -hda /tmp/test.qcow2 -loadvm foo -incoming defer
      qemu-system-x86_64: 'incoming' and 'loadvm' options are mutually exclusive
      
      Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
      Message-ID: <20231201142520.32255-3-kwolf@redhat.com>
      Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
      (cherry picked from commit 5a7f21efaf99c60614fe1967be1c0f9aa46c526e)
      Signed-off-by: default avatarMichael Tokarev <mjt@tls.msk.ru>
      64537ff1
    • Kevin Wolf's avatar
      block: Fix crash when loading snapshot on inactive node · e2e01b3a
      Kevin Wolf authored
      
      bdrv_is_read_only() only checks if the node is configured to be
      read-only eventually, but even if it returns false, writing to the node
      may not be permitted at the moment (because it's inactive).
      
      bdrv_is_writable() checks that the node can be written to right now, and
      this is what the snapshot operations really need.
      
      Change bdrv_can_snapshot() to use bdrv_is_writable() to fix crashes like
      the following:
      
      $ ./qemu-system-x86_64 -hda /tmp/test.qcow2 -loadvm foo -incoming defer
      qemu-system-x86_64: ../block/io.c:1990: int bdrv_co_write_req_prepare(BdrvChild *, int64_t, int64_t, BdrvTrackedRequest *, int): Assertion `!(bs->open_flags & BDRV_O_INACTIVE)' failed.
      
      The resulting error message after this patch isn't perfect yet, but at
      least it doesn't crash any more:
      
      $ ./qemu-system-x86_64 -hda /tmp/test.qcow2 -loadvm foo -incoming defer
      qemu-system-x86_64: Device 'ide0-hd0' is writable but does not support snapshots
      
      Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
      Message-ID: <20231201142520.32255-2-kwolf@redhat.com>
      Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
      (cherry picked from commit d3007d348adaaf04ee8b099a475282034a662414)
      Signed-off-by: default avatarMichael Tokarev <mjt@tls.msk.ru>
      e2e01b3a
  10. Dec 19, 2023
Loading