1. 03 2月, 2010 8 次提交
    • D
      Re-arrange QEMU device alias assignment code · 16478459
      Daniel P. Berrange 提交于
      This patch re-arranges the QEMU device alias assignment code to
      make it easier to call into the same codeblock when performing
      device hotplug. The new code has the ability to skip over already
      assigned names to facilitate hotplug
      
      * src/qemu/qemu_driver.c: Call qemuAssignDeviceNetAlias()
        instead of qemuAssignNetNames
      * src/qemu/qemu_conf.h: Export qemuAssignDeviceNetAlias()
        instead of qemuAssignNetNames
      * src/qemu/qemu_driver.c: Merge the legacy disk/network alias
        assignment code into the main methods
      16478459
    • D
      Remove direct storage of hostnet_name & vlan · 0943048a
      Daniel P. Berrange 提交于
      The current way of assigning names to the host network backend and
      NIC device in QEMU was over complicated, by varying naming scheme
      based on the NIC model and backend type. This simplifies the naming
      to simply be 'net0' and 'hostnet0', allowing code to easily determine
      the host network name and vlan based off the primary device alias
      name 'net0'. This in turn allows removal of alot of QEMU specific
      code from the XML parser, and makes it easier to assign new unique
      names for NICs that are hotplugged
      
      * src/conf/domain_conf.c, src/conf/domain_conf.h: Remove hostnet_name
        and vlan fields from virNetworkDefPtr
      * src/qemu/qemu_conf.c, src/qemu/qemu_conf.h, src/qemu/qemu_driver.c:
        Use a single network alias naming scheme regardless of NIC type
        or backend type. Determine VLANs from the alias name.
      * tests/qemuxml2argvdata/qemuxml2argv-net-eth-names.args,
        tests/qemuxml2argvdata/qemuxml2argv-net-virtio-device.args,
        tests/qemuxml2argvdata/qemuxml2argv-net-virtio-netdev.args: Update
        for new simpler naming scheme
      0943048a
    • D
      Remove use of -netdev arg with QEMU · 49a0f6cd
      Daniel P. Berrange 提交于
      The QEMU 0.12.x tree has the -netdev command line argument, but not
      corresponding monitor command. We can't enable the former, without
      the latter since it will break hotplug/unplug.
      
      * src/qemu/qemu_conf.c, src/qemu/qemu_conf.h: Disable -netdev usage
        until 0.13 at earliest
      * tests/qemuxml2argvtest.c: Add test for -netdev syntax
      * tests/qemuxml2argvdata/qemuxml2argv-net-virtio-netdev.args,
        tests/qemuxml2argvdata/qemuxml2argv-net-virtio-netdev.xml: Test
        data files for -netdev syntax
      49a0f6cd
    • D
      Assign PCI addresses before hotplugging devices · d8acc446
      Daniel P. Berrange 提交于
      PCI disk, disk controllers, net devices and host devices need to
      have PCI addresses assigned before they are hot-plugged
      
      * src/qemu/qemu_conf.c: Add APIs for ensuring a device has an
        address and releasing unused addresses
      * src/qemu/qemu_driver.c: Ensure all devices have addresses
        when hotplugging.
      d8acc446
    • D
      Rewrite way QEMU PCI addresses are allocated · 9258ec0a
      Daniel P. Berrange 提交于
      The current QEMU code allocates PCI addresses incrementally starting
      at 4. This is not satisfactory because the user may have given some
      addresses in their XML config, which need to be skipped over when
      allocating addresses to remaining devices.
      
      It is thus neccessary to maintain a list of already allocated PCI
      addresses and then only allocate ones that remain unused. This is
      also required for domain device hotplug to work properly later.
      
      * src/qemu/qemu_conf.c, src/qemu/qemu_conf.h: Add APIs for creating
        list of existing PCI addresses, and allocating new addresses.
        Refactor address assignment to use this code
      * src/qemu/qemu_driver.c: Pull PCI address assignment up into the
        qemuStartVMDaemon() method, as a prelude to moving it into the
        'define' method. Update list of allocated addresses when connecting
        to a running VM at daemon startup.
      * tests/qemuxml2argvtest.c, tests/qemuargv2xmltest.c,
        tests/qemuxml2xmltest.c: Remove USB product test since all
        passthrough is done based on address
      * tests/qemuxml2argvdata/qemuxml2argv-hostdev-usb-product.args,
        tests/qemuxml2argvdata/qemuxml2argv-hostdev-usb-product.xml: Kil
        unused data files
      9258ec0a
    • D
      Introduce generic virDomainDeviceInfo iterator function · 3fdef8cf
      Daniel P. Berrange 提交于
      The virDomainDeviceInfoIterate() function will provide a
      convenient way to iterate over all devices in a domain.
      
      * src/conf/domain_conf.c, src/conf/domain_conf.h,
        src/libvirt_private.syms: Add virDomainDeviceInfoIterate()
        function.
      3fdef8cf
    • D
      Make hotplug use new device_add where possible · 264e98d6
      Daniel P. Berrange 提交于
      Since QEMU startup uses the new -device argument, the hotplug
      code needs todo the same. This converts disk, network and
      host device hotplug to use the device_add command
      
      * src/qemu/qemu_driver.c: Use new device_add monitor APIs
        whereever possible
      264e98d6
    • D
      Introduce internal QEMU monitor APIs for drive + device hotadd · 5ec6cf7f
      Daniel P. Berrange 提交于
      The way QEMU is started has been changed to use '-device' and
      the new style '-drive' syntax. This needs to be mirrored in
      the hotplug code, requiring addition of two new APIs.
      
      * src/qemu/qemu_monitor.h, src/qemu/qemu_monitor.c: Define APIs
        qemuMonitorAddDevice() and qemuMonitorAddDrive()
      * src/qemu/qemu_monitor_json.c, src/qemu/qemu_monitor_json.h,
        src/qemu/qemu_monitor_text.c, src/qemu/qemu_monitor_text.h:
        Implement the new monitor APIs
      5ec6cf7f
  2. 02 2月, 2010 11 次提交
  3. 01 2月, 2010 5 次提交
    • J
      Log flags in virConnectCompareCPU · 0ea01289
      Jiri Denemark 提交于
      * src/libvirt.c: extend the debug statement to log flags too
      0ea01289
    • C
      Fix PCI host reattach on domain detach. · 29727bac
      Chris Lalancette 提交于
      Similar to the race fixed by
      be34c3c7, make sure
      to wait around for KVM to release the resources from
      a hot-detached PCI device before attempting to
      rebind that device to the host driver.
      Signed-off-by: NChris Lalancette <clalance@redhat.com>
      29727bac
    • M
      Clarify controllers -device string in QEMU driver · 09080c38
      Matthew Booth 提交于
      The QEMU driver contained code to generate a -device string for piix4-ide, but
      wasn't using it. This change removes this string generation. It also adds a
      comment explaining why IDE and FDC controllers don't generate -device strings.
      
      The change also generates an error if a sata controller is specified for a QEMU
      domain, as this isn't supported.
      
      * src/qemu/qemu_conf.c: Remove VIR_DOMAIN_CONTROLLER_TYPE_IDE handler in
        qemuBuildControllerDevStr(). Ignore IDE and FDC controllers. Error if
        SATA controller is discovered. Add comments.
      09080c38
    • C
      Fix up a comment in virHashUpdateEntry · 62a30a49
      Chris Lalancette 提交于
      Signed-off-by: NChris Lalancette <clalance@redhat.com>
      62a30a49
    • C
      Look in /usr/libexec for the qemu-kvm binary. · b16cd226
      Chris Lalancette 提交于
      On RHEL-5 the qemu-kvm binary is located in /usr/libexec.
      To reduce confusion for people trying to run upstream libvirt
      on RHEL-5 machines, make the qemu driver look in /usr/libexec
      for the qemu-kvm binary.
      
      To make this work, I modified virFindFileInPath to handle an
      absolute path correctly.  I also ran into an issue where
      NULL was sometimes being passed for the file parameter
      to virFindFileInPath; it didn't crash prior to this patch
      since it was building paths like /usr/bin/(null).  This
      is non-standard behavior, though, so I added a NULL
      check at the beginning.
      Signed-off-by: NChris Lalancette <clalance@redhat.com>
      b16cd226
  4. 30 1月, 2010 2 次提交
  5. 28 1月, 2010 1 次提交
    • J
      Support Xen 4.0 sysctl version 7 · 3bd3d6b0
      Jim Fehlig 提交于
      xen-unstable c/s 20762 bumped XEN_SYSCTL_INTERFACE_VERSION to 7.  The
      interface change does not affect libvirt, other than xenHypervisorInit()
      failing since version 7 is not tried.
      
      The attached patch accommodates the upcoming Xen 4.0 release by checking
      for XEN_SYSCTL_INTERFACE_VERSION 7.  If found, it sets
      XEN_DOMCTL_INTERFACE_VERSION to 6, which is also new to Xen 4.0.
      3bd3d6b0
  6. 27 1月, 2010 10 次提交
  7. 26 1月, 2010 3 次提交
    • J
      hostusb: closedir only if non-NULL; rename labels: s/error/cleanup/ · fb54230b
      Jim Meyering 提交于
      * src/util/hostusb.c (usbSysReadFile): Rename labels s/error/cleanup/
      (usbFindBusByVendor): Likewise.  And closedir only if non-NULL.
      fb54230b
    • L
      Cleanup of large buffer on stack in virFileMakePath · ba1d379c
      Laine Stump 提交于
      virFileMakePath is a recursive function that was creates a buffer
      PATH_MAX bytes long for each recursion (one recursion for each element
      in the path). This changes it to have no buffers on the stack, and to
      allocate just one buffer total, no matter how many elements are in the
      path. Because the modified algorithm requires a char* to be passed in
      rather than const char *, it is now 2 functions - a toplevel API
      function that remains identical in function, and a 2nd helper function
      called for the recursions, which 1) doesn't allocate anything, and 2)
      takes a char* arg, so it can modify the contents.
      * src/util/util.c: rewrite virFileMakePath
      ba1d379c
    • M
      854111f9