1. 14 2月, 2010 18 次提交
  2. 13 2月, 2010 2 次提交
  3. 11 2月, 2010 20 次提交
    • C
      ide: add topology support · 0009baf1
      Christoph Hellwig 提交于
      Export the physical block size in the ATA IDENTIFY command.  The
      other topology values are not supported in ATA so skip them.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      0009baf1
    • C
      scsi: add topology support · ee3659e3
      Christoph Hellwig 提交于
      Export the physical block size in the READ CAPACITY (16) command,
      and add the new block limits VPD page to export the minimum and
      optiomal I/O sizes.
      
      Note that we also need to bump the scsi revision level to SPC-2
      as that is the minimum requirement by at least the Linux kernel
      to try READ CAPACITY (16) first and look at the block limits VPD
      page.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      ee3659e3
    • C
      virtio-blk: add topology support · 9752c371
      Christoph Hellwig 提交于
      Export all topology information in the block config structure,
      guarded by a new VIRTIO_BLK_F_TOPOLOGY feature flag.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      9752c371
    • C
      block: add topology qdev properties · 428c149b
      Christoph Hellwig 提交于
      Add three new qdev properties to export block topology information to
      the guest.  This is needed to get optimal I/O alignment for RAID arrays
      or SSDs.
      
      The options are:
      
       - physical_block_size to specify the physical block size of the device,
         this is going to increase from 512 bytes to 4096 kilobytes for many
         modern storage devices
       - min_io_size to specify the minimal I/O size without performance impact,
         this is typically set to the RAID chunk size for arrays.
       - opt_io_size to specify the optimal sustained I/O size, this is
         typically the RAID stripe width for arrays.
      
      I decided to not auto-probe these values from blkid which might easily
      be possible as I don't know how to deal with these issues on migration.
      
      Note that we specificly only set the physical_block_size, and not the
      logial one which is the unit all I/O is described in.  The reason for
      that is that IDE does not support increasing the logical block size and
      at last for now I want to stick to one meachnisms in queue and allow
      for easy switching of transports for a given backing image which would
      not be possible if scsi and virtio use real 4k sectors, while ide only
      uses the physical block exponent.
      
      To make this more common for the different block drivers introduce a
      new BlockConf structure holding all common block properties and a
      DEFINE_BLOCK_PROPERTIES macro to add them all together, mirroring
      what is done for network drivers.  Also switch over all block drivers
      to use it, except for the floppy driver which has weird driveA/driveB
      properties and probably won't require any advanced block options ever.
      
      Example usage for a virtio device with 4k physical block size and
      8k optimal I/O size:
      
        -drive file=scratch.img,media=disk,cache=none,id=scratch \
        -device virtio-blk-pci,drive=scratch,physical_block_size=4096,opt_io_size=8192
      
      aliguori: updated patch to take into account BLOCK events
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      428c149b
    • H
      virtio-blk: revert serial number support · 37d5ddd6
      hch@lst.de 提交于
      The addition of the whole ATA IDENTIY page caused the config space to
      go above the allowed size in the PCI spec, and thus the feature was
      already reverted in the Linux guest driver and disabled by default in
      qemu.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      37d5ddd6
    • B
      Increase VNC_MAX_WIDTH · 3f54bfbf
      Brian Jackson 提交于
      Increase VNC_MAX_WIDTH to match "commonly available" consumer level monitors
      available these days.
      
      This also closes KVM bug 2907597
      Signed-off-by: NBrian Jackson <iggy@theiggy.com>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      3f54bfbf
    • T
      qemu-img: use the heap instead of the huge stack array for win32 · d6771bfa
      TeLeMan 提交于
      The default stack size of PE is 1MB on win32 and IO_BUF_SIZE in
      img_convert() & img_rebase() is 2MB, so qemu-img will crash when doing
      "convert" & "rebase" on win32.
      Although we can improve the stack size of PE to resolve it, I think we
      should avoid using the huge stack variables.
      Signed-off-by: NTeLeMan <geleman@gmail.com>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      d6771bfa
    • J
      don't dereference NULL after failed strdup · 6265eb26
      Jim Meyering 提交于
      Most of these are obvious NULL-deref bug fixes, for example,
      the ones in these files:
      
        block/curl.c
        net.c
        slirp/misc.c
      
      and the first one in block/vvfat.c.
      The others in block/vvfat.c may not lead to an immediate segfault, but I
      traced the two schedule_rename(..., strdup(path)) uses, and a failed
      strdup would appear to trigger this assertion in handle_renames_and_mkdirs:
      
      	    assert(commit->path);
      
      The conversion to use qemu_strdup in envlist_to_environ is not technically
      needed, but does avoid a theoretical leak in the caller when strdup fails
      for one value, but later succeeds in allocating another buffer(plausible,
      if one string length is much larger than the others).  The caller does
      not know the length of the returned list, and as such can only free
      pointers until it hits the first NULL.  If there are non-NULL pointers
      beyond the first, their buffers would be leaked.  This one is admittedly
      far-fetched.
      
      The two in linux-user/main.c are worth fixing to ensure that an
      OOM error is diagnosed up front, rather than letting it provoke some
      harder-to-diagnose secondary error, in case of exec failure, or worse, in
      case the exec succeeds but with an invalid list of command line options.
      However, considering how unlikely it is to encounter a failed strdup early
      in main, this isn't a big deal.  Note that adding the required uses of
      qemu_strdup here and in envlist.c induce link failures because qemu_strdup
      is not currently in any library they're linked with.  So for now, I've
      omitted those changes, as well as the fixes in target-i386/helper.c
      and target-sparc/helper.c.
      
      If you'd like to see the above discussion (or anything else)
      in the commit log, just let me know and I'll be happy to adjust.
      
      >From 9af42864fd1ea666bd25e2cecfdfae74c20aa8c7 Mon Sep 17 00:00:00 2001
      From: Jim Meyering <meyering@redhat.com>
      Date: Mon, 8 Feb 2010 18:29:29 +0100
      Subject: [PATCH] don't dereference NULL after failed strdup
      
      Handle failing strdup by replacing each use with qemu_strdup,
      so as not to dereference NULL or trigger a failing assertion.
      * block/curl.c (curl_open): s/\bstrdup\b/qemu_strdup/
      * block/vvfat.c (init_directories): Likewise.
      (get_cluster_count_for_direntry, check_directory_consistency): Likewise.
      * net.c (parse_host_src_port): Likewise.
      * slirp/misc.c (fork_exec): Likewise.
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      6265eb26
    • L
      QMP: Don't leak on connection close · 47116d1c
      Luiz Capitulino 提交于
      QMP's chardev event callback doesn't call
      json_message_parser_destroy() on CHR_EVENT_CLOSED. As the call
      to json_message_parser_init() on CHR_EVENT_OPENED allocates memory,
      we'are leaking on close.
      
      Fix that by just calling json_message_parser_destroy() on
      CHR_EVENT_CLOSED.
      Signed-off-by: NLuiz Capitulino <lcapitulino@redhat.com>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      47116d1c
    • L
      QError: Don't abort on multiple faults · 27a749fb
      Luiz Capitulino 提交于
      Ideally, Monitor code should report an error only once and
      return the error information up the call chain.
      
      To assure that this happens as expected and that no error is
      lost, we have an assert() in qemu_error_internal().
      
      However, we still have not fully converted handlers using
      monitor_printf() to report errors. As there can be multiple
      monitor_printf() calls on an error, the assertion is easily
      triggered when debugging is enabled; and we will get a memory
      leak if it's not.
      
      The solution to this problem is to allow multiple faults by only
      reporting the first one, and to release the additional error objects.
      
      A better mechanism to report multiple errors to programmers is
      underway.
      Signed-off-by: NLuiz Capitulino <lcapitulino@redhat.com>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      27a749fb
    • L
      Monitor: remove unneeded checks · ba144141
      Luiz Capitulino 提交于
      It's not needed to check the return of qobject_from_jsonf()
      anymore, as an assert() has been added there.
      Signed-off-by: NLuiz Capitulino <lcapitulino@redhat.com>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      ba144141
    • L
      qjson: Improve debugging · 668e3cac
      Luiz Capitulino 提交于
      Add an assert() to qobject_from_jsonf() to assure that the returned
      QObject is not NULL. Currently this is duplicated in the callers.
      Signed-off-by: NLuiz Capitulino <lcapitulino@redhat.com>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      668e3cac
    • T
      virtio-net: fix network stall under load · 06b12970
      Tom Lendacky 提交于
      Fix a race condition where qemu finds that there are not enough virtio
      ring buffers available and the guest make more buffers available before
      qemu can enable notifications.
      Signed-off-by: NTom Lendacky <toml@us.ibm.com>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      06b12970
    • R
      json: fix PRId64 on Win32 · 2c0d4b36
      Roy Tam 提交于
      OK we are fooled by the json lexer and parser. As we use %I64d to
      print 'long long' variables in Win32, but lexer and parser only deal
      with %lld but not %I64d, this patch add support for %I64d and solve
      'info pci', 'powser_reset' and 'power_powerdown' assert failure in
      Win32.
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      2c0d4b36
    • M
      fix inet_parse typo · 2198a62e
      Marcelo Tosatti 提交于
      qemu_opt_set wants on/off, not yes/no.
      Signed-off-by: NMarcelo Tosatti <mtosatti@redhat.com>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      2198a62e
    • M
      iothread: fix vcpu stop with smp tcg · c37cc7b0
      Marcelo Tosatti 提交于
      Round robin vcpus in tcg_cpu_next even if the vm stopped. This
      allows all cpus to enter stopped state.
      Signed-off-by: NMarcelo Tosatti <mtosatti@redhat.com>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      c37cc7b0
    • L
      5307d7d3
    • L
      QMP: Enforce capability negotiation rules · 09069b19
      Luiz Capitulino 提交于
      With this commit QMP will be started in Capabilities Negotiation
      mode, where the only command allowed to run is 'qmp_capabilities'.
      
      All other commands will return CommandNotFound error. Asynchronous
      messages are not delivered either.
      
      When 'qmp_capabilities' is successfully executed QMP enters in
      Command mode, where all commands (except 'qmp_capabilities') are
      allowed to run and asynchronous messages are delivered.
      Signed-off-by: NLuiz Capitulino <lcapitulino@redhat.com>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      09069b19
    • L
      QMP: Introduce the qmp_capabilities command · 4a7e1190
      Luiz Capitulino 提交于
      This command will be used to enable QMP capabilities advertised
      by the capabilities array.
      
      Note that it will be mandatory to issue this command in order
      to make QMP functional (although this behavior is not being
      enforced by this commit).
      
      Also, as we don't have any capabilities yet, the new command
      doesn't accept any arguments. I will postpone the decision for
      a format for this until we get our first capability.
      
      Finally, this command is visible from the user Monitor too, in
      the meaning that you can execute it but it won't do anything.
      Making it only visible in QMP is beyond this series' goal, as
      it requires changes in unrelated places.
      Signed-off-by: NLuiz Capitulino <lcapitulino@redhat.com>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      4a7e1190
    • L
      QMP: Add QEMU's version to the greeting message · ca9567e2
      Luiz Capitulino 提交于
      With capability negotiation support clients will only have a chance
      to check QEMU's version (ie. issue 'query-version') after the
      negotiation procedure is done.
      
      It might be useful to clients to check QEMU's version before
      negotiating features, though.
      
      To allow that, this commit adds the QEMU's version object to the
      greeting message.
      
      Not really sure this is needed, but doesn't hurt anyway.
      Signed-off-by: NLuiz Capitulino <lcapitulino@redhat.com>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      ca9567e2