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