1. 26 9月, 2012 2 次提交
  2. 21 9月, 2012 1 次提交
  3. 17 9月, 2012 1 次提交
  4. 14 8月, 2012 1 次提交
    • O
      Destroy virdomainlist.[ch] · bb705e25
      Osier Yang 提交于
      As the consensus in:
      https://www.redhat.com/archives/libvir-list/2012-July/msg01692.html,
      this patch is to destroy conf/virdomainlist.[ch], folding the
      helpers into conf/domain_conf.[ch].
      
      * src/Makefile.am:
        - Various indention fixes incidentally
        - Add macro DATATYPES_SOURCES (datatypes.[ch])
        - Link datatypes.[ch] for libvirt_lxc
      
      * src/conf/domain_conf.c:
        - Move all the stuffs from virdomainlist.c into it
        - Use virUnrefDomain and virUnrefDomainSnapshot instead of
          virDomainFree and virDomainSnapshotFree, which are defined
          in libvirt.c, and we don't want to link to it.
        - Remove "if" before "free" the object, as virObjectUnref
          is in the list "useless_free_options".
      
      * src/conf/domain_conf.h:
        - Move all the stuffs from virdomainlist.h into it
        - s/LIST_FILTER/LIST_DOMAINS_FILTER/
      
      * src/libxl/libxl_driver.c:
        - s/LIST_FILTER/LIST_DOMAINS_FILTER/
        - no (include "virdomainlist.h")
      
      * src/libxl/libxl_driver.c: Likewise
      
      * src/lxc/lxc_driver.c: Likewise
      
      * src/openvz/openvz_driver.c: Likewise
      
      * src/parallels/parallels_driver.c: Likewise
      
      * src/qemu/qemu_driver.c: Likewise
      
      * src/test/test_driver.c: Likewise
      
      * src/uml/uml_driver.c: Likewise
      
      * src/vbox/vbox_tmpl.c: Likewise
      
      * src/vmware/vmware_driver.c: Likewise
      
      * tools/virsh-domain-monitor.c: Likewise
      
      * tools/virsh.c: Likewise
      bb705e25
  5. 10 8月, 2012 1 次提交
    • L
      nwfilter: fix crash during filter define when lxc driver failed startup · b8a56f12
      Laine Stump 提交于
      The meat of this patch is just moving the calls to
      virNWFilterRegisterCallbackDriver from each hypervisor's "register"
      function into its "initialize" function. The rest is just code
      movement to allow that, and a new virNWFilterUnRegisterCallbackDriver
      function to undo what the register function does.
      
      The long explanation:
      
      There is an array in nwfilter called callbackDrvArray that has
      pointers to a table of functions for each hypervisor driver that are
      called by nwfilter. One of those function pointers is to a function
      that will lock the hypervisor driver. Entries are added to the table
      by calling each driver's "register" function, which happens quite
      early in libvirtd's startup.
      
      Sometime later, each driver's "initialize" function is called. This
      function allocates a driver object and stores a pointer to it in a
      static variable that was previously initialized to NULL. (and here's
      the important part...) If the "initialize" function fails, the driver
      object is freed, and that pointer set back to NULL (but the entry in
      nwfilter's callbackDrvArray is still there).
      
      When the "lock the driver" function mentioned above is called, it
      assumes that the driver was successfully loaded, so it blindly tries
      to call virMutexLock on "driver->lock".
      
      BUT, if the initialize never happened, or if it failed, "driver" is
      NULL. And it just happens that "lock" is always the first field in
      driver so it is also NULL.
      
      Boom.
      
      To fix this, the call to virNWFilterRegisterCallbackDriver for each
      driver shouldn't be called until the end of its (*already guaranteed
      successful*) "initialize" function, not during its "register" function
      (which is currently the case). This implies that there should also be
      a virNWFilterUnregisterCallbackDriver() function that is called in a
      driver's "shutdown" function (although in practice, that function is
      currently never called).
      b8a56f12
  6. 23 7月, 2012 1 次提交
    • O
      Desert the FSF address in copyright · f9ce7dad
      Osier Yang 提交于
      Per the FSF address could be changed from time to time, and GNU
      recommends the following now: (http://www.gnu.org/licenses/gpl-howto.html)
      
        You should have received a copy of the GNU General Public License
        along with Foobar.  If not, see <http://www.gnu.org/licenses/>.
      
      This patch removes the explicit FSF address, and uses above instead
      (of course, with inserting 'Lesser' before 'General').
      
      Except a bunch of files for security driver, all others are changed
      automatically, the copyright for securify files are not complete,
      that's why to do it manually:
      
        src/security/security_selinux.h
        src/security/security_driver.h
        src/security/security_selinux.c
        src/security/security_apparmor.h
        src/security/security_apparmor.c
        src/security/security_driver.c
      f9ce7dad
  7. 19 7月, 2012 2 次提交
  8. 20 6月, 2012 1 次提交
    • P
      drivers: Implement virListAllDomains for drivers using virDomainObj · 33dc8cf0
      Peter Krempa 提交于
      This patch adds support for listing all domains into drivers that use
      the common virDomainObj implementation: libxl, lxc, openvz, qemu, test,
      uml, vmware.
      
      For drivers that don't support managed save images the guests are
      treated as if they had none, so filtering guests that do have such an
      image on this driver succeeds and produces 0 results.
      33dc8cf0
  9. 28 5月, 2012 1 次提交
  10. 22 5月, 2012 1 次提交
    • D
      Fix potential events deadlock when unref'ing virConnectPtr · 2cb0899e
      Daniel P. Berrange 提交于
      When the last reference to a virConnectPtr is released by
      libvirtd, it was possible for a deadlock to occur in the
      virDomainEventState functions. The virDomainEventStatePtr
      holds a reference on virConnectPtr for each registered
      callback. When removing a callback, the virUnrefConnect
      function is run. If this causes the last reference on the
      virConnectPtr to be released, then virReleaseConnect can
      be run, which in turns calls qemudClose. This function has
      a call to virDomainEventStateDeregisterConn which is intended
      to remove all callbacks associated with the virConnectPtr
      instance. This will try to grab a lock on virDomainEventState
      but this lock is already held. Deadlock ensues
      
      Thread 1 (Thread 0x7fcbb526a840 (LWP 23185)):
      
      Since each callback associated with a virConnectPtr holds a
      reference on virConnectPtr, it is impossible for the qemudClose
      method to be invoked while any callbacks are still registered.
      Thus the call to virDomainEventStateDeregisterConn must in fact
      be a no-op. Thus it is possible to just remove all trace of
      virDomainEventStateDeregisterConn and avoid the deadlock.
      
      * src/conf/domain_event.c, src/conf/domain_event.h,
        src/libvirt_private.syms: Delete virDomainEventStateDeregisterConn
      * src/libxl/libxl_driver.c, src/lxc/lxc_driver.c,
        src/qemu/qemu_driver.c, src/uml/uml_driver.c: Remove
        calls to virDomainEventStateDeregisterConn
      2cb0899e
  11. 14 5月, 2012 1 次提交
    • W
      Use XDG Base Directories instead of storing in home directory · 32a9aac2
      William Jon McCann 提交于
      As defined in:
      http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html
      
      This offers a number of advantages:
       * Allows sharing a home directory between different machines, or
      sessions (eg. using NFS)
       * Cleanly separates cache, runtime (eg. sockets), or app data from
      user settings
       * Supports performing smart or selective migration of settings
      between different OS versions
       * Supports reseting settings without breaking things
       * Makes it possible to clear cache data to make room when the disk
      is filling up
       * Allows us to write a robust and efficient backup solution
       * Allows an admin flexibility to change where data and settings are stored
       * Dramatically reduces the complexity and incoherence of the
      system for administrators
      32a9aac2
  12. 10 4月, 2012 1 次提交
  13. 30 3月, 2012 1 次提交
  14. 23 3月, 2012 1 次提交
    • D
      Centralize error reporting for URI parsing/formatting problems · 1f66c18f
      Daniel P. Berrange 提交于
      Move error reporting out of the callers, into virURIParse
      and virURIFormat, to get consistency.
      
      * include/libvirt/virterror.h, src/util/virterror.c: Add VIR_FROM_URI
      * src/util/viruri.c, src/util/viruri.h: Add error reporting
      * src/esx/esx_driver.c, src/libvirt.c, src/libxl/libxl_driver.c,
        src/lxc/lxc_driver.c, src/openvz/openvz_driver.c,
        src/qemu/qemu_driver.c, src/qemu/qemu_migration.c,
        src/remote/remote_driver.c, src/uml/uml_driver.c,
        src/vbox/vbox_tmpl.c, src/vmx/vmx.c, src/xen/xen_driver.c,
        src/xen/xend_internal.c, tests/viruritest.c: Remove error
        reporting
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      1f66c18f
  15. 08 3月, 2012 1 次提交
    • E
      xml: use long long internally, to centralize overflow checks · 73b99771
      Eric Blake 提交于
      On 64-bit platforms, unsigned long and unsigned long long are
      identical, so we don't have to worry about overflow checks.
      On 32-bit platforms, anywhere we narrow unsigned long long back
      to unsigned long, we have to worry about overflow; it's easier
      to do this in one place by having most of the code use the same
      or wider types, and only doing the narrowing at the last minute.
      Therefore, the memory set commands remain unsigned long, and
      the memory get command now centralizes the overflow check into
      libvirt.c, so that drivers don't have to repeat the work.
      
      This also fixes a bug where xen returned the wrong value on
      failure (most APIs return -1 on failure, but getMaxMemory
      must return 0 on failure).
      
      * src/driver.h (virDrvDomainGetMaxMemory): Use long long.
      * src/libvirt.c (virDomainGetMaxMemory): Raise overflow.
      * src/test/test_driver.c (testGetMaxMemory): Fix driver.
      * src/rpc/gendispatch.pl (name_to_ProcName): Likewise.
      * src/xen/xen_hypervisor.c (xenHypervisorGetMaxMemory): Likewise.
      * src/xen/xen_driver.c (xenUnifiedDomainGetMaxMemory): Likewise.
      * src/xen/xend_internal.c (xenDaemonDomainGetMaxMemory):
      Likewise.
      * src/xen/xend_internal.h (xenDaemonDomainGetMaxMemory):
      Likewise.
      * src/xen/xm_internal.c (xenXMDomainGetMaxMemory): Likewise.
      * src/xen/xm_internal.h (xenXMDomainGetMaxMemory): Likewise.
      * src/xen/xs_internal.c (xenStoreDomainGetMaxMemory): Likewise.
      * src/xen/xs_internal.h (xenStoreDomainGetMaxMemory): Likewise.
      * src/xenapi/xenapi_driver.c (xenapiDomainGetMaxMemory):
      Likewise.
      * src/esx/esx_driver.c (esxDomainGetMaxMemory): Likewise.
      * src/libxl/libxl_driver.c (libxlDomainGetMaxMemory): Likewise.
      * src/qemu/qemu_driver.c (qemudDomainGetMaxMemory): Likewise.
      * src/lxc/lxc_driver.c (lxcDomainGetMaxMemory): Likewise.
      * src/uml/uml_driver.c (umlDomainGetMaxMemory): Likewise.
      73b99771
  16. 02 3月, 2012 1 次提交
    • E
      build: use correct type for pid and similar types · 3e2c3d8f
      Eric Blake 提交于
      No thanks to 64-bit windows, with 64-bit pid_t, we have to avoid
      constructs like 'int pid'.  Our API in libvirt-qemu cannot be
      changed without breaking ABI; but then again, libvirt-qemu can
      only be used on systems that support UNIX sockets, which rules
      out Windows (even if qemu could be compiled there) - so for all
      points on the call chain that interact with this API decision,
      we require a different variable name to make it clear that we
      audited the use for safety.
      
      Adding a syntax-check rule only solves half the battle; anywhere
      that uses printf on a pid_t still needs to be converted, but that
      will be a separate patch.
      
      * cfg.mk (sc_correct_id_types): New syntax check.
      * src/libvirt-qemu.c (virDomainQemuAttach): Document why we didn't
      use pid_t for pid, and validate for overflow.
      * include/libvirt/libvirt-qemu.h (virDomainQemuAttach): Tweak name
      for syntax check.
      * src/vmware/vmware_conf.c (vmwareExtractPid): Likewise.
      * src/driver.h (virDrvDomainQemuAttach): Likewise.
      * tools/virsh.c (cmdQemuAttach): Likewise.
      * src/remote/qemu_protocol.x (qemu_domain_attach_args): Likewise.
      * src/qemu_protocol-structs (qemu_domain_attach_args): Likewise.
      * src/util/cgroup.c (virCgroupPidCode, virCgroupKillInternal):
      Likewise.
      * src/qemu/qemu_command.c(qemuParseProcFileStrings): Likewise.
      (qemuParseCommandLinePid): Use pid_t for pid.
      * daemon/libvirtd.c (daemonForkIntoBackground): Likewise.
      * src/conf/domain_conf.h (_virDomainObj): Likewise.
      * src/probes.d (rpc_socket_new): Likewise.
      * src/qemu/qemu_command.h (qemuParseCommandLinePid): Likewise.
      * src/qemu/qemu_driver.c (qemudGetProcessInfo, qemuDomainAttach):
      Likewise.
      * src/qemu/qemu_process.c (qemuProcessAttach): Likewise.
      * src/qemu/qemu_process.h (qemuProcessAttach): Likewise.
      * src/uml/uml_driver.c (umlGetProcessInfo): Likewise.
      * src/util/virnetdev.h (virNetDevSetNamespace): Likewise.
      * src/util/virnetdev.c (virNetDevSetNamespace): Likewise.
      * tests/testutils.c (virtTestCaptureProgramOutput): Likewise.
      * src/conf/storage_conf.h (_virStoragePerms): Use mode_t, uid_t,
      and gid_t rather than int.
      * src/security/security_dac.c (virSecurityDACSetOwnership): Likewise.
      * src/conf/storage_conf.c (virStorageDefParsePerms): Avoid
      compiler warning.
      3e2c3d8f
  17. 25 2月, 2012 1 次提交
    • M
      Fixed URI parsing · 9f748277
      Martin Kletzander 提交于
      Function xmlParseURI does not remove square brackets around IPv6
      address when parsing. One of the solutions is making wrappers around
      functions working with xmlURI*. This assures that uri->server will be
      always properly assigned and it doesn't have to be changed when used
      on some new place in the code.
      For this purpose, functions virParseURI and virSaveURI were
      added. These function are wrappers around xmlParseURI and xmlSaveUri
      respectively.
      Also there is one new syntax check function to prohibit these functions
      anywhere else.
      
      File changes:
       - src/util/viruri.h        -- declaration
       - src/util/viruri.c        -- definition
       - src/libvirt_private.syms -- symbol export
       - src/Makefile.am          -- added source and header files
       - cfg.mk                   -- added sc_prohibit_xmlURI
       - all others               -- ID name and include fixes
      9f748277
  18. 24 1月, 2012 1 次提交
    • D
      Add new virDomainShutdownFlags API · 0b7ddf9e
      Daniel P. Berrange 提交于
      Add a new API virDomainShutdownFlags and define:
      
          VIR_DOMAIN_SHUTDOWN_DEFAULT        = 0,
          VIR_DOMAIN_SHUTDOWN_ACPI_POWER_BTN = (1 << 0),
          VIR_DOMAIN_SHUTDOWN_GUEST_AGENT    = (1 << 1),
      
      Also define some flags for the reboot API
      
          VIR_DOMAIN_REBOOT_DEFAULT        = 0,
          VIR_DOMAIN_REBOOT_ACPI_POWER_BTN = (1 << 0),
          VIR_DOMAIN_REBOOT_GUEST_AGENT    = (1 << 1),
      
      Although these two APIs currently have the same flags, using
      separate enums allows them to expand separately in the future.
      
      Add stub impls of the new API for all existing drivers
      0b7ddf9e
  19. 19 12月, 2011 4 次提交
    • D
      Only add the timer when a callback is registered · 707781fe
      Daniel P. Berrange 提交于
      The lifetime of the virDomainEventState object is tied to
      the lifetime of the driver, which in stateless drivers is
      tied to the lifetime of the virConnectPtr.
      
      If we add & remove a timer when allocating/freeing the
      virDomainEventState object, we can get a situation where
      the timer still triggers once after virDomainEventState
      has been freed. The timeout callback can't keep a ref
      on the event state though, since that would be a circular
      reference.
      
      The trick is to only register the timer when a callback
      is registered with the event state & remove the timer
      when the callback is unregistered.
      
      The demo for the bug is to run
      
        while true ; do date ; ../tools/virsh -q -c test:///default 'shutdown test; undefine test; dominfo test' ; done
      
      prior to this fix, it will frequently hang and / or
      crash, or corrupt memory
      707781fe
    • D
      Hide use of timers for domain event dispatch · 34ad1353
      Daniel P. Berrange 提交于
      Currently all drivers using domain events need to provide a callback
      for handling a timer to dispatch events in a clean stack. There is
      no technical reason for dispatch to go via driver specific code. It
      could trivially be dispatched directly from the domain event code,
      thus removing tedious boilerplate code from all drivers
      
      Also fix the libxl & xen drivers to pass 'true' when creating the
      virDomainEventState, since they run inside the daemon & thus always
      expect events to be present.
      
      * src/conf/domain_event.c, src/conf/domain_event.h: Internalize
        dispatch of events from timer callback
      * src/libxl/libxl_driver.c, src/lxc/lxc_driver.c,
        src/qemu/qemu_domain.c, src/qemu/qemu_driver.c,
        src/remote/remote_driver.c, src/test/test_driver.c,
        src/uml/uml_driver.c, src/vbox/vbox_tmpl.c,
        src/xen/xen_driver.c: Remove all timer dispatch functions
      34ad1353
    • D
      Convert drivers to thread safe APIs for adding callbacks · 7b87a30f
      Daniel P. Berrange 提交于
      * src/libxl/libxl_driver.c, src/lxc/lxc_driver.c,
        src/qemu/qemu_driver.c, src/remote/remote_driver.c,
        src/test/test_driver.c, src/uml/uml_driver.c,
        src/vbox/vbox_tmpl.c, src/xen/xen_driver.c: Convert
        to threadsafe APIs
      7b87a30f
    • D
      Return count of callbacks when registering callbacks · d09f6ba5
      Daniel P. Berrange 提交于
      When registering a callback for a particular event some callers
      need to know how many callbacks already exist for that event.
      While it is possible to ask for a count, this is not free from
      race conditions when threaded. Thus the API for registering
      callbacks should return the count of callbacks. Also rename
      virDomainEventStateDeregisterAny to virDomainEventStateDeregisterID
      
      * src/conf/domain_event.c, src/conf/domain_event.h,
        src/libvirt_private.syms: Return count of callbacks when
        registering callbacks
      * src/libxl/libxl_driver.c, src/libxl/libxl_driver.c,
        src/qemu/qemu_driver.c, src/remote/remote_driver.c,
        src/remote/remote_driver.c, src/uml/uml_driver.c,
        src/vbox/vbox_tmpl.c, src/xen/xen_driver.c: Update
        for change in APIs
      d09f6ba5
  20. 01 12月, 2011 1 次提交
  21. 29 11月, 2011 1 次提交
    • S
      Implement the core API to suspend/resume the host · 4ddb37c3
      Srivatsa S. Bhat 提交于
      Add the core functions that implement the functionality of the API.
      Suspend is done by using an asynchronous mechanism so that we can return
      the status to the caller before the host gets suspended. This asynchronous
      operation is achieved by suspending the host in a separate thread of
      execution. However, returning the status to the caller is only best-effort,
      but not guaranteed.
      
      To resume the host, an RTC alarm is set up (based on how long we want to
      suspend) before suspending the host. When this alarm fires, the host
      gets woken up.
      
      Suspend-to-RAM operation on a host running Linux can take upto more than 20
      seconds, depending on the load of the system. (Freezing of tasks, an operation
      preceding any suspend operation, is given up after a 20 second timeout).
      And Suspend-to-Disk can take even more time, considering the time required
      for compaction, creating the memory image and writing it to disk etc.
      So, we do not allow the user to specify a suspend duration of less than 60
      seconds, to be on the safer side, since we don't want to prematurely declare
      failure when we only had to wait for some more time.
      4ddb37c3
  22. 24 11月, 2011 2 次提交
  23. 12 11月, 2011 1 次提交
    • E
      build: drop useless dirent.h includes · e55ec69d
      Eric Blake 提交于
      * .gnulib: Update to latest, for improved syntax-check.
      * src/lxc/lxc_container.c (includes): Drop unused include.
      * src/network/bridge_driver.c: Likewise.
      * src/node_device/node_device_linux_sysfs.c: Likewise.
      * src/openvz/openvz_driver.c: Likewise.
      * src/qemu/qemu_conf.c: Likewise.
      * src/storage/storage_backend_iscsi.c: Likewise.
      * src/storage/storage_backend_mpath.c: Likewise.
      * src/uml/uml_conf.c: Likewise.
      * src/uml/uml_driver.c: Likewise.
      e55ec69d
  24. 10 11月, 2011 4 次提交
    • D
      Split bridge.h into three separate files · e49c9bf2
      Daniel P. Berrange 提交于
      Following the renaming of the bridge management APIs, we can now
      split the source file into 3 corresponding pieces
      
       * src/util/virnetdev.c: APIs for any type of network interface
       * src/util/virnetdevbridge.c: APIs for bridge interfaces
       * src/util/virnetdevtap.c: APIs for TAP interfaces
      
      * src/util/virnetdev.c, src/util/virnetdev.h,
        src/util/virnetdevbridge.c, src/util/virnetdevbridge.h,
        src/util/virnetdevtap.c, src/util/virnetdevtap.h: Copied
        from bridge.{c,h}
      * src/util/bridge.c, src/util/bridge.h: Split into 3 pieces
      * src/lxc/lxc_driver.c, src/network/bridge_driver.c,
        src/openvz/openvz_driver.c, src/qemu/qemu_command.c,
        src/qemu/qemu_conf.h, src/uml/uml_conf.c, src/uml/uml_conf.h,
        src/uml/uml_driver.c: Update #include directives
      e49c9bf2
    • D
      Rename all brXXXX APIs to follow new convention · dced27c8
      Daniel P. Berrange 提交于
      The existing brXXX APIs in src/util/bridge.h are renamed to
      follow one of three different conventions
      
       - virNetDevXXX       - operations for any type of interface
       - virNetDevBridgeXXX - operations for bridge interfaces
       - virNetDevTapXXX    - operations for tap interfaces
      
      * src/util/bridge.h, src/util/bridge.c: Rename all APIs
      * src/lxc/lxc_driver.c, src/network/bridge_driver.c,
        src/qemu/qemu_command.c, src/uml/uml_conf.c,
        src/uml/uml_driver.c: Update for API renaming
      dced27c8
    • D
      Make all brXXX APIs raise errors, instead of returning errnos · 4f4fd8f7
      Daniel P. Berrange 提交于
      Currently every caller of the brXXX APIs has to store the returned
      errno value and then raise an error message. This results in
      inconsistent error messages across drivers, additional burden on
      the callers and makes the error reporting inaccurate since it is
      hard to distinguish different scenarios from 1 errno value.
      
      * src/util/bridge.c: Raise errors instead of returning errnos
      * src/lxc/lxc_driver.c, src/network/bridge_driver.c,
        src/qemu/qemu_command.c, src/uml/uml_conf.c,
        src/uml/uml_driver.c: Remove error reporting code
      4f4fd8f7
    • D
      Remove 'brControl' object · 6cfeb9a7
      Daniel P. Berrange 提交于
      The bridge management APIs in src/util/bridge.c require a brControl
      object to be passed around. This holds the file descriptor for the
      control socket. This extra object complicates use of the API for
      only a minor efficiency gain, which is in turn entirely offset by
      the need to fork/exec the brctl command for STP configuration.
      
      This patch removes the 'brControl' object entirely, instead opening
      the control socket & closing it again within the scope of each method.
      
      The parameter names for the APIs are also made to consistently use
      'brname' for bridge device name, and 'ifname' for an interface
      device name. Finally annotations are added for non-NULL parameters
      and return check validation
      
      * src/util/bridge.c, src/util/bridge.h: Remove brControl object
        and update API parameter names & annotations.
      * src/lxc/lxc_driver.c, src/network/bridge_driver.c,
        src/uml/uml_conf.h, src/uml/uml_conf.c, src/uml/uml_driver.c,
        src/qemu/qemu_command.c, src/qemu/qemu_conf.h,
        src/qemu/qemu_driver.c: Remove reference to 'brControl' object
      6cfeb9a7
  25. 03 11月, 2011 2 次提交
    • D
      Set aliases for LXC/UML console devices · 8866eed0
      Daniel P. Berrange 提交于
      To allow virDomainOpenConsole to access non-primary consoles,
      device aliases are required to be set. Until now only the QEMU
      driver has done this. Update LXC & UML to set aliases for any
      console devices
      
      * src/lxc/lxc_driver.c, src/uml/uml_driver.c: Set aliases
        for console devices
      8866eed0
    • D
      Allow multiple consoles per virtual guest · 0873b688
      Daniel P. Berrange 提交于
      While Xen only has a single paravirt console, UML, and
      QEMU both support multiple paravirt consoles. The LXC
      driver can also be trivially made to support multiple
      consoles. This patch extends the XML to allow multiple
      <console> elements in the XML. It also makes the UML
      and QEMU drivers support this config.
      
      * src/conf/domain_conf.c, src/conf/domain_conf.h: Allow
        multiple <console> devices
      * src/lxc/lxc_driver.c, src/xen/xen_driver.c,
        src/xenxs/xen_sxpr.c, src/xenxs/xen_xm.c: Update for
        internal API changes
      * src/security/security_selinux.c, src/security/virt-aa-helper.c:
        Only label consoles that aren't a copy of the serial device
      * src/qemu/qemu_command.c, src/qemu/qemu_driver.c,
        src/qemu/qemu_process.c, src/uml/uml_conf.c,
        src/uml/uml_driver.c: Support multiple console devices
      * tests/qemuxml2xmltest.c, tests/qemuxml2argvtest.c: Extra
        tests for multiple virtio consoles. Set QEMU_CAPS_CHARDEV
        for all console /channel tests
      * tests/qemuxml2argvdata/qemuxml2argv-channel-virtio-auto.args,
        tests/qemuxml2argvdata/qemuxml2argv-channel-virtio.args
        tests/qemuxml2argvdata/qemuxml2argv-console-virtio.args: Update
        for correct chardev syntax
      * tests/qemuxml2argvdata/qemuxml2argv-console-virtio-many.args,
        tests/qemuxml2argvdata/qemuxml2argv-console-virtio-many.xml: New
        test file
      0873b688
  26. 19 10月, 2011 1 次提交
    • D
      Add support for autodestroy of guests to the LXC and UML drivers · 02e92dc4
      Daniel P. Berrange 提交于
      We recently added support for VIR_DOMAIN_START_AUTODESTROY and
      an impl to the QEMU driver. It is very desirable to support in
      other drivers, so this adds it to LXC and UML
      
      * src/lxc/lxc_conf.h, src/lxc/lxc_driver.c,
        src/uml/uml_conf.h, src/uml/uml_driver.c: Wire up autodestroy
        functions
      02e92dc4
  27. 16 9月, 2011 1 次提交
  28. 05 9月, 2011 1 次提交
    • E
      snapshot: also support disks by path · 89b6284f
      Eric Blake 提交于
      I got confused when 'virsh domblkinfo dom disk' required the
      path to a disk (which can be ambiguous, since a single file
      can back multiple disks), rather than the unambiguous target
      device name that I was using in disk snapshots.  So, in true
      developer fashion, I went for the best of both worlds - all
      interfaces that operate on a disk (aka block) now accept
      either the target name or the unambiguous path to the backing
      file used by the disk.
      
      * src/conf/domain_conf.h (virDomainDiskIndexByName): Add
      parameter.
      (virDomainDiskPathByName): New prototype.
      * src/libvirt_private.syms (domain_conf.h): Export it.
      * src/conf/domain_conf.c (virDomainDiskIndexByName): Also allow
      searching by path, and decide whether ambiguity is okay.
      (virDomainDiskPathByName): New function.
      (virDomainDiskRemoveByName, virDomainSnapshotAlignDisks): Update
      callers.
      * src/qemu/qemu_driver.c (qemudDomainBlockPeek)
      (qemuDomainAttachDeviceConfig, qemuDomainUpdateDeviceConfig)
      (qemuDomainGetBlockInfo, qemuDiskPathToAlias): Likewise.
      * src/qemu/qemu_process.c (qemuProcessFindDomainDiskByPath):
      Likewise.
      * src/libxl/libxl_driver.c (libxlDomainAttachDeviceDiskLive)
      (libxlDomainDetachDeviceDiskLive, libxlDomainAttachDeviceConfig)
      (libxlDomainUpdateDeviceConfig): Likewise.
      * src/uml/uml_driver.c (umlDomainBlockPeek): Likewise.
      * src/xen/xend_internal.c (xenDaemonDomainBlockPeek): Likewise.
      * docs/formatsnapshot.html.in: Update documentation.
      * tools/virsh.pod (domblkstat, domblkinfo): Likewise.
      * docs/schemas/domaincommon.rng (diskTarget): Tighten pattern on
      disk targets.
      * docs/schemas/domainsnapshot.rng (disksnapshot): Update to match.
      * tests/domainsnapshotxml2xmlin/disk_snapshot.xml: Update test.
      89b6284f
  29. 19 8月, 2011 1 次提交
  30. 03 8月, 2011 1 次提交
    • E
      fdstream: drop delete argument · 00ef048f
      Eric Blake 提交于
      Revert 6a1f5f56.  Now that libvirt_iohelper takes fds by
      inheritance rather than by open() (commit 1eb66479), there is
      no longer a race where the parent can unlink() a file prior to
      the iohelper open()ing the same file.  From there, it makes
      more sense to have the callers both create and unlink, rather
      than the caller create and the stream unlink, since the latter
      was only needed when iohelper had to do the unlink.
      
      * src/fdstream.h (virFDStreamOpenFile, virFDStreamCreateFile):
      Callers are responsible for deletion.
      * src/fdstream.c (virFDStreamOpenFileInternal): Don't leak created
      file on failure.
      (virFDStreamOpenFile, virFDStreamCreateFile): Drop parameter.
      * src/lxc/lxc_driver.c (lxcDomainOpenConsole): Update callers.
      * src/qemu/qemu_driver.c (qemuDomainScreenshot)
      (qemuDomainOpenConsole): Likewise.
      * src/storage/storage_driver.c (storageVolumeDownload)
      (storageVolumeUpload): Likewise.
      * src/uml/uml_driver.c (umlDomainOpenConsole): Likewise.
      * src/vbox/vbox_tmpl.c (vboxDomainScreenshot): Likewise.
      * src/xen/xen_driver.c (xenUnifiedDomainOpenConsole): Likewise.
      00ef048f