mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-24 14:45:24 +00:00
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
This commit is contained in:
parent
51ae69be69
commit
c1b2264477
@ -554,11 +554,11 @@ libvirt_la_BUILT_LIBADD += libvirt_driver_remote.la
|
|||||||
endif
|
endif
|
||||||
libvirt_driver_remote_la_CFLAGS = \
|
libvirt_driver_remote_la_CFLAGS = \
|
||||||
$(GNUTLS_CFLAGS) \
|
$(GNUTLS_CFLAGS) \
|
||||||
$(SASL_CFLAGS) $(XDR_CFLAGS) \
|
|
||||||
-I@top_srcdir@/src/conf \
|
-I@top_srcdir@/src/conf \
|
||||||
|
-I@top_srcdir@/src/rpc \
|
||||||
$(AM_CFLAGS)
|
$(AM_CFLAGS)
|
||||||
libvirt_driver_remote_la_LDFLAGS = $(AM_LDFLAGS)
|
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
|
if WITH_DRIVER_MODULES
|
||||||
libvirt_driver_remote_la_LIBADD += ../gnulib/lib/libgnu.la
|
libvirt_driver_remote_la_LIBADD += ../gnulib/lib/libgnu.la
|
||||||
libvirt_driver_remote_la_LDFLAGS += -module -avoid-version
|
libvirt_driver_remote_la_LDFLAGS += -module -avoid-version
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -1326,7 +1326,7 @@ elsif ($opt_k) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($call->{streamflag} ne "none") {
|
if ($call->{streamflag} ne "none") {
|
||||||
print " struct private_stream_data *privst = NULL;\n";
|
print " virNetClientStreamPtr netst = NULL;\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
print "\n";
|
print "\n";
|
||||||
@ -1334,11 +1334,16 @@ elsif ($opt_k) {
|
|||||||
|
|
||||||
if ($call->{streamflag} ne "none") {
|
if ($call->{streamflag} ne "none") {
|
||||||
print "\n";
|
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 " goto done;\n";
|
||||||
print "\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->driver = &remoteStreamDrv;\n";
|
||||||
print " st->privateData = privst;\n";
|
print " st->privateData = netst;\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($call->{ProcName} eq "SupportsFeature") {
|
if ($call->{ProcName} eq "SupportsFeature") {
|
||||||
@ -1403,7 +1408,8 @@ elsif ($opt_k) {
|
|||||||
print " (xdrproc_t)xdr_$call->{ret}, (char *)$call_ret) == -1) {\n";
|
print " (xdrproc_t)xdr_$call->{ret}, (char *)$call_ret) == -1) {\n";
|
||||||
|
|
||||||
if ($call->{streamflag} ne "none") {
|
if ($call->{streamflag} ne "none") {
|
||||||
print " remoteStreamRelease(st);\n";
|
print " virNetClientRemoveStream(priv->client, netst);\n";
|
||||||
|
print " virNetClientStreamFree(netst);\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
print " goto done;\n";
|
print " goto done;\n";
|
||||||
|
Loading…
Reference in New Issue
Block a user