]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu: delete methods which are no longer supported
authorDaniel P. Berrangé <berrange@redhat.com>
Wed, 26 Jun 2019 15:45:03 +0000 (16:45 +0100)
committerDaniel P. Berrangé <berrange@redhat.com>
Thu, 27 Jun 2019 13:41:48 +0000 (14:41 +0100)
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>
docs/hvsupport.pl
docs/libvirt.css
src/check-aclrules.pl
src/check-driverimpls.pl
src/qemu/qemu_driver.c

index 2ea245e83ad99ad5d2a4de8c951c62d29d979bb6..4f4d86fbf12c5c3aecdb50cc17fae64fea253ba1 100755 (executable)
@@ -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";
index 6639b1df64509f1c2ef93216b741d98493ff25f5..960c3f07fe019407abc32162e25616067cb1ba70 100644 (file)
@@ -588,7 +588,7 @@ td.enumvalue {
     display: inline;
 }
 
-.deprecatedhv {
+.removedhv {
     color: darkred;
 }
 
index be618f6c9fbd8ec0c83980e50c2474a55025334b..0d4cac17ca1732ef87934ba949aa4eb04edab789 100755 (executable)
@@ -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" &&
index 832a3900f416f33cc4ee11699c067e75f3b6e425..b175e710f1d4a8499ab464d703c367be7c1a9a99 100755 (executable)
@@ -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;
index d6ab134196c36918face92bc9201af32c88b418d..ef2e9802163639559984cd2239243eac397d4f26 100644 (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 */