1. 29 9月, 2009 11 次提交
    • D
      Add API for issuing 'balloon' monitor command · eff29c8b
      Daniel P. Berrange 提交于
      * src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h: Add new
        qemuMonitorSetBalloon() based on existing code in
        qemudDomainSetMemoryBalloon
      * src/qemu/qemu_driver.c: Remove use of qemudDomainSetMemoryBalloon()
        in favour of qemuMonitorSetBalloon(). Fix error code when balloon
        is not supported
      eff29c8b
    • D
      Add API for running 'info balloon' monitor command · 6f19c16c
      Daniel P. Berrange 提交于
      * src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h: Pull old
        qemudDomainGetMemoryBalloon() code into a new method called
        qemuMonitorGetBalloonInfo()
      * src/qemu/qemu_driver.c: Update to call qemuMonitorGetBalloonInfo()
        and remove qemudDomainGetMemoryBalloon().
      6f19c16c
    • D
      Add API for the 'system_powerdown' monitor command · 19d70c7d
      Daniel P. Berrange 提交于
      * src/qemu/qemu_driver.c: Remove use of 'system_powerdown'
      * src/qemu/qemu_monitor.h, src/qemu/qemu_monitor.c: Add a new
        qemuMonitorSystemPowerdown() api call
      19d70c7d
    • D
      Add API for 'stop' monitor command · 1e64d8c7
      Daniel P. Berrange 提交于
      * src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h: Add a new
        qemuMonitorStopCPUs() API
      * src/qemu/qemu_driver.c: Replace direct monitor commands for 'stop'
        with qemuMonitorStopCPUs()
      1e64d8c7
    • D
      Rename qemudMonitorSendCont to qemuMonitorStartCPUs · 4734a422
      Daniel P. Berrange 提交于
      * src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h: Rename
        Rename qemudMonitorSendCont to qemuMonitorStartCPUs
      * src/qemu/qemu_driver.c: Update callers for new name
      4734a422
    • D
      Add API for 'change vnc password' monitor command · 3aee2615
      Daniel P. Berrange 提交于
      * src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h: Add a
        new qemuMonitorSetVNCPassword() API
      * src/qemu/qemu_driver.c: Refactor qemudInitPasswords to
        call qemuMonitorSetVNCPassword()
      3aee2615
    • D
      Add API for 'info cpus' monitor command · f38b654e
      Daniel P. Berrange 提交于
      * src/qemu/qemu_monitor.h, src/qemu/qemu_monitor.c: Add a new
        qemuMonitorGetCPUInfo() command
      * src/qemu/qemu_driver.c: Refactor qemudDetectVcpuPIDs to
        use qemuMonitorGetCPUInfo()
      f38b654e
    • D
      Pull QEMU monitor interaction out to separate file · a541c762
      Daniel P. Berrange 提交于
      Pull out all the QEMU monitor interaction code to a separate
      file. This will make life easier when we need to drop in a
      new implementation for the forthcoming QMP machine friendly
      monitor support.
      
      Next step is to add formal APIs for each monitor command,
      and remove direct commands for sending/receiving generic
      data.
      
      * src/Makefile.am: Add qemu_monitor.c to build
      * src/qemu/qemu_driver.c: Remove code for monitor interaction
      * src/qemu/qemu_monitor_text.c, src/qemu/qemu_monitor_text.h: New
        file for monitor interaction
      * po/POTFILES.in: Add src/qemu/qemu_monitor_text.c
      a541c762
    • L
      Maintain value of ctxt->node in virInterfaceDefParseDhcp · c93370c4
      Laine Stump 提交于
      * src/conf/interface_conf.c: This was causing subsequent calls to
        virXPathxxx() to fail, since ctxt->node was left pointing at the
        dhcp node, rather than the protocol node.
      c93370c4
    • D
      Fix some XPath relative node resets · 237f3bf8
      Daniel Veillard 提交于
      * src/util/xml.c: The virXPath... function take extra care to preserve
        the XPath context node (ctxt->node) but in the case of virXPathString
        and virXPathBoolean they forgot to do this on the error path. This
        patch fixes this and move all ctxt->node = relnode instuctions just
        after the xmlXPathEval() to make sure this doesn't happen if this code
        is modified.
      237f3bf8
    • M
      util.h needs libvirt.h for virConnectPtr · 25e2857c
      Mark McLoughlin 提交于
      Seems standard to include internal.h in order to pull in libvirt.h
      
      * src/util/util.h: include internal.h
      25e2857c
  2. 28 9月, 2009 2 次提交
    • D
      Don't require full daemon install for libvirt python bindings · 323ad539
      Daniel P. Berrange 提交于
      * libvirt.spec.in: libvirt-python only needs to depend on
        libvirt-clients
      323ad539
    • D
      Fix API doc extractor to stop munging comment formatting · 5486abfe
      Daniel P. Berrange 提交于
      The python method help docs are copied across from the C
      funtion comments, but in the process all line breaks and
      indentation was being lost. This made the resulting text
      and code examples completely unreadable. Both the API
      doc extractor and the python generator were destroying
      whitespace & this fixes them to preserve it exactly.
      
      * docs/apibuild.py: Preserve all whitespace when extracting
        function comments. Print function comment inside a <![CDATA[
        section to fully preserve all whitespace. Look for the
        word 'returns' to describe return values, instead of 'return'
        to avoid getting confused with code examples including the
        C 'return' statement.
      * python/generator.py: Preserve all whitespace when printing
        function help docs
      * src/libvirt.c: Change any return parameter indicated by
        'return' to be 'returns', to avoid confusing the API extractor
      * docs/libvirt-api.xml: Re-build for fixed descriptions
      5486abfe
  3. 24 9月, 2009 6 次提交
  4. 23 9月, 2009 14 次提交
    • M
      ESX: Check if a datastore is accessible first · b167672c
      Matthias Bolte 提交于
      An inaccessible datastore has no valid URL property so don't
      access its URI property.
      
      * src/esx/esx_vi.c: esxVI_LookupDatastoreByName(): check if datastore is
        accessible before accessing its URL property
      * src/esx/esx_vmx.c: update to changed datastore properties
      b167672c
    • M
      ESX remove phantom mode · 23b24972
      Matthias Bolte 提交于
      * src/esx/esx_driver.c: remove phantom mode
      23b24972
    • M
      ESX replace esxUtil_EqualSuffix() with virFileHasSuffix() · 8ce9f2b1
      Matthias Bolte 提交于
      * src/esx/esx_util.[ch]: remove esxUtil_EqualSuffix()
      * src/esx/esx_driver.c, src/esx/esx_vmx.c: replace esxUtil_EqualSuffix()
        with virFileHasSuffix()
      8ce9f2b1
    • M
      ESX add esxDomainDefineXML() · 49faa15e
      Matthias Bolte 提交于
      A given domain XML gets converted to a VMX config, uploaded to the host
      and registered as new virtual machine.
      
      * src/esx/esx_driver.c: refactor datastore related path parsing into
        esxUtil_ParseDatastoreRelatedPath()
      * src/esx/esx_util.[ch]: add esxUtil_ParseDatastoreRelatedPath()
      * src/esx/esx_vi.[ch]: add esxVI_Context_UploadFile(), add datastores to
        the traversal in esxVI_BuildFullTraversalSpecList(), add
        esxVI_LookupDatastoreByName()
      * src/esx/esx_vi_methods.[ch]: add esxVI_RegisterVM_Task()
      * src/esx/esx_vi_types.c: make some error message more verbose
      * src/esx/esx_vmx.[ch]: add esxVMX_AbsolutePathToDatastoreRelatedPath()
        to convert a path into a datastore related path, add esxVMX_ParseFileName()
        to convert from VMX path format to domain XML path format, extend the other
        parsing function to be datastore aware, add esxVMX_FormatFileName() to
        convert from domain XML path format to VMX path format, fix VMX ethernet
        entry formating
      * tests/esxutilstest.c: add test for esxUtil_ParseDatastoreRelatedPath()
      * tests/vmx2xmldata/*: update domain XML files to use datastore related paths
      * tests/xml2vmxdata/*: update domain XML files to use datastore related paths,
        update VMX files to use absolute paths
      49faa15e
    • M
      ESX add esxVI_Occurence enum to for occurences · c3aa1f8b
      Matthias Bolte 提交于
      Add esxVI_Occurence enum to describe expected occurence of items
      * src/esx/esx_driver.c: update the use of esxVI_LookupVirtualMachineByUuid()
      * src/esx/esx_vi.c: add an esxVI_Occurence parameter to
        esxVI_LookupVirtualMachineByUuid() and take care if esxVI_FindByUuid()
        can't find anything for a given uuid
      * src/esx/esx_vi.h: add esxVI_Occurence enum
      * src/esx/esx_vi_methods.c: expect null or more items to be returned
        from esxVI_FindByUuid()
      c3aa1f8b
    • M
      ESX Whitespace cleanup · 0d4d04e5
      Matthias Bolte 提交于
      0d4d04e5
    • M
      ESX add x86_64 detection based on the CPUID · 15b0c4ff
      Matthias Bolte 提交于
      * src/esx/esx_driver.c: add esxSupportsLongMode() and update esxCapsInit()
      * src/esx/esx_vi.[ch]: Add AnyType handling for lists
      * src/esx/esx_vi_types.c: bind VI type HostCpuIdInfo
      15b0c4ff
    • M
      ESX add tests for the VMX to/from domain XML mapping · af4c893e
      Matthias Bolte 提交于
      * tests/.gitignore: ignore new test binaries
      * tests/Makefile.am: add new tests
      * tests/esxutilstest.c: test esxVMX_IndexToDiskName()
      * tests/vmx2xmldata/*: config files for the VMX to domain XML test
      * tests/vmx2xmltest.c: test the VMX to domain XML mapping
      * tests/xml2vmxdata/*: config files for the domain XML to VMX test
      * tests/xml2vmxtest.c: test the domain XML to VMX mapping
      af4c893e
    • M
      ESX Add esxDomainXMLToNative() · a1c4d7d7
      Matthias Bolte 提交于
      Extend and cleanup the VMX to domain XML mapping. Add the domain XML to
      VMX mapping functions.
      
      * src/esx/esx_driver.c: add esxDomainXMLToNative()
      * src/esx/esx_vmx.[ch]: add esxVMX_SCSIDiskNameToControllerAndID(),
        esxVMX_IDEDiskNameToControllerAndID(), esxVMX_FloppyDiskNameToController(),
        esxVMX_GatherSCSIControllers(), add basic handling for the VMX guestOS entry
        to distinguish between i686 and x86_64, make SCSI virtualDev VMX entry
        optional as it should be, map the VMX networkName entry to the domain XML
        interface bridge name, add basic mapping for serial devices in pipe mode,
        add several esxVMX_Format*() functions
      a1c4d7d7
    • M
      ESX Set challenge for auth callback to hostname · 6f9d8bdb
      Matthias Bolte 提交于
      This enables the auth callback to automatically distinguish between
      requests for ESX host and vCenter credentials.
      
      * src/esx/esx_util.[ch]: set challenge for auth callback to hostname
      6f9d8bdb
    • M
      ESX Add esxNodeGetFreeMemory() · ecd93b75
      Matthias Bolte 提交于
      * src/esx/esx_driver.c: add esxNodeGetFreeMemory(), cache IP address
      * src/esx/esx_vi.[ch]: refactor resource pool query into esxVI_GetResourcePool()
      * src/esx/esx_vi_types.[ch]: bind VI type ResourcePoolResourceUsage
      ecd93b75
    • C
    • P
      network: add 'bootp' and 'tftp' config · 738ee810
      Paolo Bonzini 提交于
      Currently, libvirtd will start a dnsmasq process for the virtual
      network, but (aside from killing the dnsmasq process and replacing it),
      there's no way to define tftp boot options.
      
      This change introduces the appropriate tags to the dhcp configuration:
      
       <network>
         <name>default</name>
         <bridge name="virbr%d" />
         <forward/>
         <ip address="192.168.122.1" netmask="255.255.255.0">
           <tftp root="/var/lib/tftproot" />
           <dhcp>
             <range start="192.168.122.2" end="192.168.122.254" />
             <bootp file="pxeboot.img"/>
           </dhcp>
         </ip>
       </network>
      
      When the attributes are present, these are passed to the
      arguments to dnsmasq:
      
       dnsmasq [...] --enable-tftp --tftp-root /srv/tftp --dhcp-boot pxeboot.img
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^
                            from <tftp />                     from <bootp />
      
      At present, only local tftp servers are supported (ie, dnsmasq runs as
      the tftp server), but we could improve this in future by adding a
      server= attribute.
      Signed-off-by: NJeremy Kerr <jk@ozlabs.org>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      
      2009-09-21  Paolo Bonzini  <pbonzini@redhat.com>
                  Jeremy Kerr  <jk@ozlabs.org>
      
      	* docs/formatnetwork.html.in: Document new tags.
      	* docs/formatnetwork.html: Regenerate.
      	* docs/schemas/network.rng: Update.
      	* src/network_conf.c (virNetworkDefFree): Free new fields.
      	(virNetworkDHCPRangeDefParseXML): Parse <bootp>.
      	(virNetworkIPParseXML): New, parsing <dhcp> and <tftp>.
      	(virNetworkDefParseXML): Use virNetworkIPParseXML instead of
      	virNetworkDHCPRangeDefParseXML.
      	(virNetworkDefFormat): Pretty print new fields.
      	* src/network_conf.h (struct _virNetworkDef): Add netboot fields.
      	* src/network_driver.c (networkBuildDnsmasqArgv): Add
      	TFTP and BOOTP arguments.
      
      	* tests/Makefile.am (EXTRA_DIST): Add networkschemadata.
      	* tests/networkschematest: Look in networkschemadata.
      	* tests/networkschemadata/netboot-network.xml: New.
      738ee810
    • C
      Introduce virStrncpy. · 03d777f3
      Chris Lalancette 提交于
      Add the virStrncpy function, which takes a dst string, source string,
      the number of bytes to copy and the number of bytes available in the
      dest string.  If the source string is too large to fit into the
      destination string, including the \0 byte, then no data is copied and
      the function returns NULL.  Otherwise, this function copies n bytes
      from source into dst, including the \0, and returns a pointer to the
      dst string.  This function is intended to replace all unsafe uses
      of strncpy in the code base, since strncpy does *not* guarantee that
      the buffer terminates with a \0.
      Signed-off-by: NChris Lalancette <clalance@redhat.com>
      03d777f3
  5. 22 9月, 2009 7 次提交
    • D
      Fix handling of Xen(ner) detection · b81a7ece
      Daniel P. Berrange 提交于
      Latest upstream QEMU can be built with Xen support, which introduces
      a -xen-domid argument. This was  mistakenly detected as -domid due
      to old Xenner support. Adapt to cope with both syntax. Also only
      set domid if the virt type is xen, or the guest type is xen
      
      * src/qemu_conf.c, src/qemu_conf.h: Detect new -xen-domid flag in
        preference to -domid.
      * tests/qemuxml2argvdata/qemuxml2argv-bootloader.args,
        tests/qemuxml2argvdata/qemuxml2argv-input-xen.args: Add missing
        -domid param
      * tests/qemuxml2argvdata/qemuxml2argv-misc-uuid.args: Remove bogus
        -boot param.
      * tests/qemuxml2argvtest.c: Add missing QEMUD_CMD_FLAG_DOMID params
      b81a7ece
    • D
      Ignore auto-generated header file · 12c542a4
      Daniel P. Berrange 提交于
      * include/libvirt/.gitignore: Ignore libvirt.h
      12c542a4
    • M
      Fix xen driver refcounting. · 6ed7374c
      Matthias Bolte 提交于
      The commit cb51aa48 "Fix up connection
      reference counting." changed the driver closing and virConnectPtr
      unref-logic in virConnectClose().
      
      Before this commit virConnectClose() closed all drivers of the given
      virConnectPtr and virUnrefConnect()'ed it afterwards. After this
      commit the driver-closing is done in virUnrefConnect() if and only if
      the ref-count of the virConnectPtr dropped to zero.
      
      This change in execution order leads to a virConnectPtr leak, at least
      for connections to Xen.
      
      The relevant call sequences:
      
      virConnectOpen() -> xenUnifiedOpen() ...
      
      ... xenInotifyOpen() -> virConnectRef(conn)
      
      ... xenStoreOpen() -> xenStoreAddWatch() -> conn->refs++
      
      virConnectClose() -> xenUnifiedClose() ...
      
      ... xenInotifyClose() -> virUnrefConnect(conn)
      
      ... xenStoreClose() -> xenStoreRemoveWatch() -> virUnrefConnect(conn)
      
      Before the commit this additional virConnectRef/virUnrefConnect calls
      where no problem, because virConnectClose() closed the drivers
      explicitly and the additional refs added by the Xen subdrivers were
      removed properly. After the commit this additional refs result in a
      virConnectPtr leak (including a leak of the hypercall file handle;
      that's how I noticed this problem), because now the drivers are only
      close if and only if the ref-count drops to zero, but this cannot
      happen anymore, because the additional refs from the Xen subdrivers
      would only be removed if the drivers get closed, but that doesn't
      happen because the ref-count cannot drop to zero.
      
      The fix for this problem is simple: remove the
      virConnectRef/virUnrefConnect calls from the Xen subdrivers (see
      attached patch). Maybe someone could explain why the Xen Inotify and
      Xen Store driver do this extra ref-counting, but none of the other Xen
      subdrivers. It seems unnecessary to me and can be removed without
      problems.
      Signed-off-by: NChris Lalancette <clalance@redhat.com>
      6ed7374c
    • D
      Fix a number of small typos · 27a1f781
      Dan Kenigsberg 提交于
      27a1f781
    • R
      lxc: suspend/resume support · c8c9ef27
      Ryota Ozaki 提交于
      * src/conf/domain_conf.c: Don't assume all virDomainObjPtr have
        a non-NULL monitor_chr field in virDomainObjFormat.
      * src/lxc/lxc_driver.c: Implement suspend/resume driver APis
      * src/util/cgroup.c, src/util/cgroup.h: Support the 'freezer'
        cgroup controller
      * src/libvirt_private.syms: Export virCgroupSetFreezerState
        and virCgroupGetFreezerState
      c8c9ef27
    • Y
      OpenVZ Fix a restriction about domain names · 0c85095e
      Yuji NISHIDA 提交于
      * src/openvz/openvz_driver.c: try to autogenerate a non-conflicting
        id for the domain and use the name field as the name not as id.
      0c85095e
    • F
      add doc for graphic and video elements · 24e0171b
      Florian Vichot 提交于
      * docs/formatdomain.html.in: explain the new syntax of the video and
        graphic elements in the domain XML
      24e0171b