<html>
  <head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    On 11/09/2011 11:29 AM, Xu He Jie wrote:
    <blockquote cite="mid:4EB9F382.8030006@linux.vnet.ibm.com"
      type="cite">于 2011年11月09日 11:05, Osier Yang 写道:
      <br>
      <blockquote type="cite">On 11/09/2011 10:34 AM, Xu He Jie wrote:
        <br>
        <blockquote type="cite">于 2011年11月09日 07:08, Eric Blake 写道:
          <br>
          <blockquote type="cite">On 11/08/2011 12:16 AM, Xu He Jie
            wrote:
            <br>
            <blockquote type="cite">As the description of removing CDROM
              media from
              <br>
              <a class="moz-txt-link-freetext" href="http://wiki.libvirt.org/page/QEMUSwitchToLibvirt#eject_DEV">http://wiki.libvirt.org/page/QEMUSwitchToLibvirt#eject_DEV</a>
              <br>
            </blockquote>
            <br>
            Hmm.
            <br>
            virsh attach-disk --type cdrom --mode readonly myguest ""
            hdc
            <br>
            might look a bit nicer as:
            <br>
            virsh attach-disk --type cdrom --mode readonly myguest
            --target hdc
            <br>
            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.
            <br>
          </blockquote>
          Is there any other method of removing media from cdrom? I try
          with:
          <br>
          detach-disk myguest hdc
          <br>
        </blockquote>
        <br>
        This will detach the CD drive from guest, for just removing the
        media,
        <br>
        "update-device $domain xml" with the source path removed in the
        xml
        <br>
        will work.
        <br>
        <br>
        We planned to add some new virsh commands such as
        "insert-media",
        <br>
        "eject-media" before to do the work, as "update-device" is not
        quite
        <br>
        visiable, and question like this are frequent in upstream, but
        unfortunately,
        <br>
        it's not implemented yet.
        <br>
      </blockquote>
      I understood, thanks.
      <br>
      <blockquote type="cite">
        <br>
        <blockquote type="cite">It told me: 'unsupported configuration:
          device type 'disk' cannot be detached'
          <br>
        </blockquote>
        <br>
        Is this the exact error you saw, it's weried if a device of type
        disk can't be
        <br>
        detached. The error expected should be something like:
        <br>
        <br>
        "unsupported configuration: device type of 'cdrom' cannot be
        detached"
        <br>
        <br>
      </blockquote>
      Yes, the xml as below:
      <br>
      <disk type='block' device='cdrom'>
      <br>
      <driver name='qemu' type='raw'/>
      <br>
      <target dev='hdc' bus='ide'/>
      <br>
      <readonly/>
      <br>
      <address type='drive' controller='0' bus='1' unit='0'/>
      <br>
      </disk>
      <br>
      <br>
      the command as below:
      <br>
      virsh # detach-disk ubuntu-test-vm1 hdc
      <br>
      错误: Failed to detach disk
      <br>
      错误: unsupported configuration: device type 'disk' cannot be
      detached
      <br>
    </blockquote>
    <br>
    I see, there is a bug here. This patch fixed it.<br>
    <br>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    <a
href="http://www.redhat.com/archives/libvir-list/2011-November/msg00355.html">http://www.redhat.com/archives/libvir-list/2011-November/msg00355.html</a><br>
    <br>
    Osier<br>
  </body>
</html>