[libvirt] [PATCH] [5/6] Add script hook support to the QEmu driver

Eric Blake eblake at redhat.com
Fri Mar 26 17:09:08 UTC 2010


On 03/26/2010 09:45 AM, Daniel Veillard wrote:
> +    /* now that we know it is about to start call the hook if present */
> +    if (virHookPresent(VIR_HOOK_DRIVER_QEMU)) {
> +        char *xml = virDomainDefFormat(vm->def, 0);
> +        int hookret;
> +
> +        hookret = virHookCall(VIR_HOOK_DRIVER_QEMU, vm->def->name,
> +                    VIR_HOOK_QEMU_OP_START, VIR_HOOK_SUBOP_BEGIN, NULL, xml);
> +        VIR_FREE(xml);
> +
> +        /*
> +         * If the script raised an error abort the launch
> +         */
> +        if (hookret < 0)
> +            goto cleanup;

Should we also report an error if virHookCall returned 1 because the
hook could not be run?

> +        /* we can't stop the operation even if the script raised an error */
> +        virHookCall(VIR_HOOK_DRIVER_QEMU, vm->def->name,
> +                    VIR_HOOK_QEMU_OP_STOPPED, VIR_HOOK_SUBOP_END, NULL, xml);

Likewise, should we report if virHookCall returns non-zero, even though
we don't abort the operation?

-- 
Eric Blake   eblake at redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 323 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20100326/da699f9d/attachment-0001.sig>


More information about the libvir-list mailing list