1. 04 9月, 2015 2 次提交
    • J
      qemu: Need to check for machine.os when using ADDRESS_TYPE_CCW · a39ab909
      John Ferlan 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=1258361
      
      When attaching a disk, controller, or rng using an address type ccw
      or s390, we need to ensure the support is provided by both the machine.os
      and the emulator capabilities (corollary to unconditional setting when
      address was not provided for the correct machine.os and emulator.
      
      For an inactive guest, an addition followed by a start would cause the
      startup to fail after qemu_command builds the command line and attempts
      to start the guest. For an active guest, libvirtd would crash.
      a39ab909
    • J
      qemu: Introduce qemuDomainMachineIsS390CCW · d334c917
      John Ferlan 提交于
      Rather than have different usages of STR function in order to determine
      whether the domain is s390-ccw or s390-ccw-virtio, make a single API
      which will check the machine.os prefix. Then use the function.
      d334c917
  2. 02 9月, 2015 1 次提交
    • J
      qemu: add udp interface support · 5c668a78
      Jonathan Toppins 提交于
      Adds a new interface type using UDP sockets, this seems only applicable
      to QEMU but have edited tree-wide to support the new interface type.
      
      The interface type required the addition of a "localaddr" (local
      address), this then maps into the following xml and qemu call.
      
      <interface type='udp'>
        <mac address='52:54:00:5c:67:56'/>
        <source address='127.0.0.1' port='11112'>
          <local address='127.0.0.1' port='22222'/>
        </source>
        <model type='virtio'/>
        <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>
      </interface>
      
      QEMU call:
      	-net socket,udp=127.0.0.1:11112,localaddr=127.0.0.1:22222
      
      Notice the xml "local" entry becomes the "localaddr" for the qemu call.
      
      reference:
      http://lists.gnu.org/archive/html/qemu-devel/2011-11/msg00629.htmlSigned-off-by: NJonathan Toppins <jtoppins@cumulusnetworks.com>
      Signed-off-by: NJán Tomko <jtomko@redhat.com>
      5c668a78
  3. 28 8月, 2015 1 次提交
  4. 27 8月, 2015 2 次提交
    • L
      qemu: Emit correct audit message for memory hot unplug · 8f8031df
      Luyao Huang 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=1226234#c3
      
      If the qemu monitor fails to remove the memory from the guest for
      any reason, the auditlog message will incorrectly use the current
      actual memory (via virDomainDefGetMemoryActual) instead of the
      value we were attempting to reduce to. The result is the 'new-mem'
      and 'old-mem' values for the auditlog message would be identical.
      
      This patch creates a local 'newmem' which accounts for the current
      memory size minus the memory which is being removed. NB, for the
      success case this results in the same value that would be returned
      by virDomainDefGetMemoryActual without the need to do the math. This
      follows the existing code which would subtract the size for cur_balloon.
      Signed-off-by: NLuyao Huang <lhuang@redhat.com>
      8f8031df
    • L
      qemu: Emit correct audit message for memory hot plug · cb1fbda4
      Luyao Huang 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=1226234#c3
      
      Prior to this patch, after successfully hot plugging memory
      the audit log indicated that the update failed, e.g.:
      
      type=VIRT_RESOURCE ... old-mem=1024000 new-mem=1548288 \
      exe="/usr/sbin/libvirtd" hostname=? addr=? terminal=pts/2 res=failed
      
      This patch will adjust where virDomainAuditMemory is called to
      ensure the proper 'ret' value is used based on success or failure.
      
      Additionally, the audit message should include the size of the
      memory we were attempting to change to rather than the current
      actual size. On failure to add, the message showed the same value
      for old-mem and new-mem.
      
      In order to do this, introduce a 'newmem' local which will compute
      the new size based on the oldmem size plus the size of memory we
      are about to add. NB: This would be the same as calling the
      virDomainDefGetMemoryActual again on success, but avoids the
      overhead of recalculating. Plus cur_balloon is already adjusted
      by the same value, so this follows that.
      Signed-off-by: NLuyao Huang <lhuang@redhat.com>
      cb1fbda4
  5. 26 8月, 2015 2 次提交
  6. 24 8月, 2015 3 次提交
  7. 20 8月, 2015 1 次提交
  8. 19 8月, 2015 4 次提交
  9. 18 8月, 2015 1 次提交
  10. 16 8月, 2015 1 次提交
    • J
      qemu: Resolve Coverity UNINIT · c4cfc0d0
      John Ferlan 提交于
      Coverity complained that 'vm' wasn't initialized before jumping to
      cleanup: and calling virDomainObjEndAPI if the VIR_STRDUP fails.
      So I initialized vm = NULL and also moved the VIR_STRDUP closer to
      usage and used endjob for goto. Lots of other reasons for failures.
      c4cfc0d0
  11. 14 8月, 2015 3 次提交
  12. 13 8月, 2015 6 次提交
    • M
      qemu: Use numad information when getting pin information · 776924e3
      Martin Kletzander 提交于
      Pinning information returned for emulatorpin and vcpupin calls is being
      returned from our data without querying cgroups for some time.  However,
      not all the data were utilized.  When automatic placement is used the
      information is not returned for the calls mentioned above.  Since the
      numad hint in private data is properly saved/restored, we can safely use
      it to return true information.
      
      Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1162947Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
      776924e3
    • M
      qemu: Keep numad hint after daemon restart · 8ce86722
      Martin Kletzander 提交于
      The numad hint stored in priv->autoNodeset is information that gets lost
      during daemon restart.  And because we would like to use that
      information in the future, we also need to save it in the status XML.
      For the sake of tests, we need to initialize nnumaCell_max to some
      value, so that the restoration doesn't fail in our test suite.  There is
      no need to fill in the actual numa cell data since the recalculating
      function virCapabilitiesGetCpusForNodemask() will not fail, it will just
      skip filling the data in the bitmap which we don't use in tests anyway.
      Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
      8ce86722
    • M
      conf: Pass private data to Parse function of XML options · 7c8028cd
      Martin Kletzander 提交于
      This needs a reorder of XML option definitions.  It might come in handy
      one day.
      Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
      7c8028cd
    • M
      qemu: Fix segfault when parsing private domain data · 92ddffdb
      Martin Kletzander 提交于
      When parsing private domain data, there are two paths that are flawed.
      They are both error paths, just from different parts of the function.
      One of them can call free() on an uninitialized pointer.  Initialization
      to NULL is enough here.  The other one is a bit trickier to explain, but
      as easy as the first one to fix.  We create capabilities, parse them and
      then assign them into the private data pointer inside the domain object.
      If, however, we get to fail from now on, the error path calls unrefs the
      capabilities and then, when the domain object is being cleaned,
      qemuDomainObjPrivateFree() tries to unref them as well.  That causes a
      segfault.  Settin the pointer to NULL upon successful addition to the
      private data is enough.
      Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
      92ddffdb
    • J
      conf: Check for hostdev conflicts when assign default disk address · 1b08cc17
      John Ferlan 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=1210587  (completed)
      
      When generating the default drive address for a SCSI <disk> device,
      check the generated address to ensure it doesn't conflict with a SCSI
      <hostdev> address. The <disk> address generation algorithm uses the
      <target> "dev" name in order to determine which controller and unit
      in order to place the device. Since a SCSI <hostdev> device doesn't
      require a target device name, its placement on the guest SCSI address
      "could" conflict.  For instance, if a SCSI <hostdev> exists at
      controller=0 unit=0 and an attempt to hotplug 'sda' into the guest
      made, there would be a conflict if the <hostdev> is already using
      /dev/sda.
      1b08cc17
    • F
      Drive hot-unplug: reliable parsing of HMP results · 69a3b0df
      Frank Schreuder 提交于
      Hot-unplugging a disk from a guest that supports hot-unplugging generates an error
      in the libvirt log when running QEMU with the "-msg timestamp=on" flag.
      
      2015-08-06 10:48:59.945+0000: 11662: error : qemuMonitorTextDriveDel:2594 :
      operation failed: deleting drive-virtio-disk4 drive failed:
      2015-08-06T10:48:59.945058Z Device 'drive-virtio-disk4' not found
      
      This error is caused because the HMP results are getting prefixed with a timestamp.
      Parsing the output is not reliable with STRPREFIX as the results can be prefixed with a timestamp.
      
      Using strstr ensures that parsing the output works whether the results are prefixed or not.
      
      Cc: Stefan Hajnoczi <stefanha@redhat.com>
      Cc: Daniel P. Berrange <berrange@redhat.com>
      Signed-off-by: NFrank Schreuder <fschreuder@transip.nl>
      69a3b0df
  13. 12 8月, 2015 2 次提交
    • L
      Revert "qemu: Allow to plug virtio-net-pci into PCIe slot" · d5e6d1cf
      Laine Stump 提交于
      This reverts commit ede34470, which
      was apparently written based on testing performed before commits
      1e15be1b and 9a12b6 were pushed upstream. Once those two patches are in
      place, commit ede34470 is redundant, and can even cause
      incorrect/unexpected behavior when auto-assigning addresses for
      virtio-net devices.
      d5e6d1cf
    • L
      qemu: fix qemuDomainSupportsPCI() for ARM machines of "virt" machinetype · 9bd16ad3
      Laine Stump 提交于
      Commit e8d55172 updated the domain post-parse to automatically add
      pcie-root et al for certain ARM "virt" machinetypes, but didn't update
      the function qemuDomainSupportsPCI() which is called later on when we
      are auto-assigning PCI addresses and default settings for the PCI
      controller <model> and <target> attributes. The result was that PCI
      addresses weren't assigned, and the controllers didn't have their
      attribute default values set, leading to an error when the domain was
      started, e.g.:
      
        internal error: autogenerated dmi-to-pci-bridge options not set
      
      This patch adds the same check made in the earlier patch to
      qemuDomainSupportsPCI(), so that PCI address auto-assignment and
      target/model default values will be set.
      9bd16ad3
  14. 11 8月, 2015 3 次提交
    • M
      qemu: Implement VIR_DOMAIN_BANDWIDTH_IN_FLOOR · b044e325
      Michal Privoznik 提交于
      Well, there are just two places that needs adjustment:
      
      qemuDomainGetInterfaceParameters - to report the @floor
      qemuDomainSetInterfaceParameters - now that the function has been
      fixed, we can allow updating @floor too.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      b044e325
    • M
      qemuDomainSetInterfaceParameters: Use new functions to update bandwidth · 5ee6d243
      Michal Privoznik 提交于
      As sketched in previous commits, imagine the following scenario:
      
        virsh # domiftune gentoo vnet0
        inbound.average: 100
        inbound.peak   : 0
        inbound.burst  : 0
        outbound.average: 100
        outbound.peak  : 0
        outbound.burst : 0
      
        virsh # domiftune gentoo vnet0 --inbound 0
      
        virsh # shutdown gentoo
        Domain gentoo is being shutdown
      
        virsh # list --all
        error: Failed to list domains
        error: Cannot recv data: Connection reset by peer
      
        Program received signal SIGSEGV, Segmentation fault.
        0x00007fffe80ea221 in networkUnplugBandwidth (net=0x7fff9400c1a0, iface=0x7fff940ea3e0) at network/bridge_driver.c:4881
        4881            net->floor_sum -= ifaceBand->in->floor;
      
      This is rather unfortunate. We should not SIGSEGV here. The
      problem is, that while in the second step the inbound QoS was
      cleared out, the network part of it was not updated (moreover, we
      don't report that vnet0 had inbound.floor set). Internal
      structure therefore still had some fragments left (e.g.
      class_id). So when qemuProcessStop() started to clean up the
      environment it got to networkUnplugBandwidth(). Here, class_id is
      set therefore function assumes that there is an inbound QoS. This
      actually is a fair assumption to make, there's no need for a
      special QoS box in network's QoS when there's no QoS to set.
      Anyway, the problem is not the networkUnplugBandwidth() rather
      than qemuDomainSetInterfaceParameters() which completely forgot
      about QoS being disperse (some parts are set directly on
      interface itself, some on bridge the interface is plugged into).
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      5ee6d243
    • L
      qemu: fail on attempts to use <filterref> for non-tap network connections · f4f1d18d
      Laine Stump 提交于
      nwfilter uses iptables and ebtables, which only work properly on
      tap-based network connections (*not* on macvtap, for example), but we
      just ignore any <filterref> elements for other types of networks,
      potentially giving users a false sense of security.
      
      This patch checks the network type and fails/logs an error if any
      domain <interface> has a <filterref> when the connection isn't using a
      tap device.
      
      This resolves:
      
        https://bugzilla.redhat.com/show_bug.cgi?id=1180011
      f4f1d18d
  15. 10 8月, 2015 8 次提交