Re: [PATCH 03/15] vbox: Drop @iid from UIMachine::LaunchVMProcess()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Jan 23, 2023 at 10:34:12AM +0100, Michal Privoznik wrote:
The @iid argument of UIMachine::LaunchVMProcess() callback is
unused. Drop it and also its propagation from parent functions.


Looks like even in 6.1 this was not a function parameter of
LaunchVMProcess.  Was it ever?  What I'm trying to figure out is whether
there is a way to make sure other cases don't happen or are not present
in the code already.

Signed-off-by: Michal Privoznik <mprivozn@xxxxxxxxxx>
---
src/vbox/vbox_common.c        | 6 +++---
src/vbox/vbox_tmpl.c          | 1 -
src/vbox/vbox_uniformed_api.h | 1 -
3 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/src/vbox/vbox_common.c b/src/vbox/vbox_common.c
index ea3a54b7c9..7b1b8bb1b0 100644
--- a/src/vbox/vbox_common.c
+++ b/src/vbox/vbox_common.c
@@ -2046,7 +2046,7 @@ static int vboxDomainUndefine(virDomainPtr dom)
}

static int
-vboxStartMachine(virDomainPtr dom, int maxDomID, IMachine *machine, vboxIID *iid)
+vboxStartMachine(virDomainPtr dom, int maxDomID, IMachine *machine)
{
    struct _vboxDriver *data = dom->conn->privateData;
    int vrdpPresent = 0;
@@ -2147,7 +2147,7 @@ vboxStartMachine(virDomainPtr dom, int maxDomID, IMachine *machine, vboxIID *iid
    if (vrdpPresent)
        VBOX_UTF8_TO_UTF16("vrdp", &sessionType);

-    rc = gVBoxAPI.UIMachine.LaunchVMProcess(data, machine, iid,
+    rc = gVBoxAPI.UIMachine.LaunchVMProcess(data, machine,
                                            sessionType, env,
                                            &progress);

@@ -2238,7 +2238,7 @@ static int vboxDomainCreateWithFlags(virDomainPtr dom, unsigned int flags)
                gVBoxAPI.UIMachine.GetState(machine, &state);

                if (gVBoxAPI.machineStateChecker.NotStart(state)) {
-                    ret = vboxStartMachine(dom, i, machine, &iid);
+                    ret = vboxStartMachine(dom, i, machine);

Looks like this makes the iid unused in this function (or rather code
block) and can be removed too.

                } else {
                    virReportError(VIR_ERR_OPERATION_FAILED, "%s",
                                   _("machine is not in "
diff --git a/src/vbox/vbox_tmpl.c b/src/vbox/vbox_tmpl.c
index 967e44fea4..57d581e49c 100644
--- a/src/vbox/vbox_tmpl.c
+++ b/src/vbox/vbox_tmpl.c
@@ -746,7 +746,6 @@ _machineRemoveSharedFolder(IMachine *machine, PRUnichar *name)
static nsresult
_machineLaunchVMProcess(struct _vboxDriver *data,
                        IMachine *machine,
-                        vboxIID *iid G_GNUC_UNUSED,
                        PRUnichar *sessionType, PRUnichar *env,
                        IProgress **progress)
{
diff --git a/src/vbox/vbox_uniformed_api.h b/src/vbox/vbox_uniformed_api.h
index 18f352d98e..393e48827f 100644
--- a/src/vbox/vbox_uniformed_api.h
+++ b/src/vbox/vbox_uniformed_api.h
@@ -182,7 +182,6 @@ typedef struct {
                                   PRBool automount);
    nsresult (*RemoveSharedFolder)(IMachine *machine, PRUnichar *name);
    nsresult (*LaunchVMProcess)(struct _vboxDriver *driver, IMachine *machine,
-                                vboxIID *iid,
                                PRUnichar *sessionType, PRUnichar *env,
                                IProgress **progress);
    nsresult (*Unregister)(IMachine *machine, PRUint32 cleanupMode,
--
2.39.1

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux