How does libvirt support QEMU command line passthrough?

How does libvirt support QEMU command line passthrough?

To deal with the problem, libvirt introduced support for command-line passthrough of QEMU arguments. This is achieved by supporting a custom XML namespace, under which some QEMU driver specific elements are defined. The canonical place to declare the namespace is on the top level element.

Where is the callbackid in libvirt-QEMU?

The callbackID parameter should be the value obtained from a previous virConnectDomainQemuMonitorEventRegister () method. This API is QEMU specific, so it will only work with hypervisor connections to the QEMU driver. Adds a callback to receive notifications of arbitrary qemu monitor events occurring on a domain.

How does libvirt know which host resources a VM can access?

When configuring security protection, however, libvirt generally needs to know exactly which host resources the VM is permitted to access. It gets this information from the domain XML document. This only works for elements in the regular schema, the arguments used with command-line passthrough are completely opaque to libvirt.

How to use libvirt as a monitor command?

Send an arbitrary monitor command @cmd to @domain through the qemu monitor. There are several requirements to safely and successfully use this API: If VIR_DOMAIN_QEMU_MONITOR_COMMAND_HMP is set, the command is considered to be a human monitor command and libvirt will automatically convert it into QMP if needed.

How to convert QEMU command line ARGs to domain XML?

(Note: of course I tried it with actual paths in place of the variables, same error – and if I remove the last two args it converts it to domain XML even with the variables included) How could I solve this? Or what would be the equivalent of the last two args in domain xml?

When to declare the XML namespace in QEMU?

Note that when an argument takes a value eg -newarg parameter, the argument and the value must be passed as separate entries. Instead of declaring the XML namespace on the top level it is also possible to declare it at time of use, which is more convenient for humans writing the XML documents manually.