qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] The reversion of hot adding a storage disk to Linux guest.
@ 2012-01-12  8:57 Shu Ming
  2012-01-15 13:46 ` Shu Ming
  0 siblings, 1 reply; 2+ messages in thread
From: Shu Ming @ 2012-01-12  8:57 UTC (permalink / raw)
  To: QEMU Developers

Hi,
   I am testing the hot plug of scsi disk to the KVM Linux guest with 
the following command.

   [root@kvm-rhel-01 bin]# ./virsh qemu-monitor-command RHEL6.1-C 
"pci_add auto storage file=/nfs/images/storage1-qcow2.img,if=scsi"
OK domian 0, bus 0, slot 7, function 0
   [root@kvm-rhel-01 bin]# lspci
...
00:05.0 SCSI storage controller: Red Hat, Inc Virtio block device
00:06.0 RAM memory: Red Hat, Inc Virtio memory balloon
00:07.0 SCSI storage controller: LSI Logic / Symbios Logic 53c895a 
<---new deviced added

  in the KVM guest:
   [root@RHEL6 ~]#cat /proc/scsi/scsi
Attached devices:
Host: scsi1 Channel: 00 Id:  00 Lun: 00
   Vendor:  QEMU    Model: QEMU DVD-ROM    Rev:  1.0.
    Type:    CD-ROM
Host: scsi2  Channel: 00  Id:  00 Lun: 00
    Vendor:  QEMU    Model: QEMU HARDDISK    Rev:  1.0.
     Type:      Direct-Access        ANSI    SCSI revision:  05 
<------new scsi disk attached

   The command successfully created a HBA device in the guest and also a 
scsi disk was enumerated under the HBA device.  My next request is to 
hot detach the scsi disk from the HBA device, not necessarily detach the 
HBA device.  That is to emulate the swapping  out of the scsi disk from 
a physical machine and to release the image file in the backend.  
Because the scsi disk is not PCI device,  "pci_del" command can not be 
used in this case.  Can we have a way to send some commands to notice 
the HBA device to offline the scsi disk?  By that way, HBA device can do 
some cleanup in their driver to fully offline the scsi disk.

BTW: In the linux guest, we can do "echo "scsi remove-single-device 2 0 
0 0" > /proc/scsi/scsi" to disable the disk.  But I don't think it is 
fully removed, because you can bring it back again by "echo "scsi 
add-single-device 2 0 0 0" > /proc/scsi/scsi"

-- 
Shu Ming<shuming@linux.vnet.ibm.com>
IBM China Systems and Technology Laboratory

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [Qemu-devel] The reversion of hot adding a storage disk to Linux guest.
  2012-01-12  8:57 [Qemu-devel] The reversion of hot adding a storage disk to Linux guest Shu Ming
@ 2012-01-15 13:46 ` Shu Ming
  0 siblings, 0 replies; 2+ messages in thread
From: Shu Ming @ 2012-01-15 13:46 UTC (permalink / raw)
  To: QEMU Developers

No other comments? Anyway,  I think we need a way to hot unplug a 
storage disk from the guest totally exactly liking to remove a disk 
physically.  After that unplugging, linux guest can not  bring back the 
disk by any command.
On 2012-1-12 16:57, Shu Ming wrote:
> Hi,
>   I am testing the hot plug of scsi disk to the KVM Linux guest with 
> the following command.
>
>   [root@kvm-rhel-01 bin]# ./virsh qemu-monitor-command RHEL6.1-C 
> "pci_add auto storage file=/nfs/images/storage1-qcow2.img,if=scsi"
> OK domian 0, bus 0, slot 7, function 0
>   [root@kvm-rhel-01 bin]# lspci
> ...
> 00:05.0 SCSI storage controller: Red Hat, Inc Virtio block device
> 00:06.0 RAM memory: Red Hat, Inc Virtio memory balloon
> 00:07.0 SCSI storage controller: LSI Logic / Symbios Logic 53c895a 
> <---new deviced added
>
>  in the KVM guest:
>   [root@RHEL6 ~]#cat /proc/scsi/scsi
> Attached devices:
> Host: scsi1 Channel: 00 Id:  00 Lun: 00
>   Vendor:  QEMU    Model: QEMU DVD-ROM    Rev:  1.0.
>    Type:    CD-ROM
> Host: scsi2  Channel: 00  Id:  00 Lun: 00
>    Vendor:  QEMU    Model: QEMU HARDDISK    Rev:  1.0.
>     Type:      Direct-Access        ANSI    SCSI revision:  05 
> <------new scsi disk attached
>
>   The command successfully created a HBA device in the guest and also 
> a scsi disk was enumerated under the HBA device.  My next request is 
> to hot detach the scsi disk from the HBA device, not necessarily 
> detach the HBA device.  That is to emulate the swapping  out of the 
> scsi disk from a physical machine and to release the image file in the 
> backend.  Because the scsi disk is not PCI device,  "pci_del" command 
> can not be used in this case.  Can we have a way to send some commands 
> to notice the HBA device to offline the scsi disk?  By that way, HBA 
> device can do some cleanup in their driver to fully offline the scsi 
> disk.
>
> BTW: In the linux guest, we can do "echo "scsi remove-single-device 2 
> 0 0 0" > /proc/scsi/scsi" to disable the disk.  But I don't think it 
> is fully removed, because you can bring it back again by "echo "scsi 
> add-single-device 2 0 0 0" > /proc/scsi/scsi"
>


-- 
Shu Ming<shuming@linux.vnet.ibm.com>
IBM China Systems and Technology Laboratory

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-01-15 13:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-12  8:57 [Qemu-devel] The reversion of hot adding a storage disk to Linux guest Shu Ming
2012-01-15 13:46 ` Shu Ming

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).