def METHOD_NAME(vm, total_cpus):
    output = vm.monitor.send_args_cmd("info cpus")
    test.log.debug("Output of info CPUs:\n%s", output)
    cpu_regexp = re.compile(r"CPU #(\d+)")
    total_cpus_monitor = len(cpu_regexp.findall(output))
    if total_cpus_monitor != total_cpus:
        test.fail("Monitor reports %s CPUs, when VM should have"
                  " %s" % (total_cpus_monitor, total_cpus))
    error_context.context("hotplugging finished, let's wait a few sec and"
                          " check CPUs quantity in guest.", test.log.info)
    if not utils_misc.wait_for(lambda: cpu.check_if_vm_vcpu_match(
                               total_cpus, vm),
                               60 + total_cpus, first=10,
                               step=5.0, text="retry later"):
        test.fail("CPU quantity mismatch cmd after hotplug !")
    error_context.context("rebooting the vm and check CPU quantity !",
                          test.log.info)
    session = vm.reboot()
    if not cpu.check_if_vm_vcpu_match(total_cpus, vm):
        test.fail("CPU quantity mismatch cmd after hotplug and reboot !")