Re: Using XML returned from domain hook script

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

 



On Sun, Oct 29, 2017 at 08:39:08PM -0600, Jim Fehlig wrote:
> Hi All,
> 
> It may be a foolish en devour, but I'm trying to make a qemu hook script
> that provides the semantics of an old, custom xen block script. The script
> parses <disk> info, does some setup based on that, and then rewrites part of
> the config based on results of the setup. As an example, here is an XML
> snippet of a <disk> device on input to the hook script
> 
>   <disk type='block' device='disk'>
>     <driver name='qemu' type='raw'/>
>     <source dev='some-dev-config'/>
>     <target dev='vdb' bus='virtio'/>
>   </disk>
> 
> and XML returned by the script
> 
>   <disk type='block' device='disk'>
>     <driver name='qemu' type='raw'/>
>     <source dev='/dev/foo'/>
>     <target dev='vdb' bus='virtio'/>
>   </disk>
> 
> The hook script performs the setup and substitution in the "prepare" phase,
> but I noticed the results are never used when subsequently starting the
> domain. Indeed qemuProcessStartHook passes a NULL buffer to virHookCall, so
> the output XML of the hook is never collected. Does anyone have objections
> to using the XML returned from the "prepare" and "release" hook script
> phases, similar to how it is used in the "restore" and "migrate" phases?

That was an explicit decision - we don't want hook scripts arbitrarily
modifying the XML during startup. They're there to let you trigger
external actions, but they're not there to let you modify the config.

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 :|

--
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]
  Powered by Linux