Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Some links on this page are affiliate links: if you buy through them we may earn a commission, at no extra cost to you.

Yes—QEMU supports virtual CPU hot-plug, but only when the machine type, CPU topology, firmware, and guest operating system are prepared for it. You normally boot with fewer vCPUs than a declared maxcpus value, then add an available CPU slot through QMP or a management layer such as libvirt. Hot-unplug is more constrained: device_del starts an asynchronous request, and the guest must offline the processor before QEMU can finish removing it.

What QEMU CPU hot-plug actually changes

CPU hot-plug adds or removes virtual processors presented to a running guest. QEMU and KVM schedule the resulting vCPU threads on the host’s existing physical CPUs. It does not hot-add physical cores, change host CPU capacity, or replace CPU affinity and NUMA planning.

This is different from:

  • Host CPU hotplug, which changes the host kernel’s physical-CPU inventory.
  • CPU pinning, which controls where vCPU threads run.
  • Guest-side online/offline operations, which change whether an already-present CPU is used but do not create a new QEMU CPU device.
  • Changing a VM’s vCPU count for its next boot.

Adding vCPUs can improve throughput only when the host has capacity and the workload can use additional parallelism. Oversubscription, poor NUMA placement, synchronization, or guest-scheduler effects can make performance unchanged or worse.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Prerequisites: reserve capacity before boot

Hot-plug is a pre-planned capacity feature. The VM must start with an initial CPU count below a maximum and with a topology that contains all possible vCPUs. QEMU’s -smp syntax is documented in the QEMU system manual.

#1 Best Overall
Sale
Sunxeke 45‑Pack M6 x16mm Rack Screws, Cage Nuts & Washers Server Cabinet
  • COMPLETE M6 RACK SCREWS KIT:Includes 45 square rack cage nuts, 45 rack mounting screws and 45 black washers stored in a plastic storage box for easy organization and quick access
  • DURABLE CARBON STEEL WITH BLACK NICKEL PLATING:Rack screws and cage nuts are built of carbon steel with black nickel coating to deliver excellent oxidation, rust, corrosion and wear resistance for long-term use in high and low temperature environments
  • PRECISE SHARP THREADS FOR SAFE INSTALLATION:Server rack mounting hardware features deep sharp threads and smooth burr-free surface for secure, safe installation of rack and cabinet equipment
  • UNIVERSAL COMPATIBILITY FOR SQUARE-HOLE RACKS:M6 x 16mm rack screws fit standard 10mm square-hole racks and cabinets; ideal for mounting servers, switches, routers and A/V equipment in data centers and workspaces
  • TIGHT TOLERANCE MANUFACTURING:Conforms to metric standard with less than 0.01mm average error; compact thread structure ensures tight fit, uniform force distribution and resistance against deformation and slipping
-smp cpus=2,maxcpus=8,sockets=1,cores=4,threads=2

Here, two CPUs start present and eight slots are reserved. The product of the topology hierarchy must equal maxcpus, and the initial count cannot exceed it. A simpler test launch is:

qemu-system-x86_64 
  -enable-kvm 
  -machine pc 
  -smp cpus=1,maxcpus=4,sockets=1,cores=4,threads=1 
  -m 2G 
  -qmp unix:/tmp/qmp.sock,server=on,wait=off

Other requirements are equally important:

  • A machine type with CPU hot-plug support.
  • A CPU model and topology valid for that machine type.
  • Firmware and ACPI support for CPU notifications.
  • A guest kernel and policy that support processor hot-add and, if needed, hot-remove.
  • Enough host capacity, with suitable KVM support.
  • A migration plan that keeps machine type, CPU model, topology, and QEMU compatibility consistent.

If maxcpus equals the initial count, there are no spare slots to add later. Reserving a maximum is not an unrestricted promise that every arbitrary topology can be inserted.

Direct QMP workflow

QMP is the lowest-level supported interface. The safest procedure is to ask the running QEMU process which CPU devices are available instead of constructing a device definition from memory. QEMU’s CPU hotplug guide and QMP reference describe these commands.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  1. Connect to the QMP UNIX socket and negotiate capabilities.
  2. Run query-hotpluggable-cpus.
  3. Choose an unused result. Possible CPUs generally have no qom-path; present CPUs do.
  4. Copy the returned CPU type and topology properties into device_add.
  5. Wait for the guest to discover and online the processor.
  6. Use query-cpus-fast to inspect QEMU’s current CPU devices and verify the guest separately.
{ "execute": "qmp_capabilities" }
{ "execute": "query-hotpluggable-cpus" }

{ "execute": "device_add",
  "arguments": {
    "id": "cpu-hotplug-1",
    "driver": "MODEL_FROM_QUERY",
    "socket-id": 0,
    "core-id": 1,
    "thread-id": 0
  }
}
{ "execute": "query-cpus-fast" }

The driver name and properties above are deliberately placeholders. For one documented x86 example, QEMU returns an IvyBridge-IBRS-x86_64-cpu type and socket/core/thread values, which are then passed to device_add. Your machine type, CPU model, and QEMU release can return different values. A successful device_add reply means QEMU accepted the request; it does not prove that the guest has onlined the CPU.

Rank #2
M6 Cage Nuts, Screws and Washers [Size: M6 x 16mm 50 Pack] Rack Mount Screws Hardware for use with Network and Server Rack Accessories, Routers, Cabinets and Enclosures.
  • Pro Grade – Here is our new Black M6 Rack Screws and Cage Nuts Set [25 x Server Rack Screws, 25 x Cage Rack Nuts, 25 x Washers] used for mounting server racks, enclosures, cabinets, and more.
  • Strong & Durable – Our Rack Cage Nuts & Relay Rack Screws for server rack have a high-grade carbon steel construction to prevent stripping. The M6 Cage Nuts and Bolts have also been coated in zinc chromate plating for resistance from corrosion.
  • Wide application – Our rack screws & nuts are universally compatible with all square hole racks & cabinets. This makes the rack cage nuts and screws suitable for mounting all server rack hardware, including rack server cabinets, server shelves, A/V device enclosures, and other server mounting procedures.
  • Easy to install – Our server rack screws and clip nuts have a Phillip’s truss-head with self-guiding pilot points to allow you to install in no time. The rackmount screws and nuts thread are extra sharp, clean & accurate, offering a smooth & satisfying installation process.
  • Essential Bundle – Our Cage nuts & screws m6 set includes all the essential parts for mounting your server equipment. Pack not only includes screws & cage nuts; we have also thrown in additional heavy-duty washers to reduce any marks or scratches when installed. We truly believe our server rack nuts and bolts set is the best in the marketplace and we stand by that. If our cage nut set starts driving you nuts, we’ll FULLY REFUND YOU. So, click “Add to Cart” now and buy with confidence.

Production software normally sends JSON over QMP rather than relying on an interactive qmp-shell. Track replies and asynchronous events, and avoid reusing a device ID.

Verify the guest, not just QEMU

On Linux, check both the CPUs that exist and those currently online:

lscpu
nproc
cat /sys/devices/system/cpu/online
cat /sys/devices/system/cpu/present
cat /sys/devices/system/cpu/cpu2/online

A newly discovered CPU may be automatically onlined, depending on the kernel and distribution. If the online file exists and policy permits it, an administrator can request that it be onlined:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
echo 1 | sudo tee /sys/devices/system/cpu/cpu2/online

This is a guest operating-system operation, not a QEMU command. CPU numbering, file availability, and automatic-online policy vary. Windows and other operating systems have their own processor-hotplug rules, editions, and possible reboot requirements; validate the exact guest version rather than assuming universal support.

Rank #3
50 PACK M6 x 16mm Rack Mount Cage Nuts, Screws and Washers for Rack Mount Server Cabinet, Rack Mount Server Shelves, Routers, Rack Mount Screws and Square Insert Nuts, Self-Locking Cable Ties for Free
  • 【Wide Application】 XOOL M6 Rack Mount Screw Kit is great for mounting your rack server cabinets, server shelves, A/V device enclosures, and more. These M6 cage nuts and screws are universally compatible with all square-hole racks and cabinets. Easily mount your equipment using this convenient kit, which comes with everything you'll need to get the job done. These self-locking cable ties are perfect for computer, appliance and electronic cord organization, wire management and storage.
  • 【Superb Quality】 The cage nuts and screws is made of high quality Carbon Steel. The Carbon Steel material features strength and offers good corrosion resistance in bad environment like high temperature, cold weather, and high humidity areas. They have superior rust resistance and the excellent of oxidation resistance, which can ensure long time using and prolong screws and nuts lifespan. Wear resistant feature make the cage nuts and screws more durable and solid.
  • 【Standard Metric】 Our M6 screws and cage nuts accord with standardized metric system. And the average error is less than 0.01mm. The screw thread is very sharp, clean and accurate without burr. The compact and force uniform screw thread is not easy to out of shape and slid in the process of rolling and installation. The deep and clear flat cross head can make your working more easily and improve your work efficiency.
  • 【Safety and Eco-Friendly】 XOOL M6 screws and cage nuts use high quality Carbon Steel raw material, which is environmental protection and non-poisonous. In the process of using, there are no toxic substances releasing, which will ensure your safety. After heat treating, carbon steel has good mechanical properties of ductility, hardness, yield strength, or impact resistance.
  • 【Thoughtful Design】 We add self-locking Nylon cable ties on our package. The CABLE TIES is good for home, office, garage, workshop and more. And the screw is very easy to insert with hand.

