This patch reverts a part of commit 0d8b24f6b. With commits 0d8b24g6 and 0785966d automatically adding a required controller had been moved from the domain xml parsing code section into the device post xml parsing code section and in doing so breaking as a side effect the SCSI hostdev hotplugging in case the required SCSI controller had not been defined in the domain. This behavior occurs because the SCSI controller gets added but is NOT hotplugged. In the hotplug code section the controller is searched for and if not found would be hotplugged but since a SCSI controller already exists in the domain defintion the required SCSI controller hotplug is never executed. This results later in the internal error: error: Failed to attach device from st0.xml error: internal error: Device alias was not set for scsi controller with index 0 This patch moves the automatic add of a SCSI controller for a SCSI hostdev device back into the domain xml parsing code section. Signed-off-by: Boris Fiuczynski <fiuczy@xxxxxxxxxxxxxxxxxx> Reviewed-by: Bjoern Walk <bwalk@xxxxxxxxxxxxxxxxxx> Reviewed-by: Stefan Zimmermann <stzi@xxxxxxxxxxxxxxxxxx> --- src/conf/domain_conf.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index cbfc41e..69cfd0f 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -16285,6 +16285,9 @@ virDomainDefParseXML(xmlDocPtr xml, } def->hostdevs[def->nhostdevs++] = hostdev; + + if (virDomainDefMaybeAddHostdevSCSIcontroller(def) < 0) + goto error; } VIR_FREE(nodes); -- 2.3.0 -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list