Bug 955484
| Summary: | Domain restore fails from a saved state in a file with xml option. | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 7 | Reporter: | zhenfeng wang <zhwang> |
| Component: | libvirt | Assignee: | Ján Tomko <jtomko> |
| Status: | CLOSED CURRENTRELEASE | QA Contact: | Virtualization Bugs <virt-bugs> |
| Severity: | medium | Docs Contact: | |
| Priority: | medium | ||
| Version: | 7.0 | CC: | acathrow, cwei, dallan, dyuan, gsun, jtomko, leiwan, mzhan |
| Target Milestone: | rc | ||
| Target Release: | --- | ||
| Hardware: | x86_64 | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | libvirt-1.1.0-1.el7 | Doc Type: | Bug Fix |
| Doc Text: | Story Points: | --- | |
| Clone Of: | 834196 | Environment: | |
| Last Closed: | 2014-06-13 10:20:56 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: | |||
Hi Jan,
I verify this bug with libvirt-1.1.0-1.el7.x86_64,The guest can be restored with the xml successfully,however,I found an issue that the usb controller wasn't included in the save image while there was just one usb controller in the guest,however,the usb controller will be included in the save image while there were two usb controllers in the guest,even so ,the guest can still be restored with the xml,so i wonder that whether this was the expect result ? also is it enough to verify this bug with the following steps ? thanks
Steps to Reproduce:
1.start a guest with the default xml configuration which has one usb controller
#virsh dumpxml rhel7 |grep usb
<controller type='usb' index='0'>
2.# virsh dumpxml rhel7 > rhel7.xml
3.Copy the image of guest to /tmp/
# cp /var/lib/libvirt/images/rhel7.img /tmp/
4.Edit rhel7.xml to change /var/lib/libvirt/images/rhel7.img to /tmp/rhel7.img
5.Save the guest with --xml
# virsh save rhel6 rhel7.save --xml rhel7.xml
6. Check that xml embedded in binary rhel6.save did change,and the usb controller was not included in the save file
#vim rhel7.save
7. Restore guest with --xml ,The guest can be restored successfully and left where it was saved
# virsh restore rhel7.save --xml rhel7.xml
Domain restored from rhel7.save
8.check the guest's xml, the usb controller and other device has been re-added to the guest's xml
#virsh dumpxml rhel7 >rhel72.xml
compare the guest's xml ,almost the same with the previous
diff rhel71.xml rhel72.xml
< <domain type='kvm' id='2'>
---
> <domain type='kvm' id='3'>
79,80c79,80
< <label>system_u:system_r:svirt_t:s0:c565,c683</label>
< <imagelabel>system_u:object_r:svirt_image_t:s0:c565,c683</imagelabel>
---
> <label>system_u:system_r:svirt_t:s0:c24,c869</label>
> <imagelabel>system_u:object_r:svirt_image_t:s0:c24,c869</imagelabel>
9.retest the upper steps on the migration environment,then, migrate the restored guest to the target, the guest can be migrated successfully
10.detroy the guest,add another usb controller to the guest's xml
#virsh dumpxml rhel7|grep usb
# virsh dumpxml rhel72 |grep usb
<controller type='usb' index='0'>
<alias name='usb0'/>
<controller type='usb' index='1'>
<alias name='usb1'/>
11.Re-test the uppper 2-5 steps, then,check the save img,find that the usb controller will be included in the save img
vim rhel7.save
--
<controller type='usb' index='0'>
<address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
</controller>
<controller type='usb' index='1'>
<address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>
</controller>
--
12.restore the guest with the xml,can gust can be restorted successfully
# virsh restore rhel72.save --xml rhel72.xml
Domain restored from rhel72.save
13.retest the upper steps on the migration environment,then, migrate the restored guest to the target, the guest can be migrated successfully
If there is only one usb controller (with the default model), it is intentionally removed to be compatible with older versions of libvirt which didn't know the XML syntax, but they did provide an USB controller. Multiple USB controllers weren't supported by those versions of libvirt, which is why they stay in the XML. And yes, these steps seem sufficient to verify this bug. Thanks for Jan's quick reply,base the comment 4,set this bug verified This request was resolved in Red Hat Enterprise Linux 7.0. Contact your manager or support representative in case you have further questions about the request. |
Now fixed upstream: commit 07966f6a8b5ccb5bb4c716b25deb8ba2e572cc67 Author: Ján Tomko <jtomko> AuthorDate: 2013-06-11 15:03:17 +0200 Commit: Ján Tomko <jtomko> CommitDate: 2013-06-13 16:58:30 +0200 qemu: allow restore with non-migratable XML input Convert input XML to migratable before using it in qemuDomainSaveImageOpen. XML in the save image is migratable, i.e. doesn't contain implicit controllers. If these controllers were in a non-default order in the input XML, the ABI check would fail. Removing and re-adding these controllers fixes it. https://bugzilla.redhat.com/show_bug.cgi?id=834196 git describe: v1.0.6-70-g07966f6