Re: [PATCH] Change security driver APIs to use virDomainDefPtr instead of virDomainObjPtr

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

 



On 11/28/2011 05:26 AM, Daniel P. Berrange wrote:
> From: "Daniel P. Berrange" <berrange@xxxxxxxxxx>
> 
> When sVirt is integrated with the LXC driver, it will be neccessary
> to invoke the security driver APIs using only a virDomainDefPtr
> since the lxc_container.c code has no virDomainObjPtr available.
> Aside from two functions which want obj->pid, every bit of the
> security driver code only touches obj->def. So we don't need to
> pass a virDomainObjPtr into the security drivers, a virDomainDefPtr
> is sufficient. Two functions also gain a 'pid_t pid' argument.
> 
> * src/qemu/qemu_driver.c, src/qemu/qemu_hotplug.c,
>   src/qemu/qemu_migration.c, src/qemu/qemu_process.c,
>   src/security/security_apparmor.c,
>   src/security/security_dac.c,
>   src/security/security_driver.h,
>   src/security/security_manager.c,
>   src/security/security_manager.h,
>   src/security/security_nop.c,
>   src/security/security_selinux.c,
>   src/security/security_stack.c: Change all security APIs to use a
>   virDomainDefPtr instead of virDomainObjPtr

> +++ b/src/security/security_selinux.c
> @@ -162,7 +162,7 @@ SELinuxInitialize(void)

> @@ -882,9 +884,9 @@ done:
>  
>  
>  static int
> -SELinuxRestoreSecurityChardevCallback(virDomainDefPtr def ATTRIBUTE_UNUSED,
> +SELinuxRestoreSecurityChardevCallback(virDomainDefPtr def,
>                                        virDomainChrDefPtr dev,
> -                                      void *opaque)
> +                                      void *opaque ATTRIBUTE_UNUSED)
>  {
>      virDomainObjPtr vm = opaque;

This warns:

security/security_selinux.c: In function
'SELinuxRestoreSecurityChardevCallback':
security/security_selinux.c:891:21: error: unused variable 'vm'
[-Werror=unused-variable]

> @@ -1227,10 +1228,11 @@ SELinuxClearSecuritySocketLabel(virSecurityManagerPtr mgr,
>  
>  
>  static int
> -SELinuxSetSecurityChardevCallback(virDomainDefPtr def ATTRIBUTE_UNUSED,
> +SELinuxSetSecurityChardevCallback(virDomainDefPtr def,
>                                    virDomainChrDefPtr dev,
> -                                  void *opaque)
> +                                  void *opaque ATTRIBUTE_UNUSED)
>  {
> +<<<<<<< HEAD
>      virDomainObjPtr vm = opaque;
>  
>      /* This is taken care of by processing of def->serials */
> @@ -1239,15 +1241,17 @@ SELinuxSetSecurityChardevCallback(virDomainDefPtr def ATTRIBUTE_UNUSED,
>          return 0;
>  
>      return SELinuxSetSecurityChardevLabel(vm, &dev->source);
> +=======
> +    return SELinuxSetSecurityChardevLabel(def, &dev->source);
> +>>>>>>> Change security driver APIs to use virDomainDefPtr instead of virDomainObjPtr

And this can't possibly be right.

Overall, the changes look mechanical, and probably the right thing, but
you need a patch that works.  :)

-- 
Eric Blake   eblake@xxxxxxxxxx    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

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

[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]