1. 17 7月, 2012 1 次提交
    • S
      Convert 'raw MAC address' usages to use virMacAddr · 387117ad
      Stefan Berger 提交于
      Introduce new members in the virMacAddr 'class'
      - virMacAddrSet: set virMacAddr from a virMacAddr
      - virMacAddrSetRaw: setting virMacAddr from raw 6 byte MAC address buffer
      - virMacAddrGetRaw: writing virMacAddr into raw 6 byte MAC address buffer
      - virMacAddrCmp: comparing two virMacAddr
      - virMacAddrCmpRaw: comparing a virMacAddr with a raw 6 byte MAC address buffer
      
      then replace raw MAC addresses by replacing
      
      - 'unsigned char *' with virMacAddrPtr
      - 'unsigned char ... [VIR_MAC_BUFLEN]' with virMacAddr
      
      and introduce usage of above functions where necessary.
      387117ad
  2. 11 7月, 2012 3 次提交
    • V
      S390: Add support for virtio-s390 devices. · d0304eaa
      Viktor Mihajlovski 提交于
      The s390(x) architecture doesn't feature a PCI bus. For the purpose of
      supporting virtio devices a virtual bus called virtio-s390 is used.
      A new address type VIR_DOMAIN_DEVICE_ADDRESS_TYPE_VIRTIO_S390 is used to
      distinguish the virtio devices on s390 from PCI-based virtio devices.
      
      V3 Change: updated QEMU_CAPS_VIRTIO_S390 to fit upstream.
      Signed-off-by: NViktor Mihajlovski <mihajlov@linux.vnet.ibm.com>
      d0304eaa
    • V
      qemu: Extended qemuDomainAssignAddresses to be callable from everywhere. · f5dd58a6
      Viktor Mihajlovski 提交于
      This is in preparation of the enablement of s390 guests with virtio devices.
      
      The assignment of device addresses happens in different places, i.e. the
      qemu driver and process modules as well as in the unit tests in slightly
      different flavors. Currently, these are PPC spapr-vio and PCI
      devices, virtio-s390 (not PCI based) will follow.
      
      By optionally passing to qemuDomainAssignAddresses the domain
      object and the capabilities it is now possible to call the function
      from most of the places (except for hotplug) where address assignment
      is done.
      Signed-off-by: NViktor Mihajlovski <mihajlov@linux.vnet.ibm.com>
      f5dd58a6
    • C
      Fix /domain/features setting in qemuParseCommandLine · 626dd518
      Christophe Fergeau 提交于
      Commit 5e6ce1 moved down detection of the ACPI feature in
      qemuParseCommandLine. However, when ACPI is detected, it clears
      all feature flags in def->features to only set ACPI. This used to
      be fine because this was the first place were def->features was set,
      but after the move this is no longer necessarily true because this
      block comes before the ACPI check:
      
      if (strstr(def->emulator, "kvm")) {
          def->virtType = VIR_DOMAIN_VIRT_KVM;
          def->features |= (1 << VIR_DOMAIN_FEATURE_PAE);
      }
      
      Since def is allocated in qemuParseCommandLine using VIR_ALLOC, we
      can always use |= when modifying def->features
      626dd518
  3. 05 7月, 2012 1 次提交
  4. 03 7月, 2012 1 次提交
  5. 21 6月, 2012 1 次提交
  6. 20 6月, 2012 1 次提交
  7. 08 6月, 2012 1 次提交
    • L
      Assign correct address type to spapr-vlan and spapr-vty. · 04a319ba
      Li Zhang 提交于
      For pseries guest, spapr-vlan and spapr-vty is based
      on spapr-vio address. According to model of network
      device, the address type should be assigned automatically.
      For serial device, serial pty device is recognized as
      spapr-vty device, which is also on spapr-vio.
      
      So this patch is to correct the address type of
      spapr-vlan and spapr-vty, and build correct
      command line of spapr-vty.
      Signed-off-by: NLi Zhang <zhlcindy@linux.vnet.ibm.com>
      Reviewed-by:   Michael Ellerman<michaele@au1.ibm.com>
      04a319ba
  8. 05 6月, 2012 1 次提交
  9. 02 6月, 2012 2 次提交
    • M
      qemu: move -name arg to be 1st in "ps x" output · 195fa214
      Marti Raudsepp 提交于
      Currently, monitoring QEMU virtual machines with standard Unix
      sysadmin tools is harder than it has to be. The QEMU command line is
      often miles long and mostly redundant, it's hard to tell which process
      is which.
      
      This patch reorders the QEMU -name argument to be the first, so it's
      immediately visible in "ps x", htop and "atop -c" output.
      195fa214
    • L
      qemu: fix netdev alias name assignment wrt type='hostdev' · 6734ce7b
      Laine Stump 提交于
      This patch resolves:
      
         https://bugzilla.redhat.com/show_bug.cgi?id=827519
      
      The problem is that an interface with type='hostdev' will have an
      alias of the form "hostdev%d", while the function that looks through
      existing netdevs to determine the name to use for a new addition will
      fail if there's an existing entry that does not match the form
      "net%d".
      
      This is another of the handful of places that need an exception due to
      the hybrid nature of <interface type='hostdev'> (which is not exactly
      an <interface> or a <hostdev>, but is both at the same time).
      6734ce7b
  10. 18 5月, 2012 1 次提交
  11. 16 5月, 2012 2 次提交
    • J
      qemu: Add support for -no-user-config · 63b42436
      Jiri Denemark 提交于
      Thanks to this new option we are now able to use modern CPU models (such
      as Westmere) defined in external configuration file.
      
      The qemu-1.1{,-device} data files for qemuhelptest are filled in with
      qemu-1.1-rc2 output for now. I will update those files with real
      qemu-1.1 output once it is released.
      63b42436
    • D
      Fix logic for assigning PCI addresses to USB2 companion controllers · 1ebd52cb
      Daniel P. Berrange 提交于
      Currently each USB2 companion controller gets put on a separate
      PCI slot. Not only is this wasteful of PCI slots, but it is not
      in compliance with the spec for USB2 controllers. The master
      echi1 and all companion controllers should be in the same slot,
      with echi1 in function 7, and uhci1-3 in functions 0-2 respectively.
      
      * src/qemu/qemu_command.c: Special case handling of USB2 controllers
        to apply correct pci slot assignment
      * tests/qemuxml2argvdata/qemuxml2argv-usb-ich9-ehci-addr.args,
        tests/qemuxml2argvdata/qemuxml2argv-usb-ich9-ehci-addr.xml: Expand
        test to cover automatic slot assignment
      1ebd52cb
  12. 15 5月, 2012 1 次提交
  13. 09 5月, 2012 1 次提交
  14. 01 5月, 2012 1 次提交
  15. 23 4月, 2012 1 次提交
    • P
      cpu: Improve error reporting on incompatible CPUs · a2ba53cf
      Peter Krempa 提交于
      This patch modifies the CPU comparrison function to report the
      incompatibilities in more detail to ease identification of problems.
      
      * src/cpu/cpu.h:
          cpuGuestData(): Add argument to return detailed error message.
      * src/cpu/cpu.c:
          cpuGuestData(): Add passthrough for error argument.
      * src/cpu/cpu_x86.c
          x86FeatureNames(): Add function to convert a CPU definition to flag
                             names.
          x86Compute(): - Add error message parameter
                        - Add macro for reporting detailed error messages.
                        - Improve error reporting.
                        - Simplify calculation of forbidden flags.
          x86DataIteratorInit():
          x86cpuidMatchAny(): Remove functions that are no longer needed.
      * src/qemu/qemu_command.c:
          qemuBuildCpuArgStr(): - Modify for new function prototype
                                - Add detailed error reports
                                - Change error code on incompatible processors
                                  to VIR_ERR_CONFIG_UNSUPPORTED instead of
                                  internal error
      * tests/cputest.c:
          cpuTestGuestData(): Modify for new function prototype
      a2ba53cf
  16. 18 4月, 2012 1 次提交
    • E
      qemu: use consistent error when qemu binary is too old · 6fb8a64d
      Eric Blake 提交于
      Most of our errors complaining about an inability to support a
      particular action due to qemu limitations used CONFIG_UNSUPPORTED,
      but we had a few outliers.  Reported by Jiri Denemark.
      
      * src/qemu/qemu_command.c (qemuBuildDriveDevStr): Prefer
      CONFIG_UNSUPPORTED.
      * src/qemu/qemu_driver.c (qemuDomainReboot)
      (qemuDomainBlockJobImpl): Likewise.
      * src/qemu/qemu_hotplug.c (qemuDomainAttachPciControllerDevice):
      Likewise.
      * src/qemu/qemu_monitor.c (qemuMonitorTransaction)
      (qemuMonitorBlockJob, qemuMonitorSystemWakeup): Likewise.
      6fb8a64d
  17. 17 4月, 2012 2 次提交
    • O
      qemu: Split ide-drive into ide-cd and ide-hd · a4cda054
      Osier Yang 提交于
      A "ide-drive" device can be either a hard disk or a CD-ROM,
      if there is ",media=cdrom" specified for the backend, it's
      a CD-ROM, otherwise it's a hard disk.
      
      Upstream qemu splitted "ide-drive" into "ide-hd" and "ide-cd"
      since commit 1f56e32, and ",media=cdrom" is not required for
      ide-cd anymore. "ide-drive" is still supported for backwards
      compatibility, but no doubt we should go foward.
      a4cda054
    • O
      qemu: Split scsi-disk into into scsi-hd and scsi-cd · 02e8d0cf
      Osier Yang 提交于
      A "scsi-disk" device can be either a hard disk or a CD-ROM,
      if there is ",media=cdrom" specified for the backend, it's
      a CD-ROM, otherwise it's a hard disk.
      
      But upstream qemu splitted "scsi-disk" into "scsi-hd" and
      "scsi-cd" since commit b443ae, and ",media=cdrom" is not
      required for scsi-cd anymore. "scsi-disk" is still supported
      for backwards compatibility, but no doubt we should go
      foward.
      02e8d0cf
  18. 10 4月, 2012 1 次提交
    • D
      Wire up <loader> to set the QEMU BIOS path · ddf2dfa1
      Daniel P. Berrange 提交于
      * src/qemu/qemu_command.c: Wire up -bios with <loader>
      * tests/qemuxml2argvdata/qemuxml2argv-bios.args,
        tests/qemuxml2argvdata/qemuxml2argv-bios.xml: Expand
        existing BIOS test case to cover <loader>
      ddf2dfa1
  19. 02 4月, 2012 1 次提交
    • P
      Support clock=variable relative to localtime · b8bf79aa
      Philipp Hahn 提交于
      Since Xen 3.1 the clock=variable semantic is supported. In addition to
      qemu/kvm Xen also knows about a variant where the offset is relative to
      'localtime' instead of 'utc'.
      
      Extends the libvirt structure with a flag 'basis' to specify, if the
      offset is relative to 'localtime' or 'utc'.
      
      Extends the libvirt structure with a flag 'reset' to force the reset
      behaviour of 'localtime' and 'utc'; this is needed for backward
      compatibility with previous versions of libvirt, since they report
      incorrect XML.
      
      Adapt the only user 'qemu' to the new name.
      Extend the RelaxNG schema accordingly.
      Document the new 'basis' attribute in the HTML documentation.
      Adapt test for the new attribute.
      Signed-off-by: NPhilipp Hahn <hahn@univention.de>
      b8bf79aa
  20. 31 3月, 2012 3 次提交
    • E
      qemu: reflect any memory rounding back to xml · 095b0bc4
      Eric Blake 提交于
      If we round up a user's memory request, we should update the XML
      to reflect the actual value in use by the VM, rather than giving
      an artificially small value back to the user.
      
      * src/qemu/qemu_command.c (qemuBuildNumaArgStr)
      (qemuBuildCommandLine): Reflect rounding back to XML.
      095b0bc4
    • L
      qemu: eliminate nested switch, simplify code · ecde1591
      Laine Stump 提交于
      qemuBuildHostNetStr had a switch-within-a-switch where both were
      looking at the same variable. This was apparently to take advantage of
      code common to three different cases (while also taking care of some
      code that was different). However, there were only 2 lines common to
      all, one of those can be eliminated by merging it into the
      virAsprintfs that are in each case. On top of that, all the extra
      empty cases cause Coverity complaints (because they are unreachable),
      but absence of the empty cases causes a compile error due to
      "enumeration value not handled in switch".
      
      The solution is to just make each toplevel case independent, folding
      in the common code to each.
      ecde1591
    • L
      qemu: set default name for SPICE agent channel when generating command · 3269ee65
      Laine Stump 提交于
      commit b0e2bb33 set a default value for the SPICE agent channel by
      inserting it during parsing of the channel XML. That method of setting
      a default is problematic because it makes a format/parse roundtrip
      unclean, and experience with setting other values as a side effect of
      parsing has led to headaches (e.g. automatically setting a MAC address
      in the parser when one isn't specified in the input XML).
      
      This patch does not revert commit b0e2bb33 (it will be reverted in a
      separate patch) but adds the alternate implementation of simply
      inserting the default value in the appropriate place on the qemu
      commandline when no value is provided.
      3269ee65
  21. 27 3月, 2012 1 次提交
    • M
      Cleanup for a return statement in source files · 9943276f
      Martin Kletzander 提交于
      Return statements with parameter enclosed in parentheses were modified
      and parentheses were removed. The whole change was scripted, here is how:
      
      List of files was obtained using this command:
      git grep -l -e '\<return\s*([^()]*\(([^()]*)[^()]*\)*)\s*;' |             \
      grep -e '\.[ch]$' -e '\.py$'
      
      Found files were modified with this command:
      sed -i -e                                                                 \
      's_^\(.*\<return\)\s*(\(\([^()]*([^()]*)[^()]*\)*\))\s*\(;.*$\)_\1 \2\4_' \
      -e 's_^\(.*\<return\)\s*(\([^()]*\))\s*\(;.*$\)_\1 \2\3_'
      
      Then checked for nonsense.
      
      The whole command looks like this:
      git grep -l -e '\<return\s*([^()]*\(([^()]*)[^()]*\)*)\s*;' |             \
      grep -e '\.[ch]$' -e '\.py$' | xargs sed -i -e                            \
      's_^\(.*\<return\)\s*(\(\([^()]*([^()]*)[^()]*\)*\))\s*\(;.*$\)_\1 \2\4_' \
      -e 's_^\(.*\<return\)\s*(\([^()]*\))\s*\(;.*$\)_\1 \2\3_'
      9943276f
  22. 23 3月, 2012 2 次提交
  23. 14 3月, 2012 1 次提交
  24. 13 3月, 2012 1 次提交
    • M
      graphics: Cleanup port policy · 2e4defdc
      Michal Privoznik 提交于
      Even though we say in documentation setting (tls-)port to -1 is legacy
      compat style for enabling autoport, we're roughly doing this for VNC.
      However, in case of SPICE auto enable autoport iff both port & tlsPort
      are equal -1 as documentation says autoport plays with both.
      2e4defdc
  25. 12 3月, 2012 2 次提交
    • E
      qemu: support disk filenames with comma · 6e0ff1d4
      Eric Blake 提交于
      If there is a disk file with a comma in the name, QEmu expects a double
      comma instead of a single one (e.g., the file "virtual,disk.img" needs
      to be specified as "virtual,,disk.img" in QEmu's command line). This
      patch fixes libvirt to work with that feature. Fix RHBZ #801036.
      
      Based on an initial patch by Crístian Viana.
      
      * src/util/buf.h (virBufferEscape): Alter signature.
      * src/util/buf.c (virBufferEscape): Add parameter.
      (virBufferEscapeSexpr): Fix caller.
      * src/qemu/qemu_command.c (qemuBuildRBDString): Likewise.  Also
      escape commas in file names.
      (qemuBuildDriveStr): Escape commas in file names.
      * docs/schemas/basictypes.rng (absFilePath): Relax RNG to allow
      commas in input file names.
      * tests/qemuxml2argvdata/*-disk-drive-network-sheepdog.*: Update
      test.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      6e0ff1d4
    • D
      Fix a few typo in translated strings · dd39f13a
      Daniel Veillard 提交于
      this was raised by our hindi localization team
      chandan kumar <chandankumar.093047@gmail.com>
      dd39f13a
  26. 09 3月, 2012 3 次提交
    • M
      qemuBuildCommandLine: Don't add tlsPort if none set · ee490732
      Michal Privoznik 提交于
      If user hasn't supplied any tlsPort we default to setting it
      to zero in our internal structure. However, when building command
      line we test it against -1 which is obviously wrong.
      ee490732
    • P
      qemu: spice agent-mouse support · 896e6ac4
      Peng Zhou 提交于
      spice agent-mouse support
      
      Usage:
        <graphics type='spice'>
          <mouse mode='client'|'server'/>
        <graphics/>
      Signed-off-by: NOsier Yang <jyang@redhat.com>
      896e6ac4
    • A
      Attach vm-id to Open vSwitch interfaces. · ac8bbdbd
      Ansis Atteka 提交于
      This patch will allow OpenFlow controllers to identify which interface
      belongs to a particular VM by using the Domain UUID.
      
      ovs-vsctl get Interface vnet0 external_ids
      {attached-mac="52:54:00:8C:55:2C", iface-id="83ce45d6-3639-096e-ab3c-21f66a05f7fa", iface-status=active, vm-id="142a90a7-0acc-ab92-511c-586f12da8851"}
      
      V2 changes:
      Replaced vm-uuid with vm-id. There was a discussion in Open vSwitch
      mailinglist that we should stick with the same DB key postfixes for the
      sake of consistency (e.g iface-id, vm-id ...).
      ac8bbdbd
  27. 08 3月, 2012 1 次提交
    • E
      xml: use better types for memory values · 4888f0fb
      Eric Blake 提交于
      Using 'unsigned long' for memory values is risky on 32-bit platforms,
      as a PAE guest can have more than 4GiB memory.  Our API is
      (unfortunately) locked at 'unsigned long' and a scale of 1024, but
      the rest of our system should consistently use 64-bit values,
      especially since the previous patch centralized overflow checking.
      
      * src/conf/domain_conf.h (_virDomainDef): Always use 64-bit values
      for memory.  Change hugepage_backed to a bool.
      * src/conf/domain_conf.c (virDomainDefParseXML)
      (virDomainDefCheckABIStability, virDomainDefFormatInternal): Fix
      clients.
      * src/vmx/vmx.c (virVMXFormatConfig): Likewise.
      * src/xenxs/xen_sxpr.c (xenParseSxpr, xenFormatSxpr): Likewise.
      * src/xenxs/xen_xm.c (xenXMConfigGetULongLong): New function.
      (xenXMConfigGetULong, xenXMConfigSetInt): Avoid truncation.
      (xenParseXM, xenFormatXM): Fix clients.
      * src/phyp/phyp_driver.c (phypBuildLpar): Likewise.
      * src/openvz/openvz_driver.c (openvzDomainSetMemoryInternal):
      Likewise.
      * src/vbox/vbox_tmpl.c (vboxDomainDefineXML): Likewise.
      * src/qemu/qemu_command.c (qemuBuildCommandLine): Likewise.
      * src/qemu/qemu_process.c (qemuProcessStart): Likewise.
      * src/qemu/qemu_monitor.h (qemuMonitorGetBalloonInfo): Likewise.
      * src/qemu/qemu_monitor_text.h (qemuMonitorTextGetBalloonInfo):
      Likewise.
      * src/qemu/qemu_monitor_text.c (qemuMonitorTextGetBalloonInfo):
      Likewise.
      * src/qemu/qemu_monitor_json.h (qemuMonitorJSONGetBalloonInfo):
      Likewise.
      * src/qemu/qemu_monitor_json.c (qemuMonitorJSONGetBalloonInfo):
      Likewise.
      * src/qemu/qemu_driver.c (qemudDomainGetInfo)
      (qemuDomainGetXMLDesc): Likewise.
      * src/uml/uml_conf.c (umlBuildCommandLine): Likewise.
      4888f0fb
  28. 06 3月, 2012 2 次提交
    • L
      qemu: support type='hostdev' network devices at domain start · 8639a420
      Laine Stump 提交于
      This patch makes sure that each network device ("interface") of
      type='hostdev' appears on both the hostdevs list and the nets list of
      the virDomainDef, and it modifies the qemu driver startup code so that
      these devices will be presented to qemu on the commandline as hostdevs
      rather than as network devices.
      
      It does not add support for hotplug of these type of devices, or code
      to honor the <mac address> or <virtualport> given in the config (both
      of those will be done in separate patches).
      
      Once each device is placed on both lists, much of what this patch does
      is modify places in the code that traverse all the device lists so
      that these hybrid devices are only acted on once - either along with
      the other hostdevs, or along with the other network interfaces. (In
      many cases, only one of the lists is traversed / a specific operation
      is performed on only one type of device. In those instances, the code
      can remain unchanged.)
      
      There is one special case - when building the commandline, interfaces
      are allowed to proceed all the way through
      networkAllocateActualDevice() before deciding to skip the rest of
      netdev-specific processing - this is so that (once we have support for
      networks with pools of hostdev devices) we can get the actual device
      allocated, then rely on the loop processing all hostdevs to generate
      the correct commandline.
      
      (NB: <interface type='hostdev'> is only supported for PCI network
      devices that are SR-IOV Virtual Functions (VF). Standard PCI[e] and
      USB devices, and even the Physical Functions (PF) of SR-IOV devices
      can only be assigned to a guest using the more basic <hostdev> device
      entry. This limitation is mostly due to the fact that non-SR-IOV
      ethernet devices tend to lose mac address configuration whenever the
      card is reset, which happens when a card is assigned to a guest;
      SR-IOV VFs fortunately don't suffer the same problem.)
      8639a420
    • L
      conf: parse/format type='hostdev' network interfaces · 3b1c191f
      Laine Stump 提交于
      This is the new interface type that sets up an SR-IOV PCI network
      device to be assigned to the guest with PCI passthrough after
      initializing some network device-specific things from the config
      (e.g. MAC address, virtualport profile parameters). Here is an example
      of the syntax:
      
        <interface type='hostdev' managed='yes'>
          <source>
            <address type='pci' domain='0' bus='0' slot='4' function='3'/>
          </source>
          <mac address='00:11:22:33:44:55'/>
          <address type='pci' domain='0' bus='0' slot='7' function='0'/>
        </interface>
      
      This would assign the PCI card from bus 0 slot 4 function 3 on the
      host, to bus 0 slot 7 function 0 on the guest, but would first set the
      MAC address of the card to 00:11:22:33:44:55.
      
      NB: The parser and formatter don't care if the PCI card being
      specified is a standard single function network adapter, or a virtual
      function (VF) of an SR-IOV capable network adapter, but the upcoming
      code that implements the back end of this config will work *only* with
      SR-IOV VFs. This is because modifying the mac address of a standard
      network adapter prior to assigning it to a guest is pointless - part
      of the device reset that occurs during that process will reset the MAC
      address to the value programmed into the card's firmware.
      
      Although it's not supported by any of libvirt's hypervisor drivers,
      usb network hostdevs are also supported in the parser and formatter
      for completeness and consistency. <source> syntax is identical to that
      for plain <hostdev> devices, except that the <address> element should
      have "type='usb'" added if bus/device are specified:
      
        <interface type='hostdev'>
          <source>
            <address type='usb' bus='0' device='4'/>
          </source>
          <mac address='00:11:22:33:44:55'/>
        </interface>
      
      If the vendor/product form of usb specification is used, type='usb'
      is implied:
      
        <interface type='hostdev'>
          <source>
            <vendor id='0x0012'/>
            <product id='0x24dd'/>
          </source>
          <mac address='00:11:22:33:44:55'/>
        </interface>
      
      Again, the upcoming patch to fill in the backend of this functionality
      will log an error and fail with "Unsupported Config" if you actually
      try to assign a USB network adapter to a guest using <interface
      type='hostdev'> - just use a standard <hostdev> entry in that case
      (and also for single-port PCI adapters).
      3b1c191f