Bug 1741838 - qomid was null when start a VM with disk iotune and customized alias, blockdev enabled
Summary: qomid was null when start a VM with disk iotune and customized alias, blockde...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux Advanced Virtualization
Classification: Red Hat
Component: libvirt
Version: 8.1
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: 8.1
Assignee: Peter Krempa
QA Contact: Han Han
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-08-16 08:29 UTC by Han Han
Modified: 2020-11-14 06:26 UTC (History)
5 users (show)

Fixed In Version: libvirt-5.6.0-3.el8
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-11-06 07:18:55 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
The libvirtd log of step1 (136.66 KB, text/plain)
2019-08-16 08:29 UTC, Han Han
no flags Details
More detailed libvirtd log (253.89 KB, text/plain)
2019-08-16 08:49 UTC, Han Han
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2019:3723 0 None None None 2019-11-06 07:19:11 UTC

Description Han Han 2019-08-16 08:29:13 UTC
Created attachment 1604309 [details]
The libvirtd log of step1

Description of problem:
As subject

Version-Release number of selected component (if applicable):
libvirt-5.6.0-1.module+el8.1.0+3890+4d3d259c.x86_64
qemu-kvm-4.1.0-1.module+el8.1.0+3966+4a23dca1.x86_64

How reproducible:
100%

Steps to Reproduce:
1. start a VM with disk iotune and customized alias, blockdev enabled
VM xml:
<domain type='kvm' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
...    <disk type='file' device='disk'>
      <driver name='qemu' type='qcow2'/>
      <source file='/var/lib/libvirt/images/copy.qcow2'/>
      <target dev='vda' bus='virtio'/>
      <iotune>
        <total_bytes_sec>500000</total_bytes_sec>
      </iotune>
      <alias name='ua-a'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x0c' function='0x0'/>
    </disk>
...
  <qemu:capabilities>
    <qemu:add capability='blockdev'/>
  </qemu:capabilities>
</domain>

# virsh start copy
error: Failed to start domain copy
error: internal error: unable to execute 'block_set_io_throttle', unexpected error: 'Need exactly one of 'device' and 'id''

The log of block_set_io_throttle parameters:
Aug 16 16:16:56 lab.rhel8.me libvirtd[15758]: drivealias=<null>, qomid=<null>, info=0x7fca80317f80

The log of block_set_io_throttle parameters when -blockdev disabled:
Aug 16 16:16:24 lab.rhel8.me libvirtd[15758]: drivealias=<null>, qomid=/machine/peripheral/virtio-disk0/virtio-backend, info=0x7fca84312c70

Actual results:
As above

Expected results:
VM Started

Additional info:

Comment 1 Han Han 2019-08-16 08:49:30 UTC
Created attachment 1604312 [details]
More detailed libvirtd log

Comment 2 Peter Krempa 2019-08-26 13:12:32 UTC
Fixed upstream:

commit b8222be5831261578e60ce2e867a968a6f80f67d
Author: Peter Krempa <pkrempa>
Date:   Fri Aug 16 17:01:10 2019 +0200

    qemu: alias: Generate 'qomName' of disk with useraliases
    
    Commit fb64e176f4f forgot to delete the check that short-circuits the
    disk alias creation if the alias is already present. The side effect
    of this is that the creation qomName which is necessary to be able to
    refer to disk frontends when -blockdev is used was skipped when user
    aliases are used.
    
    Fix it by deleting the check. Also prevent any potential memory leaks
    from calling this function repeatedly by creating the qomName only when
    it's not present.

v5.6.0-339-gb8222be583

Comment 5 Han Han 2019-09-03 03:06:53 UTC
Version:
libvirt-5.6.0-3.module+el8.1.0+4110+a6d45c3d.x86_64
qemu-kvm-4.1.0-5.module+el8.1.0+4076+b5e41ebc.x86_6

Steps:
Start vm as following disk xml variants:
iotune: yes
alias: with custom alias, without custom alias
disk type: virtio, scsi

1. custom alias, virtio disk
# virsh dumpxml copy|xmllint --xpath //disk -
<disk type="file" device="disk">
      <driver name="qemu" type="qcow2"/>
      <source file="/var/lib/libvirt/images/copy.qcow2"/>
      <target dev="vda" bus="virtio"/>
      <iotune>
        <total_bytes_sec>50000000</total_bytes_sec>
      </iotune>
      <alias name="ua-a"/>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x0d" function="0x0"/>
    </disk>

# virsh start copy                           
Domain copy startedl

2. no custom alias, virtio disk
➜  ~ virsh dumpxml copy|xmllint --xpath //disk -
<disk type="file" device="disk">
      <driver name="qemu" type="qcow2"/>
      <source file="/var/lib/libvirt/images/copy.qcow2"/>
      <target dev="vda" bus="virtio"/>
      <iotune>
        <total_bytes_sec>50000000</total_bytes_sec>
      </iotune>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x0d" function="0x0"/>
    </disk>#                                                                                                                                                                ➜  ~ ~

 virsh start copy                           
Domain copy started

3. custom alias, scsi disk
➜  ~ virsh dumpxml copy|xmllint --xpath //disk -
<disk type="file" device="disk">
      <driver name="qemu" type="qcow2"/>
      <source file="/var/lib/libvirt/images/copy.qcow2"/>
      <target dev="sda" bus="scsi"/>
      <iotune>
        <total_bytes_sec>50000000</total_bytes_sec>
      </iotune>
      <alias name="ua-a"/>
      <address type="drive" controller="0" bus="0" target="0" unit="0"/>
    </disk>#                                                                                                                                                                ➜  ~ virsh start copy
Domain copy started

4. no custom alias, scsi disk
➜  ~ virsh dumpxml copy|xmllint --xpath //disk -
<disk type="file" device="disk">
      <driver name="qemu" type="qcow2"/>
      <source file="/var/lib/libvirt/images/copy.qcow2"/>
      <target dev="sda" bus="scsi"/>
      <iotune>
        <total_bytes_sec>50000000</total_bytes_sec>
      </iotune>
      <address type="drive" controller="0" bus="0" target="0" unit="0"/>
    </disk>#                                                                                                                                                                ➜  ~ virsh start copy                           
Domain copy started

Works as expected.

Comment 7 errata-xmlrpc 2019-11-06 07:18:55 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2019:3723


Note You need to log in before you can comment on or make changes to this bug.