1. 15 7月, 2014 1 次提交
  2. 14 7月, 2014 1 次提交
    • E
      capabilities: use bool instead of int · 58156f39
      Eric Blake 提交于
      While preparing to add a capability for active commit, I noticed
      that the existing code was abusing int for boolean values.
      
      * src/conf/capabilities.h (_virCapsGuestFeature, _virCapsHost)
      (virCapabilitiesNew, virCapabilitiesAddGuestFeature): Improve
      types.
      * src/conf/capabilities.c (virCapabilitiesNew)
      (virCapabilitiesAddGuestFeature): Adjust signature.
      * src/bhyve/bhyve_capabilities.c (virBhyveCapsBuild): Update
      clients.
      * src/esx/esx_driver.c (esxCapsInit): Likewise.
      * src/libxl/libxl_conf.c (libxlMakeCapabilities): Likewise.
      * src/lxc/lxc_conf.c (virLXCDriverCapsInit): Likewise.
      * src/openvz/openvz_conf.c (openvzCapsInit): Likewise.
      * src/parallels/parallels_driver.c (parallelsBuildCapabilities):
      Likewise.
      * src/phyp/phyp_driver.c (phypCapsInit): Likewise.
      * src/qemu/qemu_capabilities.c (virQEMUCapsInit)
      (virQEMUCapsInitGuestFromBinary): Likewise.
      * src/security/virt-aa-helper.c (get_definition): Likewise.
      * src/test/test_driver.c (testBuildCapabilities): Likewise.
      * src/uml/uml_conf.c (umlCapsInit): Likewise.
      * src/vbox/vbox_tmpl.c (vboxCapsInit): Likewise.
      * src/vmware/vmware_conf.c (vmwareCapsInit): Likewise.
      * src/xen/xen_hypervisor.c (xenHypervisorBuildCapabilities):
      Likewise.
      * src/xenapi/xenapi_driver.c (getCapsObject): Likewise.
      * tests/qemucaps2xmltest.c (testGetCaps): Likewise.
      * tests/testutils.c (virTestGenericCapsInit): Likewise.
      * tests/testutilslxc.c (testLXCCapsInit): Likewise.
      * tests/testutilsqemu.c (testQemuCapsInit): Likewise.
      * tests/testutilsxen.c (testXenCapsInit): Likewise.
      * tests/vircaps2xmltest.c (buildVirCapabilities): Likewise.
      * tests/vircapstest.c (buildNUMATopology): Likewise.
      * tests/vmx2xmltest.c (testCapsInit): Likewise.
      * tests/xml2vmxtest.c (testCapsInit): Likewise.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      58156f39
  3. 11 7月, 2014 1 次提交
  4. 10 7月, 2014 1 次提交
  5. 09 7月, 2014 4 次提交
    • J
      libxl: fix crash in migrate confirm for transient domains · 72a84539
      Jim Fehlig 提交于
      In libxlDomainMigrationConfirm(), a transient domain is removed
      from the domain list after successful migration.  Later in cleanup,
      the domain object is unlocked, resulting in a crash
      
      Program received signal SIGSEGV, Segmentation fault.
      [Switching to Thread 0x7fb4208ed700 (LWP 12044)]
      0x00007fb4267251e6 in virClassIsDerivedFrom (klass=0xdeadbeef,
        parent=0x7fb42830d0c0) at util/virobject.c:169
      169	        if (klass->magic == parent->magic)
      (gdb) bt
      0  0x00007fb4267251e6 in virClassIsDerivedFrom (klass=0xdeadbeef,
        parent=0x7fb42830d0c0) at util/virobject.c:169
      1  0x00007fb42672591b in virObjectIsClass (anyobj=0x7fb4100082b0,
        klass=0x7fb42830d0c0) at util/virobject.c:365
      2  0x00007fb42672583c in virObjectUnlock (anyobj=0x7fb4100082b0)
        at util/virobject.c:338
      3  0x00007fb41a8c7d7a in libxlDomainMigrationConfirm (driver=0x7fb4100404c0,
        vm=0x7fb4100082b0, flags=1, cancelled=0) at libxl/libxl_migration.c:583
      
      Fix by setting the virDomainObjPtr to NULL after removing it from
      the domain list.
      72a84539
    • J
      libxl: acquire job though begin phase only · bab7ad4c
      Jim Fehlig 提交于
      During migration, the libxl driver starts a modify job in the
      begin phase, ending the job in the confirm phase.  This is
      essentially VIR_MIGRATE_CHANGE_PROTECTION semantics, but the
      driver does not support that flag.  Without CHANGE_PROTECTION
      support, the job would never be terminated in error conditions
      where migrate confirm phase is not executed.  Further attempts
      to modify the domain would result in failure to acquire a job
      after LIBXL_JOB_WAIT_TIME.
      
      Similar to the qemu driver, end the job in the begin phase.
      Protecting the domain object across all phases of migration can
      be done in a future patch adding CHANGE_PROTECTION support.
      bab7ad4c
    • J
      libxl: remove domain when migration prepare fails · c4f66bb8
      Jim Fehlig 提交于
      In libxlDomainMigrationPrepare(), a new virDomainObj is created
      from the incoming domain def and added to the driver's domain
      list, but never removed if there are subsequent failures during
      the prepare phase.
      
      targethost# virsh list --all
      
      sourcehost# virsh migrate --live dom xen+ssh://targethost/system
         error: operation failed: Fail to create socket for incoming migration.
      
      targethost# virsh list --all
      error: Failed to list domains
      error: name in virGetDomain must not be NULL
      
      After adding code to remove the domain on prepare failure, noticed
      that libvirtd crashed due to double free of the virDomainDef.  Similar
      to the qemu driver, pass a pointer to virDomainDefPtr so it can be set
      to NULL once a virDomainObj is created from it.
      c4f66bb8
    • J
      libxl: rename goto label · 92cd6b67
      Jim Fehlig 提交于
      In libxlDomainMigrationPrepare(), the cleanup label handles error
      conditions and should be renamed as such for clarity.
      92cd6b67
  6. 08 7月, 2014 1 次提交
  7. 03 7月, 2014 3 次提交
  8. 01 7月, 2014 2 次提交
    • J
      libxl: add PV console if not explicitly specified · ec7b9225
      Jim Fehlig 提交于
      Xen PV domains always have a PV console, so add one to the domain
      config via post-parse callback if not explicitly specified in
      the XML.  The legacy Xen driver behaves similarly, causing a
      regression when switching to the new Xen toolstack.  I.e.
      
        virsh console pv-domain
      
      will no longer work after upgrading a xm/xend stack to xl/libxl.
      ec7b9225
    • 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
  9. 27 6月, 2014 1 次提交
  10. 26 6月, 2014 1 次提交
    • J
      enhance hostdev mode 'capabilities' process · 01e508f3
      Jincheng Miao 提交于
      Currently, only LXC has hostdev mode 'capabilities' support,
      so the other drivers should forbid to define it in XML.
      The hostdev mode check is added to devicesPostParseCallback()
      for each hypervisor driver.
      
      But there are some drivers lack function devicesPostParseCallback(),
      so only add check for qemu, libxl, openvz, uml, xen, xenapi.
      Signed-off-by: NJincheng Miao <jmiao@redhat.com>
      01e508f3
  11. 25 6月, 2014 1 次提交
  12. 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
  13. 21 6月, 2014 1 次提交
  14. 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
  15. 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
  16. 12 6月, 2014 1 次提交
  17. 06 6月, 2014 1 次提交
    • J
      Format NULL bitmap as an empty string · cd09ab4d
      Ján Tomko 提交于
      This simplifies the usage in {libxl,qemu}DomainGetNumaParameters
      and it's needed for consistent error reporting in virBitmapFormat.
      
      Also remove the forgotten ATTRIBUTE_NONNULL marker.
      cd09ab4d
  18. 05 6月, 2014 2 次提交
  19. 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
  20. 03 6月, 2014 5 次提交
  21. 13 5月, 2014 1 次提交
  22. 06 5月, 2014 2 次提交
  23. 29 4月, 2014 1 次提交
    • J
      xen: ensure /usr/sbin/xend exists before checking status · 4f70ae24
      Jim Fehlig 提交于
      With xend on the way out, installations may not even have
      /usr/sbin/xend, which results in the following error when the
      drivers are probed
      
      2014-04-28 18:21:19.271+0000: 22129: error : virCommandWait:2426 :
      internal error: Child process (/usr/sbin/xend status) unexpected exit
      status 127: libvirt:  error : cannot execute binary /usr/sbin/xend:
      No such file or directory
      
      Check for existence of /usr/sbin/xend before trying to run it with
      the 'status' option.
      4f70ae24
  24. 26 4月, 2014 1 次提交
    • I
      libxl: Support PV consoles · 657cb1e4
      Ian Campbell 提交于
      Currently the driver only exposes the ability to connect to the serial console
      of a Xen guest, which doesn't work for a PV guest. Since for an HVM guest the
      serial devices are duplicated as consoles it is sufficient to just use the
      console devices unconditionally.
      
      Tested with the following bit of config XML:
      
      <domain type='xen'>
        ...
        <devices>
          <console type='pty'>
            <target type='xen'/>
          </console>
        </devices>
      </domain>
      
      I have observed and tested this on ARM but I believe it also applies to x86 PV
      guests.
      Signed-off-by: NIan Campbell <ian.campbell@citrix.com>
      Cc: Jim Fehlig <jfehlig@suse.com>
      Cc: Dario Faggioli <dario.faggioli@citrix.com>
      Cc: Clark Laughlin <clark.laughlin@linaro.org>
      657cb1e4
  25. 22 4月, 2014 1 次提交
  26. 08 4月, 2014 1 次提交
  27. 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