On Thu, Mar 23, 2017 at 4:11 PM, Ashish Gahlot <dreamashis...@gmail.com> wrote:
> Actually, I'm trying to run two separate Qemu processes and the command line 
> argument is "qemu-system-x86_64 -kernel kernel -S -s" and the error which I 
> get on second invocation is
> > qemu-system-x86_64: -s: Failed to bind socket: Address already in use

Please keep qemu-devel@nongnu.org CCed so that the conversation stays
on the mailing list.

This is expected behavior.  The man page says:

  -s  Shorthand for -gdb tcp::1234, i.e. open a gdbserver on TCP port 1234.

Two processes cannot listen on the same port*, even with SO_REUSEADDR.

Please specify unique port numbers using the longer syntax from the man page:

  $ qemu-system-x86_64 -kernel kernel -S -gdb tcp::1234
  $ qemu-system-x86_64 -kernel kernel -S -gdb tcp::1235

Now you can tell gdb which QEMU instance to connect to.

Stefan

* There is a Linux-specific socket option for allowing multiple
processes to listen on the same port but it's meant for load balancing
and wouldn't help in this case.

Reply via email to