[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [libvirt] [PATCH] qemu: Allow memAccess for hugepages again



On 06/06/2017 11:42 AM, Michal Privoznik wrote:
> https://bugzilla.redhat.com/show_bug.cgi?id=1458638
> 
> Historically, we've always supported memAccess for domains backed
> by hugepages. However, somewhere along the way we've regressed
> and stopped allowing such configuration. Fix it.
> 
> Signed-off-by: Michal Privoznik <mprivozn redhat com>
> ---
>  src/qemu/qemu_command.c                            |  4 +-
>  .../qemuxml2argv-hugepages-memaccess.args          | 38 ++++++++++++++++++
>  .../qemuxml2argv-hugepages-memaccess.xml           | 45 ++++++++++++++++++++++
>  tests/qemuxml2argvtest.c                           |  1 +
>  4 files changed, 87 insertions(+), 1 deletion(-)
>  create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-hugepages-memaccess.args
>  create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-hugepages-memaccess.xml
> 
> diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
> index 015af1036..2a076301f 100644
> --- a/src/qemu/qemu_command.c
> +++ b/src/qemu/qemu_command.c
> @@ -3361,7 +3361,9 @@ qemuBuildMemoryBackendStr(virJSONValuePtr *backendProps,
>          return -1;
>  
>      if (pagesize || mem->nvdimmPath ||
> -        def->mem.source == VIR_DOMAIN_MEMORY_SOURCE_FILE) {
> +        def->mem.source == VIR_DOMAIN_MEMORY_SOURCE_FILE ||
> +        (memAccess == VIR_DOMAIN_MEMORY_ACCESS_SHARED &&
> +         def->mem.nhugepages)) {
>          *backendType = "memory-backend-file";
>  
>          if (mem->nvdimmPath) {


Self NACK. We need a better fix. Basically, whenever memAccess is
something else than default, we have to use memory-backend-file as
that's the only device that allows setting `share` attribute.

Michal


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]