1. 08 10月, 2015 1 次提交
    • J
      libxl: Resolve Coverity FORWARD_NULL · f84c6dd2
      John Ferlan 提交于
      Since the strtok_r call in libxlCapsInitGuests expects a non NULL first
      parameter when the third parameter is NULL, we need to check that
      the returned 'capabilities' from a libxl_get_version_info call is
      not NULL and error out if so since the code expects it.
      Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
      f84c6dd2
  2. 24 9月, 2015 1 次提交
  3. 22 9月, 2015 2 次提交
  4. 17 9月, 2015 1 次提交
  5. 16 9月, 2015 2 次提交
    • J
      libxl: fix compiler error introduced by commit ba25c214 · a4604eb0
      Jim Fehlig 提交于
      libxl/libxl_conf.c: In function 'libxlDriverConfigNew':
      libxl/libxl_conf.c:1560:30: error: 'log_level' may be used uninitialized
      in this function [-Werror=maybe-uninitialized]
      a4604eb0
    • J
      libxl: open libxl log stream with libvirtd log_level · ba25c214
      Jim Fehlig 提交于
      Instead of a hardcoded DEBUG log level, use the overall
      daemon log level specified in libvirtd.conf when opening
      a log stream with libxl. libxl is very verbose when DEBUG
      log level is set, resulting in huge log files that can
      potentially fill a disk. Control of libxl verbosity should
      be placed in the administrator's hands.
      ba25c214
  6. 11 9月, 2015 1 次提交
  7. 04 9月, 2015 1 次提交
  8. 02 9月, 2015 1 次提交
    • J
      qemu: add udp interface support · 5c668a78
      Jonathan Toppins 提交于
      Adds a new interface type using UDP sockets, this seems only applicable
      to QEMU but have edited tree-wide to support the new interface type.
      
      The interface type required the addition of a "localaddr" (local
      address), this then maps into the following xml and qemu call.
      
      <interface type='udp'>
        <mac address='52:54:00:5c:67:56'/>
        <source address='127.0.0.1' port='11112'>
          <local address='127.0.0.1' port='22222'/>
        </source>
        <model type='virtio'/>
        <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>
      </interface>
      
      QEMU call:
      	-net socket,udp=127.0.0.1:11112,localaddr=127.0.0.1:22222
      
      Notice the xml "local" entry becomes the "localaddr" for the qemu call.
      
      reference:
      http://lists.gnu.org/archive/html/qemu-devel/2011-11/msg00629.htmlSigned-off-by: NJonathan Toppins <jtoppins@cumulusnetworks.com>
      Signed-off-by: NJán Tomko <jtomko@redhat.com>
      5c668a78
  9. 28 8月, 2015 3 次提交
    • J
      libxl: acquire a job when receiving a migrating domain · e80b84a7
      Jim Fehlig 提交于
      Commit f86ae403 moved acquiring a job from libxlDomainStart()
      to its callers. One spot missed was in libxlDoMigrateReceive().
      Acquire a job in libxlDoMigrateReceive() before calling
      libxlDomainStart().
      Signed-off-by: NJim Fehlig <jfehlig@suse.com>
      e80b84a7
    • J
      libxl: don't attempt to resume domain when suspend fails · 15120b8c
      Jim Fehlig 提交于
      Failure of libxl_domain_suspend() does not leave the domain in
      a suspended state, so no need to call libxl_domain_resume(),
      which btw will fail with "domain not suspended".
      Signed-off-by: NJim Fehlig <jfehlig@suse.com>
      15120b8c
    • J
      libxl: fix ref counting of libxlMigrationDstArgs · 44a54eb0
      Jim Fehlig 提交于
      This patch fixes some flawed logic around ref counting the
      libxlMigrationDstArgs object.
      
      First, when adding sockets to the event loop with
      virNetSocketAddIOCallback(), the generic virObjectFreeCallback()
      was registered as a free function, with libxlMigrationDstArgs as
      its parameter. A reference was also taken on
      libxlMigrationDstArgs for each successful call to
      virNetSocketAddIOCallback(). The rational behind this logic was
      that the libxlMigrationDstArgs object had to out-live the socket
      objects. But virNetSocketAddIOCallback() already takes a
      reference on socket objects, ensuring their life until removed
      from the event loop and unref'ed in virNetSocketEventFree(). We
      only need to ensure libxlMigrationDstArgs lives until
      libxlDoMigrateReceive() finishes, which can be done by simply
      unref'ing libxlMigrationDstArgs at the end of
      libxlDoMigrateReceive().
      
      The second flaw was unref'ing the sockets in the failure path of
      libxlMigrateReceive() and at the end of libxlDoMigrateReceive().
      As mentioned above, the sockets are already unref'ed by
      virNetSocketEventFree() when removed from the event loop.
      Attempting to unref the socket a second time resulted in a
      libvirtd crash since the socket was previously unref'ed and
      disposed.
      Signed-off-by: NJim Fehlig <jfehlig@suse.com>
      44a54eb0
  10. 13 8月, 2015 1 次提交
  11. 11 7月, 2015 1 次提交
    • J
      libxl: set dom0 state to running · 4ffb21c8
      Jim Fehlig 提交于
      Commit 45697fe5 added dom0 to driver->domains, but missed
      setting its state to 'running'
      
      $ virsh list
       Id    Name                           State
      ----------------------------------------------------
       0     Domain-0                       shut off
      4ffb21c8
  12. 09 7月, 2015 2 次提交
    • J
      libxl: rework setting the state of virDomainObj · e9c27344
      Jim Fehlig 提交于
      Set the state of virDomainObj in the functions that
      actually change the domain state, instead of the generic
      libxlDomainCleanup function. This approach gives functions
      calling libxlDomainCleanup more flexibility wrt when and
      how they change virDomainObj state via virDomainObjSetState.
      
      The prior approach of calling virDomainObjSetState in
      libxlDomainCleanup resulted in the following incorrect
      coding pattern in the various functions that change
      domain state
      
       libxlDomain<DoStateTransition>
         call libxl function to do state transition
         emit lifecycle event
         libxlDomainCleanup
           virDomainObjSetState
      
      Once simple manifestation of this bug is seeing a domain
      running in virt-manager after selecting the shutdown button,
      even after the domain has long shutdown.
      e9c27344
    • J
      libxl: support dom0 · 45697fe5
      Jim Fehlig 提交于
      In Xen, dom0 is really just another domain that supports ballooning,
      adding/removing devices, changing vcpu configuration, etc. This patch
      adds support to the libxl driver for managing dom0. Note that the
      legacy xend driver has long supported managing dom0.
      
      Operations that are not supported on dom0 are filtered in libvirt
      where a sensible error is reported. Errors from libxl are not
      always helpful. E.g., attempting a save on dom0 results in
      
      2015-06-23 15:25:05 MDT libxl: debug: libxl_dom.c:1570:libxl__toolstack_save: domain=0 toolstack data size=8
      2015-06-23 15:25:05 MDT libxl: debug: libxl.c:979:do_libxl_domain_suspend: ao 0x7f7e68000b70: inprogress: poller=0x7f7e68000930, flags=i
      2015-06-23 15:25:05 MDT libxl-save-helper: debug: starting save: Success
      2015-06-23 15:25:05 MDT xc: detail: xc_domain_save_suse: starting save of domid 0
      2015-06-23 15:25:05 MDT xc: error: Couldn't map live_shinfo (3 = No such process): Internal error
      2015-06-23 15:25:05 MDT xc: detail: Save exit of domid 0 with errno=3
      2015-06-23 15:25:05 MDT libxl-save-helper: debug: complete r=1: No such process
      2015-06-23 15:25:05 MDT libxl: error: libxl_dom.c:1876:libxl__xc_domain_save_done: saving domain: domain did not respond to suspend request: No such process
      2015-06-23 15:25:05 MDT libxl: error: libxl_dom.c:2033:remus_teardown_done: Remus: failed to teardown device for guest with domid 0, rc -8
      Signed-off-by: NJim Fehlig <jfehlig@suse.com>
      45697fe5
  13. 01 7月, 2015 4 次提交
    • J
      libxl: Set def->vcpus after successfully modifying live vcpu count · 04597f8f
      Jim Fehlig 提交于
      def->vcpus was never updated after successfully changing the live
      vcpu count of a domain. Subsequent queries for vcpu info would
      return incorrect results.  E.g.:
      
      virsh vcpucount test
      maximum      config         4
      maximum      live           4
      current      config         4
      current      live           4
      
      virsh setvcpus test 2
      
      virsh vcpucount test
      maximum      config         4
      maximum      live           4
      current      config         4
      current      live           4
      
      After patch, live current config is reported correctly:
      
      virsh vcpucount test
      maximum      config         4
      maximum      live           4
      current      config         4
      current      live           2
      
      While fixing this, noticed that the live config was not saved
      to cfg->stateDir via virDomainSaveStatus. Save the live config
      and change error handling of virDomainSave{Config,Status} to
      log a message via VIR_WARN, instead of failing the entire
      DomainSetVcpusFlags operation.
      Signed-off-by: NJim Fehlig <jfehlig@suse.com>
      04597f8f
    • J
      libxl: honor domainGetXMLDesc() --inactive flag · 33be48d7
      Jim Fehlig 提交于
      The libxl driver always uses virDomainObj->def when formatting
      the domain XML description.  Use virDomainObj->newDef when
      --inactive flag is set.
      Signed-off-by: NJim Fehlig <jfehlig@suse.com>
      33be48d7
    • J
      libxl: don't remove persistent domain on start failure · 4b53d0d4
      Jim Fehlig 提交于
      libxlDomainCreateXML() would remove a persistent domain if
      libxlDomainStart() failed.  Check if domain is persistent
      before removing.
      Signed-off-by: NJim Fehlig <jfehlig@suse.com>
      4b53d0d4
    • J
      libxl: don't overwrite domain state from statedir config · 29b154e2
      Jim Fehlig 提交于
      When restarting libvirtd and reconnecting to running domains,
      libxlReconnectDomain() would unconditionally set the domain state
      to VIR_DOMAIN_RUNNING, overwriting the state maintained in
      $statedir/<domname>.xml.  A domain in a paused state would have
      the state changed to running, even though it was actually in a
      paused state.
      Signed-off-by: NJim Fehlig <jfehlig@suse.com>
      29b154e2
  14. 24 6月, 2015 1 次提交
    • L
      Improve some errors for openconsole/channel · 898e76f0
      Luyao Huang 提交于
      Functions like virDomainOpenConsole() and virDomainOpenChannel() accept
      NULL as a dev_name parameter.  Try using alias for the error message if
      dev_name is not specified.
      
      Before:
        error: internal error: character device <null> is not using a PTY
      
      After:
        error: internal error: character device serial0 is not using a PTY
      Signed-off-by: NLuyao Huang <lhuang@redhat.com>
      898e76f0
  15. 20 6月, 2015 1 次提交
    • I
      libxl: avoid freeing an uninitialised bitmap · cc99d240
      Ian Campbell 提交于
      If vm->def->cputune.nvcpupin is 0 in libxlDomainSetVcpuAffinities (as
      seems to be the case on arm) then the VIR_FREE after cleanup: would be
      operating on an uninitialised pointer in map.map.
      
      Fix this by using libxl_bitmap_init and libxl_bitmap_dispose in the
      appropriate places (like VIR_FREE, libxl_bitmap_dispose is also
      idempotent, so there is no double free on exit from the loop).
      
      libxl_bitmap_dispose is slightly preferable since it also sets
      map.size back to 0, avoiding a potential source of confusion.
      
      This fixes the crashes we've been seeing in the Xen automated tests on
      ARM.
      
      I had a glance at the handful of other users of libxl_bitmap and none
      of them looked to have a similar issue.
      Signed-off-by: NIan Campbell <ian.campbell@citrix.com>
      cc99d240
  16. 19 6月, 2015 1 次提交
  17. 13 6月, 2015 1 次提交
  18. 11 6月, 2015 1 次提交
  19. 04 6月, 2015 3 次提交
    • P
      libxl: Don't remove vcpu pin definition in libxlDomainCleanup · 8db0f438
      Peter Krempa 提交于
      The vCPU pinning definition gets removed when the domain definition is
      being freed later. If there is no next configuration it would remove the
      configured pinning.
      8db0f438
    • P
      qemu: libxl: vcpupin: Don't reset pinning when pinning to all pcpus · a02a161b
      Peter Krempa 提交于
      In the pre-NUMA ages pinning a vCPU to all pCPUs was eaqual to deleting
      the pinning info. Now it does not entirely work that way. Pinning a vCPU
      to all pCPUs might be a desired operation. Additionally removal of the
      pinning will result into using the default pinning information at the
      next boot which might be different from all vcpus.
      
      This patch removes the false assumption that we should remove the
      pinning after pinning to all vCPUs and tweaks the documentation for
      virsh.
      
      A later patch will implement a new flag for the virDomainPinVcpuFlags
      API that will allow to remove the pinning in a sane way.
      a02a161b
    • J
      maint: remove incorrect apostrophes from 'its' · 12b949df
      Ján Tomko 提交于
      12b949df
  20. 03 6月, 2015 3 次提交
  21. 01 6月, 2015 1 次提交
    • R
      libxl: load on FreeBSD · f57842ec
      Roman Bogorodskiy 提交于
      The libxl tries to check if it's running in dom0 by parsing
      /proc/xen/capabilities and if that fails it doesn't load.
      
      There's no procfs interface in Xen on FreeBSD, so this check always
      fails.
      
      In addition to checking procfs, check if /dev/xen/xenstored, that's enough to
      check if we're running in dom0 in FreeBSD case.
      f57842ec
  22. 29 5月, 2015 4 次提交
  23. 21 5月, 2015 1 次提交
  24. 18 5月, 2015 1 次提交
    • L
      conf: make virNodeDevCapData an official type · ffc40b63
      Laine Stump 提交于
      For some reason a union (_virNodeDevCapData) that had only been
      declared inside the toplevel struct virNodeDevCapsDef was being used
      as an argument to functions all over the place. Since it was only a
      union, the "type" attribute wasn't necessarily sent with it. While
      this works, it just seems wrong.
      
      This patch creates a toplevel typedef for virNodeDevCapData and
      virNodeDevCapDataPtr, making it a struct that has the type attribute
      as a member, along with an anonymous union of everything that used to
      be in union _virNodeDevCapData. This way we only have to change the
      following:
      
        s/union _virNodeDevCapData */virNodeDevCapDataPtr /
      
      and
      
        s/caps->type/caps->data.type/
      
      This will make me feel less guilty when adding functions that need a
      pointer to one of these.
      ffc40b63
  25. 16 5月, 2015 1 次提交
    • J
      libxl: provide impl for nodeGetSecurityModel · 99a42f3c
      Jim Fehlig 提交于
      Currently, the libxl driver does not support any security drivers.
      When the qemu driver has no security driver configued,
      nodeGetSecurityModel succeeds but returns an empty virSecurityModel
      object.  Do the same in the libxl driver instead of reporting
      
      this function is not supported by the connection driver:
      virNodeGetSecurityModel
      99a42f3c