Re: [PATCH] virsh: Add VSH_OFLAG_EMPTY_OK for attach-disk command

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 11/09/2011 11:29 AM, Xu He Jie wrote:
于 2011年11月09日 11:05, Osier Yang 写道:
On 11/09/2011 10:34 AM, Xu He Jie wrote:
于 2011年11月09日 07:08, Eric Blake 写道:
On 11/08/2011 12:16 AM, Xu He Jie wrote:
As the description of removing CDROM media from
http://wiki.libvirt.org/page/QEMUSwitchToLibvirt#eject_DEV

Hmm.
virsh attach-disk --type cdrom --mode readonly myguest "" hdc
might look a bit nicer as:
virsh attach-disk --type cdrom --mode readonly myguest --target hdc
except that we marked --source as a required argument, so we have to provide something even when there is no real source. So I agree that we need your patch at a bare minimum to support this documented command line for adding a cdrom drive without a disk.
Is there any other method of removing media from cdrom? I try with:
detach-disk myguest hdc

This will detach the CD drive from guest, for just removing the media,
"update-device $domain xml" with the source path removed in the xml
will work.

We planned to add some new virsh commands such as "insert-media",
"eject-media" before to do the work, as "update-device" is not quite
visiable, and question like this are frequent in upstream, but unfortunately,
it's not implemented yet.
I understood, thanks.

It told me: 'unsupported configuration: device type 'disk' cannot be detached'

Is this the exact error you saw, it's weried if a device of type disk can't be
detached. The error expected should be something like:

"unsupported configuration: device type of 'cdrom' cannot be detached"

Yes, the xml as below:
<disk type='block' device='cdrom'>
<driver name='qemu' type='raw'/>
<target dev='hdc' bus='ide'/>
<readonly/>
<address type='drive' controller='0' bus='1' unit='0'/>
</disk>

the command as below:
virsh # detach-disk ubuntu-test-vm1 hdc
错误: Failed to detach disk
错误: unsupported configuration: device type 'disk' cannot be detached

I see, there is a bug here. This patch fixed it.

http://www.redhat.com/archives/libvir-list/2011-November/msg00355.html

Osier
--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]