1. 02 11月, 2016 1 次提交
  2. 24 10月, 2016 5 次提交
  3. 22 8月, 2016 1 次提交
    • M
      slirp: fix segv when init failed · 67f3280c
      Marc-André Lureau 提交于
      Since commit f6c2e66a, slirp uses an exit notifier to call
      slirp_smb_cleanup. However, if init() failed, the notifier isn't added,
      and removing it will fail:
      
      ==18447== Invalid write of size 8
      ==18447==    at 0x7EF2B5: notifier_remove (notify.c:32)
      ==18447==    by 0x48E80C: qemu_remove_exit_notifier (vl.c:2661)
      ==18447==    by 0x6A2187: net_slirp_cleanup (slirp.c:134)
      ==18447==    by 0x69419D: qemu_cleanup_net_client (net.c:338)
      ==18447==    by 0x69445B: qemu_del_net_client (net.c:401)
      ==18447==    by 0x6A2B81: net_slirp_init (slirp.c:366)
      ==18447==    by 0x6A4241: net_init_slirp (slirp.c:865)
      ==18447==    by 0x695C6D: net_client_init1 (net.c:1051)
      ==18447==    by 0x695F6E: net_client_init (net.c:1108)
      ==18447==    by 0x696DBA: net_init_netdev (net.c:1498)
      ==18447==    by 0x7F1F99: qemu_opts_foreach (qemu-option.c:1116)
      ==18447==    by 0x696E60: net_init_clients (net.c:1516)
      ==18447==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
      Signed-off-by: NMarc-André Lureau <marcandre.lureau@redhat.com>
      Signed-off-by: NJason Wang <jasowang@redhat.com>
      67f3280c
  4. 20 7月, 2016 1 次提交
    • E
      qapi: Change Netdev into a flat union · f394b2e2
      Eric Blake 提交于
      This is a mostly-mechanical conversion that creates a new flat
      union 'Netdev' QAPI type that covers all the branches of the
      former 'NetClientOptions' simple union, where the branches are
      now listed in a new 'NetClientDriver' enum rather than generated
      from the simple union.  The existence of a flat union has no
      change to the command line syntax accepted for new code, and
      will make it possible for a future patch to switch the QMP
      command to parse a boxed union for no change to valid QMP; but
      it does have some ripple effect on the C code when dealing with
      the new types.
      
      While making the conversion, note that the 'NetLegacy' type
      remains unchanged: it applies only to legacy command line options,
      and will not be ported to QMP, so it should remain a wrapper
      around a simple union; to avoid confusion, the type named
      'NetClientOptions' is now gone, and we introduce 'NetLegacyOptions'
      in its place.  Then, in the C code, we convert from NetLegacy to
      Netdev as soon as possible, so that the bulk of the net stack
      only has to deal with one QAPI type, not two.  Note that since
      the old legacy code always rejected 'hubport', we can just omit
      that branch from the new 'NetLegacyOptions' simple union.
      
      Based on an idea originally by Zoltán Kővágó <DirtY.iCE.hu@gmail.com>:
      Message-Id: <01a527fbf1a5de880091f98cf011616a78adeeee.1441627176.git.DirtY.iCE.hu@gmail.com>
      although the sed script in that patch no longer applies due to
      other changes in the tree since then, and I also did some manual
      cleanups (such as fixing whitespace to keep checkpatch happy).
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Message-Id: <1468468228-27827-13-git-send-email-eblake@redhat.com>
      Reviewed-by: NMarkus Armbruster <armbru@redhat.com>
      [Fixup from Eric squashed in]
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      f394b2e2
  5. 19 7月, 2016 1 次提交
  6. 13 7月, 2016 1 次提交
  7. 01 4月, 2016 1 次提交
  8. 29 3月, 2016 1 次提交
  9. 23 3月, 2016 1 次提交
  10. 18 3月, 2016 1 次提交
    • E
      qapi: Don't special-case simple union wrappers · 32bafa8f
      Eric Blake 提交于
      Simple unions were carrying a special case that hid their 'data'
      QMP member from the resulting C struct, via the hack method
      QAPISchemaObjectTypeVariant.simple_union_type().  But by using
      the work we started by unboxing flat union and alternate
      branches, coupled with the ability to visit the members of an
      implicit type, we can now expose the simple union's implicit
      type in qapi-types.h:
      
      | struct q_obj_ImageInfoSpecificQCow2_wrapper {
      |     ImageInfoSpecificQCow2 *data;
      | };
      |
      | struct q_obj_ImageInfoSpecificVmdk_wrapper {
      |     ImageInfoSpecificVmdk *data;
      | };
      ...
      | struct ImageInfoSpecific {
      |     ImageInfoSpecificKind type;
      |     union { /* union tag is @type */
      |         void *data;
      |-        ImageInfoSpecificQCow2 *qcow2;
      |-        ImageInfoSpecificVmdk *vmdk;
      |+        q_obj_ImageInfoSpecificQCow2_wrapper qcow2;
      |+        q_obj_ImageInfoSpecificVmdk_wrapper vmdk;
      |     } u;
      | };
      
      Doing this removes asymmetry between QAPI's QMP side and its
      C side (both sides now expose 'data'), and means that the
      treatment of a simple union as sugar for a flat union is now
      equivalent in both languages (previously the two approaches used
      a different layer of dereferencing, where the simple union could
      be converted to a flat union with equivalent C layout but
      different {} on the wire, or to an equivalent QMP wire form
      but with different C representation).  Using the implicit type
      also lets us get rid of the simple_union_type() hack.
      
      Of course, now all clients of simple unions have to adjust from
      using su->u.member to using su->u.member.data; while this touches
      a number of files in the tree, some earlier cleanup patches
      helped minimize the change to the initialization of a temporary
      variable rather than every single member access.  The generated
      qapi-visit.c code is also affected by the layout change:
      
      |@@ -7393,10 +7393,10 @@ void visit_type_ImageInfoSpecific_member
      |     }
      |     switch (obj->type) {
      |     case IMAGE_INFO_SPECIFIC_KIND_QCOW2:
      |-        visit_type_ImageInfoSpecificQCow2(v, "data", &obj->u.qcow2, &err);
      |+        visit_type_q_obj_ImageInfoSpecificQCow2_wrapper_members(v, &obj->u.qcow2, &err);
      |         break;
      |     case IMAGE_INFO_SPECIFIC_KIND_VMDK:
      |-        visit_type_ImageInfoSpecificVmdk(v, "data", &obj->u.vmdk, &err);
      |+        visit_type_q_obj_ImageInfoSpecificVmdk_wrapper_members(v, &obj->u.vmdk, &err);
      |         break;
      |     default:
      |         abort();
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Message-Id: <1458254921-17042-13-git-send-email-eblake@redhat.com>
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      32bafa8f
  11. 15 3月, 2016 1 次提交
  12. 05 2月, 2016 1 次提交
    • P
      net: Clean up includes · 2744d920
      Peter Maydell 提交于
      Clean up includes so that osdep.h is included first and headers
      which it implies are not included manually.
      
      This commit was created with scripts/clean-includes.
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      Message-id: 1454089805-5470-11-git-send-email-peter.maydell@linaro.org
      2744d920
  13. 04 2月, 2016 1 次提交
  14. 02 11月, 2015 1 次提交
    • E
      net: Convert to new qapi union layout · 8d0bcba8
      Eric Blake 提交于
      We have two issues with our qapi union layout:
      1) Even though the QMP wire format spells the tag 'type', the
      C code spells it 'kind', requiring some hacks in the generator.
      2) The C struct uses an anonymous union, which places all tag
      values in the same namespace as all non-variant members. This
      leads to spurious collisions if a tag value matches a non-variant
      member's name.
      
      Make the conversion to the new layout for net-related code.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Message-Id: <1445898903-12082-18-git-send-email-eblake@redhat.com>
      [Commit message tweaked slightly]
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      8d0bcba8
  15. 23 6月, 2015 1 次提交
  16. 03 6月, 2015 1 次提交
  17. 27 5月, 2015 1 次提交
    • M
      net: Permit incremental conversion of init functions to Error · a30ecde6
      Markus Armbruster 提交于
      Error reporting for netdev_add is broken: the net_client_init_fun[]
      report the actual errors with (at best) error_report(), and their
      caller net_client_init1() makes up a generic error on top.
      
      For command line and HMP, this produces an mildly ugly error cascade.
      
      In QMP, the actual errors go to stderr, and the generic error becomes
      the command's error reply.
      
      To fix this, we need to convert the net_client_init_fun[] to Error.
      
      To permit fixing them one by one, add an Error ** parameter to the
      net_client_init_fun[].  If the call fails without returning an Error,
      make up the same generic Error as before.  But if it returns one, use
      that instead.  Since none of them does so far, no functional change.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Message-id: 1431691143-1015-3-git-send-email-armbru@redhat.com
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      a30ecde6
  18. 18 2月, 2015 2 次提交
    • M
      hmp: Name HMP info handler functions hmp_info_SUBCOMMAND() · 1ce6be24
      Markus Armbruster 提交于
      Some are called do_info_SUBCOMMAND() (old ones, usually), some
      hmp_info_SUBCOMMAND(), some SUBCOMMAND_info(), sometimes SUBCOMMAND
      pointlessly differs in spelling.
      
      Normalize to hmp_info_SUBCOMMAND(), where SUBCOMMAND is exactly the
      subcommand name with '-' replaced by '_'.
      
      Exceptions:
      
      * sun4m_irq_info(), sun4m_pic_info() renamed to sun4m_hmp_info_irq(),
        sun4m_hmp_info_pic().
      
      * lm32_irq_info(), lm32_pic_info() renamed to lm32_hmp_info_irq(),
        lm32_hmp_info_pic().
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      1ce6be24
    • M
      hmp: Name HMP command handler functions hmp_COMMAND() · 3e5a50d6
      Markus Armbruster 提交于
      Some are called do_COMMAND() (old ones, usually), some hmp_COMMAND(),
      and sometimes COMMAND pointlessly differs in spelling.
      
      Normalize to hmp_COMMAND(), where COMMAND is exactly the command name
      with '-' replaced by '_'.
      
      Exceptions:
      
      * do_device_add() and client_migrate_info() *not* renamed to
        hmp_device_add(), hmp_client_migrate_info(), because they're also
        QMP handlers.  They still need to be converted to QAPI.
      
      * do_memory_dump(), do_physical_memory_dump(), do_ioport_read(),
        do_ioport_write() renamed do hmp_* instead of hmp_x(), hmp_xp(),
        hmp_i(), hmp_o(), because those names are too cryptic for my taste.
      
      * do_info_help() renamed to hmp_info_help() instead of hmp_info(),
        because it only covers help.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      3e5a50d6
  19. 19 12月, 2014 1 次提交
  20. 21 11月, 2014 1 次提交
  21. 11 11月, 2014 1 次提交
    • P
      slirp/smbd: modify/set several parameters in generated smbd.conf · 7912d04b
      Peter Wu 提交于
      The file sharing module should not handle printers, so disable it.
      The options 'load printers' and 'printing' have been available since the
      beginning (May 1996, commit 0e8fd3398771da2f016d72830179507f3edda51b).
      Option 'disable spoolss' is available since Samba 2.0.4, commit
      de5f42c9d9172592779fa2504d44544e3b6b1c0d).
      
      Next, "socket address" was reported as deprecated, use a combination of
      "interfaces" and "bind interfaces only" instead (available since October
      1997, commit 79f4fb52c1ed56fd843f81b4eb0cdd2991d4d0f4).
      
      Override cache directory to avoid writing to a global directory. Option
      available since Samba 3.4.0, Jan 2009, commit
      19a05bf2f485023b11b41dfae3f6459847d55ef7.
      
      Set "usershare max shared=0" to prevent a global directory from being
      used. Option available since Samba 3.0.23, February 2006, commit
      5831715049f2d460ce42299963a5defdc160891b.
      
      The last option was introduced with Samba 3.4.0, but previously
      "state directory" was already added which exists in Samba 3.4.0. As
      unknown parameters are ignored (while printing a warning), it should be
      safe to add another option.
      Signed-off-by: NPeter Wu <peter@lekensteyn.nl>
      Cc: Jan Kiszka <jan.kiszka@siemens.com>
      Signed-off-by: NMichael Tokarev <mjt@tls.msk.ru>
      7912d04b
  22. 02 11月, 2014 1 次提交
  23. 03 9月, 2014 1 次提交
  24. 18 7月, 2014 1 次提交
  25. 28 4月, 2014 1 次提交
    • M
      slirp/smb: Move ncalrpc directory to tmp · b87b8a8b
      Michael Buesch 提交于
      The smbd forked by qemu still uses the default ncalrpc directory
      in /var/run/samba. This may lead to problems, if /var/run/samba
      does not exist (for example if /var/run is a tmpfs and the host
      smbd was not started).
      
      This leads to the following error message from samba
      and an unworkable smbd:
      	Failed to create pipe directory /var/run/samba/ncalrpc - No such file or directory
      
      Fix this by pointing smbd to /tmp/qemu-smb.%d.%d/ncalrpc as ncalrpc directory.
      Smbd will create the actual ncalrpc subdirectory on its own.
      Signed-off-by: NMichael Buesch <m@bues.ch>
      Cc: Jan Kiszka <jan.kiszka@siemens.com>
      Signed-off-by: NMichael Tokarev <mjt@tls.msk.ru>
      (Applying this to -trivial because it _is_ rather trivial
       and because Jan does not reply for months)
      b87b8a8b
  26. 12 3月, 2014 2 次提交
    • M
      slirp smb with modern win guests when samba is also running on host · 5c1e1890
      Michael Tokarev 提交于
      After numerous reports that -smb (or -netdev user,smb=foo) not working
      with modern windows (win7 and vista are reported as non-working), I
      started digging myself.  And found that indeed it doesn't work, and
      why.
      
      The thing is that modern win tries to connect to port 445 (microsoft-ds)
      first, and if that fails, it falls back to old port 139 (netbios-ssn).
      
      slirp code in qemu only redirects port 139, it does not touch port 445.
      
      So the prob is that if samba is also running on the host, guest will try
      to communicate using port 445, and that will succed, but ofcourse guest
      will not talk with our samba but with samba running on the host.
      
      If samba is not running on the host, guest will fall back to port 139,
      and will reach the redirecting rule and qemu will spawn smbd correctly.
      
      The solution is to redirect both ports (139 and 445), and the fix is
      a one-liner, adding second call to slirp_add_exec() at the end of
      net/slirp.c:slirp_smb() function (provided below).
      
      But it looks like that is not a proper fix really, since in theory
      we should redirect both ports to the SAME, single samba instance,
      but I'm not sure this is possible with slirp.  Well, even if two
      smbd processes will be run on the same config dir, it should not
      be a problem.
      
      The one-liner (not exactly 1 since it touches previous line too) is like
      this:
      Signed-off-By: NMichael Tokarev <mjt@tls.msk.ru>
      Signed-off-by: NJan Kiszka <jan.kiszka@siemens.com>
      5c1e1890
    • M
      qemu/slirp: Fix SMB security configuration on newer samba versions · c2804ee6
      Michael Buesch 提交于
      The smb.conf automatically generated by qemu's -smb option fails on current
      samba, because smbd rejects the security=share option with the following warning:
      
      >   WARNING: Ignoring invalid value 'share' for parameter 'security'
      
      Which makes it fall back to security=user without guest login.
      This results in being unable to login to the samba server from the guest OS.
      
      This fixes it by selecting 'user' explicitly and mapping
      unknown users to guest logins.
      Signed-off-by: NMichael Buesch <m@bues.ch>
      Reviewed-by: NMichael Tokarev <mjt@tls.msk.ru>
      Signed-off-by: NJan Kiszka <jan.kiszka@siemens.com>
      c2804ee6
  27. 19 6月, 2013 1 次提交
  28. 16 4月, 2013 1 次提交
  29. 05 4月, 2013 1 次提交
  30. 17 1月, 2013 1 次提交
  31. 19 12月, 2012 4 次提交