1. 10 2月, 2017 1 次提交
    • 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
  2. 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
  3. 15 12月, 2016 1 次提交
    • 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
  4. 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
  5. 02 8月, 2016 1 次提交
  6. 15 6月, 2016 1 次提交
  7. 14 6月, 2016 2 次提交
  8. 11 5月, 2016 1 次提交
    • J
      libxl: support Xen migration stream V2 in save/restore · 5325123d
      Jim Fehlig 提交于
      Xen 4.6 introduced a new migration stream commonly referred to as
      "migration V2". Xen 4.6 and newer always produce this new stream,
      whereas Xen 4.5 and older always produce the legacy stream.
      Support for migration stream V2 can be detected at build time with
      LIBXL_HAVE_SRM_V2 from libxl.h. The legacy and V2 streams are not
      compatible, but a V2 host can accept and convert a legacy stream.
      
      Commit e7440656 changed the libxl driver to use the lowest libxl
      API version possible (version 0x040200) to ensure the driver
      builds against older Xen releases. The old 4.2 restore API does
      not support specifying a stream version and assumes a legacy
      stream, even if the incoming stream is migration V2. Thinking it
      has been given a legacy stream, libxl will fail to convert an
      incoming stream that is already V2, which causes the entire
      restore operation to fail. Xen's libvirt-related OSSTest has been
      failing since commit e7440656 landed in libvirt.git master. One
      of the more recent failures can be seen here
      
      http://lists.xenproject.org/archives/html/xen-devel/2016-05/msg00071.html
      
      This patch changes the call to libxl_domain_create_restore() to
      include the stream version if LIBXL_HAVE_SRM_V2 is defined. The
      version field of the libxlSavefileHeader struct is also updated
      to '2' when LIBXL_HAVE_SRM_V2 is defined, ensuring the stream
      version in the header matches the actual stream version produced
      by Xen. Along with bumping the libxl API requirement to 0x040400,
      this patch fixes save/restore on a migration V2 Xen host.
      
      Oddly, migration has never used the libxlSavefileHeader. It
      handles passing configuration in the Begin and Prepare phases,
      and then calls libxl directly to transfer domain state/memory
      in the Perform phase. A subsequent patch will add stream
      version handling in the Begin and Prepare phase handshaking,
      which will fix the migration related OSSTest failures.
      Signed-off-by: NJim Fehlig <jfehlig@suse.com>
      5325123d
  9. 16 4月, 2016 1 次提交
    • J
      libxl: use LIBXL_API_VERSION 0x040200 · e7440656
      Jim Fehlig 提交于
      To ensure the libvirt libxl driver will build with future versions
      of Xen where the libxl API may change in incompatible ways,
      explicitly use LIBXL_API_VERSION 0x040200. The libxl driver
      does use new libxl APIs that have been added since Xen 4.2, but
      currently it does not make use of any changes made to existing
      APIs such as libxl_domain_create_restore or libxl_set_vcpuaffinity.
      The version can be bumped if/when the libxl driver consumes the
      changed APIs.
      
      Further details can be found in the following discussion thread
      
      https://www.redhat.com/archives/libvir-list/2016-April/msg00178.htmlSigned-off-by: NJim Fehlig <jfehlig@suse.com>
      e7440656
  10. 10 2月, 2016 1 次提交
    • J
      libxl: keepalive messages support · 5194eb95
      Joao Martins 提交于
      This patch introduces keep alive messages support for P2P migration
      and it adds two new configuration entries namely 'keepalive_interval'
      'keepalive_count' to control it. Behavior of these entries is the
      same as qemu driver thus the description is copied from there
      with just a few simplifications.
      Signed-off-by: NJoao Martins <joao.m.martins@oracle.com>
      5194eb95
  11. 04 2月, 2016 1 次提交
  12. 30 11月, 2015 1 次提交
    • M
      conf: Split virDomainObjList into a separate file · 90f3c0d7
      Michal Privoznik 提交于
      Our domain_conf.* files are big enough. Not only they contain XML
      parsing code, but they served as a storage of all functions whose
      name is virDomain prefixed. This is just wrong as it gathers not
      related functions (and modules) into one big file which is then
      harder to maintain. Split virDomainObjList module into a separate
      file called virdomainobjlist.[ch].
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      90f3c0d7
  13. 29 5月, 2015 1 次提交
  14. 30 4月, 2015 1 次提交
  15. 22 4月, 2015 1 次提交
  16. 20 3月, 2015 1 次提交
    • J
      libxl: use xenlight pkgconfig file if present · 2adba7d3
      Jim Fehlig 提交于
      xen.git commit babeca32 added a pkgconfig file for libxenlight,
      allowing libxl apps to determine the location of Xen binaries
      such as firmware blobs, device emulator, etc.
      
      This patch adds support for xenlight.pc in the libxl driver, falling
      back to the previous configure logic if not found.  It introduces
      LIBXL_FIRMWARE_DIR and LIBXL_EXECBIN_DIR to define the firmware and
      libexec_bin locations.  If xenlight.pc does not exist, the defines
      are set to the current hardcoded paths.  The capabilities'
      <emulator> and <loader> elements are updated to use the paths.
      Signed-off-by: NJim Fehlig <jfehlig@suse.com>
      2adba7d3
  17. 22 11月, 2014 1 次提交
    • I
      libxl: Allow libxl to find pygrub binary. · d70a51d5
      Ian Campbell 提交于
      Specifying an explicit path to pygrub (e.g. BINDIR "/pygrub") only works if
      Xen and libvirt happen to be installed to the same prefix. A more flexible
      approach is to simply specify "pygrub" which will cause libxl to use the
      correct path which it knows (since it is built with the same prefix as pygrub).
      
      This is particular problematic in the Debian packaging, since the Debian Xen
      package relocates pygrub into a libexec dir, however I think this change makes
      sense upstream.
      Signed-off-by: NIan Campbell <ian.campbell@citrix.com>
      Signed-off-by: NJim Fehlig <jfehlig@suse.com>
      d70a51d5
  18. 11 10月, 2014 1 次提交
    • J
      libxl: Add function to determine device model type · c5a00350
      Jim Fehlig 提交于
      This patch introduces a function to detect whether the specified
      emulator is QEMU_XEN or QEMU_XEN_TRADITIONAL.  Detection is based on the
      string "Options specific to the Xen version:" in '$qemu -help' output.
      AFAIK, the only qemu containing that string in help output is the
      old Xen fork (aka qemu-dm).
      
      Note:
      QEMU_XEN means a qemu that contains support for Xen.
      
      QEMU_XEN_TRADITIONAL means Xen's old forked qemu 0.10.2
      Signed-off-by: NJim Fehlig <jfehlig@suse.com>
      c5a00350
  19. 01 7月, 2014 1 次提交
    • D
      libxl: don't break the build on Xen>=4.5 because of libxl_vcpu_setaffinity() · bfc72e99
      Dario Faggioli 提交于
      libxl interface for vcpu pinning is changing in Xen 4.5. Basically,
      libxl_set_vcpuaffinity() now wants one more parameter. That is
      representative of 'VCPU soft affinity', which libvirt does not use.
      
      To mark such change, the macro LIBXL_HAVE_VCPUINFO_SOFT_AFFINITY is
      defined. Use it as a gate and, if present, re-#define the calls from
      the old to the new interface, to avoid breaking the build.
      Signed-off-by: NDario Faggioli <dario.faggioli@citrix.com>
      Cc: Jim Fehlig <jfehlig@suse.com>
      Cc: Ian Campbell <Ian.Campbell@citrix.com>
      Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>
      bfc72e99
  20. 05 6月, 2014 1 次提交
  21. 03 6月, 2014 3 次提交
  22. 08 4月, 2014 1 次提交
  23. 20 3月, 2014 1 次提交
  24. 13 3月, 2014 1 次提交
  25. 25 2月, 2014 1 次提交
  26. 07 2月, 2014 1 次提交
    • J
      libxl: remove list of timer registrations from libxlDomainObjPrivate · eaa8d9b2
      Jim Fehlig 提交于
      Due to some misunderstanding of requirements libxl places on timer
      handling, I introduced the half-brained idea of maintaining a list
      of timeouts that the driver could force to expire before freeing a
      libxlDomainObjPrivate (and hence libxl_ctx).  But testing all
      the latest versions of Xen supported by the libxl driver (4.2.3,
      4.3.1, 4.4.0 RC3), I see that libxl will handle this just fine and
      there is no need to force expiration behind libxl's back.  Indeed it
      may be harmful to do so.
      
      This patch removes the timer list, allowing libxl to handle cleanup
      of its timer registrations.
      Signed-off-by: NJim Fehlig <jfehlig@suse.com>
      eaa8d9b2
  27. 07 1月, 2014 2 次提交
  28. 10 12月, 2013 1 次提交
  29. 04 9月, 2013 8 次提交