Uploaded image for project: 'RHEL'
  1. RHEL
  2. RHEL-37542

Update disk with diskcard_no_unref should fail with a clear error message

    • libvirt-10.5.0-1.el9
    • None
    • None
    • rhel-sst-virtualization-storage
    • ssg_virtualization
    • 23
    • None
    • Dev ack
    • False
    • Hide

      None

      Show
      None
    • None
    • None
    • 10.5.0
    • None

      What were you trying to do that didn't work?
      Update disk with diskcard_no_unref should fail with a clear error message

      Please provide the package NVR for which bug is seen:
      libvirt-10.3.0-1.el9.x86_64
      qemu-kvm-9.0.0-1.el9.x86_64

      How reproducible:
      100%

      Steps to reproduce
      1. Prepare a running guest with the following disk.

      1. virsh dumpxml rhel --xpath //disk
        <disk type="file" device="disk">
          <driver name="qemu" type="qcow2"/>
          <source file="/var/lib/libvirt/images/rhel.qcow2" index="2"/>
          <backingStore/>
          <target dev="vda" bus="virtio"/>
          <alias name="virtio-disk0"/>
          <address type="pci" domain="0x0000" bus="0x04" slot="0x00" function="0x0"/>
        </disk>
        <disk type="file" device="disk">
          <driver name="qemu" type="qcow2"/>
          <source file="/var/lib/libvirt/images/test.qcow2" index="1"/>
          <backingStore/>
          <target dev="vdb" bus="virtio"/>
          <alias name="virtio-disk1"/>
          <address type="pci" domain="0x0000" bus="0x08" slot="0x00" function="0x0"/>
        </disk>
        2. Prepare vdb disk with discard_no_unref attribute.
      2. cat disk.xml
        <disk type="file" device="disk">
          <driver name="qemu" type="qcow2" discard_no_unref="on"/>
          <source file="/var/lib/libvirt/images/test.qcow2"/>
          <target dev="vdb" bus="virtio"/>
          <alias name="virtio-disk1"/>
          <address type="pci" domain="0x0000" bus="0x08" slot="0x00" function="0x0"/>
        </disk>
        3. Update-device with the above disk xml.
      3. virsh update-device rhel disk.xml
        Device updated successfully
        4. Check the disk xml but no discard_no_unref attribute.
      4. virsh dumpxml rhel --xpath //disk
        ......
        <disk type="file" device="disk">
          <driver name="qemu" type="qcow2"/>
          <source file="/var/lib/libvirt/images/test.qcow2" index="1"/>
          <backingStore/>
          <target dev="vdb" bus="virtio"/>
          <alias name="virtio-disk1"/>
          <address type="pci" domain="0x0000" bus="0x08" slot="0x00" function="0x0"/>
        </disk>

      Expected results
      Update disk device with discard_no_unref attribute failed, just like discard attribute:

      1. virsh update-device rhel disk.xml
        error: Failed to update device from disk.xml
        error: Operation not supported: cannot modify field 'discard_no_unref' of the disk

      Actual results
      Update disk device with discard_no_unref attribute successfully but it didn't actually work.

              rh-ee-ajulis Adam Julis
              rhn-support-meili Meina Li
              Meina Li
              Adam Julis Adam Julis
              Meina Li Meina Li
              Votes:
              0 Vote for this issue
              Watchers:
              12 Start watching this issue

                Created:
                Updated:
                Resolved: