Bug 624588 - If two virtio disks are added, removing 1st will make 2nd disk to disappear
Summary: If two virtio disks are added, removing 1st will make 2nd disk to disappear
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: libvirt   
(Show other bugs)
Version: 5.5
Hardware: All
OS: Linux
Target Milestone: rc
: ---
Assignee: Daniel Veillard
QA Contact: Virtualization Bugs
Depends On:
TreeView+ depends on / blocked
Reported: 2010-08-17 06:10 UTC by Mark Wu
Modified: 2018-10-27 13:14 UTC (History)
6 users (show)

Fixed In Version: libvirt-0.8.2-1.el5
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2011-01-13 23:14:34 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHEA-2011:0060 normal SHIPPED_LIVE libvirt bug fix and enhancement update 2011-01-12 17:22:30 UTC

Description Mark Wu 2010-08-17 06:10:13 UTC
Description of problem:

Version-Release number of selected component (if applicable):
Red Hat Enterprise Linux 5.5

How reproducible:

Steps to Reproduce:
1. Add two virtio disks to a VM which use ide disk as root partition  
2. Shutdown VM and remove the first virtio disk via virt-manager
3. Start the VM again, and the second virtio disk also disappeared.
Actual results:
The second virtio disk also get disappeared after removing the first one

Expected results:
The second one should still be accessible.

Additional info:

Comment 1 Mark Wu 2010-08-17 06:23:53 UTC
The description for second virtio disk after removing the first one:
    <disk type='file' device='disk'>
      <driver name='qemu' type='raw'/>
      <source file='/var/lib/libvirt/images/rhel5.4.img'/>
      <target dev='hda' bus='ide'/>
    <disk type='file' device='disk'>
      <driver name='qemu' type='raw'/>
      <source file='/var/lib/libvirt/images/rhel5.4-2.img'/>
      <target dev='vdb' bus='virtio'/>

The command line of qemu-kvm:
root     19317  1.8  5.7 729508 469012 ?       Sl   21:53   0:25 /usr/libexec/qemu-kvm -S -M rhel5.4.0 -m 512 -smp 1 -name rhel5.4 -uuid d4ba624a-3acb-4f06-b0cd-3e969c940dbc -no-kvm-pit-reinjection -monitor pty -pidfile /var/run/libvirt/qemu//rhel5.4.pid -boot c -drive file=/rhiso/rhel5/u4/server/x86_64/rhel-server-5.4-x86_64-dvd.iso,if=ide,media=cdrom,index=2 -drive file=/var/lib/libvirt/images/rhel5.4.img,if=ide,index=0,boot=on,format=raw -drive file=/var/lib/libvirt/images/rhel5.4-2.img,if=virtio,index=1,format=raw -net nic,macaddr=54:52:00:68:f3:c2,vlan=0 -net tap,fd=21,script=,vlan=0,ifname=vnet3 -serial pty -parallel none -usb -vnc -k en-us -soundhw ac97

The index of the second image is still 1, even if index 0 is not used. But qemu-kvm assume that all virtio disks begin from index 0, so the second image can't get a chance to be added to the guest.

  /* Add virtio block devices */
    if (pci_enabled) {
        int index;
        int unit_id = 0;

        while ((index = drive_get_index(IF_VIRTIO, 0, unit_id)) != -1) {
            virtio_blk_init(pci_bus, drives_table[index].bdrv);

We can manually change "<target dev='vdb' bus='virtio'/>" into "<target dev='vda' bus='virtio'/>" via "virsh edit" to workaround this issue. 

This issue doesn't exsit on FC13, so it seems it will be fixed automatically after rebase in RHEL5.6

Comment 2 Daniel Veillard 2010-09-01 13:24:04 UTC
yes I hope to have this fixed as part of the rebase,

 thanks !


Comment 3 Jiri Denemark 2010-09-02 12:00:03 UTC
Fixed in libvirt-0.8.2-1.el5

Comment 5 zhanghaiyan 2010-10-13 02:29:32 UTC
Verified this bug on RHEL5.6-Server-20100930.0-x86_64-kvm 
- kernel-2.6.18-225.el5
- kvm-83-200.el5
- libvirt-0.8.2-6.el5

Test steps:
1. Add two virtio disks to a VM which use ide disk as root partition
2. Shutdown VM and remove the first virtio disk via virt-manager
3. Start the VM again

Actual result:
The second virtio disk still appear in guest

Note: No need verify this bug on xen as virtio disk is not supported by xen

Comment 7 errata-xmlrpc 2011-01-13 23:14:34 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.


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