die "cannot parse command line options" unless $res;
die "unknown mode '$mode', expecting 'client', 'server', " .
- "'aclheader', 'aclbody', 'aclsym', 'aclapi' or 'debug'"
- unless $mode =~ /^(client|server|aclheader|aclbody|aclsym|aclapi|debug)$/;
+ "'aclheader', 'aclbody', 'aclsym', or 'debug'"
+ unless $mode =~ /^(client|server|aclheader|aclbody|aclsym|debug)$/;
my $structprefix = shift or die "missing struct prefix argument";
my $procprefix = shift or die "missing procedure prefix argument";
# Automatically generated from $protocol by gendispatch.pl.
# Do not edit this file. Any changes you make will be lost.
__EOF__
-} elsif ($mode eq "aclapi") {
- print <<__EOF__;
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- - Automatically generated from $protocol by gendispatch.pl.
- - Do not edit this file. Any changes you make will be lost.
- -->
-__EOF__
} else {
print <<__EOF__;
/* Automatically generated from $protocol by gendispatch.pl.
}
} elsif ($mode eq "aclheader" ||
$mode eq "aclbody" ||
- $mode eq "aclsym" ||
- $mode eq "aclapi") {
+ $mode eq "aclsym") {
my %generate = map { $_ => 1 } @autogen;
my @keys = keys %calls;
print "\n";
print "#define VIR_FROM_THIS VIR_FROM_ACCESS\n";
print "\n";
- } elsif ($mode eq "aclapi") {
- print "<aclinfo>\n";
} else {
print "\n";
}
print $apiname . "CheckACL;\n";
}
print $apiname . "EnsureACL;\n";
- } elsif ($mode eq "aclapi") {
- &generate_aclapi($call);
} else {
&generate_acl($call, $call->{acl}, "Ensure");
if (defined $call->{aclfilter}) {
print "}\n\n";
}
}
-
- sub generate_aclapi {
- my $call = shift;
-
- my $apiname = $prefix . $call->{ProcName};
- if ($structprefix eq "qemu") {
- $apiname =~ s/(vir(Connect)?Domain)/${1}Qemu/;
- } elsif ($structprefix eq "lxc") {
- $apiname =~ s/virDomain/virDomainLxc/;
- }
-
- print " <api name='$apiname'>\n";
-
- my $acl = $call->{acl};
- foreach (@{$acl}) {
- my @bits = split /:/;
- my $objname = $bits[0];
- $objname =~ s/_/-/g;
- my $perm = $bits[1];
- $perm =~ s/_/-/g;
- print " <check object='$objname' perm='$perm'";
- if (defined $bits[2]) {
- print " flags='$bits[2]'";
- }
- print "/>\n";
- }
-
- my $aclfilter = $call->{aclfilter};
- foreach (@{$aclfilter}) {
- my @bits = split /:/;
- my $objname = $bits[0];
- $objname =~ s/_/-/g;
- my $perm = $bits[1];
- $perm =~ s/_/-/g;
-
- print " <filter object='$objname' perm='$perm'/>\n";
- }
-
- print " </api>\n";
- }
-
- }
-
- if ($mode eq "aclapi") {
- print "</aclinfo>\n";
}
}