[libvirt] [PATCH 1/4] qemu: delete methods which are no longer supported

Daniel P. Berrangé posted 4 patches 6 years, 7 months ago
There is a newer version of this series
[libvirt] [PATCH 1/4] qemu: delete methods which are no longer supported
Posted by Daniel P. Berrangé 6 years, 7 months ago
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.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
---
 src/qemu/qemu_driver.c | 31 -------------------------------
 1 file changed, 31 deletions(-)

diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index d6ab134196..595a381734 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -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,6 @@ 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) */
     .connectDomainXMLToNative = qemuConnectDomainXMLToNative, /* 0.6.4 */
     .connectListDefinedDomains = qemuConnectListDefinedDomains, /* 0.2.0 */
     .connectNumOfDefinedDomains = qemuConnectNumOfDefinedDomains, /* 0.2.0 */
@@ -22356,7 +22326,6 @@ 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) */
     .domainQemuAgentCommand = qemuDomainQemuAgentCommand, /* 0.10.0 */
     .connectDomainQemuMonitorEventRegister = qemuConnectDomainQemuMonitorEventRegister, /* 1.2.3 */
     .connectDomainQemuMonitorEventDeregister = qemuConnectDomainQemuMonitorEventDeregister, /* 1.2.3 */
-- 
2.21.0

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH 1/4] qemu: delete methods which are no longer supported
Posted by Peter Krempa 6 years, 7 months ago
On Wed, Jun 26, 2019 at 16:54:40 +0100, Daniel Berrange wrote:
> 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.
> 
> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
> ---
>  src/qemu/qemu_driver.c | 31 -------------------------------
>  1 file changed, 31 deletions(-)

[...]

> @@ -22271,7 +22242,6 @@ 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) */

This makes documentation strictly worse, where users may be lead into
thinking that this never existed.

I don't think we should just delete it without acknowledging we've
deleted it.
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH 1/4] qemu: delete methods which are no longer supported
Posted by Daniel P. Berrangé 6 years, 7 months ago
On Thu, Jun 27, 2019 at 08:02:54AM +0200, Peter Krempa wrote:
> On Wed, Jun 26, 2019 at 16:54:40 +0100, Daniel Berrange wrote:
> > 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.
> > 
> > Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
> > ---
> >  src/qemu/qemu_driver.c | 31 -------------------------------
> >  1 file changed, 31 deletions(-)
> 
> [...]
> 
> > @@ -22271,7 +22242,6 @@ 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) */
> 
> This makes documentation strictly worse, where users may be lead into
> thinking that this never existed.
> 
> I don't think we should just delete it without acknowledging we've
> deleted it.

A documentation problem we can address pretty easily while keeping
these code semantics. eg

  .connectDomainXMLFromNative = NULL, /* 0.6.4 - 5.5.0 */

then just adapt your docs patch which read the deprecated comment to
require the version range when it sees a NULL method impl.

Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH 1/4] qemu: delete methods which are no longer supported
Posted by Andrea Bolognani 6 years, 7 months ago
On Thu, 2019-06-27 at 08: 02 +0200, Peter Krempa wrote:
> On Wed, Jun 26, 2019 at 16: 54:40 +0100, Daniel Berrange wrote:
> > @@ -22271,7 +22242,6 @@ static virHypervisorDriver qemuHypervisorDriver = {: > > @@ -22271,7 +22242,6 @@ 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) */
>: > 
> This makes documentation strictly worse, where users may be lead into: > This makes documentation strictly worse, where users may be lead into
> thinking that this never existed.: > thinking that this never existed.
>: > 
> I don't think we should just delete it without acknowledging we've: > I don't think we should just delete it without acknowledging we've
> deleted it.: > deleted it.
X-ZohoMail-Sender: Andrea Bolognani
X-ZM-MESSAGEID: 1561628665109010001

FWIW, I completely agree with Peter.

-- 
Andrea Bolognani / Red Hat / Virtualization

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH 1/4] qemu: delete methods which are no longer supported
Posted by Ján Tomko 6 years, 7 months ago
On Wed, Jun 26, 2019 at 04:54:40PM +0100, Daniel P. Berrangé wrote:
>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.
>
>Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
>---
> src/qemu/qemu_driver.c | 31 -------------------------------
> 1 file changed, 31 deletions(-)
>

This is a followup to
commit 215d9393bb60615f957f456fec646cf187fec26e
    qemu: driver: Drop support for qemu-attach
which also introduced an exception for domainQemuAttach in src/check-aclrules.pl:

diff --git a/src/check-aclrules.pl b/src/check-aclrules.pl
index be618f6c9f..23872cda98 100755
--- a/src/check-aclrules.pl
+++ b/src/check-aclrules.pl
@@ -61,7 +61,6 @@ my %whitelist = (
     "interfaceClose" => 1,
     "connectURIProbe" => 1,
     "localOnly" => 1,
-    "domainQemuAttach" => 1,
     );

 # XXX this vzDomainMigrateConfirm3Params looks

Reviewed-by: Ján Tomko <jtomko@redhat.com>

Jano
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list