Hot-unplug is a negotiated, asynchronous operation

To request removal through QMP:

{ "execute": "device_del",
  "arguments": { "id": "cpu-hotplug-1" }
}

QEMU sends a CPU hotplug notification through the ACPI interface. The guest must receive it, identify the processor, take it offline, and signal that removal can proceed. The ACPI notification and status mechanism is described in QEMU’s ACPI CPU hotplug specification.

Therefore, device_del is a request, not a synchronous deletion. Poll QMP or the management API, inspect guest CPU state, and handle refusal or delay. Removal may fail for the boot CPU, a CPU needed by an active workload or interrupt path, an indivisible topology unit, or a guest subsystem that has not released the processor.

Using libvirt and virsh

For managed VMs, libvirt is usually preferable to hand-written QMP because it maintains domain XML and lifecycle state. Inspect the current and maximum counts first:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
virsh vcpucount DOMAIN
virsh dumpxml DOMAIN
virsh version
virsh help setvcpus

To request a live count change:

virsh setvcpus DOMAIN COUNT --live

On versions that expose it and for domains whose hypervisor configuration supports it, request hotpluggable vCPUs explicitly:

Rank #4
RVIEVJP 50 Pack M6 x 16mm Rack Mount Cage Nuts, Screws & Washers
  • 【UNIVERSAL 19-INCH RACK COMPATIBILITY】No more ill-fitting hardware! Our M6 x 16mm fasteners fit all standard 19-inch SERVER RACKS, network cabinets and data centers—seamless lock-in, zero size guesswork, no return risks for mismatched parts. Perfect for your rack mount setup
  • 【DURABLE BLACK ZINC-PLATED BUILD】Fight mild rust and stripping! Our RACK MOUNT HARDWARE features thick BLACK ZINC PLATING on carbon steel—resists wear, bending and indoor/semi-outdoor corrosion for 2+ years. Sturdier than generic flimsy fasteners
  • 【50-PACK ALL-IN-ONE CAGE NUTS KIT】No mid-install part runs! Our complete 50-pack of CAGE NUTS includes matching M6 screws, washers + FREE self-locking cable ties—exact parts for rack/cabinet builds, no extra hardware store trips
  • 【TOOL-FREE SNAP-ON EASY INSTALL】Skip complex tools and slow builds! Our RACK MOUNT SCREWS pair with snap-on cage nuts (hand-installed)—twist in with a basic Phillips driver, no stripping. Finish your rack setup in 10-15 mins, even for first-timers
  • 【MULTI-USE RACK ACCESSORY HARDWARE】Max out your setup versatility! This hardware works for all NETWORK AND SERVER RACK ACCESSORIES—small business racks, office cabinets, home labs, audio racks. Washers prevent scratches, cable ties tidy wiring
virsh setvcpus DOMAIN COUNT --live --hotpluggable

Common scope flags have different meanings:

  • --live: change the running guest.
  • --config: change the persistent definition used on a future boot.
  • --current: apply to the current definition according to libvirt’s rules.
  • --maximum --config: change the persistent maximum rather than only the currently active count.

Consult the installed command help: accepted flags and behavior depend on libvirt and QEMU versions. Libvirt maps a requested count onto eligible hotplug entities; it cannot create capacity that was not reserved in the domain’s topology. XML may represent individual vCPU enabled and hotpluggable state, but its exact form is version- and configuration-dependent. The libvirt setvcpus reference documents the core operation.

QMP, libvirt, or a higher-level platform?

Method Best use Strength Main risk
QMP Custom orchestration and debugging Exact device and topology control Easy to violate slot or topology rules; asynchronous state is your responsibility
libvirt Ordinary production administration Persistent XML and lifecycle integration Topology details may be abstracted; behavior varies by versions
Higher-level platforms Fleet automation Policy, scheduling, and audit The platform may restrict or hide QEMU’s capability

Architecture, topology, and migration

x86 pc machines commonly use ACPI CPU hotplug with socket, core, and thread placement. Do not copy that command to another architecture. AArch64 virt has machine- and GIC-dependent CPU limits and topology rules; its documentation also warns that -cpu max can hurt migration compatibility when feature sets differ between QEMU versions. See the ARM virt documentation and CPU model guidance. s390x, pSeries, and other machines have their own layouts and interfaces.

