Re: [PATCH RFC 01/22] qemu_process: Move process code from qemu_capabilities to qemu_process

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

 



On Sun, Nov 11, 2018 at 13:59:09 -0600, Chris Venteicher wrote:
> Qemu process code in qemu_capabilities.c is moved to qemu_process.c in
> order to make the code usable outside the original capabilities
> usecases.
> 
> This process code activates and manages Qemu processes without
> establishing a guest domain.
> 
> This patch is a straight cut/paste move between files.
> 
> Following patches modify the process code
> making it more generic and consistent with qemu_process.
> 
> Signed-off-by: Chris Venteicher <cventeic@xxxxxxxxxx>
> ---
>  src/qemu/qemu_capabilities.c | 218 +----------------------------------
>  src/qemu/qemu_process.c      | 201 ++++++++++++++++++++++++++++++++
>  src/qemu/qemu_process.h      |  29 +++++
>  3 files changed, 231 insertions(+), 217 deletions(-)
> 
...
> diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
> index 06a65b44e4..0b3922fa39 100644
> --- a/src/qemu/qemu_process.c
> +++ b/src/qemu/qemu_process.c
> @@ -8064,3 +8064,204 @@ qemuProcessReconnectAll(virQEMUDriverPtr driver)
>      struct qemuProcessReconnectData data = {.driver = driver};
>      virDomainObjListForEach(driver->domains, qemuProcessReconnectHelper, &data);
>  }
> +
> +
> +static void virQEMUCapsMonitorNotify(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
> +                                     virDomainObjPtr vm ATTRIBUTE_UNUSED,
> +                                     void *opaque ATTRIBUTE_UNUSED)
> +{
> +}
> +
> +static qemuMonitorCallbacks callbacks = {
> +    .eofNotify = virQEMUCapsMonitorNotify,
> +    .errorNotify = virQEMUCapsMonitorNotify,
> +};
> +
> +
> +
> +

Two empty lines would be enough.

> +void
> +virQEMUCapsInitQMPCommandFree(virQEMUCapsInitQMPCommandPtr cmd)
> +{
> +    if (!cmd)
> +        return;
> +
> +    virQEMUCapsInitQMPCommandAbort(cmd);
> +    VIR_FREE(cmd->binary);
> +    VIR_FREE(cmd->monpath);
> +    VIR_FREE(cmd->monarg);
> +    VIR_FREE(cmd->pidfile);
> +    VIR_FREE(cmd);
> +}
...
> diff --git a/src/qemu/qemu_process.h b/src/qemu/qemu_process.h
> index 2037467c94..4ba3988e3d 100644
> --- a/src/qemu/qemu_process.h
> +++ b/src/qemu/qemu_process.h
> @@ -214,4 +214,33 @@ int qemuProcessStartManagedPRDaemon(virDomainObjPtr vm);
>  
>  void qemuProcessKillManagedPRDaemon(virDomainObjPtr vm);
>  
> +typedef struct _virQEMUCapsInitQMPCommand virQEMUCapsInitQMPCommand;
> +typedef virQEMUCapsInitQMPCommand *virQEMUCapsInitQMPCommandPtr;
> +struct _virQEMUCapsInitQMPCommand {
> +    char *binary;
> +    uid_t runUid;
> +    gid_t runGid;
> +    char **qmperr;
> +    char *monarg;
> +    char *monpath;
> +    char *pidfile;
> +    virCommandPtr cmd;
> +    qemuMonitorPtr mon;
> +    virDomainChrSourceDef config;
> +    pid_t pid;
> +    virDomainObjPtr vm;
> +};
> +
> +virQEMUCapsInitQMPCommandPtr virQEMUCapsInitQMPCommandNew(char *binary,
> +                                                          const char *libDir,
> +                                                          uid_t runUid,
> +                                                          gid_t runGid,
> +                                                          char **qmperr);
> +
> +void virQEMUCapsInitQMPCommandFree(virQEMUCapsInitQMPCommandPtr cmd);
> +
> +int virQEMUCapsInitQMPCommandRun(virQEMUCapsInitQMPCommandPtr cmd, bool forceTCG);

Each parameter on its own line, please.

Jirka

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