mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
qemu: virtiofs can be used without NUMA nodes
...if a machine memory-backend using shared memory is configured for
the guest. This is especially important for QEMU machine types that
don't have NUMA but virtiofs support.
An example snippet:
<domain type='kvm'>
<name>test</name>
<memory unit='KiB'>2097152</memory>
<memoryBacking>
<access mode='shared'/>
</memoryBacking>
<devices>
<filesystem type='mount' accessmode='passthrough'>
<driver type='virtiofs'/>
<source dir='/tmp/test'/>
<target dir='coffee'/>
</filesystem>
...
</devices>
...
</domain>
and the corresponding QEMU command line:
/usr/bin/qemu-system-s390x \
-machine s390-ccw-virtio-5.2,memory-backend=s390.ram \
-m 2048 \
-object
memory-backend-file,id=s390.ram,mem-path=/var/lib/libvirt/qemu/ram/46-test/s390.ram,share=yes,size=2147483648 \
...
Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
committed by
Michal Privoznik
parent
4cb5f34905
commit
e2425a1727
@@ -3470,14 +3470,19 @@ qemuValidateDomainDeviceDefGraphics(const virDomainGraphicsDef *graphics,
|
||||
|
||||
|
||||
static int
|
||||
qemuValidateDomainDefVirtioFSSharedMemory(const virDomainDef *def)
|
||||
qemuValidateDomainDefVirtioFSSharedMemory(const virDomainDef *def,
|
||||
virQEMUCapsPtr qemuCaps)
|
||||
{
|
||||
const char *defaultRAMId = virQEMUCapsGetMachineDefaultRAMid(qemuCaps,
|
||||
def->virtType,
|
||||
def->os.machine);
|
||||
size_t numa_nodes = virDomainNumaGetNodeCount(def->numa);
|
||||
size_t i;
|
||||
|
||||
if (numa_nodes == 0) {
|
||||
if (numa_nodes == 0 &&
|
||||
!(defaultRAMId && def->mem.access == VIR_DOMAIN_MEMORY_ACCESS_SHARED)) {
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||
_("virtiofs requires one or more NUMA nodes"));
|
||||
_("virtiofs requires shared memory"));
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -3591,7 +3596,7 @@ qemuValidateDomainDeviceDefFS(virDomainFSDefPtr fs,
|
||||
_("virtiofs does not support multidevs"));
|
||||
return -1;
|
||||
}
|
||||
if (qemuValidateDomainDefVirtioFSSharedMemory(def) < 0)
|
||||
if (qemuValidateDomainDefVirtioFSSharedMemory(def, qemuCaps) < 0)
|
||||
return -1;
|
||||
break;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user