1. 19 5月, 2010 1 次提交
  2. 07 5月, 2010 1 次提交
    • E
      build: update gnulib · 062a25f0
      Eric Blake 提交于
      81 patches to gnulib, picks up several new syntax checks.
      
      * .gnulib: Update to latest.
      * .x-sc_prohibit_always_true_header_tests: New file.
      * bootstrap.conf (gnulib_modules): Add sched.
      * src/util/processinfo.c (includes): <sched.h> is now guaranteed.
      * src/network/bridge_driver.c (includes): Drop useless
      <strings.h>.
      * src/openvz/openvz_conf.c (includes): Likewise.
      * src/openvz/openvz_driver.c (includes): Likewise.
      * src/phyp/phyp_driver.c (includes): Likewise.
      * src/qemu/qemu_driver.c (includes): Likewise.
      * src/uml/uml_driver.c (includes): Likewise.
      062a25f0
  3. 28 4月, 2010 1 次提交
    • D
      Move dnsmasq host file to a separate directory · 4e041189
      Daniel Veillard 提交于
      use /var/lib/libvirt/dnsmasq since /var/lib/libvirt/network is
      unreadable by the dnsmasq binary
      
      * src/network/bridge_driver.c: update DNSMASQ_STATE_DIR
      * src/Makefile.am: create it on make install
      * libvirt.spec.in: take the new directory into account
      4e041189
  4. 26 4月, 2010 1 次提交
    • S
      Starts dnsmasq from libvirtd with --dhcp-hostsfile option · 8fa9c221
      Satoru SATOH 提交于
      This patch makes libvirtd start the dnsmasq daemon with a
      --dhcp-hostsfile option instead of --dhcp-host options for each
      '//ip/dhcp/host' entries defined in network xml file.
      
      the dnsmasq host file is stored into /var/lib/libvirt/network
      
      * src/network/bridge_driver.c: define the directory for the hostfiles
        and save/delete them to be used by dnsmasq
      8fa9c221
  5. 10 3月, 2010 1 次提交
  6. 08 3月, 2010 1 次提交
    • E
      build: consistently use C99 varargs macros · 2e56fb2b
      Eric Blake 提交于
      Prior to this patch, there was an inconsistent mix between GNU and C99.
      
      For consistency, and potential portability to other compilers, stick
      with the C99 vararg macro syntax.
      
      * src/conf/cpu_conf.c (virCPUReportError): Use C99 rather than GNU
        vararg macro syntax.
      * src/conf/domain_conf.c (virDomainReportError): Likewise.
      * src/conf/domain_event.c (eventReportError): Likewise.
      * src/conf/interface_conf.c (virInterfaceReportError): Likewise.
      * src/conf/network_conf.c (virNetworkReportError): Likewise.
      * src/conf/node_device_conf.h (virNodeDeviceReportError): Likewise.
      * src/conf/secret_conf.h (virSecretReportError): Likewise.
      * src/conf/storage_conf.h (virStorageReportError): Likewise.
      * src/esx/esx_device_monitor.c (ESX_ERROR): Use C99 rather than
        GNU vararg macro syntax.
      * src/esx/esx_driver.c (ESX_ERROR): Likewise.
      * src/esx/esx_interface_driver.c (ESX_ERROR): Likewise.
      * src/esx/esx_network_driver.c (ESX_ERROR): Likewise.
      * src/esx/esx_secret_driver.c (ESX_ERROR): Likewise.
      * src/esx/esx_storage_driver.c (ESX_ERROR): Likewise.
      * src/esx/esx_util.c (ESX_ERROR): Likewise.
      * src/esx/esx_vi.c (ESX_VI_ERROR): Likewise.
      * src/esx/esx_vi_methods.c (ESX_VI_ERROR): Likewise.
      * src/esx/esx_vi_types.c (ESX_VI_ERROR): Likewise.
      * src/esx/esx_vmx.c (ESX_ERROR): Likewise.
      * src/util/hostusb.c (usbReportError): Use C99 rather than GNU
        vararg macro syntax.
      * src/util/json.c (virJSONError): Likewise.
      * src/util/macvtap.c (ReportError): Likewise.
      * src/util/pci.c (pciReportError): Likewise.
      * src/util/stats_linux.c (virStatsError): Likewise.
      * src/util/util.c (virUtilError): Likewise.
      * src/util/xml.c (virXMLError): Likewise.
      * src/xen/proxy_internal.c (virProxyError): Use C99 rather than
        GNU vararg macro syntax.
      * src/xen/sexpr.c (virSexprError): Likewise.
      * src/xen/xen_driver.c (xenUnifiedError): Likewise.
      * src/xen/xen_hypervisor.c (virXenError): Likewise.
      * src/xen/xen_inotify.c (virXenInotifyError): Likewise.
      * src/xen/xend_internal.c (virXendError): Likewise.
      * src/xen/xm_internal.c (xenXMError): Likewise.
      * src/xen/xs_internal.c (virXenStoreError): Likewise.
      * src/cpu/cpu.h (virCPUReportError): Use C99 rather than GNU
        vararg macro syntax.
      * src/datatypes.c (virLibConnError): Likewise.
      * src/interface/netcf_driver.c (interfaceReportError): Likewise.
      * src/libvirt.c (virLibStreamError): Likewise.
      * src/lxc/lxc_conf.h (lxcError): Likewise.
      * src/network/bridge_driver.c (networkReportError): Likewise.
      * src/nodeinfo.c (nodeReportError): Likewise.
      * src/opennebula/one_conf.h (oneError): Likewise.
      * src/openvz/openvz_conf.h (openvzError): Likewise.
      * src/phyp/phyp_driver.c (PHYP_ERROR): Likewise.
      * src/qemu/qemu_conf.h (qemuReportError): Likewise.
      * src/remote/remote_driver.c (errorf): Likewise.
      * src/security/security_driver.h (virSecurityReportError): Likewise.
      * src/test/test_driver.c (testError): Likewise.
      * src/uml/uml_conf.h (umlReportError): Likewise.
      * src/vbox/vbox_driver.c (vboxError): Likewise.
      * src/vbox/vbox_tmpl.c (vboxError): Likewise.
      2e56fb2b
  7. 18 2月, 2010 1 次提交
  8. 10 2月, 2010 1 次提交
    • D
      Remove virConnectPtr from network XML APis · 0677e111
      Daniel P. Berrange 提交于
      The virConnectPtr is no longer required for error reporting since
      that is recorded in a thread local. Remove use of virConnectPtr
      from all APIs in network_conf.{h,c} and update all callers to
      match
      0677e111
  9. 09 2月, 2010 3 次提交
  10. 21 1月, 2010 1 次提交
    • L
      Fix uses of virFileMakePath · 623bc48a
      Laine Stump 提交于
      * src/lxc/lxc_container.c src/lxc/lxc_controller.c src/lxc/lxc_driver.c
        src/network/bridge_driver.c src/qemu/qemu_driver.c
        src/uml/uml_driver.c: virFileMakePath returns 0 for success, or the
        value of errno on failure, so error checking should be to test
        if non-zero, not if lower than 0
      623bc48a
  11. 20 1月, 2010 1 次提交
  12. 07 1月, 2010 1 次提交
  13. 10 12月, 2009 3 次提交
    • M
      remove all traces of lokkit support · 3b3305d8
      Mark McLoughlin 提交于
      Long ago we tried to use Fedora's lokkit utility in order to register
      our iptables rules so that 'service iptables restart' would
      automatically load our rules.
      
      There was one fatal flaw - if the user had configured iptables without
      lokkit, then we would clobber that configuration by running lokkit.
      
      We quickly disabled lokkit support, but never removed it. Let's do
      that now.
      
      The 'my virtual network stops working when I restart iptables' still
      remains. For all the background on this saga, see:
      
        https://bugzilla.redhat.com/227011
      
      * src/util/iptables.c: remove lokkit support
      
      * configure.in: remove --enable-lokkit
      
      * libvirt.spec.in: remove the dirs used only for saving rules for lokkit
      
      * src/Makefile.am: ditto
      
      * src/libvirt_private.syms, src/network/bridge_driver.c,
        src/util/iptables.h: remove references to iptablesSaveRules
      3b3305d8
    • M
      reload iptables rules on libvirtd restart · 534664c3
      Mark McLoughlin 提交于
      This is the expected behaviour, I think - reloading libvirtd should
      be a subset of restarting it.
      
      Note, we reload the rules after we've determined which networks
      are active (because we only add the rules for active networks)
      and before we start autostart networks (to avoid re-adding the
      rules).
      
      * src/network/bridge_driver.c: reload iptables rules on startup
      534664c3
    • M
      reload iptables rules simply by re-adding them · 98895e93
      Mark McLoughlin 提交于
      Currently, when we add iptables rules, we keep them on a list so that
      we can easily reload them on e.g. 'service libvirtd reload'.
      
      However, we don't save this list to disk, so if libvirtd is restarted
      we lose the ability to reload the rules.
      
      The fix is simple - just re-add the damn things on reload.
      
      Note, we delete the rules before re-adding them, just like the current
      behaviour of iptRulesReload().
      
      * src/network/bridge_driver.c: re-add the iptables rules on reload.
      98895e93
  14. 16 11月, 2009 1 次提交
  15. 11 11月, 2009 2 次提交
    • D
      Implmentation of new APIs to checking state/persistence of objects · cabc2cc9
      Daniel P. Berrange 提交于
      This implements the virConnectIsSecure, virConnectIsEncrypted,
      virDomainIsPersistent, virDomainIsActive, virNetworkIsActive,
      virNetworkIsPersistent, virStoragePoolIsActive,
      virStoragePoolIsPersistent, virInterfaceIsActive APIs in
      (nearly) all drivers. Exceptions are:
      
       phyp: missing domainIsActive/Persistent
       esx: missing domainIsPersistent
       opennebula: missing domainIsActive/Persistent
      
      * src/remote/remote_protocol.x: Define remote wire ABI for newly
        added APIs.
      * daemon/remote_dispatch*.h: Re-generated from remote_protocol.x
      * src/esx/esx_driver.c, src/lxc/lxc_driver.c, src/network/bridge_driver.c,
        src/opennebula/one_driver.c, src/openvz/openvz_conf.c,
        src/openvz/openvz_driver.c, src/phyp/phyp_driver.c,
        src/remote/remote_driver.c, src/storage/storage_driver.c,
        src/test/test_driver.c, src/uml/uml_driver.c, src/vbox/vbox_tmpl.c,
        src/xen/xen_driver.c, src/xen/xen_driver.h, src/xen/xen_inotify.c,
        src/xen/xen_inotify.h: Implement all the new APIs where possible
      cabc2cc9
    • D
      New APIs for checking some object properties · c04498b3
      Daniel P. Berrange 提交于
      Introduce a number of new APIs to  expose some boolean properties
      of objects, which cannot otherwise reliably determined, nor are
      aspects of the XML configuration.
      
       * virDomainIsActive: Checking virDomainGetID is not reliable
         since it is not possible to distinguish between error condition
         and inactive domain for ID of -1.
       * virDomainIsPersistent: Check whether a persistent config exists
         for the domain
      
       * virNetworkIsActive: Check whether the network is active
       * virNetworkIsPersistent: Check whether a persistent config exists
         for the network
      
       * virStoragePoolIsActive: Check whether the storage pool is active
       * virStoragePoolIsPersistent: Check whether a persistent config exists
         for the storage pool
      
       * virInterfaceIsActive: Check whether the host interface is active
      
       * virConnectIsSecure: whether the communication channel to the
         hypervisor is secure
       * virConnectIsEncrypted: whether any network based commnunication
         channels are encrypted
      
      NB, a channel can be secure, even if not encrypted, eg if it does
      not involve the network, like a UNIX socket, or pipe.
      
       * include/libvirt/libvirt.h.in: Define public API
       * src/driver.h: Define internal driver API
       * src/libvirt.c: Implement public API entry point
       * src/libvirt_public.syms: Export API symbols
       * src/esx/esx_driver.c, src/lxc/lxc_driver.c,
         src/interface/netcf_driver.c, src/network/bridge_driver.c,
         src/opennebula/one_driver.c, src/openvz/openvz_driver.c,
         src/phyp/phyp_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: Stub out driver tables
      c04498b3
  16. 07 11月, 2009 1 次提交
    • D
      524280 pass max lease option to dnsmasq · f0006d97
      Daniel Veillard 提交于
      * src/network/bridge_driver.c: when exec'ing dnsmaq, if there are
        DHCP ranges defined, then compute and pass the --dhcp-lease-max
        deriving the maximum number of leases
      f0006d97
  17. 03 11月, 2009 3 次提交
    • 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
    • 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
    • D
      Annotate many methods with ATTRIBUTE_RETURN_CHECK & fix problems · 46992453
      Daniel P. Berrange 提交于
      Nearly all of the methods in src/util/util.h have error codes that
      must be checked by the caller to correct detect & report failure.
      Add ATTRIBUTE_RETURN_CHECK to ensure compile time validation of
      this
      
      * daemon/libvirtd.c: Add explicit check on return value of virAsprintf
      * src/conf/domain_conf.c: Add missing check on virParseMacAddr return
        value status & report error
      * src/network/bridge_driver.c: Add missing OOM check on virAsprintf
        and report error
      * src/qemu/qemu_conf.c: Add missing check on virParseMacAddr return
        value status & report error
      * src/security/security_selinux.c: Remove call to virRandomInitialize
        that's done in libvirt.c already
      * src/storage/storage_backend_logical.c: Add check & log on virRun
        return status
      * src/util/util.c: Add missing checks on virAsprintf/Run status
      * src/util/util.h: Annotate all methods with ATTRIBUTE_RETURN_CHECK
        if they return an error status code
      * src/vbox/vbox_tmpl.c: Add missing check on virParseMacAddr
      * src/xen/xm_internal.c: Add missing checks on virAsprintf
      * tests/qemuargv2xmltest.c: Remove bogus call to virRandomInitialize()
      46992453
  18. 28 10月, 2009 1 次提交
    • P
      Add support for an external TFTP boot server · 936565c7
      Paolo Bonzini 提交于
      This patch adds an optional attribute to the <bootp> tag, that
      allows to specify a TFTP server address other than the address of
      the DHCP server itself.
      
      This can be used to forward the BOOTP settings of the host down to the
      guest.  This is something that configurations such as Xen's default
      network achieve naturally, but must be done manually for NAT.
      
      * docs/formatnetwork.html.in: Document new attribute.
      * docs/schemas/network.rng: Add it to schema.
      * src/conf/network_conf.h: Add it to struct.
      * src/conf/network_conf.c: Add it to parser and pretty printer.
      * src/network/bridge_driver.c: Put it in the dnsmasq command line.
      * tests/networkxml2xmlin/netboot-proxy-network.xml
        tests/networkxml2xmlout/netboot-proxy-network.xml
        tests/networkxml2xmltest.c: add new tests
      936565c7
  19. 23 9月, 2009 1 次提交
    • 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
  20. 21 9月, 2009 2 次提交
    • D
      Move config files to align with driver sources · ec171c52
      Daniel P. Berrange 提交于
      * daemon/default-network.xml: Move to src/network/default.xml
      * daemon/libvirtd_qemu.aug, daemon/test_libvirtd_qemu.aug: Move
        to src/qemu/
      * src/qemu.conf: Move to src/qemu/qemu.conf
      * daemon/Makefile.am: Remove rules for default-nmetwork.xml and
        libvirtd_qemu.aug and test_libvirtd_qemu.aug. Fix typo in
        uninstall-local that would install polkit again.
      * src/Makefile.am: Add rules for installing network/default.xml
        and the qemu/*.aug files. Add test case for QEMU augeas files.
        Add uninstall-local rule for files/directories created during
        install. Rename install-exec-local to install-data-local.
        Only install qemu.conf if WITH_QEMU is set.
      * tests/networkschematest: Update for XML location move
      ec171c52
    • D
      Move network driver into src/network · acfe3f26
      Daniel P. Berrange 提交于
      * daemon/qemud.c, src/Makefile.am: Adapt for changed paths
      * src/network_driver.c: Rename to src/network/bridge_driver.c
      * src/network_driver.h: Rename to src/network/bridge_driver.h
      acfe3f26