1. 03 6月, 2015 4 次提交
  2. 01 6月, 2015 3 次提交
  3. 29 5月, 2015 1 次提交
    • J
      Allocate priv->vioserialaddrs unconditionally · 0a2581a1
      Ján Tomko 提交于
      When attempting to hotplug a virtio-serial console to a domain
      that had no virtio-serial controllers (not even those that
      are added by libvirt when some devices need them) at daemon startup,
      report a user-friendly error:
      
      error: Failed to attach device from console.xml
      error: internal error: no virtio-serial controllers are available
      
      instead of crashing the daemon:
      
      Process terminating with default action of signal 11 (SIGSEGV): dumping core
       Access not within mapped region at address 0x8
         at 0x531028F: virDomainVirtioSerialAddrNext (domain_addr.c:916)
         by 0x531028F: virDomainVirtioSerialAddrAssign (domain_addr.c:1029)
         by 0x1CBF68: qemuDomainAttachChrDevice (qemu_hotplug.c:1565)
         by 0x1BCD5E: qemuDomainAttachDeviceLive (qemu_driver.c:7997)
         by 0x1BCD5E: qemuDomainAttachDeviceFlags (qemu_driver.c:8743)
      
      Introduced in v1.2.14-30-g59033788.
      0a2581a1
  4. 27 5月, 2015 2 次提交
  5. 26 5月, 2015 3 次提交
    • J
      qemu: Add libvirt version check to refresh capabilities algorithm · a14eff38
      John Ferlan 提交于
      Rather than an algorithm based solely on libvirtd ctime to refresh the
      capabilities add the element of the libvirt build version into the equation.
      Since that version wouldn't be there prior to this code being run - don't
      fail on reading the capabilities if not found. In this case, the cache
      will always be rebuilt when a new libvirt version is installed.
      a14eff38
    • J
      qemu: Force capabilities cache refresh if libvirtd date is different · 0b4211f9
      John Ferlan 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=1195882
      
      Original commit id 'cbde3589' indicates that the cache file would be
      discarded if either the QEMU binary or libvirtd 'ctime' changes; however,
      the code only discarded if the QEMU binary time didn't match or if the
      new libvirtd ctime was later than what created the cache file.
      
      Since many factors come into play with 'ctime' adjustments (including
      perhaps turning back the hands of time), change the logic to also force
      a refresh if the ctime of libvirt is different than what's in the cache.
      0b4211f9
    • J
      qemu: Resolve Coverity RESOURCE_LEAK · 2f9f7b5f
      John Ferlan 提交于
      Recent changes to the -M/--machine processing code in qemuParseCommandLine
      caused Coverity to determine there was a possible resource leak with how
      the 'list' is managed. Rather than try to add virStringFreeList calls
      everywhere - just promote list to the top of the variables and free it
      within the error processing code. Also required a couple of other tweaks
      in order to avoid double free's.
      2f9f7b5f
  6. 21 5月, 2015 6 次提交
  7. 20 5月, 2015 2 次提交
  8. 19 5月, 2015 1 次提交
  9. 18 5月, 2015 2 次提交
    • L
      conf: make virNodeDevCapData an official type · ffc40b63
      Laine Stump 提交于
      For some reason a union (_virNodeDevCapData) that had only been
      declared inside the toplevel struct virNodeDevCapsDef was being used
      as an argument to functions all over the place. Since it was only a
      union, the "type" attribute wasn't necessarily sent with it. While
      this works, it just seems wrong.
      
      This patch creates a toplevel typedef for virNodeDevCapData and
      virNodeDevCapDataPtr, making it a struct that has the type attribute
      as a member, along with an anonymous union of everything that used to
      be in union _virNodeDevCapData. This way we only have to change the
      following:
      
        s/union _virNodeDevCapData */virNodeDevCapDataPtr /
      
      and
      
        s/caps->type/caps->data.type/
      
      This will make me feel less guilty when adding functions that need a
      pointer to one of these.
      ffc40b63
    • T
      libvirt: qemu: enable/disable protected key management ops · 740c83f5
      Tony Krowiak 提交于
      Introduces two new -machine option parameters to the QEMU command to
      enable/disable the CPACF protected key management operations for a guest:
      
          aes-key-wrap='on|off'
          dea-key-wrap='on|off'
      
      The QEMU code maps the corresponding domain configuration elements to the
      QEMU -machine option parameters to create the QEMU command:
      
          <cipher name='aes' state='on'>   --> aes-key-wrap=on
          <cipher name='aes' state='off'>  --> aes-key-wrap=off
          <cipher name='dea' state='on'>   --> dea-key-wrap=on
          <cipher name='dea' state='off'>  --> dea-key-wrap=off
      Signed-off-by: NTony Krowiak <akrowiak@linux.vnet.ibm.com>
      Signed-off-by: NDaniel Hansel <daniel.hansel@linux.vnet.ibm.com>
      Signed-off-by: NBoris Fiuczynski <fiuczy@linux.vnet.ibm.com>
      Reviewed-by: NBoris Fiuczynski <fiuczy@linux.vnet.ibm.com>
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      740c83f5
  10. 16 5月, 2015 4 次提交
    • L
      qemu: log error when domain has an unsupported IDE controller · eadd757c
      Laine Stump 提交于
      We have previously effectively ignored all <controller type='ide'>
      elements in a domain definition.
      
      On the i440fx-based machinetypes there is an IDE controller that is
      included in the chipset and can't be removed (which is the ide
      controller with index='0'>), so it makes sense to ignore that one
      controller. However, if an i440fx domain definition has a 2nd
      controller, nothing catches this error (unless you also have a disk
      attached to it, in which case qemu will complain that you're trying to
      use the ide controller named "ide1", which doesn't exist), and if any
      other type of domain has even a single controller defined, it will be
      incorrectly ignored.
      
      Ignoring a bogus controller definition isn't such a big problem, as
      long as an error is logged when any disk is attached to that
      non-existent controller. But in the case of q35-based machinetypes,
      the hardcoded id ("alias" in libvirt terms) of its builtin SATA
      controller is "ide", which happens to be the same id as the builtin
      IDE controller on i440fx machinetypes. So libvirt creates a
      commandline believing that it is connecting the disk to the builtin
      (but actually nonexistent) IDE controller, qemu thinks that libvirt
      wanted that disk connected to the builtin SATA controller, and
      everybody is happy.
      
      Until you try to connect a 2nd disk to the IDE controller. Then qemu
      will complain that you're trying to set unit=1 on a controller that
      requires unit=0 (SATA controllers are organized differently than IDE
      controllers).
      
      After this patch, if a domain has an IDE controller defined for a
      machinetype that has no IDE controllers, libvirt will log an error
      about the controller itself as it is building the qemu commandline
      (rather than a (possible) error from qemu about disks attached to that
      controller). This is done by adding IDE to the list of controller
      types that are handled in the loop that creates controller command
      strings in qemuBuildCommandline() (previously it would *always* skip
      IDE controllers). Then qemuBuildControllerDevStr() is modified to log
      an appropriate error in the case of IDE controllers.
      
      In the future, if we add support for extra IDE controllers (piix3-ide
      and/or piix4-ide) we can just add it into the IDE case in
      qemuBuildControllerDevStr(). For now, nobody seems anxious to add
      extra support for an aging and very slow controller, when there are so
      many better options available.
      
      Resolves:
      
      https://bugzilla.redhat.com/show_bug.cgi?id=1176071 (Fedora)
      eadd757c
    • L
      qemu: clean up qemuBuildCommandline loop that builds controller args · b8f345b4
      Laine Stump 提交于
      Reorganize the loop that builds controller args to remove unnecessary
      duplicated code and superfluous else clauses. No functional change.
      b8f345b4
    • L
      qemu: use controller alias when constructing device/controller args · 0260506c
      Laine Stump 提交于
      This makes sure that that the commandlines generated for devices and
      controller devices are all using the alias that has been set in the
      controller's object as the id of the controller, rather than
      hardcoding a printf (or worse, encoding exceptions to the standard
      ${controller}${index} into the logic)
      
      Since this "fixes" the controller name used for the sata controller,
      the commandline arg for the sata controller in the sata test case had
      to be adjusted to be "sata0" instead of "ahci0". All other tests
      remain unchanged, verifying that the patch causes no other functional
      change.
      
      Because the function that finds a controller alias based on a device
      def requires a pointer to the full domainDef in order to get the list
      of controllers, the arglist of a few functions had to have this added.
      0260506c
    • L
      qemu: fix exceptions in qemuAssignDeviceControllerAlias · 75cd7d9b
      Laine Stump 提交于
      There are a few extra exceptions that weren't being accounted for when
      creating the alias for a controller. This resulted in 1) incorrect
      status XML, and 2) exceptions/printfs of what *should* have been
      directly available in the controller alias when constructing device
      commandline arguments:
      
      1) The primary (and only) IDE controller on a 440FX machinetype is
      hardcoded to be "ide" in qemu.
      
      2) The primary SATA controller on a 440FX machinetype is also
      hardcoded to be "ide" in qemu.
      
      3) On machinetypes that don't support multiple PCI buses, the PCI bus
      is hardcoded in qemu to have the name "pci".
      
      4) The first usb master controller is "usb", all others are the normal
      "usb%d". (note that usb controllers that are not a "master" will have
      the same index, and thus alias, as the master).
      
      We needed to pass in the full domainDef and qemuCaps in order to
      properly make the decisions about these exceptions.
      75cd7d9b
  11. 15 5月, 2015 5 次提交
  12. 14 5月, 2015 1 次提交
  13. 13 5月, 2015 3 次提交
  14. 12 5月, 2015 3 次提交
    • L
      qemu: fix double free when RNG cold-plug fails · 5f6fe84d
      Luyao Huang 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=1220809
      
      When cold-plugging an RNG device but something fails in
      qemuDomainAssignAddresses, we will double free the RNG device.
      Once a device is plugged into the domain, we should set the
      device pointer to NULL to fix this issue.
      
      ...
      5  0x00007fb7d180ac8a in virFree at util/viralloc.c:582
      6  0x00007fb7d1895cdd in virDomainRNGDefFree at conf/domain_conf.c:19786
      7  0x00007fb7d1895d99 in virDomainDeviceDefFree at conf/domain_conf.c:2022
      8  0x00007fb7b92b8baf in qemuDomainAttachDeviceFlags at qemu/qemu_driver.c:8785
      9  0x00007fb7d190c5d7 in virDomainAttachDeviceFlags at libvirt-domain.c:8488
      10 0x00007fb7d23af9d2 in remoteDispatchDomainAttachDeviceFlags at remote_dispatch.h:2842
      ...
      Signed-off-by: NLuyao Huang <lhuang@redhat.com>
      5f6fe84d
    • L
      qemu: eliminate duplicated code in qemuBuildDriveDevStr() · e27c5c8f
      Laine Stump 提交于
      The code to add device type to the commandline was identical for lsi
      and other models of SCSI controllers, but was duplicated (with the
      exception of a minor ordering difference of the if-else clauses) for
      the two cases. This patch replaces those two with a single instance of
      the code just before the if().
      e27c5c8f
    • L
      qemu: use qemuDomainMachineIsI440FX() in appropriate place · da558e72
      Laine Stump 提交于
      This patch makes qemuValideDevicePCISlotsChipsets() more consistent in
      appearance by replacing several clauses of an if with the equivalent
      call to qemuDomainMachineIsI440FX. The if was checking exactly the
      same items, just in a slightly different order.
      da558e72