提交 c1b22644 编写于 作者: D Daniel P. Berrange

Convert the remote driver to new RPC client APIs

This guts the current remote driver, removing all its networking
handling code. Instead it calls out to the new virClientPtr and
virClientProgramPtr APIs for all RPC & networking work.

* src/Makefile.am: Link remote driver with generic RPC code
* src/remote/remote_driver.c: Gut code, replacing with RPC
  API calls
* src/rpc/gendispatch.pl: Update for changes in the way
  streams are handled
上级 51ae69be
......@@ -554,11 +554,11 @@ libvirt_la_BUILT_LIBADD += libvirt_driver_remote.la
endif
libvirt_driver_remote_la_CFLAGS = \
$(GNUTLS_CFLAGS) \
$(SASL_CFLAGS) $(XDR_CFLAGS) \
-I@top_srcdir@/src/conf \
-I@top_srcdir@/src/rpc \
$(AM_CFLAGS)
libvirt_driver_remote_la_LDFLAGS = $(AM_LDFLAGS)
libvirt_driver_remote_la_LIBADD = $(GNUTLS_LIBS) $(SASL_LIBS)
libvirt_driver_remote_la_LIBADD = $(GNUTLS_LIBS) libvirt-net-rpc-client.la libvirt-net-rpc.la
if WITH_DRIVER_MODULES
libvirt_driver_remote_la_LIBADD += ../gnulib/lib/libgnu.la
libvirt_driver_remote_la_LDFLAGS += -module -avoid-version
......
此差异已折叠。
......@@ -1326,7 +1326,7 @@ elsif ($opt_k) {
}
if ($call->{streamflag} ne "none") {
print " struct private_stream_data *privst = NULL;\n";
print " virNetClientStreamPtr netst = NULL;\n";
}
print "\n";
......@@ -1334,11 +1334,16 @@ elsif ($opt_k) {
if ($call->{streamflag} ne "none") {
print "\n";
print " if (!(privst = remoteStreamOpen(st, REMOTE_PROC_$call->{UC_NAME}, priv->counter)))\n";
print " if (!(netst = virNetClientStreamNew(priv->remoteProgram, REMOTE_PROC_$call->{UC_NAME}, priv->counter)))\n";
print " goto done;\n";
print "\n";
print " if (virNetClientAddStream(priv->client, netst) < 0) {";
print " virNetClientStreamFree(netst);\n";
print " goto done;\n";
print " }";
print "\n";
print " st->driver = &remoteStreamDrv;\n";
print " st->privateData = privst;\n";
print " st->privateData = netst;\n";
}
if ($call->{ProcName} eq "SupportsFeature") {
......@@ -1403,7 +1408,8 @@ elsif ($opt_k) {
print " (xdrproc_t)xdr_$call->{ret}, (char *)$call_ret) == -1) {\n";
if ($call->{streamflag} ne "none") {
print " remoteStreamRelease(st);\n";
print " virNetClientRemoveStream(priv->client, netst);\n";
print " virNetClientStreamFree(netst);\n";
}
print " goto done;\n";
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册