提交 464a41bc 编写于 作者: D Daniel P. Berrangé

qemu: delete methods which are no longer supported

The public API entry points will report VIR_ERR_NO_SUPPORT to the
caller when a driver does not provide an implementation of a particular
method.

When deleting methods, leaving the driver API entry point explicitly
set to NULL with an version range comment, allows the hvsupport.html
page to document when the AP was removed.
Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
上级 773f923e
...@@ -234,17 +234,22 @@ foreach my $src (@srcs) { ...@@ -234,17 +234,22 @@ foreach my $src (@srcs) {
} }
} else { } else {
if ($line =~ m!\s*\.(\w+)\s*=\s*(\w+)\s*,?\s*(?:/\*\s*(\d+\.\d+\.\d+)\s*(?:\(deprecated:\s*(\d+\.\d+\.\d+)\))?\s*\*/\s*)?$!) { if ($line =~ m!\s*\.(\w+)\s*=\s*(\w+)\s*,?\s*(?:/\*\s*(\d+\.\d+\.\d+)\s*(?:-\s*(\d+\.\d+\.\d+))?\s*\*/\s*)?$!) {
my $api = $1; my $api = $1;
my $meth = $2; my $meth = $2;
my $vers = $3; my $vers = $3;
my $depre = $4; my $deleted = $4;
next if $api eq "no" || $api eq "name"; next if $api eq "no" || $api eq "name";
die "Method $meth in $src is missing version" unless defined $vers || $api eq "connectURIProbe"; if ($meth eq "NULL" && !defined $deleted) {
die "Method impl for $api is NULL, but no deleted version is provided";
}
if ($meth ne "NULL" && defined $deleted) {
die "Method impl for $api is non-NULL, but deleted version is provided";
}
die "Driver method for $api is NULL in $src" if $meth eq "NULL"; die "Method $meth in $src is missing version" unless defined $vers || $api eq "connectURIProbe";
if (!exists($groups{$ingrp}->{apis}->{$api})) { if (!exists($groups{$ingrp}->{apis}->{$api})) {
next if $api =~ /\w(Open|Close|URIProbe)/; next if $api =~ /\w(Open|Close|URIProbe)/;
...@@ -254,7 +259,7 @@ foreach my $src (@srcs) { ...@@ -254,7 +259,7 @@ foreach my $src (@srcs) {
$groups{$ingrp}->{drivers}->{$impl}->{$api} = {}; $groups{$ingrp}->{drivers}->{$impl}->{$api} = {};
$groups{$ingrp}->{drivers}->{$impl}->{$api}->{vers} = $vers; $groups{$ingrp}->{drivers}->{$impl}->{$api}->{vers} = $vers;
$groups{$ingrp}->{drivers}->{$impl}->{$api}->{depre} = $depre; $groups{$ingrp}->{drivers}->{$impl}->{$api}->{deleted} = $deleted;
if ($api eq "domainMigratePrepare" || if ($api eq "domainMigratePrepare" ||
$api eq "domainMigratePrepare2" || $api eq "domainMigratePrepare2" ||
$api eq "domainMigratePrepare3") { $api eq "domainMigratePrepare3") {
...@@ -351,9 +356,9 @@ print <<EOF; ...@@ -351,9 +356,9 @@ print <<EOF;
<p> <p>
This page documents which <a href="html/">libvirt calls</a> work on This page documents which <a href="html/">libvirt calls</a> work on
which libvirt drivers / hypervisors, and which version the API appeared which libvirt drivers / hypervisors, and which version the API appeared
in. If a hypervisor driver deprecated the API, the version when it in. If a hypervisor driver later dropped support for the API, the version
was removed is also mentioned (highlighted in when it was removed is also mentioned (highlighted in
<span class="deprecatedhv">dark red</span>). <span class="removedhv">dark red</span>).
</p> </p>
EOF EOF
...@@ -411,8 +416,8 @@ EOF ...@@ -411,8 +416,8 @@ EOF
if ($groups{$grp}->{drivers}->{$drv}->{$field}->{vers}) { if ($groups{$grp}->{drivers}->{$drv}->{$field}->{vers}) {
print $groups{$grp}->{drivers}->{$drv}->{$field}->{vers}; print $groups{$grp}->{drivers}->{$drv}->{$field}->{vers};
} }
if ($groups{$grp}->{drivers}->{$drv}->{$field}->{depre}) { if ($groups{$grp}->{drivers}->{$drv}->{$field}->{deleted}) {
print " - <span class=\"deprecatedhv\">", $groups{$grp}->{drivers}->{$drv}->{$field}->{depre}, "</span>"; print " - <span class=\"removedhv\">", $groups{$grp}->{drivers}->{$drv}->{$field}->{deleted}, "</span>";
} }
} }
print "</td>\n"; print "</td>\n";
......
...@@ -588,7 +588,7 @@ td.enumvalue { ...@@ -588,7 +588,7 @@ td.enumvalue {
display: inline; display: inline;
} }
.deprecatedhv { .removedhv {
color: darkred; color: darkred;
} }
......
...@@ -212,6 +212,8 @@ while (<>) { ...@@ -212,6 +212,8 @@ while (<>) {
my $api = $1; my $api = $1;
my $impl = $2; my $impl = $2;
next if $impl eq "NULL";
if ($api ne "no" && if ($api ne "no" &&
$api ne "name" && $api ne "name" &&
$table ne "virStateDriver" && $table ne "virStateDriver" &&
......
...@@ -37,6 +37,7 @@ while (<>) { ...@@ -37,6 +37,7 @@ while (<>) {
next if $api eq "no"; next if $api eq "no";
next if $api eq "name"; next if $api eq "name";
next if $impl eq "NULL";
my $suffix = $impl; my $suffix = $impl;
my $prefix = $impl; my $prefix = $impl;
......
...@@ -7316,22 +7316,6 @@ static char ...@@ -7316,22 +7316,6 @@ static char
} }
static char *
qemuConnectDomainXMLFromNative(virConnectPtr conn,
const char *format ATTRIBUTE_UNUSED,
const char *config ATTRIBUTE_UNUSED,
unsigned int flags)
{
virCheckFlags(0, NULL);
if (virConnectDomainXMLFromNativeEnsureACL(conn) < 0)
return NULL;
virReportError(VIR_ERR_DEPRECATED, "%s",
_("converting arbitrary QEMU command lines to libvirt domain XML is no longer supported"));
return NULL;
}
static char *qemuConnectDomainXMLToNative(virConnectPtr conn, static char *qemuConnectDomainXMLToNative(virConnectPtr conn,
const char *format, const char *format,
const char *xmlData, const char *xmlData,
...@@ -16772,19 +16756,6 @@ static int qemuDomainQemuMonitorCommand(virDomainPtr domain, const char *cmd, ...@@ -16772,19 +16756,6 @@ static int qemuDomainQemuMonitorCommand(virDomainPtr domain, const char *cmd,
} }
static virDomainPtr
qemuDomainQemuAttach(virConnectPtr conn ATTRIBUTE_UNUSED,
unsigned int pid_value ATTRIBUTE_UNUSED,
unsigned int flags)
{
virCheckFlags(0, NULL);
virReportError(VIR_ERR_DEPRECATED, "%s",
_("attaching to a QEMU process started outside of libvirt is no longer supported"));
return NULL;
}
static int static int
qemuDomainOpenConsole(virDomainPtr dom, qemuDomainOpenConsole(virDomainPtr dom,
const char *dev_name, const char *dev_name,
...@@ -22271,7 +22242,7 @@ static virHypervisorDriver qemuHypervisorDriver = { ...@@ -22271,7 +22242,7 @@ static virHypervisorDriver qemuHypervisorDriver = {
.domainGetSecurityLabelList = qemuDomainGetSecurityLabelList, /* 0.10.0 */ .domainGetSecurityLabelList = qemuDomainGetSecurityLabelList, /* 0.10.0 */
.nodeGetSecurityModel = qemuNodeGetSecurityModel, /* 0.6.1 */ .nodeGetSecurityModel = qemuNodeGetSecurityModel, /* 0.6.1 */
.domainGetXMLDesc = qemuDomainGetXMLDesc, /* 0.2.0 */ .domainGetXMLDesc = qemuDomainGetXMLDesc, /* 0.2.0 */
.connectDomainXMLFromNative = qemuConnectDomainXMLFromNative, /* 0.6.4 (deprecated: 5.5.0) */ .connectDomainXMLFromNative = NULL, /* 0.6.4 - 5.5.0 */
.connectDomainXMLToNative = qemuConnectDomainXMLToNative, /* 0.6.4 */ .connectDomainXMLToNative = qemuConnectDomainXMLToNative, /* 0.6.4 */
.connectListDefinedDomains = qemuConnectListDefinedDomains, /* 0.2.0 */ .connectListDefinedDomains = qemuConnectListDefinedDomains, /* 0.2.0 */
.connectNumOfDefinedDomains = qemuConnectNumOfDefinedDomains, /* 0.2.0 */ .connectNumOfDefinedDomains = qemuConnectNumOfDefinedDomains, /* 0.2.0 */
...@@ -22356,7 +22327,7 @@ static virHypervisorDriver qemuHypervisorDriver = { ...@@ -22356,7 +22327,7 @@ static virHypervisorDriver qemuHypervisorDriver = {
.domainRevertToSnapshot = qemuDomainRevertToSnapshot, /* 0.8.0 */ .domainRevertToSnapshot = qemuDomainRevertToSnapshot, /* 0.8.0 */
.domainSnapshotDelete = qemuDomainSnapshotDelete, /* 0.8.0 */ .domainSnapshotDelete = qemuDomainSnapshotDelete, /* 0.8.0 */
.domainQemuMonitorCommand = qemuDomainQemuMonitorCommand, /* 0.8.3 */ .domainQemuMonitorCommand = qemuDomainQemuMonitorCommand, /* 0.8.3 */
.domainQemuAttach = qemuDomainQemuAttach, /* 0.9.4 (deprecated: 5.5.0) */ .domainQemuAttach = NULL, /* 0.9.4 - 5.5.0 */
.domainQemuAgentCommand = qemuDomainQemuAgentCommand, /* 0.10.0 */ .domainQemuAgentCommand = qemuDomainQemuAgentCommand, /* 0.10.0 */
.connectDomainQemuMonitorEventRegister = qemuConnectDomainQemuMonitorEventRegister, /* 1.2.3 */ .connectDomainQemuMonitorEventRegister = qemuConnectDomainQemuMonitorEventRegister, /* 1.2.3 */
.connectDomainQemuMonitorEventDeregister = qemuConnectDomainQemuMonitorEventDeregister, /* 1.2.3 */ .connectDomainQemuMonitorEventDeregister = qemuConnectDomainQemuMonitorEventDeregister, /* 1.2.3 */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册