<disk type='file' device='disk'>
     <driver name='qemu' type='qcow2' cache='none'/>
     <source file='/var/lib/libvirt/images/rhel6rc_64.img'/>
     <target dev='hda' bus='ide'/>
     <alias name='ide0-0-0'/>
     <address type='drive' controller='0' bus='0' unit='0'/>
   </disk>
   <disk type='file' device='cdrom'>
     <driver name='qemu' type='raw'/>
     <source file='/var/lib/libvirt/images/test.iso'/>
     <target dev='hdc' bus='ide'/>
     <readonly/>
     <alias name='ide0-1-0'/>
     <address type='drive' controller='0' bus='1' unit='0'/>
   </disk>
   <disk type='file' device='disk'>
     <driver name='file' type='qcow2'/>
     <source file='/var/lib/libvirt/images/test3.img'/>
     <target dev='vdb' bus='virtio'/>
     <alias name='virtio-disk1'/>
     <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
   </disk>
   <controller type='ide' index='0'>
     <alias name='ide0'/>
     <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
   </controller>


Thank you very much. It is exactly the same output as mine, particularly
 <driver name='file' type='qcow2'/>
I thought it has to be name='qemu' to detach properly but since you didn't have a problem, I am very lost on why mine didn't work.

My libvirtd.log shows (with debugging turned on)
14:43:18.965: debug : qemuMonitorCommandWithHandler:235 : Receive command reply ret=0 errno=0 33 bytes 'Device 'virtio-disk1' not found^M
'
14:43:18.965: debug : virEventDispatchTimeouts:405 : Dispatch 3
14:43:18.965: debug : virEventDispatchHandles:450 : Dispatch 8
14:43:18.965: error : qemuMonitorTextDelDevice:2314 : operation failed: detaching virtio-disk1 device failed: Device 'virtio-disk1' not found^M

Do you know what the "device not found" error means?

Thanks.

Shi