Application Support

Application Support

These objects provide high-level services that applications typically need when building a SPICE client.

Audio

SpiceAudio provides automatic audio playback and recording by connecting to playback and record channels as they appear. Use spice_audio_get() to obtain the session’s audio handler.

USB Device Manager

SpiceUsbDeviceManager manages USB device redirection. It can automatically redirect newly plugged devices based on filter rules, or let the application explicitly connect and disconnect devices.

SpiceUsbDeviceManager *mgr = spice_usb_device_manager_get(session, NULL);
GPtrArray *devices = spice_usb_device_manager_get_devices(mgr);

for (guint i = 0; i < devices->len; i++) {
    SpiceUsbDevice *dev = g_ptr_array_index(devices, i);
    gchar *desc = spice_usb_device_get_description(dev, NULL);
    g_print("Device: %s\n", desc);
    g_free(desc);
}

Smartcard Manager

SpiceSmartcardManager manages smartcard readers and virtual card insertion/removal. Use spice_smartcard_manager_get() to obtain the singleton.

QMP Port

SpiceQmpPort wraps the QEMU Machine Protocol over a SPICE port channel, allowing the client to query VM status and trigger actions like pause, reset, and powerdown.

Utility Functions