Re: [PATCH v1 6/6] ivshmem: add start param to server attribute

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

 



On 2014/8/22 18:47, Maxime Leroy wrote:

> +# util/virivshmemserver.h
> +virStartIvshmemServer;
> +virStopIvshmemServer;

I think function name virIvshmemStartServer is better.
So is the stop function.

> @@ -5120,6 +5121,12 @@ qemuBuildIvshmemCommandLine(virCommandPtr cmd,
>                  return -1;
>              virCommandAddArg(cmd, devstr);
>              VIR_FREE(devstr);
> +
> +            if (ivshmem->server.start == VIR_TRISTATE_BOOL_YES) {
> +                if (virStartIvshmemServer(dev->name, ivshmem->server.path,
> +                                          ivshmem->size, ivshmem->msi.vectors))
> +                    return -1;
> +            }
>      }

I'm not sure that calling virStartIvshmemServer in qemuBuildIvshmemCommandLine
is the best way. Maybe qemuBuild*CommandLine() usually only build commandline.

>  
>      return 0;
> diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
> index baa866a..aaf03a3 100644
> --- a/src/qemu/qemu_process.c
> +++ b/src/qemu/qemu_process.c
> @@ -67,6 +67,7 @@
>  #include "virstring.h"
>  #include "virhostdev.h"
>  #include "storage/storage_driver.h"
> +#include "virivshmemserver.h"
>  
>  #define VIR_FROM_THIS VIR_FROM_QEMU
>  
> @@ -4684,6 +4685,15 @@ void qemuProcessStop(virQEMUDriverPtr driver,
>          }
>      }
>  
> +    /* stop runnning ivshmem server */
> +    for (i = 0; i < vm->def->nshmems; i++) {
> +        virDomainShmemDefPtr shmem =  vm->def->shmems[i];
> +        if (shmem->model == VIR_DOMAIN_SHMEM_MODEL_IVSHMEM &&

You can use switch (for extension other shmem in future).


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