1. 13 3月, 2015 1 次提交
    • J
      Introduce virBitmapIsBitSet · 22fd3ac3
      Ján Tomko 提交于
      A helper that never returns an error and treats bits out of bitmap range
      as false.
      
      Use it everywhere we use ignore_value on virBitmapGetBit, or loop over
      the bitmap size.
      22fd3ac3
  2. 06 3月, 2015 1 次提交
    • J
      libxl: remove unneeded cleanup_unlock label · 3b7f5895
      Jim Fehlig 提交于
      In the old days of a global driver lock, it was necessary to unlock
      the driver after a domain restore operation.  When the global lock
      was removed from the driver, some remnants were left behind in
      libxlDomainRestoreFlags.  Remove this unneeded (and incorrect) code.
      Signed-off-by: NJim Fehlig <jfehlig@suse.com>
      3b7f5895
  3. 06 2月, 2015 1 次提交
  4. 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
  5. 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
  6. 16 1月, 2015 1 次提交
  7. 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
  8. 13 1月, 2015 2 次提交
  9. 04 1月, 2015 1 次提交
  10. 22 11月, 2014 2 次提交
    • 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: 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
  11. 15 11月, 2014 1 次提交
  12. 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
  13. 23 10月, 2014 1 次提交
  14. 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
  15. 12 9月, 2014 2 次提交
  16. 24 7月, 2014 1 次提交
  17. 16 7月, 2014 2 次提交
  18. 15 7月, 2014 1 次提交
  19. 09 7月, 2014 2 次提交
    • 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
  20. 03 7月, 2014 3 次提交
  21. 27 6月, 2014 1 次提交
  22. 25 6月, 2014 1 次提交
  23. 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
  24. 05 6月, 2014 1 次提交
  25. 03 6月, 2014 1 次提交
  26. 06 5月, 2014 2 次提交
  27. 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
  28. 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
  29. 22 4月, 2014 1 次提交
  30. 08 4月, 2014 1 次提交
  31. 03 4月, 2014 1 次提交
    • S
      libxl: Use id from virDomainObj inside the driver · 0e0c1a74
      Stefan Bader 提交于
      There is a domain id in the virDomain structure as well as in the
      virDomainObj structure. While the former can become stale the latter
      is kept up to date. So it is safer to always (virDomainObjPtr)->def->id
      internally.
      
      This will fix issues seen when managing Xen guests through libvirt from
      virt-manager (not being able to get domain info after define or reboot).
      This was caused both though libxlDomainGetInfo() only but there were
      a lot of places that might potentially cause issues, too.
      Signed-off-by: NStefan Bader <stefan.bader@canonical.com>
      0e0c1a74