1. 13 8月, 2013 1 次提交
  2. 26 7月, 2013 1 次提交
  3. 24 7月, 2013 5 次提交
  4. 27 6月, 2013 1 次提交
  5. 19 6月, 2013 11 次提交
  6. 18 6月, 2013 16 次提交
  7. 15 6月, 2013 1 次提交
    • M
      create qemu_openpty_raw() helper function and move it to a separate file · 0817fa97
      Michael Tokarev 提交于
      In two places qemu uses openpty() which is very system-dependent,
      and in both places the pty is switched to raw mode as well.
      Make a wrapper function which does both steps, and move all the
      system-dependent complexity into a separate file, together
      with static/local implementations of openpty() and cfmakeraw()
      from qemu-char.c.
      
      It is in a separate file, not part of oslib-posix.c, because
      openpty() often resides in -lutil which is not linked to
      every program qemu builds.
      
      This change removes #including of <pty.h>, <termios.h>
      and other rather specific system headers out of qemu-common.h,
      which isn't a place for such specific headers really.
      
      This version has been verified to build correctly on Linux,
      OpenBSD, FreeBSD and OpenIndiana.  On the latter it lets qemu
      to be built with gtk gui which were not possible there due to
      missing openpty() and cfmakeraw().
      Signed-off-by: NMichael Tokarev <mjt@tls.msk.ru>
      Tested-by: NAndreas Färber <andreas.faerber@web.de>
      (cherry picked from commit 4efeabbb)
      Signed-off-by: NMichael Roth <mdroth@linux.vnet.ibm.com>
      0817fa97
  8. 13 6月, 2013 4 次提交
    • S
      blockdev: reset werror/rerror on drive_del · 58101748
      Stefan Hajnoczi 提交于
      Paolo Bonzini <pbonzini@redhat.com> suggested the following test case:
      
      1. Launch a guest and wait at the GRUB boot menu:
      
        qemu-system-x86_64 -enable-kvm -m 1024 \
         -drive if=none,cache=none,file=test.img,id=foo,werror=stop,rerror=stop
         -device virtio-blk-pci,drive=foo,id=virtio0,addr=4
      
      2. Hot unplug the device:
      
        (qemu) drive_del foo
      
      3. Select the first boot menu entry
      
      Without this patch the guest pauses due to ENOMEDIUM.  The guest is
      stuck in a continuous pause loop since the I/O request is retried and
      fails immediately again when the guest is resumed.
      
      With this patch the error is reported to the guest.
      
      Note that this scenario actually happens sometimes during libvirt disk
      hot unplug, where device_del is followed by drive_del.  I/O may still be
      submitted to the drive after drive_del if the guest does not process the
      PCI hot unplug notification.
      Reported-by: NDafna Ron <dron@redhat.com>
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      Reviewed-by: NKevin Wolf <kwolf@redhat.com>
      (cherry picked from commit 293c51a6)
      Signed-off-by: NMichael Roth <mdroth@linux.vnet.ibm.com>
      58101748
    • M
      q35: set fw_name · eeaa8d33
      Michael S. Tsirkin 提交于
      PCI host bridges need to set fw_name to be discoverable
      by bios for boot device selection.
      
      In particular, seabios expects root device to be called
      "/pci/@i0cf8", so let's set it up like that for Q35.
      
      Cc: qemu-stable@nongnu.org
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      Tested-by: NAmos Kong <akong@redhat.com>
      (cherry picked from commit 68c0e134)
      Signed-off-by: NMichael Roth <mdroth@linux.vnet.ibm.com>
      eeaa8d33
    • R
      target-i386: Fix aflag logic for CODE64 and the 0x67 prefix · c1270701
      Richard Henderson 提交于
      The code reorganization in commit 4a6fd938 broke handling of PREFIX_ADR.
      While fixing this, tidy and comment the code so that it's more obvious
      what's going on in setting both aflag and dflag.
      
      The TARGET_X86_64 ifdef can be eliminated because CODE64 expands to the
      constant zero when TARGET_X86_64 is undefined.
      
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Reported-by: NLaszlo Ersek <lersek@redhat.com>
      Signed-off-by: NRichard Henderson <rth@twiddle.net>
      Reviewed-by: NPaolo Bonzini <pbonzini@redhat.com>
      Message-id: 1369855851-21400-1-git-send-email-rth@twiddle.net
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      (cherry picked from commit dec3fc96)
      Signed-off-by: NMichael Roth <mdroth@linux.vnet.ibm.com>
      c1270701
    • M
      qemu-char: don't issue CHR_EVENT_OPEN in a BH · 252a7c6e
      Michael Roth 提交于
      When CHR_EVENT_OPENED was initially added, it was CHR_EVENT_RESET,
      and it was issued as a bottom-half:
      
      86e94dea
      
      Which we basically used to print out a greeting/prompt for the
      monitor.
      
      AFAICT the only reason this was ever done in a BH was because in
      some cases we'd modify the chr_write handler for a new chardev
      backend *after* the site where we issued the reset (see:
      86e94d:qemu_chr_open_stdio())
      
      At some point this event was renamed to CHR_EVENT_OPENED, and we've
      maintained the use of this BH ever since.
      
      However, due to 9f939df9, we schedule
      the BH via g_idle_add(), which is causing events to sometimes be
      delivered after we've already begun processing data from backends,
      leading to:
      
       known bugs:
      
        QMP:
          session negotation resets with OPENED event, in some cases this
          is causing new sessions to get sporadically reset
      
       potential bugs:
      
        hw/usb/redirect.c:
          can_read handler checks for dev->parser != NULL, which may be
          true if CLOSED BH has not been executed yet. In the past, OPENED
          quiesced outstanding CLOSED events prior to us reading client
          data. If it's delayed, our check may allow reads to occur even
          though we haven't processed the OPENED event yet, and when we
          do finally get the OPENED event, our state may get reset.
      
        qtest.c:
          can begin session before OPENED event is processed, leading to
          a spurious reset of the system and irq_levels
      
        gdbstub.c:
          may start a gdb session prior to the machine being paused
      
      To fix these, let's just drop the BH.
      
      Since the initial reasoning for using it still applies to an extent,
      work around that by deferring the delivery of CHR_EVENT_OPENED until
      after the chardevs have been fully initialized, toward the end of
      qmp_chardev_add() (or some cases, qemu_chr_new_from_opts()). This
      defers delivery long enough that we can be assured a CharDriverState
      is fully initialized before CHR_EVENT_OPENED is sent.
      
      Also, rather than requiring each chardev to do an explicit open, do it
      automatically, and allow the small few who don't desire such behavior to
      suppress the OPENED-on-init behavior by setting a 'explicit_be_open'
      flag.
      
      We additionally add missing OPENED events for stdio backends on w32,
      which were previously not being issued, causing us to not recieve the
      banner and initial prompts for qmp/hmp.
      Reported-by: NStefan Priebe <s.priebe@profihost.ag>
      Signed-off-by: NMichael Roth <mdroth@linux.vnet.ibm.com>
      Message-id: 1370636393-21044-1-git-send-email-mdroth@linux.vnet.ibm.com
      Cc: qemu-stable@nongnu.org
      Signed-off-by: NMichael Roth <mdroth@linux.vnet.ibm.com>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      (cherry picked from commit bd5c51ee)
      Signed-off-by: NMichael Roth <mdroth@linux.vnet.ibm.com>
      252a7c6e