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: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
Daniel P. Berrangé 2019-06-26 16:45:03 +01:00
parent 773f923e74
commit 464a41bc0d
5 changed files with 21 additions and 42 deletions

View File

@ -234,17 +234,22 @@ foreach my $src (@srcs) {
}
} 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 $meth = $2;
my $vers = $3;
my $depre = $4;
my $deleted = $4;
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})) {
next if $api =~ /\w(Open|Close|URIProbe)/;
@ -254,7 +259,7 @@ foreach my $src (@srcs) {
$groups{$ingrp}->{drivers}->{$impl}->{$api} = {};
$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" ||
$api eq "domainMigratePrepare2" ||
$api eq "domainMigratePrepare3") {
@ -351,9 +356,9 @@ print <<EOF;
<p>
This page documents which <a href="html/">libvirt calls</a> work on
which libvirt drivers / hypervisors, and which version the API appeared
in. If a hypervisor driver deprecated the API, the version when it
was removed is also mentioned (highlighted in
<span class="deprecatedhv">dark red</span>).
in. If a hypervisor driver later dropped support for the API, the version
when it was removed is also mentioned (highlighted in
<span class="removedhv">dark red</span>).
</p>
EOF
@ -411,8 +416,8 @@ EOF
if ($groups{$grp}->{drivers}->{$drv}->{$field}->{vers}) {
print $groups{$grp}->{drivers}->{$drv}->{$field}->{vers};
}
if ($groups{$grp}->{drivers}->{$drv}->{$field}->{depre}) {
print " - <span class=\"deprecatedhv\">", $groups{$grp}->{drivers}->{$drv}->{$field}->{depre}, "</span>";
if ($groups{$grp}->{drivers}->{$drv}->{$field}->{deleted}) {
print " - <span class=\"removedhv\">", $groups{$grp}->{drivers}->{$drv}->{$field}->{deleted}, "</span>";
}
}
print "</td>\n";

View File

@ -588,7 +588,7 @@ td.enumvalue {
display: inline;
}
.deprecatedhv {
.removedhv {
color: darkred;
}

View File

@ -212,6 +212,8 @@ while (<>) {
my $api = $1;
my $impl = $2;
next if $impl eq "NULL";
if ($api ne "no" &&
$api ne "name" &&
$table ne "virStateDriver" &&

View File

@ -37,6 +37,7 @@ while (<>) {
next if $api eq "no";
next if $api eq "name";
next if $impl eq "NULL";
my $suffix = $impl;
my $prefix = $impl;

View File

@ -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,
const char *format,
const char *xmlData,
@ -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
qemuDomainOpenConsole(virDomainPtr dom,
const char *dev_name,
@ -22271,7 +22242,7 @@ static virHypervisorDriver qemuHypervisorDriver = {
.domainGetSecurityLabelList = qemuDomainGetSecurityLabelList, /* 0.10.0 */
.nodeGetSecurityModel = qemuNodeGetSecurityModel, /* 0.6.1 */
.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 */
.connectListDefinedDomains = qemuConnectListDefinedDomains, /* 0.2.0 */
.connectNumOfDefinedDomains = qemuConnectNumOfDefinedDomains, /* 0.2.0 */
@ -22356,7 +22327,7 @@ static virHypervisorDriver qemuHypervisorDriver = {
.domainRevertToSnapshot = qemuDomainRevertToSnapshot, /* 0.8.0 */
.domainSnapshotDelete = qemuDomainSnapshotDelete, /* 0.8.0 */
.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 */
.connectDomainQemuMonitorEventRegister = qemuConnectDomainQemuMonitorEventRegister, /* 1.2.3 */
.connectDomainQemuMonitorEventDeregister = qemuConnectDomainQemuMonitorEventDeregister, /* 1.2.3 */