Skip to content
Snippets Groups Projects
  1. Jul 19, 2013
  2. Jul 18, 2013
  3. Jul 17, 2013
  4. Jul 16, 2013
    • Luiz Capitulino's avatar
      qapi: qapi-commands: fix possible leaks on visitor dealloc · 8f91ad8a
      Luiz Capitulino authored
      
      In qmp-marshal.c the dealloc visitor calls use the same errp
      pointer of the input visitor calls. This means that if any of
      the input visitor calls fails, then the dealloc visitor will
      return early, before freeing the object's memory.
      
      Here's an example, consider this code:
      
      int qmp_marshal_input_block_passwd(Monitor *mon, const QDict *qdict, QObject **ret)
      {
      	[...]
      
          char * device = NULL;
          char * password = NULL;
      
          mi = qmp_input_visitor_new_strict(QOBJECT(args));
          v = qmp_input_get_visitor(mi);
          visit_type_str(v, &device, "device", errp);
          visit_type_str(v, &password, "password", errp);
          qmp_input_visitor_cleanup(mi);
      
          if (error_is_set(errp)) {
              goto out;
          }
          qmp_block_passwd(device, password, errp);
      
      out:
          md = qapi_dealloc_visitor_new();
          v = qapi_dealloc_get_visitor(md);
          visit_type_str(v, &device, "device", errp);
          visit_type_str(v, &password, "password", errp);
          qapi_dealloc_visitor_cleanup(md);
      
      	[...]
      
          return 0;
      }
      
      Consider errp != NULL when the out label is reached, we're going
      to leak device and password.
      
      This patch fixes this by always passing errp=NULL for dealloc
      visitors, meaning that we always try to free them regardless of
      any previous failure. The above example would then be:
      
      out:
          md = qapi_dealloc_visitor_new();
          v = qapi_dealloc_get_visitor(md);
          visit_type_str(v, &device, "device", NULL);
          visit_type_str(v, &password, "password", NULL);
          qapi_dealloc_visitor_cleanup(md);
      
      Signed-off-by: default avatarLuiz Capitulino <lcapitulino@redhat.com>
      Reviewed-by: default avatarLaszlo Ersek <lersek@redhat.com>
      Reviewed-by: default avatarMichael Roth <mdroth@linux.vnet.ibm.com>
      8f91ad8a
  5. Jul 15, 2013
    • Vijay Mohan Pandarathil's avatar
      vfio: QEMU-AER: Qemu changes to support AER for VFIO-PCI devices · 7b4b0e9e
      Vijay Mohan Pandarathil authored
      Add support for error containment when a VFIO device assigned to a KVM
      guest encounters an error. This is for PCIe devices/drivers that support AER
      functionality. When the host OS is notified of an error in a device either
      through the firmware first approach or through an interrupt handled by the AER
      root port driver, the error handler registered by the vfio-pci driver gets
      invoked. The qemu process is signaled through an eventfd registered per
      VFIO device by the qemu process. In the eventfd handler, qemu decides on
      what action to take. In this implementation, guest is brought down to
      contain the error.
      
      The kernel patches for the above functionality has been already accepted.
      
      This is a refresh of the QEMU patch which was reviewed earlier.
      http://marc.info/?l=linux-kernel&m=136281557608087&w=2
      
      
      This patch has the same contents and has been built after refreshing
      to latest upstream and after the linux headers have been updated in qemu.
      
      	- Create eventfd per vfio device assigned to a guest and register an
                event handler
      
      	- This fd is passed to the vfio_pci driver through the SET_IRQ ioctl
      
      	- When the device encounters an error, the eventfd is signalled
                and the qemu eventfd handler gets invoked.
      
      	- In the handler decide what action to take. Current action taken
                is to stop the guest.
      
      Signed-off-by: default avatarVijay Mohan Pandarathil <vijaymohan.pandarathil@hp.com>
      Signed-off-by: default avatarAlex Williamson <alex.williamson@redhat.com>
      7b4b0e9e
    • Alex Williamson's avatar
      vfio-pci: VGA quirk update · 39360f0b
      Alex Williamson authored
      
      Turns out all the suspicions for AMD devices were correct, everywhere
      we read a BAR address that the address matches the config space offset,
      there's full access to PCI config space.  Attempt to generalize some
      helpers to allow quirks to easily be added for mirrors and windows.
      Also fill in complete config space for AMD.
      
      Signed-off-by: default avatarAlex Williamson <alex.williamson@redhat.com>
      39360f0b
    • Anthony Liguori's avatar
      Merge remote-tracking branch 'quintela/migration.next' into staging · 6453a3a6
      Anthony Liguori authored
      
      # By Chegu Vinod
      # Via Juan Quintela
      * quintela/migration.next:
        Force auto-convegence of live migration
        Add 'auto-converge' migration capability
        Introduce async_run_on_cpu()
      
      Message-id: 1373664508-5404-1-git-send-email-quintela@redhat.com
      Signed-off-by: default avatarAnthony Liguori <aliguori@us.ibm.com>
      6453a3a6
Loading