1. 13 9月, 2016 1 次提交
    • L
      qemu: fix improper initialization of cgroupControllers bitmap · 02760153
      Laine Stump 提交于
      virQEMUDriverConfigNew() always initializes the bitmap in its
      cgroupControllers member to -1 (i.e. all 1's).
      
      Prior to commit a9331394, if qemu.conf had a line with
      "cgroup_controllers", cgroupControllers would get reset to 0 before
      going through a loop setting a bit for each named cgroup controller.
      commit a9331394 left out the "reset to 0" part, so cgroupControllers
      would always be -1; if you didn't want a controller included, there
      was no longer a way to make that happen.
      
      This was discovered by users who were using qemu commandline
      passthrough to use the "input-linux" method of directing
      keyboard/mouse input to a virtual machine:
      
       https://www.redhat.com/archives/vfio-users/2016-April/msg00105.html
      
      Here's the first report I found of the problem encountered after
      upgrading libvirt beyond v2.0.0:
      
       https://www.redhat.com/archives/vfio-users/2016-August/msg00053.html
      
      Thanks to sL1pKn07 SpinFlo <sl1pkn07@gmail.com> for bringing the
      problem up in IRC, and then taking the time to do a git bisect and
      find the patch that started the problem.
      02760153
  2. 12 9月, 2016 4 次提交
    • D
      qemu: avoid parameter named 'listen' · 92513bc2
      Daniel P. Berrange 提交于
      previous commit:
      
        commit 2c322378
        Author: John Ferlan <jferlan@redhat.com>
        Date:   Mon Jun 13 12:30:34 2016 -0400
      
          qemu: Add the ability to hotplug the TLS X.509 environment
      
      added a parameter "bool listen" in some methods. This
      unfortunately clashes with the listen() method, causing
      compile failures on certain platforms (RHEL-6 for example)
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      92513bc2
    • J
      qemu: Don't use query-migrate on destination · 56258a38
      Jiri Denemark 提交于
      When migration fails, we need to poke QEMU monitor to check for a reason
      of the failure. We did this using query-migrate QMP command, which is
      not supposed to return any meaningful result on the destination side.
      Thus if the monitor was still functional when we detected the migration
      failure, parsing the answer from query-migrate always failed with the
      following error message:
      
          "info migration reply was missing return status"
      
      This irrelevant message was then used as the reason for the migration
      failure replacing any message we might have had.
      
      Let's use harmless query-status for poking the monitor to make sure we
      only get an error if the monitor connection is broken.
      
      https://bugzilla.redhat.com/show_bug.cgi?id=1374613Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
      56258a38
    • P
      qemu: hotplug: Don't wait if cdrom tray is opened forcibly · 85c82612
      Peter Krempa 提交于
      Qemu always opens the tray if forced to. Skip the waiting step in such
      case.
      
      This also helps if qemu does not report the tray change event when
      opening the cdrom forcibly (the documentation says that the event will
      not be sent although qemu in fact does trigger it even if @force is
      selceted).
      
      This is a workaround for a qemu issue where qemu does not send the tray
      change event in some cases (after migration with empty closed locked
      drive) and thus renders the cdrom useless from libvirt's point of view.
      
      Partially resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1368368
      85c82612
    • P
      qemu: domain: Clear startup policy for dropped removable media · 6e19cc59
      Peter Krempa 提交于
      When a source image is dropped when missing due to startup policy the
      policy needs to be cleared since it was relevant only for the given
      storage source. New sources need to update it if needed.
      6e19cc59
  3. 09 9月, 2016 9 次提交
  4. 07 9月, 2016 4 次提交
  5. 06 9月, 2016 3 次提交
    • J
      qemu: Don't warn about missing device in DEVICE_DELETED event · 5ead7f93
      Jiri Denemark 提交于
      Debug priority is good enough for this.
      Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
      5ead7f93
    • D
      qemu: allow turning off QEMU guest RAM dump globally · 90e178f8
      Daniel P. Berrange 提交于
      We already have the ability to turn off dumping of guest
      RAM via the domain XML. This is not particularly useful
      though, as it is under control of the management application.
      What is needed is a way for the sysadmin to turn off guest
      RAM defaults globally, regardless of whether the mgmt app
      provides its own way to set this in the domain XML.
      
      So this adds a 'dump_guest_core' option in /etc/libvirt/qemu.conf
      which defaults to false. ie guest RAM will never be included in
      the QEMU core dumps by default. This default is different from
      historical practice, but is considered to be more suitable as
      a default because
      
       a) guest RAM can be huge and so inflicts a DOS on the host
          I/O subsystem when dumping core for QEMU crashes
      
       b) guest RAM can contain alot of sensitive data belonging
          to the VM owner. This should not generally be copied
          around inside QEMU core dumps submitted to vendors for
          debugging
      
       c) guest RAM contents are rarely useful in diagnosing
          QEMU crashes
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      90e178f8
    • D
      qemu: add a max_core setting to qemu.conf for core dump size · fa1ce979
      Daniel P. Berrange 提交于
      Currently the QEMU processes inherit their core dump rlimit
      from libvirtd, which is really suboptimal. This change allows
      their limit to be directly controlled from qemu.conf instead.
      fa1ce979
  6. 03 9月, 2016 4 次提交
  7. 02 9月, 2016 1 次提交
    • X
      conf: Fix initialization value of 'multi' in PCI address · f7658da6
      Xian Han Yu 提交于
      The 'multi' element in PCI address struct used as 'virTristateSwitch',
      and its default value is 'VIR_TRISTATE_SWITCH_ABSENT'. Current PCI
      process use 'false' to initialization 'multi', which is ambiguously
      for assignment or comparison. This patch use '{0}' to initialize
      the whole PCI address struct, which fix the 'multi' initialization
      and makes code more simplify and explicitly.
      Signed-off-by: NXian Han Yu <xhyubj@linux.vnet.ibm.com>
      f7658da6
  8. 26 8月, 2016 5 次提交
    • P
      qemu: driver: Validate configuration when setting maximum vcpu count · 802fac97
      Peter Krempa 提交于
      Setting vcpu count when cpu topology is specified may result into an
      invalid configuration. Since the topology can't be modified, reject the
      setting if it doesn't match the requested topology. This will allow
      fixing the topology in case it was broken.
      
      Partially fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1370066
      802fac97
    • P
      qemu: driver: Fix qemuDomainHelperGetVcpus for sparse vcpu topologies · 9b6e947b
      Peter Krempa 提交于
      ce43cca0 refactored the helper to prepare it for sparse topologies but
      forgot to fix the iterator used to fill the structures. This would
      result into a weirdly sparse populated array and possible out of bounds
      access and crash once sparse vcpu topologies were allowed.
      
      Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1369988
      9b6e947b
    • L
      qemu: set tap device online for type='ethernet' · 07262221
      Laine Stump 提交于
      When support for auto-creating tap devices was added to <interface
      type='ethernet'> in commit 9c17d6, the code assumed that
      virNetDevTapCreate() would honor the VIR_NETDEV_TAP__CREATE_IFUP flag
      that is supported by virNetDevTapCreateInBridgePort(). That isn't the
      case - the latter function performs several operations, and one of
      them is setting the tap device online. But virNetDevTapCreate() *only*
      creates the tap device, and relies on the caller to do everything
      else, so qemuInterfaceEthernetConnect() needs to call
      virNetDevSetOnline() after the device is successfully created.
      07262221
    • L
      qemu: remove unnecessary setting of tap device online state · dbb79039
      Laine Stump 提交于
      The linkstate setting of an <interface> is only meant to change the
      online status reported to the guest system by the emulated network
      device driver in qemu, but when support for auto-creating tap devices
      for <interface type='ethernet'> was added in commit 9717d6, a chunk of
      code was also added to qemuDomainChangeNetLinkState() that sets the
      online status of the tap device (i.e. the *host* side of the
      interface) for type='ethernet'. This was never done for tap devices
      used in type='bridge' or type='network' interfaces, nor was it done in
      the past for tap devices created by external scripts for
      type='ethernet', so we shouldn't be doing it now.
      
      This patch removes the bit of code in qemuDomainChangeNetLinkState()
      that modifies online status of the tap device.
      dbb79039
    • V
      qemu: fix ethernet network type ip/route assign · 5f243153
      Vasiliy Tolstov 提交于
      The call to virNetDevIPInfoAddToDev() that sets up tap device IP
      addresses and routes was somehow incorrectly placed in
      qemuInterfaceStopDevice() instead of qemuInterfaceStartDevice() in
      commit fe8567f6.  This fixes that error by moving the call to
      virNetDevIPInfoAddToDev() to qemuInterfaceStartDevice().
      Signed-off-by: NVasiliy Tolstov <v.tolstov@selfip.ru>
      5f243153
  9. 25 8月, 2016 9 次提交
    • P
      qemu: hotplug: Add support for VCPU unplug · e3229f6e
      Peter Krempa 提交于
      This patch removes the old vcpu unplug code completely and replaces it
      with the new code using device_del. The old hotplug code basically never
      worked with any recent qemu and thus is useless.
      
      As the new code is using device_del all the implications of using it
      are present. Contrary to the device deletion code, the vcpu deletion
      code fails if the unplug request is not executed in time.
      e3229f6e
    • P
      qemu: hotplug: Allow marking unplugged devices by alias · 00990d9f
      Peter Krempa 提交于
      Add a overlay function that takes the alias directly rather than
      extracting it from a device info.
      00990d9f
    • P
      qemu: Use modern vcpu hotplug approach if possible · 6d4ee77d
      Peter Krempa 提交于
      To allow unplugging the vcpus, hotplugging of vcpus on platforms which
      require to plug multiple logical vcpus at once or plugging them in an
      arbitrary order it's necessary to use the new device_add interface for
      vcpu hotplug.
      
      This patch adds support for the device_add interface using the old
      setvcpus API by implementing an algorithm to select the appropriate
      entities to plug in.
      6d4ee77d
    • P
      qemu: command: Add support for sparse vcpu topologies · 9eb9106e
      Peter Krempa 提交于
      Add support for using the new approach to hotplug vcpus using device_add
      during startup of qemu to allow sparse vcpu topologies.
      
      There are a few limitations imposed by qemu on the supported
      configuration:
      - vcpu0 needs to be always present and not hotpluggable
      - non-hotpluggable cpus need to be ordered at the beginning
      - order of the vcpus needs to be unique for every single hotpluggable
        entity
      
      Qemu also doesn't really allow to query the information necessary to
      start a VM with the vcpus directly on the commandline. Fortunately they
      can be hotplugged during startup.
      
      The new hotplug code uses the following approach:
      - non-hotpluggable vcpus are counted and put to the -smp option
      - qemu is started
      - qemu is queried for the necessary information
      - the configuration is checked
      - the hotpluggable vcpus are hotplugged
      - vcpus are started
      
      This patch adds a lot of checking code and enables the support to
      specify the individual vcpu element with qemu.
      9eb9106e
    • P
      qemu: process: Copy final vcpu order information into the vcpu definition · 20ef1232
      Peter Krempa 提交于
      The vcpu order information is extracted only for hotpluggable entities,
      while vcpu definitions belonging to the same hotpluggable entity need
      to all share the order information.
      
      We also can't overwrite it right away in the vcpu info detection code as
      the order is necessary to add the hotpluggable vcpus enabled on boot in
      the correct order.
      
      The helper will store the order information in places where we are
      certain that it's necessary.
      20ef1232
    • P
      qemu: command: Add helper to convert vcpu definition to JSON props · 8807f28b
      Peter Krempa 提交于
      For use on the monitor we need to format certain parts of the vcpu
      private definition into a JSON object. Add a helper.
      8807f28b
    • P
      qemu: migration: Prepare for non-contiguous vcpu configurations · 48e3d428
      Peter Krempa 提交于
      Introduce a new migration cookie flag that will be used for any
      configurations that are not compatible with libvirt that would not
      support the specific vcpu hotplug approach. This will make sure that old
      libvirt does not fail to reproduce the configuration correctly.
      48e3d428
    • P
      conf: Add XML for individual vCPU hotplug · 5847bc5c
      Peter Krempa 提交于
      Individual vCPU hotplug requires us to track the state of any vCPU. To
      allow this add the following XML:
      
      <domain>
        ...
        <vcpu current='2'>3</vcpu>
        <vcpus>
          <vcpu id='0' enabled='yes' hotpluggable='no' order='1'/>
          <vcpu id='1' enabled='yes' hotpluggable='yes' order='2'/>
          <vcpu id='1' enabled='no' hotpluggable='yes'/>
        </vcpus>
        ...
      
      The 'enabled' attribute allows to control the state of the vcpu.
      'hotpluggable' controls whether given vcpu can be hotplugged and 'order'
      allows to specify the order to add the vcpus.
      5847bc5c
    • P