Versioned machine types matter. A VM that works locally can fail to migrate if source and destination QEMU versions, host CPU features, machine aliases, or final vCPU topology differ. Treat the maximum topology and CPU model as part of the migration contract. Test migration after both hot-add and hot-unplug, not merely at the initial boot state.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Troubleshooting

Symptom Likely cause What to check
No hotplug slots No spare maxcpus capacity, full topology, unsupported machine type, or management-layer configuration Compare initial CPUs with maxcpus, inspect the complete QEMU command line and machine type, and recreate the VM if capacity was never reserved.
device_add rejects CPU/topology Wrong model, occupied slot, or invalid socket/core/thread combination Run query-hotpluggable-cpus and copy the exact type and properties from an unused result.
QEMU accepts add; guest count is unchanged Missing guest ACPI support, CPU discovered but offline, or guest policy prevents online Check lscpu, present, online, guest logs, and the individual CPU’s online file.
Unplug never completes Guest did not process ACPI, CPU is not removable, or caller assumed synchronous behavior Check guest kernel logs and offline state; poll QMP/libvirt until completion or an explicit failure.
Migration fails afterward Incompatible QEMU versions, machine types, CPU features, or topology Use a stable CPU model, avoid untested -cpu max combinations, and test the post-hotplug state on the destination.
Performance does not scale Host oversubscription, NUMA mismatch, emulator contention, or workload serialization Review placement and scheduling; hotplug changes available capacity, not guaranteed application throughput.

When a reboot is the better choice

Use a shutdown-and-reconfigure resize when the guest’s hotplug support is unreliable, topology must remain NUMA-symmetric, licensing is tied to a fixed CPU count, latency sensitivity makes topology changes undesirable, or migration compatibility cannot be guaranteed. Other alternatives include booting with the maximum and controlling utilization, scaling stateless services across more VMs or containers, and using pinning or NUMA tuning when the real requirement is isolation rather than changing capacity. Memory hotplug addresses a different resource and is not a substitute for vCPU hotplug.

Best Value
Leadrise 50-Pack M6 x 16mm Computer Rack Mount Cage Screws, Nuts & Washers for Server Cabinet - Black
  • Accurate & Durable Design:Our M6 screws and cage nuts are manufactured to strict metric standards with an average tolerance of less than 0.01 mm for accurate fit and reliable performance. The threads are sharp, clean, and burr-free, ensuring smooth installation. The compact, evenly distributed thread design resists deformation and slipping during fastening. A deep, well-defined Phillips head allows for easier operation and improved work efficiency.
  • Heavy-Duty & Long-Lasting:Constructed from premium carbon steel with a protective black nickel coating to resist rust and oxidation. Designed to withstand high temperatures, cold weather, and other harsh conditions for reliable, long-term performance.
  • Clean & Professional Look:Finished in sleek black nickel to match most rack systems, delivering a clean, organized, and professional appearance inside your cabinet.
  • Wide Application:Perfect for server cabinets, rack shelves, and A/V enclosures. Compatible with all standard square-hole racks, this M6 cage nut and screw kit provides secure installation hardware along with durable self-locking cable ties for clean and organized wire management.
  • 50-Pack Complete Set – Comes with 50 cage nuts, 50 mounting screws, and 50 black washers. Packaged in a sturdy small box to keep everything organized and easy to store.

Operational checklist

  • Choose and pin a supported machine type and CPU model.
  • Reserve a complete, valid maximum topology with maxcpus.
  • Confirm firmware and guest processor-hotplug support.
  • Test QMP discovery with query-hotpluggable-cpus.
  • Add a slot and verify both QEMU state and guest online state.
  • Test unplug, including delayed or refused completion.
  • Test live migration after topology changes.
  • Automate polling, guest-state checks, and rollback rather than treating replies as proof of completion.

Frequently Asked Questions

Does QEMU CPU hot-plug add physical CPU capacity?

No. It adds virtual CPUs to the guest; QEMU still schedules their threads on the host’s existing processors.

Can I hot-add CPUs if I forgot maxcpus at boot?

Usually not. Without spare topology slots reserved at startup, you generally must reconfigure and reboot the VM.

Is device_del immediate for a vCPU?

No. It requests removal through ACPI, and the guest must offline the CPU before QEMU can complete the operation.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The Bottom Line

QEMU vCPU hot-plug is reliable when treated as planned topology capacity: reserve maxcpus, query the running instance for valid slots, verify the guest independently, and handle unplug and migration asynchronously.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.