1. 01 2月, 2012 1 次提交
  2. 18 1月, 2012 1 次提交
    • O
      qemu: Introduce inactive PCI device list · 6be610bf
      Osier Yang 提交于
      pciTrySecondaryBusReset checks if there is active device on the
      same bus, however, qemu driver doesn't maintain an effective
      list for the inactive devices, and it passes meaningless argument
      for parameter "inactiveDevs". e.g. (qemuPrepareHostdevPCIDevices)
      
      if (!(pcidevs = qemuGetPciHostDeviceList(hostdevs, nhostdevs)))
          return -1;
      
      ..skipped...
      
      if (pciResetDevice(dev, driver->activePciHostdevs, pcidevs) < 0)
          goto reattachdevs;
      
      NB, the "pcidevs" used above are extracted from domain def, and
      thus one won't be able to attach a device of which bus has other
      device even detached from host (nodedev-detach). To see more
      details of the problem:
      
      RHBZ: https://bugzilla.redhat.com/show_bug.cgi?id=773667
      
      This patch is to resolve the problem by introducing an inactive
      PCI device list (just like qemu_driver->activePciHostdevs), and
      the whole logic is:
      
        * Add the device to inactive list during nodedev-dettach
        * Remove the device from inactive list during nodedev-reattach
        * Remove the device from inactive list during attach-device
          (for non-managed device)
        * Add the device to inactive list after detach-device, only
          if the device is not managed
      
      With the above, we have a sufficient inactive PCI device list, and thus
      we can use it for pciResetDevice. e.g.(qemuPrepareHostdevPCIDevices)
      
      if (pciResetDevice(dev, driver->activePciHostdevs,
                         driver->inactivePciHostdevs) < 0)
          goto reattachdevs;
      6be610bf
  3. 25 12月, 2011 1 次提交
  4. 23 12月, 2011 1 次提交
  5. 24 11月, 2011 1 次提交
  6. 19 11月, 2011 1 次提交
    • D
      Rename and split the macvtap.c file · 896104c9
      Daniel P. Berrange 提交于
      Rename the macvtap.c file to virnetdevmacvlan.c to reflect its
      functionality. Move the port profile association code out into
      virnetdevvportprofile.c. Make the APIs available unconditionally
      to callers
      
      * src/util/macvtap.h: rename to src/util/virnetdevmacvlan.h,
      * src/util/macvtap.c: rename to src/util/virnetdevmacvlan.c
      * src/util/virnetdevvportprofile.c, src/util/virnetdevvportprofile.h:
        Pull in vport association code
      * src/Makefile.am, src/conf/domain_conf.h, src/qemu/qemu_conf.c,
        src/qemu/qemu_conf.h, src/qemu/qemu_driver.c: Update include
        paths & remove conditional compilation
      896104c9
  7. 10 11月, 2011 2 次提交
    • D
      Split bridge.h into three separate files · e49c9bf2
      Daniel P. Berrange 提交于
      Following the renaming of the bridge management APIs, we can now
      split the source file into 3 corresponding pieces
      
       * src/util/virnetdev.c: APIs for any type of network interface
       * src/util/virnetdevbridge.c: APIs for bridge interfaces
       * src/util/virnetdevtap.c: APIs for TAP interfaces
      
      * src/util/virnetdev.c, src/util/virnetdev.h,
        src/util/virnetdevbridge.c, src/util/virnetdevbridge.h,
        src/util/virnetdevtap.c, src/util/virnetdevtap.h: Copied
        from bridge.{c,h}
      * src/util/bridge.c, src/util/bridge.h: Split into 3 pieces
      * src/lxc/lxc_driver.c, src/network/bridge_driver.c,
        src/openvz/openvz_driver.c, src/qemu/qemu_command.c,
        src/qemu/qemu_conf.h, src/uml/uml_conf.c, src/uml/uml_conf.h,
        src/uml/uml_driver.c: Update #include directives
      e49c9bf2
    • D
      Remove 'brControl' object · 6cfeb9a7
      Daniel P. Berrange 提交于
      The bridge management APIs in src/util/bridge.c require a brControl
      object to be passed around. This holds the file descriptor for the
      control socket. This extra object complicates use of the API for
      only a minor efficiency gain, which is in turn entirely offset by
      the need to fork/exec the brctl command for STP configuration.
      
      This patch removes the 'brControl' object entirely, instead opening
      the control socket & closing it again within the scope of each method.
      
      The parameter names for the APIs are also made to consistently use
      'brname' for bridge device name, and 'ifname' for an interface
      device name. Finally annotations are added for non-NULL parameters
      and return check validation
      
      * src/util/bridge.c, src/util/bridge.h: Remove brControl object
        and update API parameter names & annotations.
      * src/lxc/lxc_driver.c, src/network/bridge_driver.c,
        src/uml/uml_conf.h, src/uml/uml_conf.c, src/uml/uml_driver.c,
        src/qemu/qemu_command.c, src/qemu/qemu_conf.h,
        src/qemu/qemu_driver.c: Remove reference to 'brControl' object
      6cfeb9a7
  8. 29 9月, 2011 1 次提交
  9. 06 9月, 2011 1 次提交
    • M
      qemu: Introduce job queue size limit · 3005cacb
      Michal Privoznik 提交于
      This patch creates an optional BeginJob queue size limit. When
      active, all other attempts above level will fail. To set this
      feature assign desired value to max_queued variable in qemu.conf.
      Setting it to 0 turns it off.
      3005cacb
  10. 03 9月, 2011 1 次提交
    • E
      snapshot: cache qemu-img location · 3881a470
      Eric Blake 提交于
      As more clients start to want to know this information, doing
      a PATH stat walk and malloc for every client adds up.
      
      We are only caching the location, not the capabilities, so even
      if qemu-img is updated in the meantime, it will still probably
      live in the same location.  So there is no need to worry about
      clearing this particular cache.
      
      * src/qemu/qemu_conf.h (qemud_driver): Add member.
      * src/qemu/qemu_driver.c (qemudShutdown): Cleanup.
      (qemuFindQemuImgBinary): Add an argument, and cache result.
      (qemuDomainSnapshotForEachQcow2, qemuDomainSnapshotDiscard)
      (qemuDomainSnapshotCreateInactive, qemuDomainSnapshotRevertInactive)
      (qemuDomainSnapshotCreateXML, qemuDomainRevertToSnapshot): Update
      callers.
      3881a470
  11. 22 7月, 2011 1 次提交
    • E
      save: support bypass-cache flag in qemu.conf · a9f9545e
      Eric Blake 提交于
      When auto-dumping a domain on crash events, or autostarting a domain
      with managed save state, let the user configure whether to imply
      the bypass cache flag.
      
      * src/qemu/qemu.conf (auto_dump_bypass_cache, auto_start_bypass_cache):
      Document new variables.
      * src/qemu/libvirtd_qemu.aug (vnc_entry): Let augeas parse them.
      * src/qemu/qemu_conf.h (qemud_driver): Store new preferences.
      * src/qemu/qemu_conf.c (qemudLoadDriverConfig): Parse them.
      * src/qemu/qemu_driver.c (processWatchdogEvent, qemuAutostartDomain):
      Honor them.
      a9f9545e
  12. 24 6月, 2011 1 次提交
    • D
      Add infrastructure to automatically destroy guests when a connection closes · 558b7fd0
      Daniel P. Berrange 提交于
      Sometimes it is useful to be able to automatically destroy a guest when
      a connection is closed. For example, kill an incoming migration if
      the client managing the migration dies. This introduces a map between
      guest 'uuid' strings and virConnectPtr objects. When a connection is
      closed, any associated guests are killed off.
      
      * src/qemu/qemu_conf.h: Add autokill hash table to qemu driver
      * src/qemu/qemu_process.c, src/qemu/qemu_process.h: Add APIs
        for performing autokill of guests associated with a connection
      * src/qemu/qemu_driver.c: Initialize autodestroy map
      558b7fd0
  13. 02 6月, 2011 1 次提交
    • D
      Integrate the QEMU driver with the lock manager infrastructure · 12317957
      Daniel P. Berrange 提交于
      The QEMU integrates with the lock manager instructure in a number
      of key places
      
       * During startup, a lock is acquired in between the fork & exec
       * During startup, the libvirtd process acquires a lock before
         setting file labelling
       * During shutdown, the libvirtd process acquires a lock
         before restoring file labelling
       * During hotplug, unplug & media change the libvirtd process
         holds a lock while setting/restoring labels
      
      The main content lock is only ever held by the QEMU child process,
      or libvirtd during VM shutdown. The rest of the operations only
      require libvirtd to hold the metadata locks, relying on the active
      QEMU still holding the content lock.
      
      * src/qemu/qemu_conf.c, src/qemu/qemu_conf.h,
        src/qemu/libvirtd_qemu.aug, src/qemu/test_libvirtd_qemu.aug:
        Add config parameter for configuring lock managers
      * src/qemu/qemu_driver.c: Add calls to the lock manager
      12317957
  14. 13 5月, 2011 1 次提交
  15. 17 4月, 2011 1 次提交
  16. 06 4月, 2011 1 次提交
    • J
      qemu: Support for overriding NPROC limit · 87e78b2b
      Jiri Denemark 提交于
      This patch adds max_processes option to qemu.conf which can be used to
      override system default limit on number of processes that are allowed to
      be running for qemu user.
      87e78b2b
  17. 24 2月, 2011 1 次提交
  18. 22 1月, 2011 1 次提交
    • C
      qemu: Add conf option to auto setup VNC unix sockets · a942ea06
      Cole Robinson 提交于
      If vnc_auto_unix_socket is enabled, any VNC devices without a hardcoded
      listen or socket value will be setup to serve over a unix socket in
      /var/lib/libvirt/qemu/$vmname.vnc.
      
      We store the generated socket path in the transient VM definition at
      CLI build time.
      a942ea06
  19. 11 1月, 2011 1 次提交
    • D
      Refactor the security drivers to simplify usage · d6623003
      Daniel P. Berrange 提交于
      The current security driver usage requires horrible code like
      
          if (driver->securityDriver &&
              driver->securityDriver->domainSetSecurityHostdevLabel &&
              driver->securityDriver->domainSetSecurityHostdevLabel(driver->securityDriver,
                                                                    vm, hostdev) < 0)
      
      This pair of checks for NULL clutters up the code, making the driver
      calls 2 lines longer than they really need to be. The goal of the
      patchset is to change the calling convention to simply
      
        if (virSecurityManagerSetHostdevLabel(driver->securityDriver,
                                              vm, hostdev) < 0)
      
      The first check for 'driver->securityDriver' being NULL is removed
      by introducing a 'no op' security driver that will always be present
      if no real driver is enabled. This guarentees driver->securityDriver
      != NULL.
      
      The second check for 'driver->securityDriver->domainSetSecurityHostdevLabel'
      being non-NULL is hidden in a new abstraction called virSecurityManager.
      This separates the driver callbacks, from main internal API. The addition
      of a virSecurityManager object, that is separate from the virSecurityDriver
      struct also allows for security drivers to carry state / configuration
      information directly. Thus the DAC/Stack drivers from src/qemu which
      used to pull config from 'struct qemud_driver' can now be moved into
      the 'src/security' directory and store their config directly.
      
      * src/qemu/qemu_conf.h, src/qemu/qemu_driver.c: Update to
        use new virSecurityManager APIs
      * src/qemu/qemu_security_dac.c,  src/qemu/qemu_security_dac.h
        src/qemu/qemu_security_stacked.c, src/qemu/qemu_security_stacked.h:
        Move into src/security directory
      * src/security/security_stack.c, src/security/security_stack.h,
        src/security/security_dac.c, src/security/security_dac.h: Generic
        versions of previous QEMU specific drivers
      * src/security/security_apparmor.c, src/security/security_apparmor.h,
        src/security/security_driver.c, src/security/security_driver.h,
        src/security/security_selinux.c, src/security/security_selinux.h:
        Update to take virSecurityManagerPtr object as the first param
        in all callbacks
      * src/security/security_nop.c, src/security/security_nop.h: Stub
        implementation of all security driver APIs.
      * src/security/security_manager.h, src/security/security_manager.c:
        New internal API for invoking security drivers
      * src/libvirt.c: Add missing debug for security APIs
      d6623003
  20. 17 12月, 2010 4 次提交
    • D
      Move QEMU driver lock helpers to a separate file · 22f4cb85
      Daniel P. Berrange 提交于
      To allow their use from other source files, move qemuDriverLock
      and qemuDriverUnlock to qemu_conf.h and make them non-static
      
      * src/qemu/qemu_conf.c, src/qemu/qemu_conf.h: Add qemuDriverLock
        qemuDriverUnlock
      * src/qemu/qemu_driver.c: Remove qemuDriverLock and qemuDriverUnlock
      22f4cb85
    • D
      Move QEMU private data & namespace code into separate file · df4aabaf
      Daniel P. Berrange 提交于
      Move the code for handling the QEMU virDomainObjPtr private
      data, and custom XML namespace into a separate file
      
      * src/qemu/qemu_domain.c, src/qemu/qemu_domain.h: New file
        for private data & namespace code
      * src/qemu/qemu_driver.c, src/qemu/qemu_driver.h: Remove
        private data & namespace code
      * src/qemu/qemu_driver.h, src/qemu/qemu_command.h: Update
        includes
      * src/Makefile.am: Add src/qemu/qemu_domain.c
      df4aabaf
    • D
      Move QEMU command line management into a separate file · 0f2e4b9c
      Daniel P. Berrange 提交于
      The qemu_conf.c code is doing three jobs, driver config file
      loading, QEMU capabilities management and QEMU command line
      management. Move the command line code into its own file
      
      * src/qemu/qemu_command.c, src/qemu/qemu_command.h: New
        command line management code
      * src/qemu/qemu_conf.c, src/qemu/qemu_conf.h: Delete command
        line code
      * src/qemu/qemu_conf.h, src/qemu_conf.c: Adapt for API renames
      * src/Makefile.am: add src/qemu/qemu_command.c
      * src/qemu/qemu_monitor_json.c, src/qemu/qemu_monitor_text.c: Add
        import of qemu_command.h
      0f2e4b9c
    • D
      Move QEMU capabilities management into a separate file · d8ae147d
      Daniel P. Berrange 提交于
      The qemu_conf.c code is doing three jobs, driver config file
      loading, QEMU capabilities management and QEMU command line
      management. Move the capabilities code into its own file
      
      * src/qemu/qemu_capabilities.c, src/qemu/qemu_capabilities.h: New
        capabilities management code
      * src/qemu/qemu_conf.c, src/qemu/qemu_conf.h: Delete capabilities
        code
      * src/qemu/qemu_conf.h: Adapt for API renames
      * src/Makefile.am: add src/qemu/qemu_capabilities.c
      d8ae147d
  21. 10 12月, 2010 1 次提交
    • H
      Add a watchdog action `dump' · e19cdbfc
      Hu Tao 提交于
      `dump' watchdog action lets libvirtd to dump the guest when receives a
      watchdog event (which probably means a guest crash)
      
      Currently only qemu is supported.
      e19cdbfc
  22. 08 12月, 2010 2 次提交
  23. 03 12月, 2010 1 次提交
    • E
      qemu: convert to virCommand · 6a7e7c4f
      Eric Blake 提交于
      * src/qemu/qemu_conf.c (qemudExtractVersionInfo): Check for file
      before executing it here, rather than in callers.
      (qemudBuildCommandLine): Rewrite with virCommand.
      * src/qemu/qemu_conf.h (qemudBuildCommandLine): Update signature.
      * src/qemu/qemu_driver.c (qemuAssignPCIAddresses)
      (qemudStartVMDaemon, qemuDomainXMLToNative): Adjust callers.
      6a7e7c4f
  24. 01 12月, 2010 1 次提交
    • S
      802.1Qbg: use pre-associate state at beginning of inc. migr · c2b38277
      Stefan Berger 提交于
      This patch introduces the usage of the pre-associate state of the IEEE 802.1Qbg standard on incoming VM migration on the target host. It is in response to bugzilla entry 632750.
      
      https://bugzilla.redhat.com/show_bug.cgi?id=632750
      
      For being able to differentiate the exact reason as to why a macvtap device is being created, either due to a VM creation or an incoming VM migration, I needed to pass that reason as a parameter from wherever qemudStartVMDaemon is being called in order to determine whether to send an ASSOCIATE (VM creation) or a PRE-ASSOCIATE (incoming VM migration) towards lldpad.
      
      I am also fixing a problem with the virsh domainxml-to-native call on the way.
      
      Gerhard successfully tested the patch with a recent blade network 802.1Qbg-compliant switch.
      
      The patch should not have any side-effects on the 802.1Qbh support in libvirt, but Roopa (cc'ed) may want to verify this.
      c2b38277
  25. 09 11月, 2010 3 次提交
    • D
      Add SPICE support for QEMU driver configuration file · b5c99209
      Daniel P. Berrange 提交于
      In common with VNC, the QEMU driver configuration file is used
      specify the host level TLS certificate location and a default
      password / listen address
      
      * src/qemu/qemu.conf: Add spice_listen, spice_tls,
        spice_tls_x509_cert_dir & spice_password config params
      * src/qemu/qemu_conf.c, src/qemu/qemu_conf.h: Parsing of
        spice config parameters and updating -spice arg generation
        to use them
      * tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-rhel6.args,
        tests/qemuxml2argvtest.c: Expand test case to cover driver
        level configuration
      b5c99209
    • D
      Implement QEMU/KVM support for SPICE graphics · 9b57fa65
      Daniel P. Berrange 提交于
      This supports the -spice argument posted for review against
      the latest upstream QEMU/KVM. This supports the bare minimum
      config with port, TLS port & listen address. The x509 bits are
      added in a later patch.
      
      * src/qemu_conf.c, src/qemu_conf.h: Add SPICE flag. Check for
        -spice availability. Format -spice arg for command line
      * qemuhelptest.c: Add SPICE flag
      * qemuxml2argvdata/qemuxml2argv-graphics-spice.args: Add <graphics>
        for spice
      * qemuxml2argvdata/qemuxml2argv-graphics-spice.xml: Add -spice arg
      * qemuxml2argvtest.c: Add SPICE flag
      9b57fa65
    • D
      Implement QEMU/KVM QXL video card support in QEMU driver · 635f9ca1
      Daniel P. Berrange 提交于
      This supports the '-vga qxl' parameter in upstream QEMU/KVM
      which has SPICE support added. This isn't particularly useful
      until you get the next patch for -spice support. Also note that
      while the libvirt XML supports multiple video devices, this
      patch only supports a single one. A later patch can add support
      for 2nd, 3rd, etc PCI devices for QXL
      
      * src/qemu/qemu_conf.h: Flag for QXL support
      * src/qemu/qemu_conf.c: Probe for '-vga qxl' support and implement it
      * tests/qemuxml2argvtest.c, tests/qemuxml2xmltest.c,
        tests/qemuxml2argvdata/qemuxml2argv-graphics-spice.args,
        tests/qemuxml2argvdata/qemuxml2argv-graphics-spice.xml: Test
        case for generating spice args with RHEL6 kvm
      635f9ca1
  26. 08 11月, 2010 2 次提交
    • D
      Add sysinfo/smbios support to the QEmu driver · 54c0237c
      Daniel Veillard 提交于
      The patch is based on the possiblity in the QEmu command line to
      add -smbios options allowing to override the default values picked
      by QEmu. We need to detect this first from QEmu help output.
      If the domain is defined with smbios to be inherited from host
      then we pass the values coming from the Host own SMBIOS, but
      if the domain is defined with smbios to come from sysinfo, we
      use the ones coming from the domain definition.
      
      * src/qemu/qemu_conf.h: add the QEMUD_CMD_FLAG_SMBIOS_TYPE enum
        value
      * src/qemu/qemu_conf.c: scan the help output for the smbios support,
        and if available add support based on the domain definitions,
        and host data
      * tests/qemuhelptest.c: add the new enum in the outputs
      54c0237c
    • D
      Read the host sysinfo for the QEmu driver · 1e4c4599
      Daniel Veillard 提交于
      Read and store the data when initializing the driver.
      1e4c4599
  27. 30 10月, 2010 1 次提交
    • K
      add compression support for "virsh dump" · 95a17abd
      KAMEZAWA Hiroyuki 提交于
      Add dump_image_format[] to qemu.conf and support compressed dump
      at virsh dump. coredump compression is important for saving disk space
      in an environment where multiple guests run.
      
      In general, "disk space for dump" is specially allocated and will be
      a dead space in the system. It's used only at emergency. So, it's better
      to have both of save_image_format and dump_image_format. "save" is done
      in scheduled manner with enough calculated disk space for it.
      
      This code reuses some of save_image_format[] and supports the same format.
      
      Changelog:
       - modified libvirtd_qemu.aug
       - modified test_libvirtd_qemu.aug
       - fixed error handling of qemudSaveCompressionTypeFromString()
      95a17abd
  28. 26 10月, 2010 1 次提交
    • J
      qemu: Fix detection of drive readonly option · 69b75521
      Jiri Denemark 提交于
      So far, readonly=on option is used when qemu supports -device. However,
      there are qemu versions which support readonly option with -drive
      although they don't have support for -device.
      69b75521
  29. 20 10月, 2010 1 次提交
    • J
      Add process= support for 'qemu-kvm -name' · c08c7b01
      John Morrissey 提交于
      This sets the process name to the same value as the Windows title,
      but since the name is limited to 16 chars only this is kept as a
      configuration option and turned off by default
      * src/qemu/qemu.conf src/qemu/qemu_conf.[ch]: hceck for support in the
        QEmu help output, add the option in qemu conf file and augment
        qemudBuildCommandLine to add it if switched on
      * src/qemu/libvirtd_qemu.aug src/qemu/test_libvirtd_qemu.aug: augment
        the augeas lenses accordingly
      * tests/qemuhelptest.c: cope with the extra flag being detected now
      c08c7b01
  30. 13 10月, 2010 2 次提交
    • D
      Enable support for nested SVM · f98a6cd6
      Daniel P. Berrange 提交于
      This enables support for nested SVM using the regular CPU
      model/features block. If the CPU model or features include
      'svm', then the '-enable-nesting' flag will be added to the
      QEMU command line. Latest out of tree patches for nested
      'vmx', no longer require the '-enable-nesting' flag. They
      instead just look at the cpu features. Several of the models
      already include svm support, but QEMU was just masking out
      the svm bit silently. So this will enable SVM on such
      models
      
      * src/qemu/qemu_conf.h: flag for -enable-nesting
      * src/qemu/qemu_conf.c: Use -enable-nesting if VMX or SVM are in
        the CPUID
      * src/cpu/cpu.h, src/cpu/cpu.c: API to check for a named feature
      * src/cpu/cpu_x86.c: x86 impl of feature check
      * src/libvirt_private.syms: Add cpuHasFeature
      * src/qemuhelptest.c: Add nesting flag where required
      f98a6cd6
    • D
      Implement support for virtio plan9fs filesystem passthrough in QEMU · a5c646a7
      Daniel P. Berrange 提交于
      Make use of the existing <filesystem> element to support plan9fs
      filesystem passthrough in the QEMU driver
      
          <filesystem type='mount'>
            <source dir='/export/to/guest'/>
            <target dir='/import/from/host'/>
          </filesystem>
      
      NB, the target is not actually a directory, it is merely a arbitrary
      string tag that is exported to the guest as a hint for where to mount
      it.
      a5c646a7
  31. 23 8月, 2010 1 次提交
    • D
      Add support for -enable-kqemu flag · 6e44ec7a
      Daniel P. Berrange 提交于
      Previously QEMU enabled KQEMU by default and had -no-kqemu.
      0.11.x switched to requiring -enable-kqemu. 0.12.x dropped
      kqemu entirely. This patch adds support for -enable-kqemu
      so 0.11.x works. It replaces a huge set of if() with a
      switch() to make the code a bit more readable.
      
      * src/qemu/qemu_conf.c, src/qemu/qemu_conf.h: Support
        -enable-kqemu
      6e44ec7a