[libvirt] [PATCH] virQEMUDriverPtr clean up

Humaid posted 1 patch 5 years ago
Test syntax-check passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/20190317060427.16574-1-syedhumaidbinharoon@gmail.com
src/qemu/qemu_tpm.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
[libvirt] [PATCH] virQEMUDriverPtr clean up
Posted by Humaid 5 years ago
From: Ubuntu <shbh@Ubuntu1.4obxdks5shaudmr0jmg1ainqgb.bx.internal.cloudapp.net>

---
 src/qemu/qemu_tpm.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/qemu/qemu_tpm.c b/src/qemu/qemu_tpm.c
index 835a9caf46..b60e443f14 100644
--- a/src/qemu/qemu_tpm.c
+++ b/src/qemu/qemu_tpm.c
@@ -834,16 +834,16 @@ qemuExtTPMStartEmulator(virQEMUDriverPtr driver,
 
 
 int
-qemuExtTPMStart(virQEMUDriverPtr driver,
-                virDomainObjPtr vm,
+qemuExtTPMStart(virDomainObjPtr vm,
                 qemuDomainLogContextPtr logCtxt)
 {
     int ret = 0;
+    qemuDomainObjPrivatePtr priv = vm->privateData;
     virDomainTPMDefPtr tpm = vm->def->tpm;
 
     switch (tpm->type) {
     case VIR_DOMAIN_TPM_TYPE_EMULATOR:
-        ret = qemuExtTPMStartEmulator(driver, vm, logCtxt);
+        ret = qemuExtTPMStartEmulator(priv->driver, vm, logCtxt);
         break;
     case VIR_DOMAIN_TPM_TYPE_PASSTHROUGH:
     case VIR_DOMAIN_TPM_TYPE_LAST:
-- 
2.17.1

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] virQEMUDriverPtr clean up
Posted by Daniel P. Berrangé 5 years ago
On Sun, Mar 17, 2019 at 06:04:27AM +0000, Humaid wrote:
> From: Ubuntu <shbh@Ubuntu1.4obxdks5shaudmr0jmg1ainqgb.bx.internal.cloudapp.net>

You need to set your git author name to something sensible using
commands line this:

  $ git config --global user.name "John Doe"
  $ git config --global user.email johndoe@example.com

you can use 'git commit --amend --reset-author' to fix the author
on existing commits once you've fixed your config.

> ---
>  src/qemu/qemu_tpm.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/src/qemu/qemu_tpm.c b/src/qemu/qemu_tpm.c
> index 835a9caf46..b60e443f14 100644
> --- a/src/qemu/qemu_tpm.c
> +++ b/src/qemu/qemu_tpm.c
> @@ -834,16 +834,16 @@ qemuExtTPMStartEmulator(virQEMUDriverPtr driver,
>  
>  
>  int
> -qemuExtTPMStart(virQEMUDriverPtr driver,
> -                virDomainObjPtr vm,
> +qemuExtTPMStart(virDomainObjPtr vm,
>                  qemuDomainLogContextPtr logCtxt)

This has removed a parameter from qemuExtTPMStart, but has not updated
the declaration of this in the header, nor updated any callers. So there
is no way this code is going to successfully compile.

I'm not really convinced we want todo this change in any case. Normally
we lookup the 'driver' at the main API entry points, and then just pass
it to all internal APIs.

>  {
>      int ret = 0;
> +    qemuDomainObjPrivatePtr priv = vm->privateData;
>      virDomainTPMDefPtr tpm = vm->def->tpm;
>  
>      switch (tpm->type) {
>      case VIR_DOMAIN_TPM_TYPE_EMULATOR:
> -        ret = qemuExtTPMStartEmulator(driver, vm, logCtxt);
> +        ret = qemuExtTPMStartEmulator(priv->driver, vm, logCtxt);
>          break;
>      case VIR_DOMAIN_TPM_TYPE_PASSTHROUGH:
>      case VIR_DOMAIN_TPM_TYPE_LAST:



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] virQEMUDriverPtr clean up
Posted by Peter Krempa 5 years ago
On Sun, Mar 17, 2019 at 06:04:27 +0000, Humaid wrote:
> From: Ubuntu <shbh@Ubuntu1.4obxdks5shaudmr0jmg1ainqgb.bx.internal.cloudapp.net>

This address is not resolvable your git is probably misconfigured.

Please provide a commit message according to the contributor
guildelines including certification of agreement with the developer
certificate of origin.

https://libvirt.org/hacking.html#patches

> 
> ---
>  src/qemu/qemu_tpm.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/src/qemu/qemu_tpm.c b/src/qemu/qemu_tpm.c
> index 835a9caf46..b60e443f14 100644
> --- a/src/qemu/qemu_tpm.c
> +++ b/src/qemu/qemu_tpm.c
> @@ -834,16 +834,16 @@ qemuExtTPMStartEmulator(virQEMUDriverPtr driver,
>  
>  
>  int
> -qemuExtTPMStart(virQEMUDriverPtr driver,
> -                virDomainObjPtr vm,
> +qemuExtTPMStart(virDomainObjPtr vm,
>                  qemuDomainLogContextPtr logCtxt)

This does not fix any of the callers nor the header file thus breaks the
build.

Additionally without any further refactors and no justification
in the commit message I don't see much value in this change. Please
write a commit message and justify it.

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