1. 24 6月, 2014 1 次提交
    • J
      libxl: prefer qdisk for <driver name='file'> · 48d81cef
      Jim Fehlig 提交于
      The libxl driver currently sets the disk backend to
      LIBXL_DISK_BACKEND_TAP when <driver name='file'> is specified
      in the <disk> config.  qdisk should be prefered with this
      configuration, otherwise existing configuration such as the
      following, which worked with the old Xen driver, will not work
      with the libxl driver
      
        <disk type='file' device='cdrom'>
          <driver name='file'/>
          <source file='/path/to/some/iso'/>
          <target dev='hdc' bus='ide'/>
          <readonly/>
        </disk>
      
      In addition, tap performs poorly compared to qdisk.
      48d81cef
  2. 20 6月, 2014 2 次提交
    • J
      libxl: limit support for specifying an interface script · 2624dfde
      Jim Fehlig 提交于
      Generally, <interface> ... <script> is only supported for
      type='ethernet'.  Due to the long and pervasive use of
      
        <interface type='bridge'>
          ...
          <script path='foo'/>
        </interface>
      
      in Xen domain configuration, it was agreed to allow the use
      of <script> with type='bridge' for backwards compatibility.  See
      the following discussion thread
      
      http://www.redhat.com/archives/libvir-list/2013-April/msg00755.html
      
      This patch limits the use of <script> to interface types ethernet
      and bridge, raising an unsupported config error if <script> is
      specified for all other interface types.
      
      While at it, use VIR_ERR_CONFIG_UNSUPPORTED instead of
      VIR_ERR_INTERNAL_ERROR when reporting unsupported interface types.
      2624dfde
    • J
      libxl: support interface type=network · bf410bb8
      Jim Fehlig 提交于
      Add support for <interface type='network'> in the libxl driver.
      bf410bb8
  3. 19 6月, 2014 1 次提交
    • M
      virCaps: expose pages info · 02129b7c
      Michal Privoznik 提交于
      There are two places where you'll find info on page sizes. The first
      one is under <cpu/> element, where all supported pages sizes are
      listed. Then the second one is under each <cell/> element which refers
      to concrete NUMA node. At this place, the size of page's pool is
      reported. So the capabilities XML looks something like this:
      
      <capabilities>
      
        <host>
          <uuid>01281cda-f352-cb11-a9db-e905fe22010c</uuid>
          <cpu>
            <arch>x86_64</arch>
            <model>Westmere</model>
            <vendor>Intel</vendor>
            <topology sockets='1' cores='1' threads='1'/>
            ...
            <pages unit='KiB' size='4'/>
            <pages unit='KiB' size='2048'/>
            <pages unit='KiB' size='1048576'/>
          </cpu>
          ...
          <topology>
            <cells num='4'>
              <cell id='0'>
                <memory unit='KiB'>4054408</memory>
                <pages unit='KiB' size='4'>1013602</pages>
                <pages unit='KiB' size='2048'>3</pages>
                <pages unit='KiB' size='1048576'>1</pages>
                <distances/>
                <cpus num='1'>
                  <cpu id='0' socket_id='0' core_id='0' siblings='0'/>
                </cpus>
              </cell>
              <cell id='1'>
                <memory unit='KiB'>4071072</memory>
                <pages unit='KiB' size='4'>1017768</pages>
                <pages unit='KiB' size='2048'>3</pages>
                <pages unit='KiB' size='1048576'>1</pages>
                <distances/>
                <cpus num='1'>
                  <cpu id='1' socket_id='0' core_id='0' siblings='1'/>
                </cpus>
              </cell>
              ...
            </cells>
          </topology>
          ...
        </host>
      
        <guest/>
      
      </capabilities>
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      02129b7c
  4. 04 6月, 2014 1 次提交
    • M
      virCaps: Expose distance between host NUMA nodes · 8ba0a58f
      Michal Privoznik 提交于
      If user or management application wants to create a guest,
      it may be useful to know the cost of internode latencies
      before the guest resources are pinned. For example:
      
      <capabilities>
      
        <host>
          ...
          <topology>
            <cells num='2'>
              <cell id='0'>
                <memory unit='KiB'>4004132</memory>
                <distances>
                  <sibling id='0' value='10'/>
                  <sibling id='1' value='20'/>
                </distances>
                <cpus num='2'>
                  <cpu id='0' socket_id='0' core_id='0' siblings='0'/>
                  <cpu id='2' socket_id='0' core_id='2' siblings='2'/>
                </cpus>
              </cell>
              <cell id='1'>
                <memory unit='KiB'>4030064</memory>
                <distances>
                  <sibling id='0' value='20'/>
                  <sibling id='1' value='10'/>
                </distances>
                <cpus num='2'>
                  <cpu id='1' socket_id='0' core_id='0' siblings='1'/>
                  <cpu id='3' socket_id='0' core_id='2' siblings='3'/>
                </cpus>
              </cell>
            </cells>
          </topology>
          ...
        </host>
        ...
      </capabilities>
      
      We can see the distance from node1 to node0 is 20 and within nodes 10.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      8ba0a58f
  5. 03 6月, 2014 3 次提交
  6. 13 5月, 2014 1 次提交
  7. 08 4月, 2014 1 次提交
  8. 03 4月, 2014 1 次提交
    • S
      libxl: Set disk format for empty cdrom device · 7a1452f5
      Stefan Bader 提交于
      The XML config for a CDROM device can be without a source path,
      indicating that there is no media present. Without this change
      the libxl driver fails to start a guest in that case because
      the libxl library checks for the LIBXL_DISK_FORMAT_EMPTY format
      type and tries to stat the NULL pointer that gets passed on.
      
      > libxl: error: libxl_device.c:265:libxl__device_disk_set_backend:
      > Disk vdev=hdc failed to stat: (null): Bad address
      Signed-off-by: NStefan Bader <stefan.bader@canonical.com>
      7a1452f5
  9. 26 3月, 2014 1 次提交
    • S
      libxl: Create log directory earlier · 139efe75
      Stefan Bader 提交于
      Commit d9f19c30 moved a lot of the
      configuration setup into libxlDriverConfigNew().
      However that tries to create the libxl/libxl-driver.log before the
      libxl directory gets created in libxlStateInitialize().
      
      This causes the daemon to fail on systems that have not had the directory
      created before.
      
      Move the code to create the libxl directory into libxlDriverConfigNew().
      Signed-off-by: NStefan Bader <stefan.bader@canonical.com>
      139efe75
  10. 25 3月, 2014 2 次提交
  11. 20 3月, 2014 1 次提交
  12. 19 3月, 2014 1 次提交
    • J
      libxl: fix framebuffer port setting for HVM domains · b55cc5f4
      Jim Fehlig 提交于
      libxl uses the libxl_vnc_info and libxl_sdl_info fields from the
      hvm union in libxl_domain_build_info struct when generating QEMU
      args for VNC or SDL.  These fields were left unset by the libxl
      driver, causing libxl to ignore any user settings.  E.g. with
      
        <graphics type='vnc' port='5950'/>
      
      port would be ignored and QEMU would instead be invoked with
      
        -vnc 127.0.0.1:0,to=99
      
      Unlike the libxl_domain_config struct, the libxl_domain_build_info
      contains only a single libxl_vnc_info and libxl_sdl_info, so
      populate these fields from the first vfb in
      libxl_domain_config->vfbs.
      Signed-off-by: NJim Fehlig <jfehlig@suse.com>
      Signed-off-by: NDavid Kiarie <davidkiarie4@gmail.com>
      b55cc5f4
  13. 18 3月, 2014 1 次提交
  14. 13 3月, 2014 1 次提交
  15. 26 2月, 2014 1 次提交
    • I
      libxl: Recognise ARM architectures · bf5dbce6
      Ian Campbell 提交于
      Only tested on v7 but the v8 equivalent seems pretty obvious.
      
      XEN_CAP_REGEX already accepts more than it should (e.g. x86_64p or x86_32be)
      but I have stuck with the existing pattern.
      
      With this I can create a guest from:
        <domain type='xen'>
          <name>libvirt-test</name>
          <uuid>6343998e-9eda-11e3-98f6-77252a7d02f3</uuid>
          <memory>393216</memory>
          <currentMemory>393216</currentMemory>
          <vcpu>1</vcpu>
          <os>
            <type arch='armv7l' machine='xenpv'>linux</type>
            <kernel>/boot/vmlinuz-arm-native</kernel>
            <cmdline>console=hvc0 earlyprintk debug root=/dev/xvda1</cmdline>
          </os>
          <clock offset='utc'/>
          <on_poweroff>destroy</on_poweroff>
          <on_reboot>restart</on_reboot>
          <on_crash>destroy</on_crash>
          <devices>
            <disk type='block' device='disk'>
              <source dev='/dev/marilith-n0/debian-disk'/>
              <target dev='xvda1'/>
            </disk>
            <interface type='bridge'>
              <mac address='8e:a7:8e:3c:f4:f6'/>
              <source bridge='xenbr0'/>
            </interface>
          </devices>
        </domain>
      
      Using virsh create and I can destroy it too.
      
      Currently virsh console fails with:
        Connected to domain libvirt-test
        Escape character is ^]
        error: internal error: cannot find character device <null>
      
      I haven't investigated yet.
      Signed-off-by: NIan Campbell <ian.campbell@citrix.com>
      Signed-off-by: NEric Blake <eblake@redhat.com>
      bf5dbce6
  16. 25 2月, 2014 1 次提交
  17. 09 1月, 2014 1 次提交
    • S
      libxl: Fix devid init in libxlMakeNicList · e1459c1f
      Stefan Bader 提交于
      This basically reverts commit ba64b971
      "libxl: Allow libxl to set NIC devid". However assigning devid's
      before calling libxlMakeNic does not work as that is calling
      libxl_device_nic_init which sets it back to -1.
      Right now auto-assignment only works in the hotplug case. But even if
      that would be fixed at some point (if that is possible at all), this
      would add a weird dependency between Xen and libvirt versions.
      The change here should accept any auto-assignment that makes it into
      libxl_device_nic_init. My understanding is that a caller always is
      allowed to make the devid choice itself. And assuming libxlMakeNicList
      is only used on domain creation, a sequential numbering should be ok.
      Signed-off-by: NStefan Bader <stefan.bader@canonical.com>
      e1459c1f
  18. 07 1月, 2014 1 次提交
  19. 18 11月, 2013 1 次提交
    • J
      Return -1 in virPortAllocatorAcquire if all ports are used · 8c41794a
      Ján Tomko 提交于
      Report the error in virPortAllocatorAcquire instead
      of doing it in every caller.
      
      The error contains the port range name instead of the intended
      use for the port, e.g.:
      Unable to find an unused port in range 'display' (65534-65535)
      instead of:
      Unable to find an unused port for SPICE
      
      This also adds error reporting when the QEMU driver could not
      find an unused port for VNC, VNC WebSockets or NBD migration.
      8c41794a
  20. 08 11月, 2013 1 次提交
    • P
      conf: Refactor storing and usage of feature flags · de7b5faf
      Peter Krempa 提交于
      Currently we were storing domain feature flags in a bit field as the
      they were either enabled or disabled. New features such as paravirtual
      spinlocks however can be tri-state as the default option may depend on
      hypervisor version.
      
      To allow storing tri-state feature state in the same place instead of
      having to declare dedicated variables for each feature this patch
      refactors the bit field to an array.
      de7b5faf
  21. 06 9月, 2013 1 次提交
    • J
      libxl: Compile regular expression where it is used · 4e0ba0bd
      Jim Fehlig 提交于
      The regular expression used to determine guest capabilities
      was compiled in libxlCapsInitHost() but used in libxlCapsInitGuests().
      Move compilation to libxlCapsInitGuests() where it is used, and free
      the compiled regex after use.  Ensure not to free the regex if
      compilation fails.
      4e0ba0bd
  22. 05 9月, 2013 1 次提交
  23. 04 9月, 2013 7 次提交
    • J
      libxl: Use standard format for source file copyright notice · edd60d9c
      Jim Fehlig 提交于
      Change source file copyright notice to prevailing libvirt style.
      edd60d9c
    • J
      libxl: Remove unnecessary driver locking · 21bdbb82
      Jim Fehlig 提交于
      Now that most fields of libxlDriverPrivate struct are immutable
      or self-locking, there is no need to acquire the driver lock in
      much of the libxl driver.
      21bdbb82
    • J
      libxl: Introduce libxlDriverConfig object · d9f19c30
      Jim Fehlig 提交于
      The libxlDriverPrivate struct contains an variety of data with
      varying access needs. Similar to the QEMU and LXC drivers,
      move all the static config data into a dedicated libxlDriverConfig
      object. The only locking requirement is to hold the driver lock
      while obtaining an instance of libxlDriverConfig. Once a reference
      is held on the config object, it can be used completely lockless
      since it is immutable.
      d9f19c30
    • J
      libxl: libxl: Use per-domain ctx in libxlMakeDomCreateInfo · e1f67c90
      Jim Fehlig 提交于
      libxlMakeDomCreateInfo() uses the driver-wide libxl ctx when
      it would be more appropriate to use the per-domain ctx
      associated with the domain.  Switch to using the per-domain
      libxl ctx.
      e1f67c90
    • J
      libxl: Add libxl_version_info to libxlDriverPrivate · cb0d49af
      Jim Fehlig 提交于
      libxl version info is static data as far as the libxl driver
      is concerned, so retrieve this info when the driver is initialized
      and stash it in the libxlDriverPrivate object.  Subsequently use
      the stashed info instead of repeatedly calling libxl_get_version_info().
      cb0d49af
    • J
      libxl: Introduce libxl_domain.[ch] · 12315cd7
      Jim Fehlig 提交于
      Create libxl_domain.[ch] and move all functions operating on
      libxlDomainObjPrivate to these files.  This will be useful for
      future patches that e.g. add job support for libxlDomainObjPrivate.
      12315cd7
    • J
      libxl: Move detection of autoballoon to libxl_conf · c9d5432d
      Jim Fehlig 提交于
      Detecting whether or not to autoballoon is configuration related,
      so move the code to libxl_conf.
      c9d5432d
  24. 21 8月, 2013 1 次提交
    • J
      libxl: Resolve possible NULL dereference · 6aea4ebc
      John Ferlan 提交于
      If we reached cleanup: prior to allocating cpus, it was possible that
      'nr_nodes' had a value, but cpus was NULL leading to a possible NULL
      deref. Add a 'cpus' as an end condition to for loop
      6aea4ebc
  25. 20 8月, 2013 1 次提交
    • J
      libxl: implement NUMA capabilities reporting · 0192fd67
      Jim Fehlig 提交于
      From: Dario Faggioli <dario.faggioli@citrix.com>
      
      Starting from Xen 4.2, libxl has all the bits and pieces in place
      for retrieving an adequate amount of information about the host
      NUMA topology. It is therefore possible, after a bit of shuffling,
      to arrange those information in the way libvirt wants to present
      them to the outside world.
      
      Therefore, with this patch, the <topology> section of the host
      capabilities is properly populated, when running on Xen, so that
      we can figure out whether or not we're running on a NUMA host,
      and what its characteristics are.
      
      [raistlin@Zhaman ~]$ sudo virsh --connect xen:/// capabilities
      <capabilities>
        <host>
          <cpu>
          ....
          <topology>
            <cells num='2'>
              <cell id='0'>
                <memory unit='KiB'>6291456</memory>
                <cpus num='8'>
                  <cpu id='0' socket_id='1' core_id='0' siblings='0-1'/>
                  <cpu id='1' socket_id='1' core_id='0' siblings='0-1'/>
                  <cpu id='2' socket_id='1' core_id='1' siblings='2-3'/>
                  <cpu id='3' socket_id='1' core_id='1' siblings='2-3'/>
                  <cpu id='4' socket_id='1' core_id='9' siblings='4-5'/>
                  <cpu id='5' socket_id='1' core_id='9' siblings='4-5'/>
                  <cpu id='6' socket_id='1' core_id='10' siblings='6-7'/>
                  <cpu id='7' socket_id='1' core_id='10' siblings='6-7'/>
                </cpus>
              </cell>
              <cell id='1'>
                <memory unit='KiB'>6881280</memory>
                <cpus num='8'>
                  <cpu id='8' socket_id='0' core_id='0' siblings='8-9'/>
                  <cpu id='9' socket_id='0' core_id='0' siblings='8-9'/>
                  <cpu id='10' socket_id='0' core_id='1' siblings='10-11'/>
                  <cpu id='11' socket_id='0' core_id='1' siblings='10-11'/>
                  <cpu id='12' socket_id='0' core_id='9' siblings='12-13'/>
                  <cpu id='13' socket_id='0' core_id='9' siblings='12-13'/>
                  <cpu id='14' socket_id='0' core_id='10' siblings='14-15'/>
                  <cpu id='15' socket_id='0' core_id='10' siblings='14-15'/>
                </cpus>
              </cell>
            </cells>
          </topology>
        </host>
        ....
      0192fd67
  26. 17 8月, 2013 1 次提交
    • J
      libxl: refactor capabilities code · aeab0243
      Jim Fehlig 提交于
      Cleanup the libxl capabilities code to be a bit more extensible,
      splitting out the creation of host and guest capabilities.  This
      should make it easier to implement additional capabilities in the
      future, such as NUMA topology reporting.
      aeab0243
  27. 15 8月, 2013 1 次提交
  28. 31 7月, 2013 1 次提交
  29. 24 7月, 2013 1 次提交
    • S
      libxl: Correctly initialize vcpu bitmap · 65026d72
      Stefan Bader 提交于
      The avail_vcpu bitmap has to be allocated before it can be used (using
      the maximum allowed value for that). Then for each available VCPU the
      bit in the mask has to be set (libxl_bitmap_set takes a bit position
      as an argument, not the number of bits to set).
      
      Without this, I would always only get one VCPU for guests created
      through libvirt/libxl.
      Signed-off-by: NStefan Bader <stefan.bader@canonical.com>
      65026d72
  30. 11 7月, 2013 1 次提交