[libvirt-users] why attach-disk can't be effective when the guest is booting

Daniel P. Berrangé berrange at redhat.com
Thu Mar 7 09:49:49 UTC 2019


On Thu, Mar 07, 2019 at 05:15:49PM +0800, Jianan Gao wrote:
> Hi,
>       When i use "virsh attach-device rhel disk.xml" when the guest is
> booting,then i can't find the disk in the guest after booting.But i can
> find it by "virsh domblklist rhel",and when i want to detach it from the
> guest and use "virsh detach-disk rhel vdb", i still can find the disk by
> "virsh domblklist rhel"
>     The disk.xml is like:
> <disk type="file" device="disk">
> <driver name='qemu' type='raw' cache='none'/>
> <source file="/var/lib/libvirt/images/foo.img"/>
> <target dev="vdb" bus="virtio"/>
> </disk>
> 
> Libvirt-release is 5.0.0.4 and the qemu-kvm release is 3.1.0
> 
> So i want to know why it failed to attach-disk when booting,and why we design
> in this way.Maybe it's better to return failure if we can't use it like
> this.

Hotplug uses ACPI and thus relies on the guest OS to be processing ACPI
hotplug requests. If the OS hasn't initialized sufficiently then it is
possible it might miss th ACPI event, though I'd hope well written OS
would cope wit hthis & catch up later. In any guest its a guest OS problem.

Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|




More information about the libvirt-users mailing list