I am very glad to hear that you can reproduce this problem.<div>Please keep me posted on the status of this patch.</div><div>One more question which might be more appropriate for Redhat: any idea when this fix would go into RHEL-6 as a bug fix?</div>
<div>Should I open a bug ticket at RHEL support?</div><div><br></div><div>Thank you very much.</div><div>Shi<br><br><div class="gmail_quote">On Sun, Mar 6, 2011 at 10:28 PM, Wen Congyang <span dir="ltr"><<a href="mailto:wency@cn.fujitsu.com">wency@cn.fujitsu.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="im">At 03/05/2011 05:35 AM, Shi Jin Write:<br>
> Although the attach/detach problem has been solved, I fond the driver name<br>
> issue still causes problems restoring from a saved VM with disk attached.<br>
<br>
</div>I can reproduce this a bug of libvirt: we can not restore the VM from the file<br>
we saved.<br>
<br>
Thank you for reporting this problem.<br>
I will make a patch to fix it.<br>
<br>
Thanks.<br>
<font color="#888888">Wen Congyang<br>
</font><div><div></div><div class="h5"><br>
><br>
> For example, once saved, the checkpoint file would contains<br>
>  <disk type='file' device='disk'><br>
>       <driver name='file' type='qcow2'/><br>
>       <source<br>
> file='/vrstorm/cloud/PrivateAccounts/74d37709b07be4bbae228dfc273e4339/volumes/vol-126'/><br>
>       <target dev='vdf' bus='virtio'/><br>
>       <alias name='virtio-disk5'/><br>
>       <address type='pci' domain='0x0000' bus='0x00' slot='0x06'<br>
> function='0x0'/><br>
>     </disk><br>
><br>
> And then the restore would fail:<br>
><br>
> [cloudadmin@test2 images]$ virsh restore checkpoint<br>
> error: Failed to restore domain from checkpoint<br>
> error: internal error unsupported driver name 'file' for disk<br>
> '/vrstorm/cloud/PrivateAccounts/74d37709b07be4bbae228dfc273e4339/volumes/vol-126'<br>
><br>
><br>
> If I simply edit the checkpoint file to change file to qemu:<driver<br>
> name='qemu' type='qcow2'/><br>
><br>
> Then it works.<br>
><br>
> [cloudadmin@test2 images]$ virsh restore checkpoint<br>
> Domain restored from checkpoint<br>
><br>
><br>
> So there is indeed a problem with the driver name. Maybe I should<br>
> start a new thread on it?<br>
><br>
><br>
> Shi<br>
><br>
><br>
> On Fri, Mar 4, 2011 at 11:44 AM, Shi Jin <<a href="mailto:jinzishuai@gmail.com">jinzishuai@gmail.com</a>> wrote:<br>
><br>
>> Finally, everything works for if I simply change my template to use the<br>
>> /usr/libexec/qemu-kvm instead of /usr/bin/kvm, which is a symbolic link to<br>
>> it.<br>
>> Not sure why it matters but that does solve all the mysteries.<br>
>><br>
>> Shi<br>
>><br>
>> On Fri, Mar 4, 2011 at 9:56 AM, Shi Jin <<a href="mailto:jinzishuai@gmail.com">jinzishuai@gmail.com</a>> wrote:<br>
>><br>
>>> It seems that your qemu does not support monitor command 'drive_add'.<br>
>>>> What's version of your qemu?<br>
>>>><br>
>>>> Thank you. Here is my version<br>
>>> [cloudadmin@test2 ~]$ /usr/libexec/qemu-kvm -version<br>
>>> QEMU PC emulator version 0.12.1 (qemu-kvm-0.12.1.2), Copyright (c)<br>
>>> 2003-2008 Fabrice Bellard<br>
>>><br>
>>> I finally think it is a permission issue. If I run commands as root and<br>
>>> get kvm run by the default qemu user, both attach-disk and detach-disk works<br>
>>> like your case.<br>
>>><br>
>>> However, if I set to run as another user, such as cloudamin, attach-disk<br>
>>> works but detach-disk does not.<br>
>>> My libvirtd.conf has<br>
>>> unix_sock_group = "cloudadmin"<br>
>>> unix_sock_rw_perms = "0770"<br>
>>> auth_unix_ro = "none"<br>
>>> auth_unix_rw = "none"<br>
>>> log_level = 3<br>
>>> log_outputs="3:file:/var/log/libvirt/libvirtd.log"<br>
>>><br>
>>> and qemu.conf has<br>
>>> user = "cloudadmin"<br>
>>> group = "cloudadmin"<br>
>>> dynamic_ownership = 0<br>
>>><br>
>>> All images are owned by the cloudadmin:cloudadmin.<br>
>>><br>
>>> Is there a problem with this setup?<br>
>>><br>
>>> Thank you very much.<br>
>>> Shi<br>
>>><br>
>>>>  > 15:31:52.902: debug : virEventRunOnce:595 : Poll got 1 event<br>
>>>><br>
>>>>> 15:31:52.902: debug : virEventDispatchTimeouts:405 : Dispatch 3<br>
>>>>> 15:31:52.902: debug : qemuMonitorAddDevice:1878 : mon=0x7f3628341370<br>
>>>>><br>
>>>> device=virtio-blk-pci,bus=pci.0,addr=0x6,drive=drive-virtio-disk1,id=virtio-disk1<br>
>>>><br>
>>>> When 'drive_add' failes, we do not call qemuMonitorAddDevice(). But it is<br>
>>>> called.<br>
>>>><br>
>>>>> 15:31:52.902: debug : virEventDispatchHandles:450 : Dispatch 8<br>
>>>>> 15:31:52.902: debug : qemuMonitorCommandWithHandler:230 : Send command<br>
>>>>> 'device_add<br>
>>>>><br>
>>>> virtio-blk-pci,bus=pci.0,addr=0x6,drive=drive-virtio-disk1,id=virtio-disk1'<br>
>>>>> for write with FD -1<br>
>>>><br>
>>>> What's the reply of command 'device_add'? Can you provide it. I think it<br>
>>>> should fail.<br>
>>>><br>
>>>> Thanks.<br>
>>>> Wen Congyang<br>
>>>><br>
>>>>><br>
>>>>> Than you very much.<br>
>>>>><br>
>>>>> Shi<br>
>>>>><br>
>>>>><br>
>>>>><br>
>>>>><br>
>>>>><br>
>>>>> On Thu, Mar 3, 2011 at 10:12 PM, Wen Congyang <<a href="mailto:wency@cn.fujitsu.com">wency@cn.fujitsu.com</a>><br>
>>>> wrote:<br>
>>>>><br>
>>>>>> At 03/04/2011 01:00 PM, Shi Jin Write:<br>
>>>>>>>><br>
>>>>>>>><br>
>>>>>>>><br>
>>>>>>>>     <disk type='file' device='disk'><br>
>>>>>>>>       <driver name='qemu' type='qcow2' cache='none'/><br>
>>>>>>>>      <source file='/var/lib/libvirt/images/rhel6rc_64.img'/><br>
>>>>>>>>      <target dev='hda' bus='ide'/><br>
>>>>>>>>      <alias name='ide0-0-0'/><br>
>>>>>>>>      <address type='drive' controller='0' bus='0' unit='0'/><br>
>>>>>>>>    </disk><br>
>>>>>>>>    <disk type='file' device='cdrom'><br>
>>>>>>>>      <driver name='qemu' type='raw'/><br>
>>>>>>>>      <source file='/var/lib/libvirt/images/test.iso'/><br>
>>>>>>>>      <target dev='hdc' bus='ide'/><br>
>>>>>>>>      <readonly/><br>
>>>>>>>>      <alias name='ide0-1-0'/><br>
>>>>>>>>      <address type='drive' controller='0' bus='1' unit='0'/><br>
>>>>>>>>    </disk><br>
>>>>>>>>     <disk type='file' device='disk'><br>
>>>>>>>>      <driver name='file' type='qcow2'/><br>
>>>>>>>>       <source file='/var/lib/libvirt/images/test3.img'/><br>
>>>>>>>>       <target dev='vdb' bus='virtio'/><br>
>>>>>>>>       <alias name='virtio-disk1'/><br>
>>>>>>>>      <address type='pci' domain='0x0000' bus='0x00' slot='0x06'<br>
>>>>>>>> function='0x0'/><br>
>>>>>>>>    </disk><br>
>>>>>>>>    <controller type='ide' index='0'><br>
>>>>>>>>      <alias name='ide0'/><br>
>>>>>>>>      <address type='pci' domain='0x0000' bus='0x00' slot='0x01'<br>
>>>>>>>> function='0x1'/><br>
>>>>>>>>    </controller><br>
>>>>>>>><br>
>>>>>>>><br>
>>>>>>>> Thank you very much. It is exactly the same output as mine,<br>
>>>> particularly<br>
>>>>>>>  <driver name='file' type='qcow2'/><br>
>>>>>>> I thought it has to be name='qemu' to detach properly but since you<br>
>>>>>> didn't<br>
>>>>>>> have a problem, I am very lost on why mine didn't work.<br>
>>>>>>><br>
>>>>>>> My libvirtd.log shows (with debugging turned on)<br>
>>>>>>> 14:43:18.965: debug : qemuMonitorCommandWithHandler:235 : Receive<br>
>>>> command<br>
>>>>>>> reply ret=0 errno=0 33 bytes 'Device 'virtio-disk1' not found^M<br>
>>>>>>> '<br>
>>>>>>> 14:43:18.965: debug : virEventDispatchTimeouts:405 : Dispatch 3<br>
>>>>>>> 14:43:18.965: debug : virEventDispatchHandles:450 : Dispatch 8<br>
>>>>>>> 14:43:18.965: error : qemuMonitorTextDelDevice:2314 : operation<br>
>>>> failed:<br>
>>>>>>> detaching virtio-disk1 device failed: Device 'virtio-disk1' not<br>
>>>> found^M<br>
>>>>>>><br>
>>>>>>> Do you know what the "device not found" error means?<br>
>>>>>><br>
>>>>>> It seems attaching virtio-disk1 failed.<br>
>>>>>> Can you provide the log when you attach virtio-disk1?<br>
>>>>>><br>
>>>>>> Thanks.<br>
>>>>>> Wen Congyang<br>
>>>>>><br>
>>>>>>><br>
>>>>>>> Thanks.<br>
>>>>>>><br>
>>>>>>> Shi<br>
>>>>>>><br>
>>>>>><br>
>>>>>><br>
>>>>><br>
>>>>><br>
>>>><br>
>>>><br>
>>><br>
>>><br>
>>> --<br>
>>> Shi Jin, Ph.D.<br>
>>><br>
>>><br>
>><br>
>><br>
>> --<br>
>> Shi Jin, Ph.D.<br>
>><br>
>><br>
><br>
><br>
<br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Shi Jin, Ph.D.<br><br>
</div>