[libvirt] [PATCHv4 3/3] qemu: Add args generation for file memory backing

Daniel P. Berrange berrange at redhat.com
Mon Jan 30 11:38:08 UTC 2017


On Sat, Jan 28, 2017 at 03:03:16PM +0100, Michal Privoznik wrote:
> On 13.12.2016 13:12, Jaroslav Safka wrote:
> > This patch add support for file memory backing on numa topology.
> > 
> > The specified access mode in memoryBacking can be overriden
> > by specifying token memAccess in numa cell.
> > ---
> >  src/qemu/qemu_command.c                            | 113 ++++++++++++++-------
> >  .../qemuxml2argv-fd-memory-no-numa-topology.args   |  21 ++++
> >  .../qemuxml2argv-fd-memory-no-numa-topology.xml    |  27 +++++
> >  .../qemuxml2argv-fd-memory-numa-topology.args      |  24 +++++
> >  .../qemuxml2argv-fd-memory-numa-topology.xml       |  30 ++++++
> >  .../qemuxml2argv-fd-memory-numa-topology2.args     |  26 +++++
> >  .../qemuxml2argv-fd-memory-numa-topology2.xml      |  31 ++++++
> >  .../qemuxml2argv-fd-memory-numa-topology3.args     |  30 ++++++
> >  .../qemuxml2argv-fd-memory-numa-topology3.xml      |  32 ++++++
> >  tests/qemuxml2argvtest.c                           |  12 ++-
> >  tests/qemuxml2xmltest.c                            |   1 -
> >  11 files changed, 308 insertions(+), 39 deletions(-)
> >  create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-fd-memory-no-numa-topology.args
> >  create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-fd-memory-no-numa-topology.xml
> >  create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-fd-memory-numa-topology.args
> >  create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-fd-memory-numa-topology.xml
> >  create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-fd-memory-numa-topology2.args
> >  create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-fd-memory-numa-topology2.xml
> >  create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-fd-memory-numa-topology3.args
> >  create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-fd-memory-numa-topology3.xml
> 
> A lot of tests. Impressive.
> 
> > 
> > diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
> > index 7d186d2..a897ed5 100644
> > --- a/src/qemu/qemu_command.c
> > +++ b/src/qemu/qemu_command.c
> > @@ -3315,15 +3315,11 @@ qemuBuildMemoryBackendStr(unsigned long long size,
> >      if (!(props = virJSONValueNewObject()))
> >          return -1;
> >  
> > -    if (pagesize) {
> > -        if (qemuGetDomainHupageMemPath(def, cfg, pagesize, &mem_path) < 0)
> > -            goto cleanup;
> > -
> > +    if (def->mem.source == VIR_DOMAIN_MEMORY_SOURCE_FILE) {
> >          *backendType = "memory-backend-file";
> >  
> >          if (virJSONValueObjectAdd(props,
> > -                                  "b:prealloc", true,
> > -                                  "s:mem-path", mem_path,
> > +                                  "s:mem-path", cfg->libDir,
> 
> Really? cfg->libDir should stay intact. Should QEMU need to create a
> file, something cfg->stateDir based is probably more suitable. Or even
> some /tmp/ based path. Or am I misunderstanding something?

You don't want multi-GB files created in /tmp, nor cfg->stateDir
which is also on tmpfs


Regards,
Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://entangle-photo.org       -o-    http://search.cpan.org/~danberr/ :|




More information about the libvir-list mailing list