mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-04 21:47:16 +03:00
qemu: Introduce QEMU_CAPS_DEVICE_NVDIMM
Introduce a qemu capability for -device nvdimm. Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
b4e8a49f8d
commit
e21250dee8
@ -359,6 +359,7 @@ VIR_ENUM_IMPL(virQEMUCaps, QEMU_CAPS_LAST,
|
||||
"query-cpu-model-expansion", /* 245 */
|
||||
"virtio-net.host_mtu",
|
||||
"spice-rendernode",
|
||||
"nvdimm",
|
||||
);
|
||||
|
||||
|
||||
@ -1619,6 +1620,7 @@ struct virQEMUCapsStringFlags virQEMUCapsObjectTypes[] = {
|
||||
{ "ivshmem-plain", QEMU_CAPS_DEVICE_IVSHMEM_PLAIN },
|
||||
{ "ivshmem-doorbell", QEMU_CAPS_DEVICE_IVSHMEM_DOORBELL },
|
||||
{ "vhost-scsi", QEMU_CAPS_DEVICE_VHOST_SCSI },
|
||||
{ "nvdimm", QEMU_CAPS_DEVICE_NVDIMM },
|
||||
};
|
||||
|
||||
static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsVirtioBalloon[] = {
|
||||
@ -4542,6 +4544,13 @@ virQEMUCapsInitQMPMonitor(virQEMUCapsPtr qemuCaps,
|
||||
virQEMUCapsProbeQMPGICCapabilities(qemuCaps, mon) < 0)
|
||||
goto cleanup;
|
||||
|
||||
/* Prealloc on NVDIMMs is broken on older QEMUs leading to
|
||||
* user data corruption. If we are dealing with such version
|
||||
* of QEMU pretend we don't know how to NVDIMM. */
|
||||
if (qemuCaps->version < 2009000 &&
|
||||
virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_NVDIMM))
|
||||
virQEMUCapsClear(qemuCaps, QEMU_CAPS_DEVICE_NVDIMM);
|
||||
|
||||
ret = 0;
|
||||
cleanup:
|
||||
return ret;
|
||||
|
@ -394,6 +394,7 @@ typedef enum {
|
||||
QEMU_CAPS_QUERY_CPU_MODEL_EXPANSION, /* qmp query-cpu-model-expansion */
|
||||
QEMU_CAPS_VIRTIO_NET_HOST_MTU, /* virtio-net-*.host_mtu */
|
||||
QEMU_CAPS_SPICE_RENDERNODE, /* -spice rendernode */
|
||||
QEMU_CAPS_DEVICE_NVDIMM, /* -device nvdimm */
|
||||
|
||||
QEMU_CAPS_LAST /* this must always be the last item */
|
||||
} virQEMUCapsFlags;
|
||||
|
Loading…
x
Reference in New Issue
Block a user