Re: [PATCH 3/4] libxl: Add support for max_grant_frames

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

 



On Tue, Mar 12, 2019 at 02:34:43PM -0600, Jim Fehlig wrote:
> On 3/12/19 8:17 AM, Daniel P. Berrangé wrote:
> > On Fri, Mar 08, 2019 at 04:05:57PM -0700, Jim Fehlig wrote:
> > > Add support for setting max_grant_frames in libxl domain config
> > > object and include a test to check that it is properly converted
> > > from XML to libxl domain config.
> > > 
> > > Signed-off-by: Jim Fehlig <jfehlig@xxxxxxxx>
> > > ---
> > >   src/libxl/libxl_conf.c                        |  9 ++
> > >   .../max-gntframes-hvm.json                    | 90 +++++++++++++++++++
> > >   .../max-gntframes-hvm.xml                     | 37 ++++++++
> > >   tests/libxlxml2domconfigtest.c                |  3 +
> > >   4 files changed, 139 insertions(+)
> > > 
> > > diff --git a/src/libxl/libxl_conf.c b/src/libxl/libxl_conf.c
> > > index c769050ff1..e55a9fe22e 100644
> > > --- a/src/libxl/libxl_conf.c
> > > +++ b/src/libxl/libxl_conf.c
> > > @@ -393,6 +393,15 @@ libxlMakeDomBuildInfo(virDomainDefPtr def,
> > >       def->mem.cur_balloon = VIR_ROUND_UP(def->mem.cur_balloon, 1024);
> > >       b_info->max_memkb = virDomainDefGetMemoryInitial(def);
> > >       b_info->target_memkb = def->mem.cur_balloon;
> > > +
> > > +#ifdef LIBXL_HAVE_BUILDINFO_GRANT_LIMITS
> > > +    for (i = 0; i < def->ncontrollers; i++) {
> > > +        if (def->controllers[i]->type == VIR_DOMAIN_CONTROLLER_TYPE_XENBUS &&
> > > +            def->controllers[i]->opts.xenbusopts.maxGrantFrames > 0)
> > > +            b_info->max_grant_frames = def->controllers[i]->opts.xenbusopts.maxGrantFrames;
> > > +    }
> > > +#endif
> > > +
> > >       if (hvm || pvh) {
> > >           if (caps &&
> > >               def->cpu && def->cpu->mode == (VIR_CPU_MODE_HOST_PASSTHROUGH)) {
> > > diff --git a/tests/libxlxml2domconfigdata/max-gntframes-hvm.json b/tests/libxlxml2domconfigdata/max-gntframes-hvm.json
> > > new file mode 100644
> > > index 0000000000..ef602f09fc
> > > --- /dev/null
> > > +++ b/tests/libxlxml2domconfigdata/max-gntframes-hvm.json
> > > @@ -0,0 +1,90 @@
> > > +{
> > > +    "c_info": {
> > > +        "type": "hvm",
> > > +        "name": "test-hvm",
> > > +        "uuid": "2147d599-9cc6-c0dc-92ab-4064b5446e9b"
> > > +    },
> > > +    "b_info": {
> > > +        "max_vcpus": 4,
> > > +        "avail_vcpus": [
> > > +            0,
> > > +            1,
> > > +            2,
> > > +            3
> > > +        ],
> > > +        "max_memkb": 1048576,
> > > +        "target_memkb": 1048576,
> > > +        "video_memkb": 8192,
> > > +        "shadow_memkb": 12288,
> > > +        "max_grant_frames": 64,
> > > +        "device_model_version": "qemu_xen",
> > > +        "device_model": "/bin/true",
> > > +        "sched_params": {
> > > +
> > > +        },
> > > +        "type.hvm": {
> > > +            "pae": "True",
> > > +            "apic": "True",
> > > +            "acpi": "True",
> > > +            "vga": {
> > > +                "kind": "cirrus"
> > > +            },
> > > +            "vnc": {
> > > +                "enable": "True",
> > > +                "listen": "0.0.0.0",
> > > +                "findunused": "False"
> > > +            },
> > > +            "sdl": {
> > > +                "enable": "False"
> > > +            },
> > > +            "spice": {
> > > +
> > > +            },
> > > +            "boot": "c",
> > > +            "rdm": {
> > > +
> > > +            }
> > > +        },
> > > +        "arch_arm": {
> > > +
> > > +        }
> > > +    },
> > > +    "disks": [
> > > +        {
> > > +            "pdev_path": "/var/lib/xen/images/test-hvm.img",
> > > +            "vdev": "hda",
> > > +            "backend": "qdisk",
> > > +            "format": "raw",
> > > +            "removable": 1,
> > > +            "readwrite": 1
> > > +        }
> > > +    ],
> > > +    "nics": [
> > > +        {
> > > +            "devid": 0,
> > > +            "mac": "00:16:3e:66:12:b4",
> > > +            "bridge": "br0",
> > > +            "script": "/etc/xen/scripts/vif-bridge",
> > > +            "nictype": "vif_ioemu"
> > > +        }
> > > +    ],
> > > +    "vfbs": [
> > > +        {
> > > +	    "devid": -1,
> > > +            "vnc": {
> > > +                "enable": "True",
> > > +                "listen": "0.0.0.0",
> > > +                "findunused": "False"
> > > +            },
> > > +            "sdl": {
> > > +                "enable": "False"
> > > +            }
> > > +        }
> > > +    ],
> > > +    "vkbs": [
> > > +        {
> > > +            "devid": -1
> > > +        }
> > > +    ],
> > > +    "on_reboot": "restart"
> > > +}
> > > diff --git a/tests/libxlxml2domconfigdata/max-gntframes-hvm.xml b/tests/libxlxml2domconfigdata/max-gntframes-hvm.xml
> > > new file mode 100644
> > > index 0000000000..910bbda10b
> > > --- /dev/null
> > > +++ b/tests/libxlxml2domconfigdata/max-gntframes-hvm.xml
> > > @@ -0,0 +1,37 @@
> > > +<domain type='xen'>
> > > +  <name>test-hvm</name>
> > > +  <description>None</description>
> > > +  <uuid>2147d599-9cc6-c0dc-92ab-4064b5446e9b</uuid>
> > > +  <memory>1048576</memory>
> > > +  <currentMemory>1048576</currentMemory>
> > > +  <vcpu>4</vcpu>
> > > +  <on_poweroff>destroy</on_poweroff>
> > > +  <on_reboot>restart</on_reboot>
> > > +  <on_crash>destroy</on_crash>
> > > +  <clock offset='utc'/>
> > > +  <os>
> > > +    <type>hvm</type>
> > > +    <loader>/usr/lib/xen/boot/hvmloader</loader>
> > > +    <boot dev='hd'/>
> > > +  </os>
> > > +  <features>
> > > +    <apic/>
> > > +    <acpi/>
> > > +    <pae/>
> > > +  </features>
> > > +  <devices>
> > > +    <emulator>/bin/true</emulator>
> > > +    <disk type='file' device='disk'>
> > > +      <driver name='qemu'/>
> > > +      <source file='/var/lib/xen/images/test-hvm.img'/>
> > > +      <target dev='hda'/>
> > > +    </disk>
> > > +    <controller type='xenbus' maxGrantFrames='64'/>
> > 
> > Normally, <controller> would come before <disk>
> 
> virDomainDefFormatInternal() formats controllers after disks. I can change
> that if you want but it should probably be done as a separate patch.

No, don't bother. I was mistakenly thinking we formatted controllers first.


Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux