1. 16 1月, 2010 1 次提交
    • D
      Split code for building QEMU -drive arg in separate method · 2982d73a
      Daniel P. Berrange 提交于
      To enable it to be called from multiple locations, split out
      the code for building the -drive arg string. This will be needed
      by later patches which do drive hotplug, the conversion to use
      -device, and the conversion to controller/bus/unit addressing
      
      * src/qemu/qemu_conf.c, src/qemu/qemu_conf.h: Add qemuBuildDriveStr
        for building -drive arg string
      2982d73a
  2. 07 1月, 2010 1 次提交
    • A
      qemu: Always enable the virtio balloon driver · 7a90f216
      Adam Litke 提交于
      The behavior for the qemu balloon device has changed.  Formerly, a virtio
      balloon device was provided by default.  Now, '-balloon virtio' must be
      specified on the command line to enable it.  This patch causes libvirt to
      add '-balloon virtio' to the command line whenever the -balloon option is
      available.
      * src/qemu/qemu_conf.c src/qemu/qemu_conf.h: check for the new flag and
        add "-baloon vitio" to qemu command when needed
      * tests/qemuhelptest.c: add the new flag for detection
      7a90f216
  3. 22 12月, 2009 1 次提交
  4. 18 12月, 2009 1 次提交
  5. 08 12月, 2009 1 次提交
    • D
      Support for JSON mode monitor · 3a4f172f
      Daniel P. Berrange 提交于
      Initial support for the new QEMU monitor protocol  using JSON
      as the data encoding format instead of plain text
      
      * po/POTFILES.in: Add src/qemu/qemu_monitor_json.c
      * src/qemu/qemu_conf.c, src/qemu/qemu_conf.h: Hack to turn on QMP
        mode. Replace with a version number check on >= 0.12 later
      * src/qemu/qemu_monitor.c: Delegate to json monitor if enabled
      * src/qemu/qemu_monitor_json.c, src/qemu/qemu_monitor_json.h: Add
        impl of QMP protocol
      * src/Makefile.am: Add src/qemu/qemu_monitor_json.{c,h}
      3a4f172f
  6. 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
  7. 10 11月, 2009 2 次提交
    • D
      Wrap text mode monitor APIs, pass qemuMonitorPtr directly to APIs · 41d8968d
      Daniel P. Berrange 提交于
      Change the QEMU driver to not directly invoke the text mode monitor
      APIs. Instead add a generic wrapper layer, which will eventually
      invoke either the text or JSON protocol code as needed. Pass an
      qemuMonitorPtr object into the monitor APIs instead of virDomainObjPtr
      to complete the de-coupling of the monitor impl from virDomainObj
      data structures
      
      * src/qemu/qemu_conf.h: Remove qemuDomainObjPrivate definition
      * src/qemu/qemu_driver.c: Add qemuDomainObjPrivate definition.
        Pass qemuMonitorPtr into all monitor APIs instead of the
        virDomainObjPtr instance.
      * src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h: Add thin
        wrappers for all qemuMonitorXXX command APIs, calling into
        qemu_monitor_text.c/h
      * src/qemu/qemu_monitor_text.c, src/qemu/qemu_monitor_text.h:
        Rename qemuMonitor -> qemuMonitorText & update to accept
        qemuMonitorPtr instead of virDomainObjPtr
      41d8968d
    • D
      Make use of private data structure for monitor state · 1cfd5a00
      Daniel P. Berrange 提交于
      Introduce a new qemuDomainObjPrivate object which is used to store
      the private QEMU specific data associated with each virDomainObjPtr
      instance. This contains a single member, an instance of the new
      qemuMonitorPtr object which encapsulates the QEMU monitor state.
      The internals of the latter are private to the qemu_monitor* files,
      not to be shown to qemu_driver.c
      
      * src/qemu/qemu_conf.h: Definition of qemuDomainObjPrivate.
      * src/qemu/qemu_driver.c: Register a functions for creating
        and freeing qemuDomainObjPrivate instances with the domain
        capabilities. Remove the qemudDispatchVMEvent() watch since
        I/O watches are now handled by the monitor code itself. Pass
        a new qemuHandleMonitorEOF() callback into qemuMonitorOpen
        to allow notification when the monitor quits.
      * src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h: Introduce
        the 'qemuMonitor' object. Temporarily add new APIs
        qemuMonitorWrite, qemuMonitorRead, qemuMonitorWaitForInput
        to allow text based monitor impl to perform I/O.
      * src/qemu/qemu_monitor_text.c: Call APIs for reading/writing
        to monitor instead of accessing the file handle directly.
      1cfd5a00
  8. 05 11月, 2009 1 次提交
  9. 04 11月, 2009 1 次提交
    • 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
  10. 30 9月, 2009 1 次提交
  11. 29 9月, 2009 2 次提交
    • D
      Add API for issuing 'host_net_add' monitor command · 4c10127b
      Daniel P. Berrange 提交于
      * src/qemu/qemu_conf.h, src/qemu/qemu_conf.c: Remove prefix arg
        from qemuBuildHostNetStr which is no longer required
      * src/qemu/qemu_driver.c: Refactor to use qemuMonitorAddHostNetwork()
        API for adding host network
      * src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h: Add new
        qemuMonitorAddHostNetwork() method for adding host networks
      4c10127b
    • D
      Add API for issuing 'pci_add nic' monitor command · f8d54e7c
      Daniel P. Berrange 提交于
      * src/qemu/qemu_conf.c: Remove separator from qemuBuildNicStr()
        args, and remove hardcoded 'nic' prefix. Leave it upto callers
        instead
      * src/qemu/qemu_driver.c: Switch over to using the new
        qemuMonitorAddPCINetwork() method for NIC hotplug
      * src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h: Add new
        qemuMonitorAddPCINetwork API for PCI network device hotplug
      f8d54e7c
  12. 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
  13. 21 9月, 2009 2 次提交
    • 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
  14. 10 9月, 2009 1 次提交
    • M
      Canonicalize the qemu machine type in qemuxml2argvtest · 6e7ab461
      Mark McLoughlin 提交于
      This doesn't have any affect on the current tests because we don't have
      any machine aliases in the current test data.
      
      * src/qemu_conf.h, src/qemu_driver.c: expose qemudCanonicalizeMachine()
        for the tests
      
      * tests/qemuxml2argvtest.c: canonicalize the machine type
      6e7ab461
  15. 04 9月, 2009 1 次提交
    • D
      Move QEMU monitor socket in /var/lib/libvirt/qemu · 182a80b9
      Daniel P. Berrange 提交于
      Separate the guest created QEMU monitor socket location
      from the libvirtd create XML / PID data files, to improve
      security separation when running QEMU non-root
      
      * libvirt.spec.in: Leave /var/run/libvirt/qemu as root:root
      * src/qemu_conf.h: Add libDir and cacheDir directory paths
      * src/qemu_driver.c: Move QEMU monitor socket from
        stateDir to libDir to avoid making security critical directory
        accessible to QEMU guests.
      * src/util.c: Delay running hook till after damonizing to
        ensure pidfile is still written before changing UID/GID
      182a80b9
  16. 03 9月, 2009 2 次提交
    • D
      Add support for setting disk drive serial numbers · 85d15b51
      Daniel P. Berrange 提交于
      * docs/schemas/domain.rng: Add <serial> element to disks
      * src/domain_conf.h, src/domain_conf.c: XML parsing and
        formatting for disk serial numbers
      * src/qemu_conf.c: Set serial number when launching guests
      * tests/qemuxml2argvdata/qemuxml2argv-disk-drive-shared.args,
        tests/qemuxml2argvdata/qemuxml2argv-disk-drive-shared.xml: Add
        serial number to XML test
      85d15b51
    • D
      Support configuration of huge pages in guests · d823a05a
      Daniel P. Berrange 提交于
      Add option to domain XML for
      
           <memoryBacking>
              <hugepages/>
           </memoryBacking>
      
      * configure.in: Add check for mntent.h
      * qemud/libvirtd_qemu.aug, qemud/test_libvirtd_qemu.aug, src/qemu.conf
        Add 'hugetlbfs_mount' config parameter
      * src/qemu_conf.c, src/qemu_conf.h: Check for -mem-path flag in QEMU,
        and pass it when hugepages are requested.
        Load hugetlbfs_mount config parameter, search for mount if not given.
      * src/qemu_driver.c: Free hugetlbfs_mount/path parameter in driver shutdown.
        Create directory for QEMU hugepage usage, chowning if required.
      * docs/formatdomain.html.in: Document memoryBacking/hugepages elements
      * docs/schemas/domain.rng: Add memoryBacking/hugepages elements to schema
      * src/util.c, src/util.h, src/libvirt_private.syms: Add virFileFindMountPoint
        helper API
      * tests/qemuhelptest.c: Add -mem-path constants
      * tests/qemuxml2argvtest.c, tests/qemuxml2xmltest.c: Add tests for hugepage
        handling
      * tests/qemuxml2argvdata/qemuxml2argv-hugepages.xml,
        tests/qemuxml2argvdata/qemuxml2argv-hugepages.args: Data files for
        hugepage tests
      d823a05a
  17. 18 8月, 2009 1 次提交
    • M
      Maintain a list of active PCI hostdevs and use it in pciResetDevice() · e8ad3393
      Mark McLoughlin 提交于
      As we start/shutdown guests, or hotplug/hot-unplug devices, we can add
      or delete devices as appropriate from a list of active devices.
      
      Then, in pciReset(), we can use this to determine whether its safe to
      reset a device as a side effect of resetting another device.
      
      * src/qemu_conf.h: add activePciHostdevs to qemud_driver
      
      * src/qemu_driver.c: maintain the activePciHostdevs list, and pass it
        to pciResetDevice()
      
      * src/pci.[ch]: pass the activeDevs list to pciResetDevice() and use
        it to determine whether a Secondary Bus Reset is safe
      e8ad3393
  18. 17 8月, 2009 1 次提交
    • C
      Compressed save image format for Qemu. · 2d6a5819
      Chris Lalancette 提交于
      Implement a compressed save image format for qemu.  While ideally
      we would have the choice between compressed/non-compressed
      available to the libvirt API, unfortunately there is no "flags"
      parameter to the virDomainSave() API.  Therefore, implement this
      as a qemu.conf option.  gzip, bzip2, and lzma are implemented, and
      it should be very easy to implement additional compression
      methods.
      
      One open question is if/how we should detect the compression
      binaries.  One way to do it is to do compile-time setting of the
      paths (via configure.in), but that doesn't seem like a great thing
      to do.  My preferred solution is not to detect at all;
      when we go to run the commands that need them, if they
      aren't available, or aren't available in one of the standard paths,
      then we'll fail.  That's also the solution implemented in this patch.
      
      In the future, we'll have a more robust (managed) save/restore API,
      at which time we can expose this functionality properly in the API.
      
      V2: get rid of redundant dd command and just use >> to append data.
      V3: Add back the missing pieces for the enum and bumping the save version.
      V4: Make the compressed field in the save_header an int.
          Implement LZMA compression.
      Signed-off-by: NChris Lalancette <clalance@redhat.com>
      2d6a5819
  19. 14 8月, 2009 1 次提交
    • M
      Detect KVM's PCI device assignment support · d4528d9a
      Mark McLoughlin 提交于
      PCI device assignment is only supported in KVM's fork of qemu, so we
      should really detect its availability and give a nice error if its
      not supported.
      
      * src/qemu_conf.[ch]: introduce QEMUD_CMD_FLAG_PCIDEVICE indicating
        that the -pcidevice command line option is available
      
      * tests/*: update the tests
      d4528d9a
  20. 27 7月, 2009 4 次提交
    • M
      Make qemuBuildHostNetStr() take tapfd as a string · 32db8dd7
      Mark McLoughlin 提交于
      With hotplug, we're going to want to pass a tapfd name rather than an
      actual file descriptor, so prepare the way by passing a string tapfd to
      qemuBuildHostNetStr().
      
      * src/qemu_conf.h: qemuBuildHostNetStr() takes a string tapfd now
      
      * src/qemu_conf.c: pass qemuBuildHostNetStr() a string rather than an
        actual file descriptor
      
      * src/qemu_driver.c: update qemudDomainAttachNetDevice() for change
      32db8dd7
    • M
      Move vnet_hdr logic into qemudNetworkIfaceConnect() and export it · a3f33b65
      Mark McLoughlin 提交于
      * src/qemu_conf.h: export qemudNetworkIfaceConnect()
      
      * src/qemu_conf.c: move vnet_hdr logic into qemudNetworkIfaceConnect()
        since we need it for hotplug too
      a3f33b65
    • M
      Only probe qemu for machine types when binary changes · 707302b2
      Mark McLoughlin 提交于
      By probing for qemu machine types, we increased the time of a
      GetCapabilities call from 100us to a whopping 60ms.
      
      This patch takes the approach of only probing for machine types
      when the mtime of the emulator binary changed since the last time
      the capabilities were generated.
      
      * src/capabilities.h: cache the emulator binary mtime
      
      * src/qemu_conf.c: add qemudGetOldMachines() to copy the machine
        types from the old caps struct if the mtime for the binary hasn't
        changed
      
      * src/qemu_conf.h, src/qemu_driver.c: pass the old caps pointer to
        qemudCapsInit()
      707302b2
    • M
      Probe QEMU directly for machine aliases if not found in capabilties · c14c6b08
      Mark McLoughlin 提交于
      Not all possible emulators are actually in the capabilities, so if we
      don't find the supplied emulator we should probe it directly for machine
      types.
      
      * src/qemu_driver.c: add qemudCanonicalizeMachineDirect() to directly
        probe an emulator for the canonical machine type
      c14c6b08
  21. 24 7月, 2009 2 次提交
    • D
      Make QEMU cgroups use configurable · f4c3acdf
      Daniel P. Berrange 提交于
       * qemud/libvirtd_qemu.aug, qemud/test_libvirtd_qemu.aug,
         src/qemu.conf: Add 'cgroups_controllers' and 'cgroups_device_acl'
         parameters
       * src/qemu_conf.h, src/qemu_conf.c: Load & parse configuration params
         for cgroups
       * src/qemu_driver.c: Only use cgroups controllers that are activated,
         and use configured device whitelist instead of default, if set.
      f4c3acdf
    • D
      Place every QEMU guest in a private cgroup · 38f6f47b
      Daniel P. Berrange 提交于
      * src/qemu_driver.c: Place guest in cgroup upon startup. Remove
        cgroup upon shutdown
      38f6f47b
  22. 22 7月, 2009 2 次提交
    • M
      Basic qemu NIC hotplug support · 35153940
      Mark McLoughlin 提交于
      Implement basic NIC hotplug support using the 'host_net_add' and
      'pci_add' qemu monitor commands.
      
      For now, we don't support 'bridge' or 'network' types.
      
      Also, if pci_add fails, we currently fail to remove the backend
      which we added.
      
      Finally, NIC hot-unplug support is missing.
      
      * src/qemu_driver.c: add qemudDomainAttachNetDevice()
      
      * src/qemu_conf.[ch]: export qemuBuildNicStr(), qemuBuildHostNetStr()
        and qemuAssignNames()
      
      * src/libvirt_private.syms: export virDomainNetTypeToString()
      35153940
    • M
      Add checks for some NIC hotplug related features added in qemu-0.10.0 · 94889768
      Mark McLoughlin 提交于
      Add QEMUD_CMD_FLAG_NET_NAME to indicate that '-net ...,name=foo' is
      supported and QEMUD_CMD_FLAG_HOST_NET_ADD to indicate that the
      'host_net_add' monitor command is available.
      
      Set both these flags if the qemu version is greater than 0.10.0.
      Checking via the '-help' output would not work for the monitor command
      and even for the command line arg, it would be quite fragile.
      
      * src/qemu_conf.h: add new flags as aliases of QEMUD_CMD_FLAG_0_10
      
      * src/qemu_conf.c: set QEMUD_CMD_FLAG_0_10 for versions >= 0.10.0
      
      * tests/qemuhelptest.c: set QEMUD_CMD_FLAG_0_10 for the appropriate
        qemu versions
      94889768
  23. 17 7月, 2009 1 次提交
    • D
      Run QEMU guests as an unprivileged user · 0714b2ba
      Daniel P. Berrange 提交于
      * configure.in: Add --with-qemu-user and --with-qemu-group args
      * libvirt.spec.in: use 'qemu' for user/group for Fedora >= 12
      * qemud/libvirtd_qemu.arg, qemud/test_libvirtd_qemu.aug,
        src/qemu.conf: Add 'user' and 'group' args for configuration
      * src/Makefile.am: Create %localstatedir/cache/libvirt/qemu
      * src/qemu_conf.c, src/qemu_conf.h: Load user/group from config
      * src/qemu_driver.c: Change user ID/group ID when launching QEMU
        guests. Change user/group ownership on disks/usb/pci devs.
        Put memory dumps in %localstatedir/cache/libvirt/qemu
      * src/util.c, src/util.h: Add convenient APIs for converting
        username/groupname to user ID / group ID
      0714b2ba
  24. 10 7月, 2009 1 次提交
    • M
      Add the monitor type to the domain state XML · 05d377bd
      Mark McLoughlin 提交于
      There are no functional changes in this patch apart from adding the
      monitor type to the state XML.
      
      The patch mostly consists of switching to use virDomainChrDef every
      where to describe the monitor.
      
      * src/domain_conf.h: replace monitorpath with monitor_chr
      
      * src/domain_conf.c: handle parsing the monitor type and initializing
        monitor chr
      
      * src/qemu_conf.[ch]: make qemudBuildCommandLine take a
        virDomainChrDefPtr and use that to build the -monitor parameter
      
      * src/qemu_driver.c: split pty specific and common code from
        qemudOpenMonitor, have qemudStartVMDaemon() initialize monitor_chr
      
      * tests/qemuxml2argvtest.c: update for qemudBuildCommandLine() change
      05d377bd
  25. 08 7月, 2009 1 次提交
    • D
      Support <video> element for QEMU guests · ad6d5acb
      Daniel P. Berrange 提交于
      	* src/qemu_conf.c, src/qemu_conf.h: Use -vga or -std-vga
      	when starting guests if video card is present
      	* tests/qemuhelptest.c: Change to use constants instead
      	of hardcoded hex numbers, and add VGA support
      	* tests/qemuxml2argvdata/qemuxml2argv-graphics-sdl-fullscreen.xml,
      	tests/qemuxml2argvdata/qemuxml2argv-graphics-sdl.args,
      	tests/qemuxml2argvdata/qemuxml2argv-graphics-sdl.xml,
      	tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-sasl.args,
      	tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-sasl.xml,
      	tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-tls.xml,
      	tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc.xml,
      	tests/qemuxml2argvdata/qemuxml2argv-input-xen.xml: Add <video>
      	element for testing graphics adapter
      	* tests/qemuxml2argvtest.c: Add QEMUD_CMD_FLAG_VGA flag
      	* tests/qemuxml2xmltest.c: Add missing graphics-vnc-sasl/tls tests
      ad6d5acb
  26. 16 6月, 2009 1 次提交
  27. 12 6月, 2009 2 次提交
  28. 11 6月, 2009 1 次提交
  29. 28 5月, 2009 1 次提交
  30. 21 5月, 2009 1 次提交