1. 16 1月, 2010 7 次提交
    • 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
    • D
      Convert monitor over to use virDomainDeviceAddress · ab0da52b
      Daniel P. Berrange 提交于
      Convert the QEMU monitor APIs over to use virDomainDeviceAddress
      structs for passing addresses in/out, instead of individual bits.
      This makes the number of parameters smaller & easier to deal with.
      No functional change
      
      * src/qemu/qemu_driver.c, src/qemu/qemu_monitor.c,
        src/qemu/qemu_monitor.h, src/qemu/qemu_monitor_text.c,
        src/qemu/qemu_monitor_text.h: Change monitor hotplug APIs to
        take an explicit address ptr for all host/guest addresses
      ab0da52b
    • W
      Add new domain device: "controller" · 74ec5e65
      Wolfgang Mauerer 提交于
      This augments virDomainDevice with a <controller> element
      that is used to represent disk controllers (e.g., scsi
      controllers). The XML format is given by
      
        <controller type="scsi" index="<num>">
           <address type="pci" domain="0xNUM" bus="0xNUM" slot="0xNUM"/>
        </controller>
      
      where type denotes the disk interface (scsi, ide,...), index
      is an integer that identifies the controller for association
      with disks, and the <address> element specifies the controller
      address on the PCI bus as described in previous commits
      The address element can be omitted; in this case, an address
      will be assigned automatically.
      
      Most of the code in this patch is from Wolfgang Mauerer's
      previous disk controller series
      
       * docs/schemas/domain.rng: Define syntax for <controller>
         XML element
       * src/conf/domain_conf.c, src/conf/domain_conf.h: Define
         virDomainControllerDef struct, and routines for parsing
         and formatting XML
      * src/libvirt_private.syms: Add virDomainControllerInsert
         and virDomainControllerDefFree
      74ec5e65
    • D
      Set default disk controller/bus/unit props · 776e37e1
      Daniel P. Berrange 提交于
      When parsing the <disk> element specification, if no <address>
      is provided for the disk, then automatically assign one based on
      the <target dev='sdXX'/> device name. This provides for backwards
      compatability with existing applications using libvirt, while also
      allowing new apps to have complete fine grained control.
      
      * src/conf/domain_conf.h, src/conf/domain_conf.c,
        src/libvirt_private.syms: Add virDomainDiskDefAssignAddress()
        for assigning a controller/bus/unit address based on disk target
      * src/qemu/qemu_conf.c: Call virDomainDiskDefAssignAddress() after
        generating XML from ARGV
      * tests/qemuxml2argvdata/*.xml: Add in drive address information
        to all XML files
      776e37e1
    • D
      Add address info to sound, video and watchdog devices · a9e4ea94
      Daniel P. Berrange 提交于
      Add the virDomainDeviceAddress information to the sound, video
      and watchdog devices. This means all of them gain the new XML
      element
      
        <address .... />
      
      This brings them upto par with disk/net/hostdev devices which
      already have address info
      
      * src/conf/domain_conf.h: Add virDomainDeviceAddress to sound,
        video & watchdog device struts.
      * src/conf/domain_conf.c: Hook up parsing/formatting for
        virDomainDeviceAddress in sound, video & watchdog devices
      * docs/schemas/domain.rng: Associate device address info
        with sound, video & watchdog
      a9e4ea94
    • D
      Extend the virDomainDeviceAddress struture to allow disk controller addresses · d812e7ae
      Daniel P. Berrange 提交于
      Introduce a new structure
      
            struct _virDomainDeviceDriveAddress {
              unsigned int controller;
              unsigned int bus;
              unsigned int unit;
            };
      
      and plug that into virDomainDeviceAddress and generates XML that
      looks like
      
        <address type='drive' controller='1' bus='0' unit='5'/>
      
      This syntax will be used by the QEMU driver to explicitly control
      how drives are attached to the bus
      
      * src/conf/domain_conf.h, src/conf/domain_conf.c: Parsing and
        formatting of drive addresses
      * docs/schemas/domain.rng: Define new address format for drives
      d812e7ae
    • D
      Introduce a standardized data structure for device addresses · 1b0cce7d
      Daniel P. Berrange 提交于
      All guest devices now use a common device address structure
      summarized by:
      
        enum virDomainDeviceAddressType {
          VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE,
          VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI,
        };
      
        struct _virDomainDevicePCIAddress {
          unsigned int domain;
          unsigned int bus;
          unsigned int slot;
          unsigned int function;
        };
      
        struct _virDomainDeviceInfo {
          int type;
          union {
              virDomainDevicePCIAddress pci;
          } addr;
        };
      
      This replaces the anonymous structs in Disk/Net/Hostdev data
      structures. Where available, the address is *always* printed
      in the XML file, instead of being hidden in the internal state
      file.
      
        <address type='pci' domain='0x0000' bus='0x1e' slot='0x07' function='0x0'/>
      
      The structure definition is based on Wolfgang Mauerer's disk
      controller patch series.
      
      * docs/schemas/domain.rng: Define the <address> syntax and
        associate it with disk/net/hostdev devices
      * src/conf/domain_conf.h, src/conf/domain_conf.c,
        src/libvirt_private.syms: APIs for parsing/formatting address
        information. Also remove the QEMU specific 'pci_addr' attributes
      * src/qemu/qemu_driver.c: Replace use of 'pci_addr' attrs with
        new standardized format.
      1b0cce7d
  2. 15 1月, 2010 3 次提交
  3. 14 1月, 2010 3 次提交
  4. 13 1月, 2010 5 次提交
    • C
      node_device: udev: Fix memory leak · d0b97e82
      Cole Robinson 提交于
      We are setting the same property two different ways without
      free'ing in between. Just drop the second assignment.
      d0b97e82
    • C
      node_device: udev: Enumerate floppy devices · c198f51a
      Cole Robinson 提交于
      There are quite a few differences between how udev exposes legacy
      and USB floppy devs, but this patch takes care of both variants.
      c198f51a
    • C
      node_device: udev: Use base 16 for product/vendor · 3238081e
      Cole Robinson 提交于
      udev doesn't prefix USB product/vendor info with '0x', so the
      strtol conversions were wrong for the product field (vendor already
      set the correct base). Make the change for PCI product/vendor as
      well to be safe.
      
      This fixes USB device assignment via virt-manager.
      3238081e
    • C
      util: Remove logging handlers in virExec · 28613908
      Cole Robinson 提交于
      This allows debug statements and raised errors in hook functions to
      actually be logged somewhere (stderr). Users can enable debugging in the
      daemon and now see more info in /var/log/libvirt/...
      28613908
    • J
      Fix migration in xend driver · 6c6fbac7
      Jim Fehlig 提交于
      Upstream xen has changed parameters to the migration operation
      several times over the past 18 months.  Changeset 17553 removed
      the resouce parameter,  Changesets 17709, 17753, and 20326 added
      ssl, node, and change_home_server parameters respectively.
      
      Fortunately, testing has revealed that xend will fail the
      operation if a parameter is missing but happily honor it if
      unknown parameters are provided.  Thus all currently supported
      parameters can be provided, satisfying current xend but not
      regressing older versions.
      6c6fbac7
  5. 12 1月, 2010 6 次提交
    • C
      qemu: Disable errors in qemudShutdownVMDaemon · 978dd6d4
      Cole Robinson 提交于
      978dd6d4
    • C
      libvirt.c: Preserve MigratePerform failure · e85065b8
      Cole Robinson 提交于
      e85065b8
    • C
      qemu: migrate: Save MigratePerform error in MigrateFinish. · a9d12c24
      Cole Robinson 提交于
      This way we won't squash the original error report in
      MigratePerform, as is done for P2P and Tunneled migration.
      a9d12c24
    • C
      virterror: Add virSetError · fd5eb45b
      Cole Robinson 提交于
      Can be used to re-set an old error, which may have been squashed by
      other functions (like cleanup routines). Will be used in subsequent patches
      fd5eb45b
    • D
      Ensure error handling callback functions are called from safe context · 3a80f2f7
      Daniel P. Berrange 提交于
      The virRaiseErrorFull() may invoke the error handler callback
      functions an application has registered. This is not good
      because the connection object may not be available at this
      point, and the caller may be holding locks. This creates a
      problem if the error handler calls back into libvirt.
      
      The solutuon is to move invocation of the handler into the
      final cleanup code in the public API entry points, where it
      is guarenteed to have safe state.
      
      * src/libvirt.c: Invoke virDispatchError() in all error paths
      * src/util/virterror.c: Remove virSetConnError/virSetGlobalError,
        replacing with virDispatchError(). Move invocation of the
        error callbacks into virDispatchError() instead of the
        virRaiseErrorFull function which is not in a safe context
      3a80f2f7
    • M
      qemu: Fix a memory leak in qemudExtractTTYPath · f01ee2ac
      Matthias Bolte 提交于
      qemudWaitForMonitor calls qemudReadLogOutput with qemudFindCharDevicePTYs
      as callback. qemudFindCharDevicePTYs calls qemudExtractTTYPath to assign
      a string to chr->data.file.path. Afterwards qemudWaitForMonitor may call
      qemudFindCharDevicePTYsMonitor that overwrites chr->data.file.path without
      freeing the old value. This results in leaking the memory allocated by
      qemudExtractTTYPath.
      
      Report an OOM error if the strdup in qemudFindCharDevicePTYsMonitor fails.
      f01ee2ac
  6. 11 1月, 2010 2 次提交
  7. 09 1月, 2010 5 次提交
  8. 08 1月, 2010 2 次提交
    • D
      Qemu: ask for memory preallocation with large pages · edcae5a7
      Daniel Veillard 提交于
      The -mem-prealloc flag should be used when using large pages
      This ensures qemu tries to allocate all required memory immediately,
      rather than when first used. The latter mode will crash qemu
      if hugepages aren't available when accessed, while the former
      should gracefully fallback to non-hugepages.
      
      * src/qemu/qemu_conf.c: add -mem-prealloc flag to qemu command line
        when using large pages
      edcae5a7
    • J
      xen hypervisor: xen domctl version 6 · 98ea78b6
      Jim Fehlig 提交于
      xen-unstable c/s 20685 changed the domctl interface, adding a field to
      xen_domctl_getdomaininfo structure.  This additional field causes stack
      corruption in libvirt.  xen-unstable c/s 20711 rightly bumped the domctl
      interface version so it is at least possible to handle the new field.
      This change accounts for shr_pages field added to xen_domctl_getdomaininfo
      structure.
      98ea78b6
  9. 07 1月, 2010 7 次提交
    • J
      network/bridge_driver.c: avoid potential NULL-dereference · 65160f50
      Jim Meyering 提交于
      * src/network/bridge_driver.c (networkBuildDnsmasqArgv): Correct
      test for NULL *argv.
      65160f50
    • M
      esx: Fix 'vpx' MAC address range and allow arbitrary MAC addresses · 96ceb124
      Matthias Bolte 提交于
      The MAC addresses with 00:50:56 prefix are split into several ranges:
      
        00:50:56:00:00:00 - 00:50:56:3f:ff:ff  'static' range (manually assigned)
        00:50:56:80:00:00 - 00:50:56:bf:ff:ff  'vpx' range (assigned by a VI Client)
      
      Erroneously the 'vpx' range was assumed to be larger and to occupy the
      remaining addresses of the 00:50:56 prefix that are not part of the 'static'
      range.
      
      00:50:56 was used as prefix for generated MAC addresses, this is not possible
      anymore, because there are gaps in the allowed ranges. Therefore, change the
      prefix to 00:0c:29 which is the prefix for auto generated MAC addresses anyway.
      
      Allow arbitrary MAC addresses to be used and set the checkMACAddress VMX option
      to false in case the MAC address doesn't fall into any predefined range.
      
      * docs/drvesx.html.in: update website accordingly
      * src/esx/esx_driver.c: set the auto generation prefix to 00:0c:29
      * src/esx/esx_vmx.c: fix MAC address range handling and allow arbitrary MAC
        addresses
      * tests/vmx2xml*, tests/xml2vmx*: add some basic MAC address range tests
      96ceb124
    • M
    • M
      esx: Fix and improve the libcurl debug callback · d9734072
      Matthias Bolte 提交于
      The data passed to the callback is not guaranteed to be zero terminated,
      take care of that by coping the data and adding a zero terminator.
      
      Also dump the data for other types than CURLINFO_TEXT.
      
      Set CURLOPT_VERBOSE to 1 so the debug callback is called when enabled.
      d9734072
    • M
      esx: Don't warn about an empty URI path · b0367e86
      Matthias Bolte 提交于
      b0367e86
    • M
      esx: Also allow virtualHW version 4 for ESX 4.0 · 44112bce
      Matthias Bolte 提交于
      A domain with virtualHW version 4 is allowed on an ESX 4.0 server.
      If a domain is migrated from an ESX 3.5 server to an ESX 4.0 server
      then the virtualHW version stays the same. So a ESX 4.0 server can
      host domains with virtualHW version 4.
      44112bce
    • M
      Don't free an uninitalized pointer in update_driver_name() · 338e7c3c
      Matthias Bolte 提交于
      This invalid free results in heap corruption. Some symptoms I saw
      because of this were libvirtd crashing and virt-manager hanging
      while trying to enumerate devices.
      338e7c3c