On 04/23/2013 04:26 AM, Daniel P. Berrange wrote: > From: "Daniel P. Berrange" <berrange@xxxxxxxxxx> > > A number of the remote procedure names did not match the > corresponding API names. For example, many lacked the > word 'CONNECT', others re-arranged the names. Update the > procedures so their names exactly match the API names. > Then remove the special case handling of these APIs in > the generator > > Signed-off-by: Daniel P. Berrange <berrange@xxxxxxxxxx> > --- > daemon/remote.c | 83 ++++++++--------- > src/qemu_protocol-structs | 6 +- > src/remote/qemu_protocol.x | 6 +- > src/remote/remote_driver.c | 216 +++++++++++++++++++++---------------------- > src/remote/remote_protocol.x | 198 +++++++++++++++++++-------------------- > src/remote_protocol-structs | 198 +++++++++++++++++++-------------------- > src/rpc/gendispatch.pl | 31 ++----- > 7 files changed, 363 insertions(+), 375 deletions(-) Seems big but mostly mechanical. Best of all, the compiler checks it. ACK. > +++ b/src/qemu_protocol-structs Any lines removed from one of the *-structs file warrants extra scrutiny, to make sure we aren't breaking on-the-wire ABI... > @@ -4,12 +4,12 @@ struct remote_nonnull_domain { > remote_uuid uuid; > int id; > }; > -struct qemu_monitor_command_args { > +struct qemu_domain_monitor_command_args { > enum qemu_procedure { > - QEMU_PROC_MONITOR_COMMAND = 1, > + QEMU_PROC_DOMAIN_MONITOR_COMMAND = 1, ...but in both of these cases, names are not part of the stable ABI, the struct did not change size, and the semantics of the enum value 1 are identical, so these changes are fine. > +++ b/src/rpc/gendispatch.pl The meat of the change: > @@ -293,8 +293,8 @@ my $long_legacy = { > DomainSetMaxMemory => { arg => { memory => 1 } }, > DomainSetMemory => { arg => { memory => 1 } }, > DomainSetMemoryFlags => { arg => { memory => 1 } }, > - GetLibVersion => { ret => { lib_ver => 1 } }, > - GetVersion => { ret => { hv_ver => 1 } }, > + ConnectGetLibVersion => { ret => { lib_ver => 1 } }, > + ConnectGetVersion => { ret => { hv_ver => 1 } }, > NodeGetInfo => { ret => { memory => 1 } }, > DomainBlockCommit => { arg => { bandwidth => 1 } }, > DomainBlockPull => { arg => { bandwidth => 1 } }, > @@ -606,7 +606,7 @@ elsif ($mode eq "server") { > # error out on unannotated arrays > die "remote_nonnull_string array without insert@<offset> annotation: $ret_member"; > } elsif ($ret_member =~ m/^remote_nonnull_string (\S+);/) { > - if ($call->{ProcName} eq "GetType") { > + if ($call->{ProcName} eq "ConnectGetType") { > # SPECIAL: virConnectGetType returns a constant string that must > # not be freed. Therefore, duplicate the string here. > push(@vars_list, "const char *$1"); > @@ -893,28 +893,14 @@ elsif ($mode eq "server") { > > if (! @args_list) { > push(@args_list, "priv->conn"); > - > - if ($call->{ProcName} ne "NodeGetFreeMemory") { > - $prefix = "Connect" > - } > } > > - if ($call->{ProcName} eq "GetSysinfo" or > - $call->{ProcName} eq "GetMaxVcpus" or > - $call->{ProcName} eq "DomainXMLFromNative" or > - $call->{ProcName} eq "DomainXMLToNative" or > - $call->{ProcName} eq "FindStoragePoolSources" or > - $call->{ProcName} =~ m/^List/) { > - $prefix = "Connect" > - } elsif ($call->{ProcName} eq "SupportsFeature") { > - $prefix = "Drv" > - } elsif ($call->{ProcName} eq "CPUBaseline") { > - $proc_name = "ConnectBaselineCPU" > - } elsif ($call->{ProcName} eq "CPUCompare") { > - $proc_name = "ConnectCompareCPU" > - } elsif ($structprefix eq "qemu" && $call->{ProcName} =~ /^Domain/) { > + if ($structprefix eq "qemu" && $call->{ProcName} =~ /^Domain/) { > $proc_name =~ s/^(Domain)/${1}Qemu/; > } > + if ($structprefix eq "lxc" && $call->{ProcName} =~ /^Domain/) { > + $proc_name =~ s/^(Domain)/${1}Lxc/; > + } Yep, lots nicer with fewer special cases. > > if ($single_ret_as_list) { > print " /* Allocate return buffer. */\n"; > @@ -1538,6 +1524,9 @@ elsif ($mode eq "client") { > if ($structprefix eq "qemu") { > $callflags = "REMOTE_CALL_QEMU"; > } > + if ($structprefix eq "lxc") { > + $callflags = "REMOTE_CALL_LXC"; > + } > > print "\n"; > print " if (call($priv_src, priv, $callflags, $call->{constname},\n"; > -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
Attachment:
signature.asc
Description: OpenPGP digital signature
-- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list