1. 20 11月, 2009 1 次提交
    • S
      qemu-kvm needs -enable-kvm flag for VT optimization · b827338a
      Steve Yarmie 提交于
      Recent qemu releases require command option '-enable-qemu' in order
      for the kvm functionality be activated. Libvirt needs to pass this flag
      to qemu when starting a domain. Note that without the option,
      even if both the kernel and qemu support KVM, KVM will not be activated
      and VMs will be very slow.
      
      * src/qemu/qemu_conf.h src/qemu/qemu_conf.c: parse the extra command
        line option from help and add it when running kvm
      * tests/qemuhelptest.c: this modified the flags output for qemu-0.10.5
        and qemu-kvm-0.11.0-rc2 regression tests
      b827338a
  2. 15 11月, 2009 1 次提交
    • M
      esx: Fix MAC address formatting · 645f4aca
      Matthias Bolte 提交于
      VMware uses two MAC address prefixes: 00:0c:29 and 00:50:56. The 00:0c:29
      prefix is used for ESX server generated addresses. The 00:50:56 prefix is
      split into two parts. MAC addresses above 00:50:56:3f:ff:ff are generated
      by a vCenter. The rest of the 00:50:56 prefix can be assigned manually.
      Any MAC address within the 00:0c:29 and 00:50:56 prefix can be specified
      in a domain XML config and the driver will handle the details internally.
      
      * src/esx/esx_vmx.c: fix MAC address formatting
      * tests/xml2vmxdata/*: update test files accordingly
      645f4aca
  3. 13 11月, 2009 1 次提交
    • J
      Fix virt-aa-helper when host and os.type arch differ · 308b8533
      Jamie Strandboge 提交于
      * src/security/virt-aa-helper.c: get_definition() now calls the new
        caps_mockup() function which will parse the XML for os.type,
        os.type.arch and then sets the wordsize.  These attributes are needed
        only to get a valid virCapsPtr for virDomainDefParseString(). The -H
        and -b options are now removed from virt-aa-helper (they weren't used
        yet anyway).
      * tests/virt-aa-helper-test: extend and fixes tests, chmod'ed 755
      308b8533
  4. 06 11月, 2009 1 次提交
  5. 05 11月, 2009 2 次提交
    • D
      Forgot test case on previous commit · bea92f96
      Daniel Veillard 提交于
      bea92f96
    • M
      Support for <channel> in domain and QEmu backend · af249ea4
      Matthew Booth 提交于
      allows the following to be specified in a domain:
      <channel type='pipe'>
        <source path='/tmp/guestfwd'/>
        <target type='guestfwd' address='10.0.2.1' port='4600'/>
      </channel>
      
      * proxy/Makefile.am: add network.c as dep of domain_conf.c
      * docs/schemas/domain.rng src/conf/domain_conf.[ch]: extend the domain
        schemas and the parsing/serialization side for the new construct
      
      QEmu support will add the following on the qemu command line:
       -chardev pipe,id=channel0,path=/tmp/guestfwd
       -net user,guestfwd=tcp:10.0.2.1:4600-chardev:channel0
      
      * src/qemu/qemu_conf.c: Add argument output for channel
      * tests/qemuxml2(argv|xml)test.c: Add test for <channel> domain syntax
      af249ea4
  6. 04 11月, 2009 1 次提交
    • 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
  7. 03 11月, 2009 1 次提交
    • 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
  8. 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
  9. 21 10月, 2009 4 次提交
  10. 17 10月, 2009 1 次提交
  11. 16 10月, 2009 5 次提交
  12. 12 10月, 2009 1 次提交
    • M
      Take domain type into account when looking up default machine · 73c901a8
      Mark McLoughlin 提交于
      If one has e.g.
      
        <guest>
          <os_type>hvm</os_type>
          <arch name='x86_64'>
            <wordsize>64</wordsize>
            <emulator>/usr/bin/qemu-system-x86_64</emulator>
            <machine>pc-0.11</machine>
            <machine canonical='pc-0.11'>pc</machine>
            <machine>pc-0.10</machine>
            <machine>isapc</machine>
            <domain type='qemu'>
            </domain>
            <domain type='kvm'>
              <emulator>/usr/bin/kvm</emulator>
              <machine>pc</machine>
              <machine>isapc</machine>
            </domain>
          </arch>
        </guest>
      
      and start a guest with:
      
        <domain type='kvm'>
          ...
          <os>
            <type arch='x86_64'>hvm</type>
            ...
          </os>
        </domain>
      
      then the default machine type should be 'pc' and not 'pc-0.11'
      
      Issue was reported by Anton Protopopov.
      
      * src/capabilities.[ch]: pass the domain type to
        virCapabilitiesDefaultGuestArch() and use it to look up the default
        machine type from a specific guest domain if needed.
      
      * src/conf/domain_conf.c, src/xen/xm_internal.c: update
      
      * tests/qemuxml2argvdata/qemuxml2argv-machine-aliases2.xml: update
        the domain type to 'kvm' and remove the machine type to check
        that the default gets looked up correctly
      73c901a8
  13. 08 10月, 2009 1 次提交
    • J
      sVirt AppArmor security driver · bbaecd6a
      Jamie Strandboge 提交于
      * configure.in: look for AppArmor and devel
      * src/security/security_apparmor.[ch] src/security/security_driver.c
        src/Makefile.am: add and plug the new driver
      * src/security/virt-aa-helper.c: new binary which is used exclusively by
        the AppArmor security driver to manipulate AppArmor.
      * po/POTFILES.in: registers the new files
      * tests/Makefile.am tests/secaatest.c tests/virt-aa-helper-test:
        tests for virt-aa-helper and the security driver, secaatest.c is
        identical to seclabeltest.c except it initializes the 'apparmor'
        driver instead of 'selinux'
      bbaecd6a
  14. 07 10月, 2009 1 次提交
    • C
      Fix up "make check" · db68d6b1
      Chris Lalancette 提交于
      While running make check, I noticed that it was actually using
      the virsh binary from my system, in /usr/bin/virsh, and not the
      one that was just compiled.  This is actually caused by a bug
      in Makefile.am, where we didn't update the PATH to include tools.
      
      While here, I also updated all of the scripts to properly define
      the srcdir, abs_top_srcdir, and abs_top_builddir environment
      variables.  This is required if you want to be able to run the
      tests standalone (i.e. ./test instead of from make check).  I've
      tested this on both RHEL-5 and Fedora-10 machines, and make check
      works on both, as does running the individual tests by hand.
      Signed-off-by: NChris Lalancette <clalance@redhat.com>
      db68d6b1
  15. 30 9月, 2009 2 次提交
  16. 23 9月, 2009 3 次提交
    • 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 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
    • 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
  17. 22 9月, 2009 1 次提交
    • 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
  18. 21 9月, 2009 10 次提交
    • D
      Move example XML files into examples/xml · 13f59ad7
      Daniel P. Berrange 提交于
      * docs/storage/: Move to examples/xml/storage/
      * docs/test*.xml: Move to examples/xml/test/
      * docs/Makefile.am: Remove example XML files from dist
      * Makefile.am: Add examples/xml to EXTRA_DIST
      * tests/virshtest.c: Update for moved test XML
      * libvirt.spec.in: Include example XML files as docs
      * tests/int-overflow: UPdate for moved XML
      13f59ad7
    • D
      Fix missing data file in qemuhelpdata · b553b50a
      Daniel P. Berrange 提交于
      * tests/Makefile.am: Add missing data file to extra dist
      b553b50a
    • D
      Move all shared utility files to src/util/ · 1355e055
      Daniel P. Berrange 提交于
      * src/bridge.c, src/bridge.h, src/buf.c, src/buf.h, src/cgroup.c,
        src/cgroup.h, src/conf.c, src/conf.h, src/event.c, src/event.h,
        src/hash.c, src/hash.h, src/hostusb.c, src/hostusb.h,
        src/iptables.c, src/iptables.h, src/logging.c, src/logging.h,
        src/memory.c, src/memory.h, src/pci.c, src/pci.h, src/qparams.c,
        src/qparams.h, src/stats_linux.c, src/stats_linux.h,
        src/threads-pthread.c, src/threads-pthread.h, src/threads-win32.c,
        src/threads-win32.h, src/threads.c, src/threads.h, src/util.c,
        src/util.h, src/uuid.c, src/uuid.h, src/virterror.c,
        src/virterror_internal.h, src/xml.c, src/xml.h: Move all files
        into src/util/
      * daemon/Makefile.am: Add -Isrc/util/ to build flags
      * src/Makefile.am: Add -Isrc/util/ to build flags and update for
        moved files
      * src/libvirt_private.syms: Export cgroup APIs since they're now
        in util rather than linking directly to drivers
      * src/xen/xs_internal.c: Disable bogus virEventRemoveHandle call
        when built under PROXY
      * proxy/Makefile.am: Update for changed file locations. Remove
        bogus build of event.c
      * tools/Makefile.am, tests/Makefile.am: Add -Isrc/util/ to build flags
      1355e055
    • D
      Move all XML configuration handling to src/conf/ · e0a48c99
      Daniel P. Berrange 提交于
      * src/capabilities.c, src/capabilities.h, src/domain_conf.c,
        src/domain_conf.h, src/domain_event.c, src/domain_event.h,
        src/interface_conf.c, src/interface_conf.h,
        src/network_conf.c, src/network_conf.h, src/node_device_conf.c,
        src/node_device_conf.h, src/secret_conf.c, src/secret_conf.h,
        src/storage_conf.c, src/storage_conf.h, src/storage_encryption_conf.c,
        src/storage_encryption_conf.h: Move to src/conf/
      * src/Makefile.am: Add -Isrc/conf to the individual build targets
        which need to use XML config APIs. Remove LIBXML_CFLAGS, LIBSSH2_CFLAGS
        and SELINUX_CFLAGS from global INCLUDES and only have them in build
        targets which actually need them.  Create a libvirt_conf.la
        convenience library for all config parsers
      * src/hostusb.h: Remove bogus include of domain_conf.h
      * tests/Makefile.am: Add -Isrc/conf. Remove bogus -I$builddir/src
        since it never has any generated header files
      * daemon/Makefile.am: Add -Isrc/conf
      * proxy/Makefile.am: Add -Isrc/conf and cope with renamed files
      * src/hash.c: Remove bogus include of libxml/threads.h
      e0a48c99
    • 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 virsh into tools/ directory · 7ff256ec
      Daniel P. Berrange 提交于
      Move the virsh tool and its man page into the tools directory
      
      * Makefile.am: Remove rules for virsh.1 man page
      * virsh.1: Remove auto-generated file
      * docs/Makefile.am: Remove rules for virsh.pod man page
      * docs/virsh.pod: Move to tools/ directory
      * src/Makefile.am, src/.gitignore: Remove rules for virsh
      * src/console.c, src/console.h, src/*.ico, src/virsh_win_icon.rc,
        src/virsh.c: Move into tools/ directory
      * tools/Makefile.am: Add rules for building virsh
      * tools/.gitignore: Ignore virsh built files
      * tests/virshtest.c, tests/int-overflow: Update for new
        virsh location
      7ff256ec
    • D
      Move security drivers to src/security/ · e56c6a83
      Daniel P. Berrange 提交于
      * src/Makefile.am, src/qemu/qemu_conf.h, src/qemu/qemu_driver.c,
        tests/seclabeltest.c: Adapt for changed paths
      * src/security.c: Rename to src/security/security_driver.c
      * src/security.h: Rename to src/security/security_driver.h
      * src/security_selinux.c, src/security_selinux.h: Move to src/security/
      e56c6a83
    • D
      Move QEMU driver to src/qemu/ · 58355a5b
      Daniel P. Berrange 提交于
      * src/qemu_conf.c, src/qemu_conf.h, src/qemu_driver.c,
        src/qemu_driver.h: Move to src/qemu/
      * daemon/qemud.c, src/Makefile.am, tests/qemuargv2xmltest.c,
        tests/qemuhelptest.c, tests/qemuxml2argvtest.c,
        tests/qemuxml2xmltest.c: Adapt for changed paths
      58355a5b
    • D
      Move xen driver code into src/xen/ directory · f7a107f7
      Daniel P. Berrange 提交于
      * src/Makefile.am, src/proxy_internal.c, src/proxy_internal.h
        src/sexpr.c, src/sexpr.h, src/xen_unified.c, src/xen_unified.h,
        src/xen_internal.c, src/xen_internal.h, src/xen_inotify.c,
        src/xen_inotify.h, src/xend_internal.c, src/xend_internal.h,
        src/xm_internal.c, src/xm_internal.h, src/xs_internal.c,
        src/xs_internal.h: Move to src/xen/ directory
      * proxy/Makefile.am, proxy/libvirt_proxy.c, src/Makefile.am,
        src/libvirt.c, tests/sexpr2xmltest.c, tests/statstest.c,
        tests/xencapstest.c, tests/xmconfigtest.c, tests/xml2sexprtest.c:
        Adapt to changed xen location
      * src/stats_linux.h, src/stats_linux.c: Remove xen specific block
        stats APIs
      * src/qemu_driver.c, src/uml_driver.c: Add missing sys/un.h include
        uncovered after change to stats_linux.h
      * src/xen/block_stats.h, src/xen/block_stats.c: Add xen specific
        block stats APIs
      f7a107f7
    • D
      Rename qemud/ directory to daemon/ · 5c2a1ae8
      Daniel P. Berrange 提交于
      * qemud/: Rename to daemon/
      * Makefile.am, configure.in, src/Makefile.am, src/remote_internal.c,
        tests/Makefile.am, tests/eventtest.c: s/qemud/daemon/ where needed
      5c2a1ae8
  19. 10 9月, 2009 2 次提交
    • D
      Fix more OOM handling bugs · cbe63e52
      Daniel P. Berrange 提交于
      * src/qemu_conf.c: Fix leak of values upon OOM
      * src/xend_internal.c: Fix missing check for OOM failure
      * tests/qemuargv2xmltest.c, tests/qemuxml2argvtest.c: Free
        stateDir upon exit to avoid leak
      cbe63e52
    • D
      Fix misc thread locking bugs / bogus warnings · 5c8d3d3b
      Daniel P. Berrange 提交于
      Fix all thread locking bugs reported by object-locking test
      case.
      
      NB, some of the driver locking is getting too coarse. Driver
      mutexes really need to be turned into RW locks instead to
      significantly increase concurrency.
      
      * src/lxc_driver.c: Fix useof driver when unlocked in the methods
        lxcDomainGetInfo, lxcSetSchedulerParameters, and
        lxcGetSchedulerParameters
      * src/opennebula/one_driver.c: Fix missing unlock in oneDomainUndefine.
        Fix use of driver when unlocked in oneDomainGetInfo,
        oneGetOSType, oneDomainShutdown
      * src/qemu_driver.c: Fix use of driver when unlocked in
        qemudDomainSavem, qemuGetSchedulerType, qemuSetSchedulerParameters
        and qemuGetSchedulerParameters
      * src/storage_driver.c: Re-work storagePoolCreate to avoid bogus
        lock checking warning. Re-work storageVolumeCreateXMLFrom to
        remove a potential NULL de-reference & avoid bogus lock check
        warnings
      * src/test.c: Remove testDomainAssignDef since it break lock chekc
        warnings.
      * tests/object-locking.ml: Add oneDriverLock, oneDriverUnlock
        and one_driver_t methods/types to allow lock checking on the
         OpenNebula drivers
      5c8d3d3b