[libvirt] [PATCH 05/24] qemu: Introduce qemuProcessIncomingDef

Peter Krempa pkrempa at redhat.com
Fri Nov 13 09:53:28 UTC 2015


On Thu, Nov 12, 2015 at 19:37:07 +0100, Jiri Denemark wrote:
> Incoming migration may require quite a few parameters (URI, fd, path) to
> be considered while starting QEMU and we will soon add another one.
> Let's group all of them in a single struct.
> 
> Signed-off-by: Jiri Denemark <jdenemar at redhat.com>
> ---
>  src/qemu/qemu_process.c | 67 +++++++++++++++++++++++++++++++++++++++----------
>  src/qemu/qemu_process.h | 14 +++++++++++
>  2 files changed, 68 insertions(+), 13 deletions(-)
> 
> diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
> index fdd640d..638ad02 100644
> --- a/src/qemu/qemu_process.c
> +++ b/src/qemu/qemu_process.c
> @@ -4156,6 +4156,47 @@ qemuLogOperation(virDomainObjPtr vm,

[...]

> +
> +qemuProcessIncomingDefPtr
> +qemuProcessIncomingDefNew(virQEMUCapsPtr qemuCaps,
> +                          const char *migrateFrom,
> +                          int fd,
> +                          const char *path)

Please add a comment stating that @path is not copied, so it has to be
available duirng the lifetime of the struct this allocates.

> +{
> +    qemuProcessIncomingDefPtr inc = NULL;
> +
> +    if (qemuMigrationCheckIncoming(qemuCaps, migrateFrom) < 0)
> +        return NULL;
> +
> +    if (VIR_ALLOC(inc) < 0)
> +        return NULL;
> +
> +    inc->launchURI = qemuMigrationIncomingURI(migrateFrom, fd);
> +    if (!inc->launchURI)
> +        goto error;
> +
> +    inc->fd = fd;
> +    inc->path = path;
> +
> +    return inc;
> +
> + error:
> +    qemuProcessIncomingDefFree(inc);
> +    return NULL;
> +}
> +
> +
>  int qemuProcessStart(virConnectPtr conn,
>                       virQEMUDriverPtr driver,
>                       virDomainObjPtr vm,

ACK
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20151113/edad0c45/attachment-0001.sig>


More information about the libvir-list mailing list