1. 21 2月, 2015 1 次提交
  2. 14 2月, 2015 1 次提交
    • J
      libxl: Resolve Coverity CHECKED_RETURN · 4438646c
      John Ferlan 提交于
      Periodically my Coverity scan will return a checked_return failure
      for libxlDomainShutdownThread call to libxlDomainStart. Followed the
      libxlAutostartDomain example in order to check the status, emit a
      message, and continue on.
      4438646c
  3. 12 2月, 2015 2 次提交
  4. 06 2月, 2015 1 次提交
  5. 27 1月, 2015 1 次提交
    • D
      Removing probing of secondary drivers · 55ea7be7
      Daniel P. Berrange 提交于
      For stateless, client side drivers, it is never correct to
      probe for secondary drivers. It is only ever appropriate to
      use the secondary driver that is associated with the
      hypervisor in question. As a result the ESX & HyperV drivers
      have both been forced to do hacks where they register no-op
      drivers for the ones they don't implement.
      
      For stateful, server side drivers, we always just want to
      use the same built-in shared driver. The exception is
      virtualbox which is really a stateless driver and so wants
      to use its own server side secondary drivers. To deal with
      this virtualbox has to be built as 3 separate loadable
      modules to allow registration to work in the right order.
      
      This can all be simplified by introducing a new struct
      recording the precise set of secondary drivers each
      hypervisor driver wants
      
      struct _virConnectDriver {
          virHypervisorDriverPtr hypervisorDriver;
          virInterfaceDriverPtr interfaceDriver;
          virNetworkDriverPtr networkDriver;
          virNodeDeviceDriverPtr nodeDeviceDriver;
          virNWFilterDriverPtr nwfilterDriver;
          virSecretDriverPtr secretDriver;
          virStorageDriverPtr storageDriver;
      };
      
      Instead of registering the hypervisor driver, we now
      just register a virConnectDriver instead. This allows
      us to remove all probing of secondary drivers. Once we
      have chosen the primary driver, we immediately know the
      correct secondary drivers to use.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      55ea7be7
  6. 17 1月, 2015 1 次提交
    • A
      libxl: Set path to console on domain startup. · 368042cf
      Anthony PERARD 提交于
      The path to the pty of a Xen PV console is set only in
      virDomainOpenConsole. But this is done too late. A call to
      virDomainGetXMLDesc done before OpenConsole will not have the path to
      the pty, but a call after OpenConsole will.
      
      e.g. of the current issue.
      Starting a domain with '<console type="pty"/>'
      Then:
      virDomainGetXMLDesc():
        <devices>
          <console type='pty'>
            <target type='xen' port='0'/>
          </console>
        </devices>
      virDomainOpenConsole()
      virDomainGetXMLDesc():
        <devices>
          <console type='pty' tty='/dev/pts/30'>
            <source path='/dev/pts/30'/>
            <target type='xen' port='0'/>
          </console>
        </devices>
      
      The patch intend to have the TTY path on the first call of GetXMLDesc.
      This is done by setting up the path at domain start up instead of in
      OpenConsole.
      
      https://bugzilla.redhat.com/show_bug.cgi?id=1170743Signed-off-by: NAnthony PERARD <anthony.perard@citrix.com>
      368042cf
  7. 16 1月, 2015 1 次提交
  8. 14 1月, 2015 2 次提交
    • K
      libxl: Add support for parsing/formating Xen XL config · cec71a6b
      Kiarie Kahurani 提交于
      Now that xenconfig supports parsing and formatting Xen's
      XL config format, integrate it into the libxl driver's
      connectDomainXML{From,To}Native functions.
      Signed-off-by: NKiarie Kahurani <davidkiarie4@gmail.com>
      Signed-off-by: NJim Fehlig <jfehlig@suse.com>
      cec71a6b
    • D
      Give virDomainDef parser & formatter their own flags · 0ecd6851
      Daniel P. Berrange 提交于
      The virDomainDefParse* and virDomainDefFormat* methods both
      accept the VIR_DOMAIN_XML_* flags defined in the public API,
      along with a set of other VIR_DOMAIN_XML_INTERNAL_* flags
      defined in domain_conf.c.
      
      This is seriously confusing & error prone for a number of
      reasons:
      
       - VIR_DOMAIN_XML_SECURE, VIR_DOMAIN_XML_MIGRATABLE and
         VIR_DOMAIN_XML_UPDATE_CPU are only relevant for the
         formatting operation
       - Some of the VIR_DOMAIN_XML_INTERNAL_* flags only apply
         to parse or to format, but not both.
      
      This patch cleanly separates out the flags. There are two
      distint VIR_DOMAIN_DEF_PARSE_* and VIR_DOMAIN_DEF_FORMAT_*
      flags that are used by the corresponding methods. The
      VIR_DOMAIN_XML_* flags received via public API calls must
      be converted to the VIR_DOMAIN_DEF_FORMAT_* flags where
      needed.
      
      The various calls to virDomainDefParse which hardcoded the
      use of the VIR_DOMAIN_XML_INACTIVE flag change to use the
      VIR_DOMAIN_DEF_PARSE_INACTIVE flag.
      0ecd6851
  9. 13 1月, 2015 2 次提交
  10. 04 1月, 2015 1 次提交
  11. 03 12月, 2014 1 次提交
    • J
      Replace virNetworkFree with virObjectUnref · 121c09a9
      John Ferlan 提交于
      Since virNetworkFree will call virObjectUnref anyway, let's just use that
      directly so as to avoid the possibility that we inadvertently clear out
      a pending error message when using the public API.
      121c09a9
  12. 02 12月, 2014 1 次提交
    • J
      libxl: Resolve Coverity CHECKED_RETURN · 5f1d3c6c
      John Ferlan 提交于
      Commit id 'cb88d433' refactored the calling sequence to use a thread;
      however, in doing so "lost" the check for if virNetSocketAccept returns
      failure.  Since other code makes that check, Coverity complains. Although
      a false positive, adding back the failure check pacifies Coverity
      5f1d3c6c
  13. 22 11月, 2014 5 次提交
    • J
      libxl: destroy domain in migration finish phase on failure · 42874fa4
      Jim Fehlig 提交于
      This patch contains three domain cleanup improvements in the migration
      finish phase, ensuring a domain is properly disposed when a failure is
      detected or the migration is cancelled.
      
      The check for virDomainObjIsActive is moved to libxlDomainMigrationFinish,
      where cleanup can occur if migration failed and the domain is inactive.
      
      The 'cleanup' label was missplaced in libxlDomainMigrationFinish, causing
      a migrated domain to remain in the event of an error or cancelled migration.
      
      In cleanup, the domain was not removed from the driver's list of domains.
      Signed-off-by: NJim Fehlig <jfehlig@suse.com>
      42874fa4
    • J
      libxl: start domain paused on migration dst · 60386825
      Jim Fehlig 提交于
      During the perform phase of migration, the domain is started on
      the dst host in a running state if VIR_MIGRATE_PAUSED flag is not
      specified.  In the finish phase, the domain is also unpaused if
      VIR_MIGRATE_PAUSED flag is unset.  I've noticed this second unpause
      fails if the domain was already unpaused following the perform phase.
      
      This patch changes the perform phase to always start the domain
      paused, and defers unpausing, if requested, to the finish phase.
      Unpausing should occur in the finish phase anyhow, where the domain
      can be properly destroyed if the perform phase fails and migration
      is cancelled.
      Signed-off-by: NJim Fehlig <jfehlig@suse.com>
      60386825
    • J
      libxl: acquire job in migration finish phase · a1f38951
      Jim Fehlig 提交于
      Moving data reception of the perform phase of migration to a
      thread introduces a race with the finish phase, where checking
      if the domain is active races with the thread finishing the
      perform phase.  The race is easily solved by acquiring a job in
      the finish phase, which must wait for the perform phase job to
      complete.
      
      While wrapping the finish phase in a job, noticed the virDomainObj
      was being unlocked in a callee - libxlDomainMigrationFinish.  Move
      the unlocking to libxlDomainMigrateFinish3Params, where the lock
      is acquired.
      Signed-off-by: NJim Fehlig <jfehlig@suse.com>
      a1f38951
    • J
      libxl: Receive migration data in a thread · cb88d433
      Jim Fehlig 提交于
      The libxl driver receives migration data within an IO callback invoked
      by the event loop, effectively disabling the event loop while migration
      occurs.
      
      This patch moves receving of the migration data to a thread.  The
      incoming connection is still accepted in the IO callback, but control
      is immediately returned to the event loop after spawning the thread.
      Signed-off-by: NJim Fehlig <jfehlig@suse.com>
      cb88d433
    • 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
  14. 15 11月, 2014 1 次提交
  15. 31 10月, 2014 2 次提交
    • J
      libxl: fix double-free of libxl_domain_build_info · 720be2eb
      Jim Fehlig 提交于
      On error, libxlMakeDomBuildInfo() frees the caller-provided
      libxl_domain_build_info struct embedded in libxl_domain_config,
      causing a segfault
      
      Program received signal SIGSEGV, Segmentation fault.
      [Switching to Thread 0x7f9c13020700 (LWP 40988)]
      (gdb) bt
      0  0x00007f9c162f95b4 in free () from /lib64/libc.so.6
      1  0x00007f9c0d0965ad in libxl_bitmap_dispose () from
         /usr/lib64/libxenlight.so.4.4
      2  0x00007f9c0d0a73bf in libxl_domain_build_info_dispose ()
         from /usr/lib64/libxenlight.so.4.4
      3  0x00007f9c0d0a7974 in libxl_domain_config_dispose () from
         /usr/lib64/libxenlight.so.4.4
      4  0x00007f9c0d2e00c5 in libxlDomainStart (driver=0x7f9c0400e4e0,
         vm=0x7f9c0412b0d0, start_paused=false, restore_fd=-1) at
         libxl/libxl_domain.c:1323
      5  0x00007f9c0d2e1d4b in libxlDomainCreateXML (conn=0x7f9c000009a0,...)
         at libxl/libxl_driver.c:660
      
      Remove the call to libxl_domain_build_info_dispose() from
      libxlMakeDomBuildInfo().  On error, callers will dispose the
      libxl_domain_config object, which in turn disposes the build info.
      720be2eb
    • J
      libxl: Support user-specified <emulator> · 1c0bf509
      Jim Fehlig 提交于
      With the introduction of the libxlDomainGetEmulatorType function,
      it is trivial to support a user-specfied <emulator> in the libxl
      driver.  This patch is based loosely on David Scott's old patch
      to do the same
      
      https://www.redhat.com/archives/libvir-list/2013-April/msg02119.htmlSigned-off-by: NJim Fehlig <jfehlig@suse.com>
      1c0bf509
  16. 29 10月, 2014 1 次提交
    • E
      maint: avoid static zero init in drivers · ec81cf89
      Eric Blake 提交于
      C guarantees that static variables are zero-initialized.  Some older
      compilers (and also gcc -fno-zero-initialized-in-bss) create larger
      binaries if you explicitly zero-initialize a static variable.
      
      * src/libxl/libxl_driver.c: Fix initialization.
      * src/lxc/lxc_controller.c: Likewise.
      * src/openvz/openvz_util.c (openvzKBPerPages): Likewise.
      * src/phyp/phyp_driver.c: Likewise.
      * src/remote/remote_driver.c: Likewise.
      * src/test/test_driver.c: Likewise.
      * src/uml/uml_driver.c: Likewise.
      * src/vbox/vbox_XPCOMCGlue.c: Likewise.
      * src/vbox/vbox_tmpl.c: Likewise.
      * src/xen/xen_driver.c: Likewise.
      * src/xen/xen_hypervisor.c: Likewise.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      ec81cf89
  17. 23 10月, 2014 1 次提交
  18. 17 10月, 2014 1 次提交
  19. 11 10月, 2014 3 次提交
    • S
      libxl: Implement basic video device selection · 1298daca
      Stefan Bader 提交于
      This started as an investigation into an issue where libvirt (using the
      libxl driver) and the Xen host, like an old couple, could not agree on
      who is responsible for selecting the VNC port to use.
      
      Things usually (and a bit surprisingly) did work because, just like that
      old couple, they had the same idea on what to do by default. However it
      was possible that this ended up in a big argument.
      
      The problem is that display information exists in two different places:
      in the vfbs list and in the build info. And for launching the device model,
      only the latter is used. But that never gets initialized from libvirt. So
      Xen allows the device model to select a default port while libvirt thinks
      it has told Xen that this is done by libvirt (though the vfbs config).
      
      While fixing that, I made a stab at actually evaluating the configuration
      of the video device. So that it is now possible to at least decide between
      a Cirrus or standard VGA emulation and to modify the VRAM within certain
      limits using libvirt.
      Signed-off-by: NStefan Bader <stefan.bader@canonical.com>
      Signed-off-by: NJim Fehlig <jfehlig@suse.com>
      1298daca
    • 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
    • J
      libxl: Copy user-specified keymap to libxl build info struct · be28ae16
      Jim Fehlig 提交于
      Commit 4dfc34c3 missed copying the user-specified keymap to
      libxl_domain_build_info struct when creating a VFB device.
      Signed-off-by: NStefan Bader <stefan.bader@canonical.com>
      Signed-off-by: NJim Fehlig <jfehlig@suse.com>
      be28ae16
  20. 19 9月, 2014 1 次提交
    • J
      libxl: Drop driver lock in libxlDomainDefineXML · c7892373
      Jim Fehlig 提交于
      There is no need to acquire the driver-wide lock in
      libxlDomainDefineXML.  When switching to jobs in the libxl
      driver, most driver-wide locks were removed.  The locking here
      was preserved since I mistakenly thought virDomainObjListAdd
      needed protection.  This is not the case, so remove the
      unnecessary locking.
      c7892373
  21. 12 9月, 2014 3 次提交
  22. 11 9月, 2014 1 次提交
  23. 04 9月, 2014 1 次提交
    • E
      maint: use consistent if-else braces in xen and friends · fb6d6507
      Eric Blake 提交于
      I'm about to add a syntax check that enforces our documented
      HACKING style of always using matching {} on if-else statements.
      
      This patch focuses on code related to xen.
      
      * src/libxl/libxl_conf.c (libxlCapsInitGuests)
      (libxlMakeDomBuildInfo): Correct use of {}.
      * src/xen/xen_hypervisor.c (virXen_getvcpusinfo)
      (xenHypervisorMakeCapabilitiesInternal): Likewise.
      * src/xen/xend_internal.c (xenDaemonOpen)
      (xenDaemonDomainMigratePerform, xend_detect_config_version)
      (xenDaemonDetachDeviceFlags, xenDaemonDomainMigratePerform)
      (xenDaemonDomainBlockPeek): Likewise.
      * src/xenapi/xenapi_driver.c (xenapiConnectListDomains)
      (xenapiDomainLookupByUUID, xenapiDomainGetOSType): Likewise.
      * src/xenconfig/xen_common.c (xenParseCPUFeatures, xenFormatNet):
      Likewise.
      * src/xenconfig/xen_sxpr.c (xenParseSxpr, xenFormatSxprNet)
      (xenFormatSxpr): Likewise.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      fb6d6507
  24. 29 8月, 2014 1 次提交
    • J
      libxl_migration: Resolve Coverity NULL_RETURNS · 0322643e
      John Ferlan 提交于
      Coverity noted that all callers to libxlDomainEventQueue() could ensure
      the second parameter (event) was true before calling except this case.
      As I look at the code and how events are used - it seems that prior to
      generating an event for the dom == NULL condition, the resume/suspend
      event should be queue'd after the virDomainSaveStatus() call which will
      goto cleanup and queue the saved event anyway.
      Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
      0322643e
  25. 28 8月, 2014 2 次提交
    • J
      libxl_migration: Resolve Coverity RESOURCE_LEAK · ad4966d9
      John Ferlan 提交于
      In libxlDomainMigrationPrepare() if the uri_in is false, then
      'hostname' is allocated and used "generically" in the routine,
      but not freed.  Conversely, if uri_in is true, then a uri is
      allocated and hostname is set to the uri->hostname value and
      likewise generically used.
      
      At function exit, hostname wasn't free'd in the !uri_in path,
      so that was added.  To just make it clearer on usage the else
      path became the call to virURIFree() although I suppose technically
      it didn't have to since it would be a call using (NULL)
      ad4966d9
    • J
      libxl_domain: Resolve Coverity RESOURCE_LEAK · 2cc03c80
      John Ferlan 提交于
      On the error path need to free the chrdef
      2cc03c80
  26. 26 8月, 2014 1 次提交
  27. 24 7月, 2014 1 次提交