util: Refactor code for creating resctrl group
util: Refactor code for creating resctrl group

The code for creating resctrl allocation group could be reused
for monitoring group, refactor it for reuse in the later patch.

Signed-off-by: Wang Huaqiang <d50c218ff14e8070a7288e1c175a5d8637d7ddbf@intel.com>
Reviewed-by: John Ferlan <87558058f6f829e5ec976c8ef960720af4ff9c7d@redhat.com>

libvirt/libvirt,fabianfreyer/libvirt,jardasgit/libvirt,jardasgit/libvirt,jardasgit/libvirt,jfehlig/libvirt,nertpinx/libvirt,eskultety/libvirt,jfehlig/libvirt,andreabolognani/libvirt,eskultety/libvirt,zippy2/libvirt,jardasgit/libvirt,andreabolognani/libvirt,andreabolognani/libvirt,nertpinx/libvirt,fabianfreyer/libvirt,libvirt/libvirt,olafhering/libvirt,eskultety/libvirt,jfehlig/libvirt,andreabolognani/libvirt,olafhering/libvirt,eskultety/libvirt,andreabolognani/libvirt,nertpinx/libvirt,olafhering/libvirt,nertpinx/libvirt,jfehlig/libvirt,libvirt/libvirt,libvirt/libvirt,fabianfreyer/libvirt,zippy2/libvirt,crobinso/libvirt,crobinso/libvirt,jardasgit/libvirt,crobinso/libvirt,fabianfreyer/libvirt,eskultety/libvirt,zippy2/libvirt,crobinso/libvirt,olafhering/libvirt,fabianfreyer/libvirt,nertpinx/libvirt,zippy2/libvirt