52 lines
2.4 KiB
Diff
52 lines
2.4 KiB
Diff
|
Subject: virt-manager generates invalid guest XML
|
||
|
From: Seeteena Thoufeek s1seetee@linux.vnet.ibm.com Mon Dec 12 17:48:50 2016 +0530
|
||
|
Date: Mon Dec 12 21:12:09 2016 -0500:
|
||
|
Git: 5a11cf0782998a36eef42718231bcb4c2de8ebba
|
||
|
|
||
|
The virt-manager application generates invalid guest XML when a
|
||
|
spapr-vio SCSI model controller is changed to a virtio-scsi model controller.
|
||
|
|
||
|
1. Create a guest
|
||
|
2. Add an spapr-vio controller to the guest via this gui path:
|
||
|
->Add Hardware
|
||
|
->Controller
|
||
|
->Type SCSI
|
||
|
->Model Hypervisor default
|
||
|
At this point, there will be a valid spapr-vio SCSI controller defined:
|
||
|
<controller type='scsi' index='0'>
|
||
|
<address type='spapr-vio' reg='0x2000'/>
|
||
|
</controller>
|
||
|
3.Now modify the above SCSI controller using this gui path:
|
||
|
->Choose "Controller sPAPR SCSI" on left pane
|
||
|
->Choose "VirtIO SCSI" for the Model on the right pane
|
||
|
->Apply
|
||
|
At this point, there will be a SCSI controller definition which is invalid due to an incorrect address type:
|
||
|
~# virsh dumpxml dotg2|grep -A2 -i scsi
|
||
|
<controller type='scsi' index='0' model='virtio-scsi'>
|
||
|
<address type='spapr-vio' reg='0x2000'/>
|
||
|
</controller>
|
||
|
Any attempt to start the guest will throw this error:
|
||
|
error: Failed to start domain dotg2
|
||
|
error: internal error: process exited while connecting to monitor: 2016-12-02T17:45:12.989165Z qemu-system-ppc64le: -device virtio-scsi-pci,id=scsi0,reg=0x2000: Property '.reg' not found
|
||
|
|
||
|
virt-manager fails to realize that the address type needs to be changed to a PCI address for a virtio-scsi controller.
|
||
|
|
||
|
If you change the model, you are supposed to leave the address field empty, so that libvirt sets it correctly. Or change the address field also appropriately.
|
||
|
|
||
|
Note that this bug can be reproduced entirely within virt-manager. No manual editing of guest XML is being done here. So, fix is to make virt-manager delete the address field when the SCSI controller model is changed, allowing libvirt to automatically assign a new address with the correct type.
|
||
|
|
||
|
Signed-off-by: Seeteena Thoufeek <s1seetee@linux.vnet.ibm.com>
|
||
|
|
||
|
Index: virt-manager-1.4.0/virtManager/domain.py
|
||
|
===================================================================
|
||
|
--- virt-manager-1.4.0.orig/virtManager/domain.py
|
||
|
+++ virt-manager-1.4.0/virtManager/domain.py
|
||
|
@@ -949,6 +949,7 @@ class vmmDomain(vmmLibvirtObject):
|
||
|
|
||
|
else:
|
||
|
editdev.model = model
|
||
|
+ editdev.address.clear()
|
||
|
self.hotplug(device=editdev)
|
||
|
|
||
|
if model != _SENTINEL:
|