Bug 710806 - virt-manager creates unusable config with virtio block devices
Summary: virt-manager creates unusable config with virtio block devices
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: virt-manager
Version: 14
Hardware: x86_64
OS: Linux
high
high
Target Milestone: ---
Assignee: Cole Robinson
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-06-04 21:24 UTC by David Kovalsky
Modified: 2014-03-31 23:46 UTC (History)
11 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2012-01-17 22:40:21 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
generated XML config (not working) (2.33 KB, text/plain)
2011-06-04 21:27 UTC, David Kovalsky
no flags Details

Description David Kovalsky 2011-06-04 21:24:55 UTC
I've installed Debian 6 as a virt machine in F14, later decided to switch to virtio for block device. I did the change in virt-manager, but then the virt machine fails to start:

# virsh create debian-6.xml 
error: Failed to create domain from debian-6.xml
error: internal error Process exited while reading console log output: char device redirected to /dev/pts/2
qemu-kvm: -device virtio-net-pci,vlan=0,id=net0,mac=52:54:00:7f:bb:bd,bus=pci.0,addr=0x3: PCI: slot 3 function 0 not available for virtio-net-pci, in use by virtio-blk-pci
qemu-kvm: -device virtio-net-pci,vlan=0,id=net0,mac=52:54:00:7f:bb:bd,bus=pci.0,addr=0x3: Device 'virtio-net-pci' could not be initialized


What's interesting is that I was able to do the change on a remove RHEL5 host, but while attempting to do the same step on a local instance, it failed.


virt-manager-0.8.7-2.fc14.noarch

Comment 1 David Kovalsky 2011-06-04 21:27:17 UTC
Created attachment 503020 [details]
generated XML config (not working)

Comment 2 Massimiliano 2011-06-19 18:10:21 UTC
I have a similar problem trying to create a winxp host that uses virtio devices (disk, network). Here my error from virt-manager:

Error starting domain: internal error Process exited while reading console log output: char device redirected to /dev/pts/3
qemu-kvm: -device virtio-net-pci,vlan=0,id=net0,mac=52:54:00:66:8b:76,bus=pci.0,addr=0x3: PCI: slot 3 function 0 not available for virtio-net-pci, in use by virtio-blk-pci
qemu-kvm: -device virtio-net-pci,vlan=0,id=net0,mac=52:54:00:66:8b:76,bus=pci.0,addr=0x3: Device 'virtio-net-pci' could not be initialized


Traceback (most recent call last):
  File "/usr/share/virt-manager/virtManager/asyncjob.py", line 45, in cb_wrapper
    callback(asyncjob, *args, **kwargs)
  File "/usr/share/virt-manager/virtManager/engine.py", line 959, in asyncfunc
    vm.startup()
  File "/usr/share/virt-manager/virtManager/domain.py", line 1114, in startup
    self._backend.create()
  File "/usr/lib64/python2.7/site-packages/libvirt.py", line 333, in create
    if ret == -1: raise libvirtError ('virDomainCreate() failed', dom=self)
libvirtError: internal error Process exited while reading console log output: char device redirected to /dev/pts/3
qemu-kvm: -device virtio-net-pci,vlan=0,id=net0,mac=52:54:00:66:8b:76,bus=pci.0,addr=0x3: PCI: slot 3 function 0 not available for virtio-net-pci, in use by virtio-blk-pci
qemu-kvm: -device virtio-net-pci,vlan=0,id=net0,mac=52:54:00:66:8b:76,bus=pci.0,addr=0x3: Device 'virtio-net-pci' could not be initialized

$ rpm -q virt-manager libvirt
virt-manager-0.8.7-2.fc14.noarch
libvirt-0.8.3-9.fc14.x86_64

Comment 3 Nerijus Baliūnas 2011-06-21 15:03:39 UTC
Workaround in http://bugs.gentoo.org/show_bug.cgi?&id=362197 helped - I changed slot='0x03' to slot='0x05' in <interface type='bridge'> section.

Comment 4 Cole Robinson 2011-07-11 20:45:20 UTC
This is a libvirt and a virt-manager problem. On the one hand if we change the disk bus we need to remove the <address> block and libvirt generate a new one, since the old one probably won't be valid anymore. However, libvirt shouldn't be allowing an invalid config to be defined in this case.

Comment 6 Grzegorz Witkowski 2011-09-07 23:44:15 UTC
I experienced the same problem today.

Error starting domain: internal error process exited while connecting to monitor: char device redirected to /dev/pts/1
qemu-kvm: -device virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:ef:5c:6b,bus=pci.0,addr=0x3: PCI: slot 3 function 0 not available for virtio-net-pci, in use by virtio-blk-pci
qemu-kvm: -device virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:ef:5c:6b,bus=pci.0,addr=0x3: Device 'virtio-net-pci' could not be initialized


Traceback (most recent call last):
  File "/usr/share/virt-manager/virtManager/asyncjob.py", line 45, in cb_wrapper
    callback(asyncjob, *args, **kwargs)
  File "/usr/share/virt-manager/virtManager/engine.py", line 959, in asyncfunc
    vm.startup()
  File "/usr/share/virt-manager/virtManager/domain.py", line 1128, in startup
    self._backend.create()
  File "/usr/lib64/python2.7/site-packages/libvirt.py", line 330, in create
    if ret == -1: raise libvirtError ('virDomainCreate() failed', dom=self)
libvirtError: internal error process exited while connecting to monitor: char device redirected to /dev/pts/1
qemu-kvm: -device virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:ef:5c:6b,bus=pci.0,addr=0x3: PCI: slot 3 function 0 not available for virtio-net-pci, in use by virtio-blk-pci
qemu-kvm: -device virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:ef:5c:6b,bus=pci.0,addr=0x3: Device 'virtio-net-pci' could not be initialized


How to reproduce (virt-manager):
1. Create a new VM with one virtio disk and one virtio NIC.
2. Add 3 new SCSI disks to VM.
3. Once disks are added change their type from SCSI to virtio.
4. Start VM. I got the above error.
5. Changed disks back to SCSI. Got error about SCSI addresses.
6. Removed NIC. No change.
7. Removed all 3 new disks.
8. Added new virtio NIC.
9. Added back all 3 new disks as virtio.
10. Issue resolved - VM starts up.

I have not tested, but I believe by just removing and re-adding disks should fix the issue.

Comment 7 Tobias Gerschner 2011-10-18 05:58:17 UTC
My setup was very simple and I followed the instructions from Comment #6, which works for me.

Comment 8 Cole Robinson 2012-01-17 22:40:21 UTC
F14 is end of life now. This change never made it into f14 but it is in f16. Closing as CURRENTRELEASE


Note You need to log in before you can comment on or make changes to this bug.