Bug 1341415
Summary: | 'virsh event' can not capture disk-change events | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 7 | Reporter: | Yanqiu Zhang <yanqzhan> |
Component: | libvirt | Assignee: | Peter Krempa <pkrempa> |
Status: | CLOSED ERRATA | QA Contact: | Virtualization Bugs <virt-bugs> |
Severity: | unspecified | Docs Contact: | |
Priority: | unspecified | ||
Version: | 7.3 | CC: | dyuan, fjin, mzhan, pkrempa, rbalakri, yafu, yanqzhan, zpeng |
Target Milestone: | rc | ||
Target Release: | --- | ||
Hardware: | x86_64 | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | libvirt-2.0.0-1.el7 | Doc Type: | If docs needed, set a value |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2016-11-03 18:46:09 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Yanqiu Zhang
2016-06-01 03:11:20 UTC
Fixed upstream: commit 9cda91d6f6b887c6f06868f4d2fb16c288ae20d5 Author: Peter Krempa <pkrempa> Date: Thu Jun 2 15:32:00 2016 +0200 qemu: process: Call disk startup policy check after cloning domain def In commit 1e38ef72 the disk startup policy check was moved prior to the call to virDomainObjSetDefTransient which dropped the disk from the config rather than the def to be started which is a bug. Additionally we'd not report the disk change event for this since the disk aliases were not set at that point. Finally 'volume' based disks would not work with startup policy too. Fix it by moving it back after the definition is copied, aliases are assigned and disk sources are translated. Reproduced with libvirt-1.3.4-1.el7.x86_64. steps are as comment 0. Verify pass with libvirt-2.0.0-1.el7.x86_64. Test steps: 1.Edit the guest xml with optional startupPolicy,(no-disk.qcow2 is a non-exist disk). ... <disk type='file' device='disk'> <driver name='qemu' type='qcow2'/> <source file='/var/lib/libvirt/no-disk.qcow2' startupPolicy='optional'/> <target dev='vda' bus='virtio'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/> </disk> ..... 2.Open the second terminal, run the 'event-test.py' python script to catch the events # python /usr/share/doc/libvirt-python-2.0.0/examples/event-test.py qemu:///system Using uri:qemu:///system 3.Open third terminal, run the 'virsh event' command to catch the events #virsh event --all --loop 4.Start the guest : #virsh start rhel7.3 5.Check the output in the second terminal, can see the disk-chanage event: myDomainEventDiskChangeCallback: Domain rhel7.3(123) disk change oldSrcPath: /var/lib/libvirt/images/no-disk.qcow2 newSrcPath: None devAlias: virtio-disk1 reason: 1 6.Check the output in the third terminal,also can see the disk-change event: event 'disk-change' for domain rhel7.3 disk virtio-disk1: /var/lib/libvirt/images/no-disk.qcow2 -> <null>: dropped 7.Also test cdrom/floppy with 'file' type, also can see the disk-change event. 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://rhn.redhat.com/errata/RHSA-2016-2577.html |