Failed to attach scsi contr. with opt. "--config --live" when index attribute isn't specified in XML
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
The Ubuntu-power-systems project |
Fix Released
|
Medium
|
Canonical Server | ||
libvirt (Ubuntu) |
Fix Released
|
Undecided
|
Ubuntu on IBM Power Systems Bug Triage | ||
Bionic |
Fix Released
|
Undecided
|
Unassigned | ||
Cosmic |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
[Impact]
* Libvirt has a concept of a live and a persistent config.
The code was so far workign on a copy due to that the handling of
device attach that caused some issues as some functions e.g.
the scsi attach here - rely on knowing data from the other live
content.
* This was fixed upstream to use the correct definition in those cases
and by effectively splitting the definitions used for checks/code in
CONFIG/LIVE cases.
[Test Case]
* Simplified, but complete test steps (working on a fresh Bionic x86 host):
$ sudo apt install uvtool-libvirt
$ time uvt-simplestrea
$ ssh-keygen
$ uvt-kvm create --password ubuntu b-testattach arch=amd64 release=bionic label=daily
$ virsh dumpxml b-testattach | grep controller.*scsi
# will show no output - ok
$ echo "<controller type='scsi' model='virtio-scsi' />" > controller_scsi.xml
# check persistent and live config
$ virsh attach-device b-testattach controller_scsi.xml --persistent
error: Failed to attach device from controller_scsi.xml
error: internal error: Cannot parse controller index -1
$ virsh attach-device b-testattach controller_scsi.xml --live --config
error: Failed to attach device from controller_scsi.xml
error: internal error: Cannot parse controller index -1
With the fix those attaches should work just fine.
[Regression Potential]
* The changes are local to attaching devices, no other functionality
should be affected. If anything then e.g. due to backporting we could
have introduced issues there - I'll take a look at testing the case and
some other attach/detach in general to be sure.
[Other Info]
* n/a
---
== Comment: #0 - SRIKANTH AITHAL - 2019-03-28 05:10:54 ==
---Problem Description---
Failed to attach scsi contr. with opt. "--config --live" when index attribute isn't specified in XML
---Steps to Reproduce---
1. Use below guest:
# virsh list
Id Name State
-------
11 srik_ubuntu running
2.Use below xml for controller attach
# cat /home/srikanth/
<controller type='scsi' model='virtio-scsi' />
3. Check for any previous controllers attached:
# virsh dumpxml srik_ubuntu | grep controller.*scsi
4.Issue with persistent hot-attach:
# virsh attach-device srik_ubuntu /home/*
error: Failed to attach device from /home/*
error: internal error: Cannot parse controller index -1
5.Issue with persistent live-config:
# virsh attach-device srik_ubuntu /home/*
error: Failed to attach device from /home/*
error: internal error: Cannot parse controller index -1
6. Where as index is getting auto generated for live attach, as well as config attach
# virsh attach-device srik_ubuntu /home/*
Device attached successfully
# virsh dumpxml test_vm1 | grep controller.*scsi
<controller type='scsi' index='0' model='
Expected result:
From Libvirt >=1.3.5 all attach varients of hot controller attach should generate the controller index automatically if not given explicitly.
Machine Type = witherspoon
---uname output---
Linux ltcgen6 4.15.0-
---Debugger---
A debugger is not configured
Userspace tool common name: libvirt-bin 4.0.0-1ubuntu8.6
The userspace tool has the following bit modes: 64
Userspace rpm: libvirt-bin
Changed in ubuntu-power-systems: | |
importance: | Undecided → Medium |
assignee: | nobody → Canonical Server Team (canonical-server) |
Changed in ubuntu-power-systems: | |
status: | New → Won't Fix |
Changed in libvirt (Ubuntu): | |
status: | New → Won't Fix |
Changed in libvirt (Ubuntu): | |
status: | Won't Fix → Fix Released |
Changed in libvirt (Ubuntu Cosmic): | |
status: | New → Fix Released |
Changed in libvirt (Ubuntu Bionic): | |
status: | New → Triaged |
description: | updated |
tags: |
added: targetmilestone-inin18041 removed: targetmilestone-inin--- |
tags: |
added: targetmilestone-inin18042 removed: targetmilestone-inin18041 |
tags: |
added: targetmilestone-inin18041 removed: targetmilestone-inin18042 |
tags: |
added: targetmilestone-inin18041genesis2 removed: targetmilestone-inin18041 |
Changed in ubuntu-power-systems: | |
status: | Triaged → Fix Committed |
Changed in ubuntu-power-systems: | |
status: | Fix Committed → Fix Released |
Default Comment by Bridge