1. 08 4月, 2016 12 次提交
    • G
      hostmem-file: fix memory leak · 696b5501
      Gonglei 提交于
      Signed-off-by: NGonglei <arei.gonglei@huawei.com>
      Message-Id: <1456998223-12356-5-git-send-email-arei.gonglei@huawei.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      696b5501
    • G
      spapr: fix possible Negative array index read · 1a5512bb
      Gonglei 提交于
      fix CID 1351391.
      Signed-off-by: NGonglei <arei.gonglei@huawei.com>
      Message-Id: <1456998223-12356-6-git-send-email-arei.gonglei@huawei.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      1a5512bb
    • P
      nbd: do not hang nbd_wr_syncv if outside a coroutine and no available data · dacca04c
      Paolo Bonzini 提交于
      Until commit 1c778ef7 ("nbd: convert to using I/O channels for actual
      socket I/O", 2016-02-16), nbd_wr_sync returned -EAGAIN this scenario.
      nbd_reply_ready required these semantics because it has two conflicting
      requirements:
      
      1) if a reply can be received on the socket, nbd_reply_ready needs
      to read the header outside coroutine context to identify _which_
      coroutine to enter to process the rest of the reply
      
      2) on the other hand, nbd_reply_ready can find a false positive if
      another thread (e.g. a VCPU thread running aio_poll) sneaks in and
      calls nbd_reply_ready too.  In this case nbd_reply_ready does nothing
      and expects nbd_wr_syncv to return -EAGAIN.
      
      Currently, the solution to the first requirement is to wait in the very
      rare case of a read() that doesn't retrieve the reply header in its
      entirety; this is what nbd_wr_syncv does by calling qio_channel_wait().
      However, the unconditional call to qio_channel_wait() breaks the second
      requirement.  To fix this, the patch makes nbd_wr_syncv return -EAGAIN
      if done is zero, similar to the code before commit 1c778ef7.
      
      This is okay because NBD client-side negotiation is the only other case
      that calls nbd_wr_syncv outside a coroutine, and it places the socket
      in blocking mode.  On the other hand, it is a bit unpleasant to put
      this in nbd_wr_syncv(), because the function is used by both client
      and server.
      
      The full fix would be to add a counter to NbdClientSession for how
      many bytes have been filled in s->reply.  Then a reply can be filled
      by multiple separate invocations of nbd_reply_ready and the
      qio_channel_wait() call can be removed completely.  Something to
      consider for 2.7...
      Reported-by: NChanglong Xie <xiecl.fnst@cn.fujitsu.com>
      Reviewed-by: NDaniel P. Berrange <berrange@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      dacca04c
    • E
      nbd: Don't kill server when client requests unknown option · 156f6a10
      Eric Blake 提交于
      nbd-server.c currently fails to handle unsupported options properly.
      If during option haggling the client sends an unknown request, the
      server kills the connection instead of letting the client try to
      fall back to something older.  This is precisely what advertising
      NBD_FLAG_FIXED_NEWSTYLE was supposed to fix.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Message-Id: <1459982918-32229-1-git-send-email-eblake@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      156f6a10
    • A
      nbd: Fix NBD unsupported options · 6ff58164
      Alex Bligh 提交于
      nbd-client.c currently fails to handle unsupported options properly.
      If during option haggling the server finds an option that is
      unsupported, it returns an NBD_REP_ERR_UNSUP reply.
      
      According to nbd's proto.md, the format for such a reply
      should be:
      
        S: 64 bits, 0x3e889045565a9 (magic number for replies)
        S: 32 bits, the option as sent by the client to which this is a reply
        S: 32 bits, reply type (e.g., NBD_REP_ACK for successful completion,
           or NBD_REP_ERR_UNSUP to mark use of an option not known by this server
        S: 32 bits, length of the reply. This may be zero for some replies,
           in which case the next field is not sent
        S: any data as required by the reply (e.g., an export name in the case
           of NBD_REP_SERVER, or optional UTF-8 message for NBD_REP_ERR_*)
      
      However, in nbd-client.c, the reply type was being read, and if it
      contained an error, it was bailing out and issuing the next option
      request without first reading the length. This meant that the
      next option / handshake read had an extra 4 or more bytes of data in it.
      In practice, this makes Qemu incompatible with servers that do not
      support NBD_OPT_LIST.
      
      To verify this isn't an error in the specification or my reading of
      it, replies are sent by the reference implementation here:
       https://github.com/yoe/nbd/blob/66dfb35/nbd-server.c#L1232
      and as is evident it always sends a 'datasize' (aka length) 32 bit
      word. Unsupported elements are replied to here:
       https://github.com/yoe/nbd/blob/66dfb35/nbd-server.c#L1371Signed-off-by: NAlex Bligh <alex@alex.org.uk>
      Message-Id: <1459882500-24316-1-git-send-email-alex@alex.org.uk>
      [rework to ALWAYS consume an optional UTF-8 message from the server]
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Message-Id: <1459961962-18771-1-git-send-email-eblake@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      6ff58164
    • E
      qemu-nbd: Document -x option · 332a254b
      Eric Blake 提交于
      Commit 3d4b2f9c added -x to force qemu-nbd to use new-style
      negotiation, but while it documented it in the man page, it
      omitted docs in the --help output.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Message-Id: <1459908128-11925-1-git-send-email-eblake@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      332a254b
    • E
      nbd: Improve debug traces on little-endian · 7548fe31
      Eric Blake 提交于
      Print debug tracing messages while data is still in native
      ordering, rather than after we've potentially swapped it into
      network order for transmission.  Also, it's nice if the server
      mentions what it is replying, to correlate it to with what the
      client says it is receiving.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Message-Id: <1459913704-19949-4-git-send-email-eblake@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      7548fe31
    • E
      nbd: Avoid bitrot in TRACE() usage · 8c659712
      Eric Blake 提交于
      The compiler is smart enough to optimize out 'if (0)', but won't
      type-check our printfs if they are hidden behind #if.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Message-Id: <1459913704-19949-3-git-send-email-eblake@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      8c659712
    • E
      nbd: Return correct error for write to read-only export · c0301fcc
      Eric Blake 提交于
      The NBD Protocol requires that servers should send EPERM for
      attempts to write (or trim) a read-only export.  We were
      correct for TRIM (blk_co_discard() gave EPERM); but were
      manually setting EROFS which then got mapped to EINVAL over
      the wire on writes.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Message-Id: <1459913704-19949-2-git-send-email-eblake@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      c0301fcc
    • W
      docs: fix typo in memory.txt · b3f3fdeb
      Wei Jiangang 提交于
      The space between 7000 and 8000 is too wide by 1 character.
      Also correct the range of vga-window example 0xa0000-0xbffff.
      Signed-off-by: NWei Jiangang <weijg.fnst@cn.fujitsu.com>
      Message-Id: <1458639954-9980-1-git-send-email-weijg.fnst@cn.fujitsu.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      b3f3fdeb
    • B
      hw/timer: Revert "hpet: inverse polarity when pin above ISA_NUM_IRQS" · ecba1993
      Bill Paul 提交于
      This reverts commit 0d63b2dd.
      
      This change was originally intended to correct the HPET behavior
      in conjunction with Linux, however the behavior that it actually creates
      is not compatible with the ioapic.c implementation; it used to be
      compatible with KVM's own IOAPIC but it is not anymore.
      Signed-off-by: NBill Paul <wpaul@windriver.com>
      CC: Paolo Bonzini <pbonzini@redhat.com>
      CC: Richard Henderson <rth@twiddle.net>
      CC: Eduardo Habkost <ehabkost@redhat.com>
      Message-Id: <201604051558.20070.wpaul@windriver.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      ecba1993
    • H
      ps2kbd: default to scancode_set 2, as with KBD_CMD_RESET · 089adafd
      Hervé Poussineau 提交于
      This line has been added in commit ef74679a with
      other initializations. However, scancode set 0 doesn't exist (only 1, 2, 3).
      This works well as long as operating system is resetting keyboard, or overwriting
      the current scancode set with the one it wants.
      
      This fixes IBM 40p firmware, which doesn't bother sending KBD_CMD_RESET or KBD_CMD_SCANCODE.
      Signed-off-by: NHervé Poussineau <hpoussin@reactos.org>
      Message-Id: <1458714100-28885-1-git-send-email-hpoussin@reactos.org>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      089adafd
  2. 06 4月, 2016 6 次提交
  3. 05 4月, 2016 22 次提交