1. 10 11月, 2015 3 次提交
  2. 04 11月, 2015 2 次提交
    • P
      ioport: do not use CPU_LOG_IOPORT · 6f94b7d9
      Paolo Bonzini 提交于
      These messages are disabled by default; a perfect usecase for tracepoints,
      which in fact already exist.  Add the missing information to them and
      stop using qemu_log_mask.
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      6f94b7d9
    • L
      migration: rename qemu_savevm_state_cancel · ea7415fa
      Liang Li 提交于
      The function qemu_savevm_state_cancel is called after the migration
      in migration_thread, it seems strange to 'cancel' it after completion,
      rename it to qemu_savevm_state_cleanup looks better.
      Signed-off-by: NLiang Li <liang.z.li@intel.com>
      Reviewed-by: Juan Quintela <quintela@redhat.com>al3
      Reviewed-by: Amit Shah <amit.shah@redhat.com>al3
      Signed-off-by: Juan Quintela <quintela@redhat.com>al3
      ea7415fa
  3. 29 10月, 2015 1 次提交
    • M
      monitor: Simplify event throttling · 93f8f982
      Markus Armbruster 提交于
      The event throttling state machine is hard to understand.  I'm not
      sure it's entirely correct.  Rewrite it in a more straightforward
      manner:
      
      State 1: No event sent recently (less than evconf->rate ns ago)
      
          Invariant: evstate->timer is not pending, evstate->qdict is null
      
          On event: send event, arm timer, goto state 2
      
      State 2: Event sent recently, no additional event being delayed
      
          Invariant: evstate->timer is pending, evstate->qdict is null
      
          On event: store it in evstate->qdict, goto state 3
      
          On timer: goto state 1
      
      State 3: Event sent recently, additional event being delayed
      
          Invariant: evstate->timer is pending, evstate->qdict is non-null
      
          On event: store it in evstate->qdict, goto state 3
      
          On timer: send evstate->qdict, clear evstate->qdict,
                    arm timer, goto state 2
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Message-Id: <1444921716-9511-3-git-send-email-armbru@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      93f8f982
  4. 23 10月, 2015 1 次提交
  5. 22 10月, 2015 1 次提交
  6. 09 10月, 2015 1 次提交
  7. 08 10月, 2015 2 次提交
  8. 06 10月, 2015 1 次提交
  9. 29 9月, 2015 2 次提交
  10. 25 9月, 2015 1 次提交
  11. 24 9月, 2015 12 次提交
    • A
      vfio/pci: Add emulated PCI IDs · 89dcccc5
      Alex Williamson 提交于
      Specifying an emulated PCI vendor/device ID can be useful for testing
      various quirk paths, even though the behavior and functionality of
      the device with bogus IDs is fully unsupportable.  We need to use a
      uint32_t for the vendor/device IDs, even though the registers
      themselves are only 16-bit in order to be able to determine whether
      the value is valid and user set.
      
      The same support is added for subsystem vendor/device ID, though these
      have the possibility of being useful and supported for more than a
      testing tool.  An emulated platform might want to impose their own
      subsystem IDs or at least hide the physical subsystem ID.  Windows
      guests will often reinstall drivers due to a change in subsystem IDs,
      something that VM users may want to avoid.  Of course careful
      attention would be required to ensure that guest drivers do not rely
      on the subsystem ID as a basis for device driver quirks.
      
      All of these options are added using the standard experimental option
      prefix and should not be considered stable.
      Signed-off-by: NAlex Williamson <alex.williamson@redhat.com>
      89dcccc5
    • A
      vfio/pci: Move AMD device specific reset to quirks · c9c50009
      Alex Williamson 提交于
      This is just another quirk, for reset rather than affecting memory
      regions.  Move it to our new quirks file.
      Signed-off-by: NAlex Williamson <alex.williamson@redhat.com>
      c9c50009
    • A
      vfio/pci: Remove old config window and mirror quirks · 958d5534
      Alex Williamson 提交于
      These are now unused.
      Signed-off-by: NAlex Williamson <alex.williamson@redhat.com>
      958d5534
    • A
      vfio/pci: Config mirror quirk · 0d38fb1c
      Alex Williamson 提交于
      Re-implement our mirror quirk using the new infrastructure.
      Signed-off-by: NAlex Williamson <alex.williamson@redhat.com>
      0d38fb1c
    • A
      vfio/pci: Config window quirks · 0e54f24a
      Alex Williamson 提交于
      Config windows make use of an address register and a data register.
      In VGA cards, these are often used to provide real mode code in the
      BIOS an easy way to access MMIO registers since the window often
      resides in an I/O port register.  When the MMIO register has a mirror
      of PCI config space, we need to trap those accesses and redirect them
      to emulated config space.
      
      The previous version of this functionality made use of a single
      MemoryRegion and single match address.  This version uses separate
      MemoryRegions for each of the address and data registers and allows
      for multiple match addresses.  This is useful for Nvidia cards which
      have two ranges which index into PCI config space.
      
      The previous implementation is left for the follow-on patch for a more
      reviewable diff.
      Signed-off-by: NAlex Williamson <alex.williamson@redhat.com>
      0e54f24a
    • A
      vfio/pci: Rework RTL8168 quirk · 954258a5
      Alex Williamson 提交于
      Another rework of this quirk, this time to update to the new quirk
      structure.  We can handle the address and data registers with
      separate MemoryRegions and a quirk specific data structure, making the
      code much more understandable.
      Signed-off-by: NAlex Williamson <alex.williamson@redhat.com>
      954258a5
    • A
      vfio/pci: Cleanup Nvidia 0x3d0 quirk · 6029a424
      Alex Williamson 提交于
      The Nvidia 0x3d0 quirk makes use of a two separate registers and gives
      us our first chance to make use of separate memory regions for each to
      simplify the code a bit.
      Signed-off-by: NAlex Williamson <alex.williamson@redhat.com>
      6029a424
    • A
      vfio/pci: Cleanup ATI 0x3c3 quirk · b946d286
      Alex Williamson 提交于
      This is an easy quirk that really doesn't need a data structure if
      its own.  We can pass vdev as the opaque data and access to the
      MemoryRegion isn't required.
      Signed-off-by: NAlex Williamson <alex.williamson@redhat.com>
      b946d286
    • A
      vfio/pci: Cleanup ROM blacklist quirk · 056dfcb6
      Alex Williamson 提交于
      Create a vendor:device ID helper that we'll also use as we rework the
      rest of the quirks.  Re-reading the config entries, even if we get
      more blacklist entries, is trivial overhead and only incurred during
      device setup.  There's no need to typedef the blacklist structure,
      it's a static private data type used once.  The elements get bumped
      up to uint32_t to avoid future maintenance issues if PCI_ANY_ID gets
      used for a blacklist entry (avoiding an actual hardware match).  Our
      test loop is also crying out to be simplified as a for loop.
      Signed-off-by: NAlex Williamson <alex.williamson@redhat.com>
      056dfcb6
    • A
      vfio/pci: Rename MSI/X functions for easier tracing · 0de70dc7
      Alex Williamson 提交于
      This allows vfio_msi* tracing.  The MSI/X interrupt tracing is also
      pulled out of #ifdef DEBUG_VFIO to avoid a recompile for tracing this
      path.  A few cycles to read the message is hardly anything if we're
      already in QEMU.
      Signed-off-by: NAlex Williamson <alex.williamson@redhat.com>
      0de70dc7
    • A
      vfio/pci: Rename INTx functions for easier tracing · 870cb6f1
      Alex Williamson 提交于
      Rename functions and tracing callbacks so that we can trace vfio_intx*
      to see all the INTx related activities.
      Signed-off-by: NAlex Williamson <alex.williamson@redhat.com>
      870cb6f1
    • A
      vfio/pci: Cleanup RTL8168 quirk and tracing · d451008e
      Alex Williamson 提交于
      There's quite a bit of cleanup that can be done to the RTL8168 quirk,
      as well as the tracing to prevent a spew of uninteresting accesses
      for anything else the driver might choose to use the window registers
      for besides the MSI-X table.  There should be no functional change,
      but it's now possible to get compact and useful traces by enabling
      vfio_rtl8168_quirk*, ex:
      
      vfio_rtl8168_quirk_write 0000:04:00.0 [address]: 0x1f000
      vfio_rtl8168_quirk_read 0000:04:00.0 [address]: 0x8001f000
      vfio_rtl8168_quirk_read 0000:04:00.0 [data]: 0xfee0100c
      vfio_rtl8168_quirk_write 0000:04:00.0 [address]: 0x1f004
      vfio_rtl8168_quirk_read 0000:04:00.0 [address]: 0x8001f004
      vfio_rtl8168_quirk_read 0000:04:00.0 [data]: 0x0
      vfio_rtl8168_quirk_write 0000:04:00.0 [address]: 0x1f008
      vfio_rtl8168_quirk_read 0000:04:00.0 [address]: 0x8001f008
      vfio_rtl8168_quirk_read 0000:04:00.0 [data]: 0x49b1
      vfio_rtl8168_quirk_write 0000:04:00.0 [address]: 0x1f00c
      vfio_rtl8168_quirk_read 0000:04:00.0 [address]: 0x8001f00c
      vfio_rtl8168_quirk_read 0000:04:00.0 [data]: 0x0
      Signed-off-by: NAlex Williamson <alex.williamson@redhat.com>
      d451008e
  12. 15 9月, 2015 6 次提交
    • D
      crypto: introduce new module for handling TLS sessions · d321e1e5
      Daniel P. Berrange 提交于
      Introduce a QCryptoTLSSession object that will encapsulate
      all the code for setting up and using a client/sever TLS
      session. This isolates the code which depends on the gnutls
      library, avoiding #ifdefs in the rest of the codebase, as
      well as facilitating any possible future port to other TLS
      libraries, if desired. It makes use of the previously
      defined QCryptoTLSCreds object to access credentials to
      use with the session. It also includes further unit tests
      to validate the correctness of the TLS session handshake
      and certificate validation. This is functionally equivalent
      to the current TLS session handling code embedded in the
      VNC server, and will obsolete it.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      d321e1e5
    • D
      crypto: add sanity checking of TLS x509 credentials · 9a2fd434
      Daniel P. Berrange 提交于
      If the administrator incorrectly sets up their x509 certificates,
      the errors seen at runtime during connection attempts are very
      obscure and difficult to diagnose. This has been a particular
      problem for people using openssl to generate their certificates
      instead of the gnutls certtool, because the openssl tools don't
      turn on the various x509 extensions that gnutls expects to be
      present by default.
      
      This change thus adds support in the TLS credentials object to
      sanity check the certificates when QEMU first loads them. This
      gives the administrator immediate feedback for the majority of
      common configuration mistakes, reducing the pain involved in
      setting up TLS. The code is derived from equivalent code that
      has been part of libvirt's TLS support and has been seen to be
      valuable in assisting admins.
      
      It is possible to disable the sanity checking, however, via
      the new 'sanity-check' property on the tls-creds object type,
      with a value of 'no'.
      
      Unit tests are included in this change to verify the correctness
      of the sanity checking code in all the key scenarios it is
      intended to cope with. As part of the test suite, the pkix_asn1_tab.c
      from gnutls is imported. This file is intentionally copied from the
      (long since obsolete) gnutls 1.6.3 source tree, since that version
      was still under GPLv2+, rather than the GPLv3+ of gnutls >= 2.0.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      9a2fd434
    • D
      crypto: introduce new module for TLS x509 credentials · 85bcbc78
      Daniel P. Berrange 提交于
      Introduce a QCryptoTLSCredsX509 class which is used to
      manage x509 certificate TLS credentials. This will be
      the preferred credential type offering strong security
      characteristics
      
      Example CLI configuration:
      
       $QEMU -object tls-creds-x509,id=tls0,endpoint=server,\
                     dir=/path/to/creds/dir,verify-peer=yes
      
      The 'id' value in the -object args will be used to associate the
      credentials with the network services. For example, when the VNC
      server is later converted it would use
      
       $QEMU -object tls-creds-x509,id=tls0,.... \
             -vnc 127.0.0.1:1,tls-creds=tls0
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      85bcbc78
    • D
      crypto: introduce new module for TLS anonymous credentials · e00adf6c
      Daniel P. Berrange 提交于
      Introduce a QCryptoTLSCredsAnon class which is used to
      manage anonymous TLS credentials. Use of this class is
      generally discouraged since it does not offer strong
      security, but it is required for backwards compatibility
      with the current VNC server implementation.
      
      Simple example CLI configuration:
      
       $QEMU -object tls-creds-anon,id=tls0,endpoint=server
      
      Example using pre-created diffie-hellman parameters
      
       $QEMU -object tls-creds-anon,id=tls0,endpoint=server,\
                     dir=/path/to/creds/dir
      
      The 'id' value in the -object args will be used to associate the
      credentials with the network services. For example, when the VNC
      server is later converted it would use
      
       $QEMU -object tls-creds-anon,id=tls0,.... \
             -vnc 127.0.0.1:1,tls-creds=tls0
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      e00adf6c
    • D
      crypto: introduce new base module for TLS credentials · a090187d
      Daniel P. Berrange 提交于
      Introduce a QCryptoTLSCreds class to act as the base class for
      storing TLS credentials. This will be later subclassed to provide
      handling of anonymous and x509 credential types. The subclasses
      will be user creatable objects, so instances can be created &
      deleted via 'object-add' and 'object-del' QMP commands respectively,
      or via the -object command line arg.
      
      If the credentials cannot be initialized an error will be reported
      as a QMP reply, or on stderr respectively.
      
      The idea is to make it possible to represent and manage TLS
      credentials independently of the network service that is using
      them. This will enable multiple services to use the same set of
      credentials and minimize code duplication. A later patch will
      convert the current VNC server TLS code over to use this object.
      
      The representation of credentials will be functionally equivalent
      to that currently implemented in the VNC server with one exception.
      The new code has the ability to (optionally) load a pre-generated
      set of diffie-hellman parameters, if the file dh-params.pem exists,
      whereas the current VNC server will always generate them on startup.
      This is beneficial for admins who wish to avoid the (small) time
      sink of generating DH parameters at startup and/or avoid depleting
      entropy.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      a090187d
    • G
      gtk: trace input grab reason · d531deef
      Gerd Hoffmann 提交于
      Add a reason to grab calls and trace points,
      so it is easier to debug grab related ui issues.
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      Reviewed-by: NMarc-André Lureau <marcandre.lureau@redhat.com>
      d531deef
  13. 10 9月, 2015 1 次提交
    • L
      hw/pci: fix pci_update_mappings() trace events · 0f288f85
      Laszlo Ersek 提交于
      The current trace prototypes and (matching) trace calls lead to
      "unorthodox" PCI BDF notation in at least the stderr trace backend. For
      example, the four BARs of a QXL video card at 00:01.0 (bus 0, slot 1,
      function 0) are traced like this (PID and timestamps removed):
      
        pci_update_mappings_add d=0x7f14a73bf890 00:00.1 0,0x84000000+0x4000000
        pci_update_mappings_add d=0x7f14a73bf890 00:00.1 1,0x80000000+0x4000000
        pci_update_mappings_add d=0x7f14a73bf890 00:00.1 2,0x88200000+0x2000
        pci_update_mappings_add d=0x7f14a73bf890 00:00.1 3,0xd060+0x20
      
      The slot and function values are in reverse order.
      
      Stick with the conventional BDF notation.
      
      Cc: "Michael S. Tsirkin" <mst@redhat.com>
      Cc: Don Koch <dkoch@verizon.com>
      Cc: qemu-trivial@nongnu.org
      Fixes: 7828d750Signed-off-by: NLaszlo Ersek <lersek@redhat.com>
      Reviewed-by: NMichael S. Tsirkin <mst@redhat.com>
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      0f288f85
  14. 08 9月, 2015 1 次提交
  15. 03 9月, 2015 1 次提交
  16. 06 8月, 2015 1 次提交
    • S
      block/mirror: limit qiov to IOV_MAX elements · cae98cb8
      Stefan Hajnoczi 提交于
      If mirror has more free buffers than IOV_MAX, preadv(2)/pwritev(2)
      EINVAL failures may be encountered.
      
      It is possible to trigger this by setting granularity to a low value
      like 8192.
      
      This patch stops appending chunks once IOV_MAX is reached.
      
      The spurious EINVAL failure can be reproduced with a qcow2 image file
      and the following QMP invocation:
      
        qmp.command('drive-mirror', device='virtio0', target='/tmp/r7.s1',
                    granularity=8192, sync='full', mode='absolute-paths',
                    format='raw')
      
      While the guest is running dd if=/dev/zero of=/var/tmp/foo oflag=direct
      bs=4k.
      
      Cc: Jeff Cody <jcody@redhat.com>
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      Reviewed-by: NPaolo Bonzini <pbonzini@redhat.com>
      Message-id: 1435761950-26714-1-git-send-email-stefanha@redhat.com
      Signed-off-by: NJeff Cody <jcody@redhat.com>
      cae98cb8
  17. 27 7月, 2015 1 次提交
  18. 07 7月, 2015 2 次提交