1. 05 11月, 2009 7 次提交
    • M
      Detect availability of QEMU -chardev CLI option · 74003968
      Matthew Booth 提交于
      * src/qemu/qemu_conf.h: defines a new QEMUD_CMD_FLAG_CHARDEV flag
      * src/qemu/qemu_conf.c: parse the output for -chardev and set flag
        appropriately
      74003968
    • M
      Allow character devices to have different target types · 89d549c3
      Matthew Booth 提交于
      A character device's target (it's interface in the guest) had only a
      single property: port. This patch is in preparation for adding targets
      which require other properties.
      Since this changes the conf type for character devices this affects
      a number of drivers:
      
      * src/conf/domain_conf.[ch] src/esx/esx_vmx.c src/qemu/qemu_conf.c
        src/qemu/qemu_driver.c src/uml/uml_conf.c src/uml/uml_driver.c
        src/vbox/vbox_tmpl.c src/xen/xend_internal.c src/xen/xm_internal.c:
        target properties are moved into a union in virDomainChrDef, and a
        targetType field is added to identify which union member should be
        used. All current code which touches a virDomainChrDef is updated both
        to use the new union field, and to populate targetType if necessary.
      89d549c3
    • R
      LXC allow container to have ethN interfaces · 8db32571
      Ryota Ozaki 提交于
      Current implementation of lxc driver creates vethN named
      interface(s) in the host and passes as it is to a container.
      The reason why it doesn't use ethN is due to the limitation
      that one namespace cannot have multiple iterfaces that have
      an identical name so that we give up creating ethN named
      interface in the host for the container.
      
      However, we should be able to allow the container to have
      ethN by changing the name after clone(CLONE_NEWNET).
      
      * src/lxc/lxc_container.c src/lxc/veth.c src/lxc/veth.h: do the clone
        and then renames interfaces eth0 ... ethN to keep the interface names
        familiar in the domain
      8db32571
    • R
      LXC cleanup deep indentation in lxcDomainSetAutostart · a9cb3548
      Ryota Ozaki 提交于
      * src/lxc/lxc_driver.c: refactor lxcDomainSetAutostart() to avoid deep
        indentation of the code
      a9cb3548
    • R
      LXC messages cleanup and fix lxcError · 24e3b35c
      Ryota Ozaki 提交于
      * src/lxc/lxc_container.c src/lxc/lxc_controller.c src/lxc/lxc_driver.c
        src/lxc/veth.c: most of cleanups are just capitalizing their messages
        though, some fixes wrong error messages and awkward indentations, and
        improves error messages.
      24e3b35c
    • R
      LXC fix wrong or out-of-date function descriptions · 15941b2b
      Ryota Ozaki 提交于
      * src/lxc/lxc_container.c src/lxc/lxc_controller.c src/lxc/lxc_driver.c
        src/lxc/veth.c: fix broken function comments
      15941b2b
    • C
      docs: <clock> property is 'offset', not 'sync' · 45bd290b
      Cole Robinson 提交于
      45bd290b
  2. 04 11月, 2009 20 次提交
    • G
      add MAC address based port filtering to qemu · 0aa72ac6
      Gerhard Stenzel 提交于
      * src/qemu/qemu.conf src/qemu/qemu_conf.c src/qemu/qemu_conf.h: there is
        a new config type option for mac filtering
      * src/qemu/qemu_bridge_filter.[ch]: new module for the ebtable entry points
      * src/qemu/qemu_driver.c: plug the MAC filtering at the right places
        in the domain life cycle
      * src/Makefile.am po/POTFILES.in: add the new module
      0aa72ac6
    • G
      New ebtables module wrapper · 1fc3816d
      Gerhard Stenzel 提交于
      * configure.in: look for ebtables binary location if present
      * src/Makefile.am: add the new module
      * src/util/ebtables.[ch]: new module and internal APIs around
        the ebtables binary
      * src/libvirt_private.syms: export the symbols only internally
      1fc3816d
    • C
      test: Implement virDomainPinVcpu · 104fdbf0
      Cole Robinson 提交于
      104fdbf0
    • C
      test: Implement virDomainGetVcpus · 07a107f0
      Cole Robinson 提交于
      07a107f0
    • C
      test: Update vcpu runtime info in SetVcpus · 08dce95a
      Cole Robinson 提交于
      08dce95a
    • C
      test: Use privateData to track running VM vcpu state · 667ce289
      Cole Robinson 提交于
      667ce289
    • C
      test: Break out wrapper for setting up started domain state. · 4e40aee2
      Cole Robinson 提交于
      This should be a no op for now, but we will use this function to set up
      transient state in the future.
      4e40aee2
    • C
      test: Fixes for SetVcpus · 7624b47d
      Cole Robinson 提交于
      - Implement DomainGetMaxVCPUs
      - Use GetMaxVCPUs to validate requested CPU amount
      - Deny the 'hotplug' for a running domain.
      7624b47d
    • C
      qemu: Remove compiled out localhost migration support · 2f511562
      Cole Robinson 提交于
      Pretty sure this would deadlock now that we have proper locking, so
      remove the code.
      2f511562
    • C
      storage: conf: Fix memory leak in encryption parsing · 030db0c2
      Cole Robinson 提交于
      030db0c2
    • C
      Various error reporting fixes · 4c44cdcc
      Cole Robinson 提交于
      - Don't duplicate SystemError
      - Use proper error code in domain_conf
      - Fix a broken error call in qemu_conf
      - Don't use VIR_ERR_ERROR in security driver (isn't a valid code in this case)
      4c44cdcc
    • C
      Improve error reporting for virConnectGetHostname calls · 517761fd
      Cole Robinson 提交于
      All drivers have copy + pasted inadequate error reporting which wraps
      util.c:virGetHostname. Move all error reporting to this function, and improve
      what we report.
      
      Changes from v1:
        Drop the driver wrappers around virGetHostname. This means we still need
        to keep the new conn argument to virGetHostname, but I think it's worth
        it.
      517761fd
    • L
      Fix improper error return in virInterfaceDefParseProtoIPvX · af1e2ede
      Laine Stump 提交于
      * src/conf/interface_conf.c: the code was erronously returning -1
        in the two functions if <dhcp> is not provided
      af1e2ede
    • L
      Make monitor type (miimon/arpmon) optional in bond xml · 46843985
      Laine Stump 提交于
      * src/conf/interface_conf.c: lack of one of these in the live xml output
        was causing the parse in virInterfaceDefParseBond() to fail
      46843985
    • L
      Fix virInterfaceIpDefPtr leak during virInterfaceIpDefFree · 23eaae9a
      Laine Stump 提交于
      * src/conf/interface_conf.c: forgot to free the structure itself
      23eaae9a
    • L
      Support for IPv6 / multiple addresses per interfaces · 3d4c1d94
      Laine Stump 提交于
      This patch updates the xml parsing and formatting, and the associated
      virInterfaceDef data structure to support IPv6, along the way adding
      support for multiple protocols per interface, and multiple IP
      addresses per protocol.
      * src/conf/interface_conf.[ch]: update the structures, code for parsing
        and serialization
      3d4c1d94
    • L
      Support reporting live interface IP/netmask · 753c6c9c
      Laine Stump 提交于
      This patch adds the flag VIR_INTERFACE_XML_INACTIVE to
      virInterfaceGetXMLDesc's flags. When it is*not* set (the default), the
      live interface info will be returned in the XML (in particular, the IP
      address(es) and netmask(s) will be retrieved by querying the interface
      directly, rather than  reporting what's in the config file). The
      backend of this is in netcf's ncf_if_xml_state() function.
      
      * configure.in libvirt.spec.in: requires netcf >= 0.1.3
      * include/libvirt/libvirt.h.in: adds flag VIR_INTERFACE_XML_INACTIVE
      * src/conf/interface_conf.c src/interface/netcf_driver.c src/libvirt.c:
        update the parsing and backend routines accordingly
      * tools/virsh.c: change interface edit to inactive definition and
        adds the inactive flag for interface dump
      753c6c9c
    • L
      Make startmode optional in toplevel interface definition · ef591ef7
      Laine Stump 提交于
      The minimal XML returned from ncf_if_xml_state() doesn't contain this
      attribute (which makes no sense in the case of reporting current
      status of the interface), and it was preventing it from passing
      through the parse/format step.
      
      * src/conf/interface_conf.[ch]: add a new virInterfaceStartMode value
        and modify loading/saving accordingly
      ef591ef7
    • D
      Move libvirtd event loop into background thread · 075bb5f1
      Daniel P. Berrange 提交于
      The virStateInitialize() call for starting up stateful drivers
      may require that the event loop is running already. This it is
      neccessary to start the event loop before this call. At the
      same time, network clients must not be processed until afte
      virStateInitialize has completed.
      
      The qemudListenUnix() and remoteListenTCP() methods must
      therefore not register file handle watches, merely open the
      network sockets & listen() on them. This means clients can
      connected and are queued, pending completion of initialization
      
      The qemudRunLoop() method is moved into a background thread
      that is started early to allow access to the event loop during
      driver initialization. The main process thread leader pretty
      much does nothing once the daemon is running, merely waits
      for the event loop thread to quit
      
      * daemon/libvirtd.c, daemon/libvirtd.h: Move event loop into
        a background thread
      * daemon/THREADING.txt: Rewrite docs to better reflect reality
      075bb5f1
    • D
      give up python interpreter lock before calling cb · 9ae8fa58
      Dan Kenigsberg 提交于
      suggested by danpb on irc, patch by danken fixed for proper C syntax
      
      * python/libvirt-override.c: on event callback release the python
        interpreter lock and take it again when coming back so that the
        callback can reinvoke libvirt.
      9ae8fa58
  3. 03 11月, 2009 13 次提交
    • L
      Allow NULL mac address in virGetInterface · 4728bad4
      Laine Stump 提交于
      There are places where an interface will not have a mac address, and netcf
      returns this as a NULL pointer rather than a pointer to an empty string.
      Rather than checking for this all over the place in libvirt, just save it
      in the virInterface object as an empty string.
      
      * src/datatypes.c: allow NULL mac in virGetInterface()
      4728bad4
    • D
      Fix compilation problems · 112ed8f5
      Daniel Veillard 提交于
      introduced on commit 9231aa7d
      * src/qemu/qemu_driver.c: in qemudRemoveDomainStatus fix a reference
        to an undefined variable buf and free up an allocated string
      112ed8f5
    • C
      Fix up NLS warnings. · 991be604
      Chris Lalancette 提交于
      When building with --disable-nls, I got a few messages like this:
      
      storage/storage_backend.c: In function 'virStorageBackendCreateQemuImg':
      storage/storage_backend.c:571: warning: format not a string literal and no format arguments
      
      Fix these up.
      Signed-off-by: NChris Lalancette <clalance@redhat.com>
      991be604
    • C
      Remove redundant virFileDeletePID() call · 9231aa7d
      Chris Lalancette 提交于
      qemudShutdownVMDaemon() calls qemudRemoveDomainStatus(), which
      then calls virFileDeletePID().  qemudShutdownVMDaemon() then
      unnecessarily calls virFileDeletePID() again.  Remove this second
      usage of it, and also slightly refactor qemudRemoveDomainStatus()
      to VIR_WARN appropriate error messages.
      Signed-off-by: NChris Lalancette <clalance@redhat.com>
      9231aa7d
    • D
      Fix return value in virStateInitialize impl for LXC · 979218cd
      Daniel P. Berrange 提交于
      The LXC driver was mistakenly returning -1 for lxcStartup()
      in scenarios that are not an error. This caused the libvirtd
      to quit for unprivileged users. This fixes the return code
      of LXC driver, and also adds a "name" field to the virStateDriver
      struct and logging to make it easier to find these problems
      in the future
      
      * src/driver.h: Add a 'name' field to state driver to allow
        easy identification during failures
      * src/libvirt.c: Log name of failed driver for virStateInit
        failures
      * src/lxc/lxc_driver.c: Don't return a failure code for
        lxcStartup() if LXC is not available on this host, simply
        disable the driver.
      * src/network/bridge_driver.c, src/node_device/node_device_devkit.c,
        src/node_device/node_device_hal.c, src/opennebula/one_driver.c,
        src/qemu/qemu_driver.c, src/remote/remote_driver.c,
        src/secret/secret_driver.c, src/storage/storage_driver.c,
        src/uml/uml_driver.c, src/xen/xen_driver.c: Fill in name
        field in virStateDriver struct
      979218cd
    • M
      ESX: Fix memory leak in list handling functions. · 680c92ae
      Matthias Bolte 提交于
      If an error occurs between the allocation of an item and appending it
      to the list, the item leaks. Free such orphaned items in error cases.
      
      * src/esx/esx_vi.c: free orphaned items in error cases
      680c92ae
    • M
      ESX: Don't automatically follow redirects. · b79aaf91
      Matthias Bolte 提交于
      The default transport for the VI API is HTTPS. If the server redirects
      from HTTPS to HTTP the driver would silently follow that redirection.
      The user assumes to communicate with the server over a secure transport
      but isn't.
      
      This patch disables automatical redirection following. The driver reports
      an error if the server tries to redirect.
      
      * src/esx/esx_vi.c: refactor the call to curl_easy_perform() into a
        function and do error handling there, disable automatical redirection
        following for curl
      * src/esx/esx_vi.h: change the type of responseCode to int
      b79aaf91
    • M
      ESX: Unify naming of VI API utility and convenience functions. · 447ef886
      Matthias Bolte 提交于
      Unified function naming scheme:
      - 'lookup' functions query the ESX or vCenter for information
      - 'get' functions return information from a local object
      
      * src/esx/esx_driver.c, src/esx/esx_vi.[ch]: unify function naming
      447ef886
    • M
      ESX: Change disk selection for datastore detection. · 7c7681dd
      Matthias Bolte 提交于
      In order to register a new virtual machine the ESX driver needs to upload
      a VMX file to a datastore. Try to put this file beside the main VMDK file
      of the virtual machine. Change the disk selection for datastore detection
      to choose the first file-based harddisk instead of just the first disk.
      The first disk may be a CDROM disk and ISO images are normaly not located
      in the virtual machine's directory.
      
      * src/esx/esx_driver.c: change disk selection for datastore detection
      7c7681dd
    • M
      ESX: Fallback to the preliminary name if the datastore cannot be found. · b7abcf9d
      Matthias Bolte 提交于
      This allows to use domain-xml-from-native with VMX files that reference
      unavailable datastores.
      
      * src/esx/esx_vmx.c: fallback to the preliminary name if the datastore
        cannot be found
      b7abcf9d
    • D
      Rename internal APis · fc8d1991
      Daniel P. Berrange 提交于
      Rename virDomainIsActive to virDomainObjIsActive, and
      virInterfaceIsActive to virInterfaceObjIsActive and finally
      virNetworkIsActive to virNetworkObjIsActive.
      
      * src/conf/domain_conf.c, src/conf/domain_conf.h,
        src/conf/interface_conf.h, src/conf/network_conf.c,
        src/conf/network_conf.h, src/lxc/lxc_driver.c,
        src/network/bridge_driver.c, src/opennebula/one_driver.c,
        src/openvz/openvz_driver.c, src/qemu/qemu_driver.c,
        src/test/test_driver.c, src/uml/uml_driver.c: Update for
        renamed APIs.
      fc8d1991
    • M
      Fix --with-init-script configure option · 958c366b
      Matthew Booth 提交于
      * configure.in daemon/Makefile.am: the --with-init-script configure
        option was broken, and always defaulted based on the existence of
        /etc/redhat-release. This was a systematic typo based on
        mixed use of init-script and init-scripts.
      958c366b
    • D
      Don't let parent of daemon exit until basic initialization is done · 4296cea2
      Daniel P. Berrange 提交于
      The daemonizing code lets the parent exit almost immediately. This
      means that it may think it has successfully started even when
      important failures occur like not being able to acquire the PID
      file. It also means network sockets are not yet open.
      
      To address this when daemonizing the parent passes an open pipe
      file descriptor to the child. The child does its basic initialization
      and then writes a status code to the pipe indicating either success,
      or failure. This ensures that when daemonizing, the parent does not
      exit until the pidfile is acquired & basic network sockets are open.
      
      Initialization of the libvirt drivers is still done asynchronously
      since this may take a very long time.
      
      * daemon/libvirtd.c: Force parent to stay around until basic config
        file, pidfile & network socket init is completed
      4296cea2