[libvirt] [PATCH 1/3] qemu: qemuDomainHotplugVcpus - separate out the add cgroup

Ján Tomko jtomko at redhat.com
Fri Apr 3 07:39:15 UTC 2015


On Thu, Apr 02, 2015 at 12:24:40PM -0400, John Ferlan wrote:
> Future IOThread setting patches would copy the code anyway, so create
> and generalize the add the vcpu to a cgroup into its own API.
> 
> Signed-off-by: John Ferlan <jferlan at redhat.com>
> ---
>  src/qemu/qemu_driver.c | 69 +++++++++++++++++++++++++++++++++++---------------
>  1 file changed, 48 insertions(+), 21 deletions(-)
> 
> diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
> index 6132674..fa880b7 100644
> --- a/src/qemu/qemu_driver.c
> +++ b/src/qemu/qemu_driver.c
> @@ -4635,9 +4635,49 @@ static void qemuProcessEventHandler(void *data, void *opaque)
>      VIR_FREE(processEvent);
>  }
>  
> -static int qemuDomainHotplugVcpus(virQEMUDriverPtr driver,
> -                                  virDomainObjPtr vm,
> -                                  unsigned int nvcpus)
> +typedef int cgroupNewFunc(virCgroupPtr domain,
> +                          int id,
> +                          bool create,
> +                          virCgroupPtr *group);
> +

We have three virCgroupNew* functions that only differ by the parameters
of the virAsprintf call.

Would it make sense to turn them into one like this:

virCgroupNewThread(virCgroupThreadName name,
                   int id,
                   ...)
which would take the name of the thread from the enum, instead of the
function name?

Jan
-------------- 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/20150403/c55b3233/attachment-0001.sig>


More information about the libvir-list mailing list