1. 01 7月, 2010 1 次提交
    • A
      net: Fix VM start with '-net none' · 03c71553
      Amit Shah 提交于
      Commit 50e32ea8 changed the behaviour
      for the return type of net_client_init() when a nic type with no init
      method was specified. 'none' is one such nic type. Instead of returning
      0, which gets interpreted as an index into the nd_table[] array, we
      switched to returning -1, which signifies an error as well.
      
      That broke VM start with '-net none'. Testing was only done with the
      monitor command 'pci_add', which doesn't fail.
      
      The correct fix would still be to return 0+ values from
      net_client_init() only when the return value can be used as an index to
      refer to an entry in nd_table[]. With the current code, callers can
      erroneously poke into nd_table[0] when -net nic is used, which can lead
      to badness.
      
      However, this commit just returns to the previous behaviour before the
      offending commit.
      Signed-off-by: NAmit Shah <amit.shah@redhat.com>
      Signed-off-by: NAurelien Jarno <aurelien@aurel32.net>
      03c71553
  2. 15 6月, 2010 1 次提交
    • M
      Make netdev_del delete the netdev even when it's in use · 2ffcb18d
      Markus Armbruster 提交于
      To hot-unplug guest and host part of a network device, you do:
      
          device_del NIC-ID
          netdev_del NETDEV-ID
      
      For PCI devices, device_del merely tells ACPI to unplug the device.
      The device goes away for real only after the guest processed the ACPI
      unplug event.
      
      You have to wait until then (e.g. by polling info pci) before you can
      unplug the netdev.  Not good.
      
      Fix by removing the "in use" check from do_netdev_del().  Deleting a
      netdev while it's in use is safe; packets simply get routed to the bit
      bucket.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      2ffcb18d
  3. 09 6月, 2010 1 次提交
    • A
      net: Fix hotplug with pci_add · 50e32ea8
      Amit Shah 提交于
      The correct model type wasn't getting added when hotplugging nics with
      pci_add.
      
      Testcase: start VM with default nic type. In the qemu_monitor:
      
      (qemu) pci_add auto nic model=virtio
      
      This results in a nic hot-plug of the same nic type as the default.
      
      This was broken in 5294e2c7
      
      Also changes the behaviour where no .init is defined for a
      net_client_type. Previously, 0 was returned, which indicated the init
      was successful and that 0 was the index into the nd_tables[] array.
      Return -1, indicating unsuccessful init, in such a case.
      Signed-off-by: NAmit Shah <amit.shah@redhat.com>
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      50e32ea8
  4. 02 6月, 2010 1 次提交
  5. 19 4月, 2010 5 次提交
  6. 10 4月, 2010 2 次提交
  7. 02 4月, 2010 1 次提交
  8. 17 3月, 2010 1 次提交
    • M
      qemu-option: Move the implied first name into QemuOptsList · 8212c64f
      Markus Armbruster 提交于
      We sometimes permit omitting the first option name, for example
      -device foo is short for -device driver=foo.  The name to use
      ("driver" in the example) is passed as argument to qemu_opts_parse().
      For each QemuOptsList, we use at most one such name.
      
      Move the name into QemuOptsList, and pass whether to permit the
      abbreviation.  This ensures continued consistency, and simplifies the
      commit after next in this series.
      8212c64f
  9. 16 3月, 2010 1 次提交
    • M
      error: Replace qemu_error() by error_report() · 1ecda02b
      Markus Armbruster 提交于
      error_report() terminates the message with a newline.  Strip it it
      from its arguments.
      
      This fixes a few error messages lacking a newline:
      net_handle_fd_param()'s "No file descriptor named %s found", and
      tap_open()'s "vnet_hdr=1 requested, but no kernel support for
      IFF_VNET_HDR available" (all three versions).
      
      There's one place that passes arguments without newlines
      intentionally: load_vmstate().  Fix it up.
      1ecda02b
  10. 09 3月, 2010 2 次提交
  11. 22 2月, 2010 1 次提交
  12. 20 2月, 2010 7 次提交
  13. 11 2月, 2010 1 次提交
    • 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
  14. 12 12月, 2009 1 次提交
  15. 03 12月, 2009 12 次提交
  16. 30 11月, 2009 1 次提交
  17. 09 11月, 2009 1 次提交