OSDN Git Service

convert net_init_socket() to NetClientOptions
authorLaszlo Ersek <lersek@redhat.com>
Tue, 17 Jul 2012 14:17:17 +0000 (16:17 +0200)
committerStefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Mon, 23 Jul 2012 10:55:18 +0000 (11:55 +0100)
commitbef8e8fe07e80821992f61d3775c6ac3766eee48
tree3296361f99feef37c1b0432f5981c4105ee8577a
parent094f15c5c80a835dbe69afa8534909c681d35856
convert net_init_socket() to NetClientOptions

I "reverse engineered" the following permissions between the -socket
sub-options:

             fd  listen  connect  mcast  udp | localaddr
  fd         x   .       .        .      .   | .
  listen     .   x       .        .      .   | .
  connect    .   .       x        .      .   | .
  mcast      .   .       .        x      .   | x
  udp        .   .       .        .      x   | x
  -------------------------------------------+
  localaddr  .   .       .        x      x     x

I transformed the code accordingly. The real fix would be to embed "fd",
"listen", "connect", "mcast" and "udp" in a separate union. However
OptsVisitor's enum parser only supports the type=XXX QemuOpt instance as
union discriminator.

Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
net/socket.c