1. 18 4月, 2018 2 次提交
  2. 12 4月, 2018 1 次提交
  3. 22 3月, 2018 1 次提交
    • J
      libxl: don't hardcode scheduler weight · 83edaf44
      Jim Fehlig 提交于
      Long ago in commit dfa1e1dd the scheduler weight was accidentally
      hardcoded to 1000. Weight is a setting with no unit since it is
      relative to the weight of other domains. If no weight is specified,
      libxl defaults to 256.
      
      Instead of hardcoding the weight to 1000, honor any <shares> specified
      in <cputune>. libvirt's notion of shares is synonomous to libxl's
      scheduler weight setting. If shares is unspecified, defer default
      weight setting to libxl.
      
      Removing the hardcoded weight required some test fixup. While at it,
      add an explicit test for <shares> conversion to scheduler weight.
      Signed-off-by: NJim Fehlig <jfehlig@suse.com>
      Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
      83edaf44
  4. 24 2月, 2018 1 次提交
    • J
      libxl: round memory values to next 1MiB increment · ef71caea
      Jim Fehlig 提交于
      libxl requires the memory sizes to be rounded to 1MiB increments.
      Attempting to start a domain that violates this requirement will
      fail with the marginally helpful error
      
      2018-02-22 01:55:32.921+0000: xc: panic: xc_dom_boot.c:141: xc_dom_boot_mem_init: can't allocate low memory for domain: Out of memory
      2018-02-22 01:55:32.921+0000: libxl: libxl_dom.c:671:libxl__build_dom: xc_dom_boot_mem_init failed: No such file or directory
      
      Round the maximum and current memory values to the next 1MiB
      increment when generating the libxl_domain_config object.
      Signed-off-by: NJim Fehlig <jfehlig@suse.com>
      ef71caea
  5. 22 2月, 2018 2 次提交
  6. 20 2月, 2018 1 次提交
    • D
      conf: add enum constants for default controller models · a302480d
      Daniel P. Berrangé 提交于
      The controller model is slightly unusual in that the default value is
      -1, not 0. As a result the default value is not covered by any of the
      existing enum cases. This in turn means that any switch() statements
      that think they have covered all cases, will in fact not match the
      default value at all. In the qemuDomainDeviceCalculatePCIConnectFlags()
      method this has caused a serious mistake where we fallthrough from the
      SCSI controller case, to the VirtioSerial controller case, and from
      the USB controller case to the IDE controller case.
      
      By adding explicit enum constant starting at -1, we can ensure switches
      remember to handle the default case.
      Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
      Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
      a302480d
  7. 09 12月, 2017 1 次提交
  8. 13 11月, 2017 1 次提交
  9. 07 11月, 2017 1 次提交
  10. 19 10月, 2017 2 次提交
  11. 20 9月, 2017 1 次提交
  12. 24 7月, 2017 1 次提交
  13. 11 7月, 2017 1 次提交
  14. 13 6月, 2017 1 次提交
  15. 07 6月, 2017 1 次提交
  16. 05 6月, 2017 1 次提交
  17. 24 5月, 2017 1 次提交
    • J
      libxl: add default controllers for USB devices · 6de895f6
      Jim Fehlig 提交于
      Attempting to start a domain with USB hostdevs but no USB controllers
      fails with the rather cryptic error
      
      libxl: error: libxl_qmp.c:287:qmp_handle_error_response: received an
      error message from QMP server: Bus 'xenusb-0.0' not found
      
      This can be fixed by creating default USB controllers. When no USB
      controllers are defined, create the number of 8 port controllers
      necessary to accommodate the number of defined USB devices.
      
      Note that USB controllers are already created as needed in the
      domainAttachDevice code path. E.g. a USB controller will be created,
      if necessary, when attaching a USB device with
      'virsh attach-device dom usbdev.xml'.
      6de895f6
  18. 23 5月, 2017 1 次提交
    • J
      libxl: add default listen address for VNC and spice · dbb85e0c
      Jim Fehlig 提交于
      If a VNC listen address is not specified in domXML, libxl
      will default to 127.0.0.1, but this is never reflected in the domXML.
      In the case of spice, a missing listen address resulted in listening
      on all interfaces, i.e. '0.0.0.0'. If not specified, set the listen
      address in virDomainGraphicsDef struct to the libxl default when
      creating the frame buffer device. Additionally, set default spice
      listen address to 127.0.0.1.
      dbb85e0c
  19. 28 4月, 2017 1 次提交
    • W
      libxl: set nestedhvm for mode host-passthrough · c268b9ea
      Wim ten Have 提交于
      Xen feature nestedhvm is the option on Xen 4.4+ which enables
      nested virtualization when mode host-passthrough is applied.
      
      nested HVM is enabled by adding below on the target domain;
      <cpu mode='host-passthrough'/>
      
      Virtualization on target domain can be disabled by specifying
      such under feature policy rule on target name;
      
      [On Intel (VT-x) architecture]
      <feature policy='disable' name='vmx'/>
      
      or:
      
      [On AMD (AMD-V) architecture]
      <feature policy='disable' name='svm'/>
      Signed-off-by: NJoao Martins <joao.m.martins@oracle.com>
      Signed-off-by: NWim ten Have <wim.ten.have@oracle.com>
      c268b9ea
  20. 16 2月, 2017 1 次提交
    • J
      libxl: fix potential double free in libxlDriverGetDom0MaxmemConf · 2dc1cf19
      Jim Fehlig 提交于
      Commit 4ab0c959 fixed a memory leak in libxlDriverGetDom0MaxmemConf
      but introduced a potential double free of mem_tokens
      
      *** Error in `/usr/sbin/libvirtd': double free or corruption (out):
          0x00007fffc808cfd0 ***
      
      Avoid double free by setting mem_tokens to NULL after calling
      virStringListFree.
      2dc1cf19
  21. 11 2月, 2017 1 次提交
    • J
      libxl: Resolve possible resource leak in dom0 maximum memory setting · 4ab0c959
      John Ferlan 提交于
      If either the "if (STRPREFIX(mem_tokens[j], "max:"))" is never entered
      or the "if (virStrToLong_ull(mem_tokens[j] + 4, &p, 10, maxmem) < 0)" break
      is hit, control goes back to the outer loop processing 'cmd_tokens' and
      it's possible that the 'mem_tokens' would be overwritten.
      
      Found by Coverity
      4ab0c959
  22. 10 2月, 2017 3 次提交
    • J
      libxl: fix dom0 maximum memory setting · 79692c38
      Jim Fehlig 提交于
      When the libxl driver is initialized, it creates a virDomainDef
      object for dom0 and adds it to the list of domains. Total memory
      for dom0 was being set from the max_memkb field of libxl_dominfo
      struct retrieved from libxl, but this field can be set to
      LIBXL_MEMKB_DEFAULT (~0ULL) if dom0 maximum memory has not been
      explicitly set by the user.
      
      This patch adds some simple parsing of the Xen commandline,
      looking for a dom0_mem parameter that also specifies a 'max' value.
      If not specified, dom0 maximum memory is effectively all physical
      host memory.
      Signed-off-by: NJim Fehlig <jfehlig@suse.com>
      79692c38
    • J
      libxl: fix disk detach when <driver> not specified · bd116810
      Jim Fehlig 提交于
      When a user does not explicitly set a <driver> in the disk config,
      libvirt defers selection of a default to libxl. This approach works
      fine when starting a domain with such configuration or attaching a
      disk to a running domain. But when detaching such a disk, libxl
      will fail with "unrecognized disk backend type: 0". libxl makes no
      attempt to recalculate a default backend (driver) on detach and
      simply fails when uninitialized.
      
      This patch updates the libvirt disk config with the backend selected
      by libxl when starting a domain or attaching a disk to a running
      domain. Another benefit of this approach is that the live XML is
      also updated with the backend driver selected by libxl.
      bd116810
    • J
      libxl: set default disk format in device post-parse · 321a28c6
      Jim Fehlig 提交于
      When starting a domian, a libxl_domain_config object is created from
      virDomainDef. Any virDomainDiskDef devices with a format of
      VIR_STORAGE_FILE_NONE are mapped to LIBXL_DISK_FORMAT_RAW in the
      corresponding libxl_disk_device, but the virDomainDiskDef format is
      never updated to reflect the change.
      
      A better place to set a default format for disk devices is the
      device post-parse callback, ensuring the virDomainDiskDef object
      reflects the default format.
      321a28c6
  23. 09 2月, 2017 2 次提交
    • J
      libxl: use init and dispose functions with libxl_physinfo · c89a6e78
      Jim Fehlig 提交于
      The typical pattern when calling libxl functions that populate a
      structure is
      
        libxl_foo foo;
        libxl_foo_init(&foo);
        libxl_get_foo(ctx, &foo);
        ...
        libxl_foo_dispose(&foo);
      
      Fix several instances of libxl_physinfo missing the init and
      dispose calls.
      Signed-off-by: NJim Fehlig <jfehlig@suse.com>
      c89a6e78
    • J
      libxl: honor autoballoon setting in libxl.conf · ff225538
      Jim Fehlig 提交于
      libxlGetAutoballoonConf is supposed to honor user-specified
      autoballoon setting in libxl.conf. As written, the user-specified
      setting could be overwritten by the subsequent logic to check
      dom0_mem parameter. If user-specified setting is present and
      correct, accept it. Only fallback to checking Xen dom0_mem
      command line parameter if user-specfied setting is not present.
      Signed-off-by: NJim Fehlig <jfehlig@suse.com>
      ff225538
  24. 25 1月, 2017 2 次提交
    • J
      libxl: support emulate mode of tsc timer · 87df87e0
      Jim Fehlig 提交于
      While at it, use members of libxl_tsc_mode enum instead of literal
      int values.
      87df87e0
    • J
      libxl: fix timer configuration · 6e4759d0
      Jim Fehlig 提交于
      The current logic around configuring timers in libxl based on
      virDomainDef object is a bit brain dead. Unsupported timers are
      silently ignored and tsc is only recognized if it is the first
      timer specified.
      
      Change the logic to reject unsupported timers and honor the tsc
      timer regardless of its order when multiple timers are specified.
      6e4759d0
  25. 12 1月, 2017 1 次提交
  26. 11 1月, 2017 1 次提交
    • C
      libxl: define a per-domain logger. · a30b08b7
      Cédric Bosdonnat 提交于
      libxl doesn't provide a way to write one log for each domain. Thus
      we need to demux the messages. If our logger doesn't know to which
      domain to attribute a message, then it will write it to the default
      log file.
      
      Starting with Xen 4.9 (commit f9858025 and following), libxl will
      write the domain ID in an easy to grab manner. The logger introduced
      by this commit will use it to demux the libxl log messages.
      
      Thanks to the default log file, this logger will also work with older
      versions of Xen.
      a30b08b7
  27. 15 12月, 2016 2 次提交
    • J
      libxl: reverse defaults on HVM net device attach · de8607d7
      Joao Martins 提交于
      libvirt libxl picks its own default with respect to the default NIC
      to use. libxlMakeNic is the one responsible for this and on boot it
      picks LIBXL_NIC_TYPE_VIF_IOEMU for HVM domains such that it accomodates
      both PV and emulated one. The good behaving guest at boot will then
      select the pv and unplug the emulated device.
      
      Now, on HVM when attaching an interface it will pick the same default
      that is LIBXL_NIC_TYPE_VIF_IOEMU which as a result will fail the attach
      (see xen commit 32e9d0f ("libxl: nic type defaults to vif in hotplug for
      hvm guest"). Xen doesn't yet support the hotplug of emulated devices,
      but we don't want to rule out that case either, which might get support
      in the future. Hence we simply reverse the defaults when we are
      attaching the interface which allows libvirt to prefer the PV nic first
      without adding "model='netfront'" following the same pattern as above
      commit. Also to avoid ruling out the emulated one we set to
      LIBXL_NIC_TYPE_IOEMU when setting a model type that is not 'netfront'.
      Signed-off-by: NJoao Martins <joao.m.martins@oracle.com>
      Signed-off-by: NJim Fehlig <jfehlig@suse.com>
      de8607d7
    • C
      libxl: add QED disk format support · 340bb6b7
      Cédric Bosdonnat 提交于
      If libxl has QED disk format support, then pass the feature
      over to the user.
      340bb6b7
  28. 22 10月, 2016 1 次提交
  29. 28 9月, 2016 1 次提交
    • J
      libxl: channels support · 719b663f
      Joao Martins 提交于
      And allow libxl to handle channel element which creates a Xen
      console visible to the guest as a low-bandwitdh communication
      channel. If type is PTY we also fetch the tty after boot using
      libxl_channel_getinfo to fetch the tty path. On socket case,
      we autogenerate a path if not specified in the XML. Path autogenerated
      is slightly different from qemu driver: qemu stores also on
      "channels/target" but it creates then a directory per domain with
      each channel target name. libxl doesn't appear to have a clear
      definition of private files associated with each domain, so for
      simplicity we do it slightly different. On qemu each autogenerated
      channel goes like:
      
      channels/target/<domain-name>/<target name>
      
      Whereas for libxl:
      
      channels/target/<domain-name>-<target name>
      
      Should note that if path is not specified it won't persist,
      existing only on live XML, unless user had initially specified it.
      Since support for libxl channels only came on Xen >= 4.5 we therefore
      need to conditionally compile it with LIBXL_HAVE_DEVICE_CHANNEL.
      
      After this patch and having a qemu guest agent:
       $ cat domain.xml | grep -a1 channel | head -n 5 | tail -n 4
       <channel type='unix'>
         <source mode='bind' path='/tmp/channel'/>
         <target type='xen' name='org.qemu.guest_agent.0'/>
       </channel>
      
       $ virsh create domain.xml
       $ echo '{"execute":"guest-network-get-interfaces"}' | socat
       stdio,ignoreeof  unix-connect:/tmp/channel
      
       {"execute":"guest-network-get-interfaces"}
       {"return": [{"name": "lo", "ip-addresses": [{"ip-address-type": "ipv4",
       "ip-address": "127.0.0.1", "prefix": 8}, {"ip-address-type": "ipv6",
       "ip-address": "::1", "prefix": 128}], "hardware-address":
       "00:00:00:00:00:00"}, {"name": "eth0", "ip-addresses":
       [{"ip-address-type": "ipv4", "ip-address": "10.100.0.6", "prefix": 24},
       {"ip-address-type": "ipv6", "ip-address": "fe80::216:3eff:fe40:88eb",
       "prefix": 64}], "hardware-address": "00:16:3e:40:88:eb"}, {"name":
       "sit0"}]}
      Signed-off-by: NJoao Martins <joao.m.martins@oracle.com>
      Signed-off-by: NJim Fehlig <jfehlig@suse.com>
      719b663f
  30. 24 9月, 2016 1 次提交
  31. 03 9月, 2016 1 次提交
  32. 02 9月, 2016 1 次提交