[libvirt-users] How to disconnect the ISO image using virsh

Hello, I can attach disc ISO image to cd-rom from virsh. And I can replace the ISO image from disc1 to disc2 using the 2nd example. (example) attach-disk guest01 /root/disc1.iso hdc --driver file --type cdrom --mode readonly attach-disk guest01 /root/disc2.iso hdc --driver file --type cdrom --mode readonly My question is, how can I disconnect the image from the cdrom drive using virsh. Because, if I try to detach-disk hdc, I got following errors. virsh # detach-disk guest01 hdc error: Failed to detach disk error: this function is not supported by the connection driver: This type of device cannot be hot unplugged What I can do is possible from virt-manager's "Disconnect" button, (next to source path: line) from Hardware's TAB, Disk hdc screen. I want to do this from virsh. OS: RHEL5.6 libvirt-0.8.2-15.el5_6.1 is used. Regards, Masanari Iida

Somebody sent me a tips. Following command do what I wanted to do. Thanks. attach-disk guest01 " " hdc --driver file --type cdrom --mode readonly On Thu, Mar 31, 2011 at 3:29 PM, Masanari Iida <standby24x7@gmail.com> wrote:
Hello,
I can attach disc ISO image to cd-rom from virsh. And I can replace the ISO image from disc1 to disc2 using the 2nd example.
(example) attach-disk guest01 /root/disc1.iso hdc --driver file --type cdrom --mode readonly attach-disk guest01 /root/disc2.iso hdc --driver file --type cdrom --mode readonly
My question is, how can I disconnect the image from the cdrom drive using virsh. Because, if I try to detach-disk hdc, I got following errors.
virsh # detach-disk guest01 hdc error: Failed to detach disk error: this function is not supported by the connection driver: This type of device cannot be hot unplugged
What I can do is possible from virt-manager's "Disconnect" button, (next to source path: line) from Hardware's TAB, Disk hdc screen. I want to do this from virsh.
OS: RHEL5.6 libvirt-0.8.2-15.el5_6.1 is used.
Regards, Masanari Iida

于 2011年03月31日 15:17, Masanari Iida 写道:
Somebody sent me a tips. Following command do what I wanted to do. Thanks.
attach-disk guest01 " " hdc --driver file --type cdrom --mode readonly
Also using "update-device" with an xml which doesn't specify the source file path will work.
On Thu, Mar 31, 2011 at 3:29 PM, Masanari Iida<standby24x7@gmail.com> wrote:
Hello,
I can attach disc ISO image to cd-rom from virsh. And I can replace the ISO image from disc1 to disc2 using the 2nd example.
(example) attach-disk guest01 /root/disc1.iso hdc --driver file --type cdrom --mode readonly attach-disk guest01 /root/disc2.iso hdc --driver file --type cdrom --mode readonly
My question is, how can I disconnect the image from the cdrom drive using virsh. Because, if I try to detach-disk hdc, I got following errors.
virsh # detach-disk guest01 hdc error: Failed to detach disk error: this function is not supported by the connection driver: This type of device cannot be hot unplugged
What I can do is possible from virt-manager's "Disconnect" button, (next to source path: line) from Hardware's TAB, Disk hdc screen. I want to do this from virsh.
OS: RHEL5.6 libvirt-0.8.2-15.el5_6.1 is used.
Regards, Masanari Iida
_______________________________________________ libvirt-users mailing list libvirt-users@redhat.com https://www.redhat.com/mailman/listinfo/libvirt-users

On Thu, Mar 31, 2011 at 05:46:47PM +0800, Osier Yang wrote:
于 2011年03月31日 15:17, Masanari Iida 写道:
Somebody sent me a tips. Following command do what I wanted to do. Thanks.
attach-disk guest01 " " hdc --driver file --type cdrom --mode readonly
Also using "update-device" with an xml which doesn't specify the source file path will work.
BTW, if someone is looking for a short coding idea, it would be great if we finally added support for two commands specifically targetting devices with removable media: 'eject-disk' (ejects current media) 'insert-disk' (replaces current media (if any) with new media) Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|
participants (3)
-
Daniel P. Berrange
-
Masanari Iida
-
Osier Yang