Re: Calling 'virsh' from within a hook script - avoid deadlock?

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

 



On 06.11.2013 11:23, TSADOK, Shlomi (Shlomi) wrote:
> I'm trying to create a hook that attaches several virtio-scsi disks to a
> starting vm,
> 
> and it seems like the hook enters a deadlock while attempting to do so.
> 
>  
> 
> Is there any workaround around this? Any better way, forking virsh
> execution somehow?
> 
>  
> 
> Could anyone explain why this is creating a deadlock in the first place?
> Isn't libvirt multithreaded?
> 
>  
> 
> Thanks for the help!
> 
>  
> 
> Shlomi
> 
>  
> 
> ### hook script:
> 
>  
> 
> #!/bin/bash
> 
>  
> 
> enum_scsi() {
> 
>     scsi_devices=`cd /dev;ls sd[^a]*`
> 
> }
> 
>  
> 
> gen_hba_xml() {
> 
>     cat > ./hba.xml << EOF
> 
>     <controller type='scsi' model='virtio-scsi'/>
> 
> EOF
> 
> }
> 
>  
> 
> passthrough_start() {
> 
>     # create virtio-scsi HBA
> 
>     gen_hba_xml
> 
>     virsh attach-device --persistent $domain_name ./hba.xml
> 
>     rm -f ./hba.xml

http://libvirt.org/hooks.html#recursive

Do not do this.

Michal

_______________________________________________
libvirt-users mailing list
libvirt-users@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvirt-users




[Index of Archives]     [Virt Tools]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [KDE Users]

  Powered by Linux