[libvirt] [PATCH] LXC: set the right var to NULL

Chen Hanxiao posted 1 patch 6 years, 9 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/1500516150-29212-1-git-send-email-chen_han_xiao@126.com
src/lxc/lxc_driver.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[libvirt] [PATCH] LXC: set the right var to NULL
Posted by Chen Hanxiao 6 years, 9 months ago
From: Chen Hanxiao <chenhanxiao@gmail.com>

   For attaching hosdev, we should set dev->data.hostdev
   rather than dev->data.disk

Signed-off-by: Chen Hanxiao <chenhanxiao@gmail.com>
---
 src/lxc/lxc_driver.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c
index 652e9cb..6a9c528 100644
--- a/src/lxc/lxc_driver.c
+++ b/src/lxc/lxc_driver.c
@@ -4358,7 +4358,7 @@ lxcDomainAttachDeviceLive(virConnectPtr conn,
     case VIR_DOMAIN_DEVICE_HOSTDEV:
         ret = lxcDomainAttachDeviceHostdevLive(driver, vm, dev);
         if (!ret)
-            dev->data.disk = NULL;
+            dev->data.hostdev = NULL;
         break;
 
     default:
-- 
2.7.4


--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] LXC: set the right var to NULL
Posted by Cedric Bosdonnat 6 years, 9 months ago
On Thu, 2017-07-20 at 10:02 +0800, Chen Hanxiao wrote:
> From: Chen Hanxiao <chenhanxiao@gmail.com>
> 
>    For attaching hosdev, we should set dev->data.hostdev
>    rather than dev->data.disk
> 
> Signed-off-by: Chen Hanxiao <chenhanxiao@gmail.com>
> ---
>  src/lxc/lxc_driver.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c
> index 652e9cb..6a9c528 100644
> --- a/src/lxc/lxc_driver.c
> +++ b/src/lxc/lxc_driver.c
> @@ -4358,7 +4358,7 @@ lxcDomainAttachDeviceLive(virConnectPtr conn,
>      case VIR_DOMAIN_DEVICE_HOSTDEV:
>          ret = lxcDomainAttachDeviceHostdevLive(driver, vm, dev);
>          if (!ret)
> -            dev->data.disk = NULL;
> +            dev->data.hostdev = NULL;
>          break;
>  
>      default:

ACK and pushed
--
Cedric

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