[libvirt] [PATCH] activate and refresh logical volumes while refreshing logical pool

Vasiliy Tolstov posted 1 patch 6 years, 7 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/20170801132607.8330-2-v.tolstov@selfip.ru
src/storage/storage_backend_logical.c | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
[libvirt] [PATCH] activate and refresh logical volumes while refreshing logical pool
Posted by Vasiliy Tolstov 6 years, 7 months ago
Signed-off-by: Vasiliy Tolstov <v.tolstov@selfip.ru>
---
 src/storage/storage_backend_logical.c | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/src/storage/storage_backend_logical.c b/src/storage/storage_backend_logical.c
index 67f70e551729..0c34476de38e 100644
--- a/src/storage/storage_backend_logical.c
+++ b/src/storage/storage_backend_logical.c
@@ -811,6 +811,25 @@ virStorageBackendLogicalRefreshPool(virConnectPtr conn ATTRIBUTE_UNUSED,
 
     virWaitForDevices();
 
+    cmd = virCommandNewArgList("vgchange",
+                               "-aay",
+                               pool->def->source.name,
+                               NULL);
+    if (virCommandRun(cmd, NULL) < 0)
+        goto cleanup;
+
+    virCommandFree(cmd);
+
+    cmd = virCommandNewArgList("vgchange",
+                               "--refresh",
+                               pool->def->source.name,
+                               NULL);
+    if (virCommandRun(cmd, NULL) < 0)
+        goto cleanup;
+
+    virCommandFree(cmd);
+
+
     /* Get list of all logical volumes */
     if (virStorageBackendLogicalFindLVs(pool, NULL) < 0)
         goto cleanup;
-- 
2.9.3

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] activate and refresh logical volumes while refreshing logical pool
Posted by Peter Krempa 6 years, 7 months ago
On Tue, Aug 01, 2017 at 16:26:07 +0300, Vasiliy Tolstov wrote:

Please provide a commit message with justification.

> Signed-off-by: Vasiliy Tolstov <v.tolstov@selfip.ru>
> ---
>  src/storage/storage_backend_logical.c | 19 +++++++++++++++++++
>  1 file changed, 19 insertions(+)
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] activate and refresh logical volumes while refreshing logical pool
Posted by Ján Tomko 6 years, 7 months ago
On Tue, Aug 01, 2017 at 04:26:07PM +0300, Vasiliy Tolstov wrote:
>Signed-off-by: Vasiliy Tolstov <v.tolstov@selfip.ru>
>---
> src/storage/storage_backend_logical.c | 19 +++++++++++++++++++
> 1 file changed, 19 insertions(+)
>
>diff --git a/src/storage/storage_backend_logical.c b/src/storage/storage_backend_logical.c
>index 67f70e551729..0c34476de38e 100644
>--- a/src/storage/storage_backend_logical.c
>+++ b/src/storage/storage_backend_logical.c
>@@ -811,6 +811,25 @@ virStorageBackendLogicalRefreshPool(virConnectPtr conn ATTRIBUTE_UNUSED,
>
>     virWaitForDevices();
>
>+    cmd = virCommandNewArgList("vgchange",
>+                               "-aay",
>+                               pool->def->source.name,
>+                               NULL);
>+    if (virCommandRun(cmd, NULL) < 0)
>+        goto cleanup;
>+

NACK,

pool refresh should make libvirt update its internal state to match
the on-disk state. Activating the volume should be done by whatever
software created it.

Jan

>+    virCommandFree(cmd);
>+
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] activate and refresh logical volumes while refreshing logical pool
Posted by Vasiliy Tolstov 6 years, 7 months ago
2017-08-01 17:36 GMT+03:00 Ján Tomko <jtomko@redhat.com>:
> On Tue, Aug 01, 2017 at 04:26:07PM +0300, Vasiliy Tolstov wrote:
>>
>> Signed-off-by: Vasiliy Tolstov <v.tolstov@selfip.ru>
>> ---
>> src/storage/storage_backend_logical.c | 19 +++++++++++++++++++
>> 1 file changed, 19 insertions(+)
>>
>> diff --git a/src/storage/storage_backend_logical.c
>> b/src/storage/storage_backend_logical.c
>> index 67f70e551729..0c34476de38e 100644
>> --- a/src/storage/storage_backend_logical.c
>> +++ b/src/storage/storage_backend_logical.c
>> @@ -811,6 +811,25 @@ virStorageBackendLogicalRefreshPool(virConnectPtr
>> conn ATTRIBUTE_UNUSED,
>>
>>     virWaitForDevices();
>>
>> +    cmd = virCommandNewArgList("vgchange",
>> +                               "-aay",
>> +                               pool->def->source.name,
>> +                               NULL);
>> +    if (virCommandRun(cmd, NULL) < 0)
>> +        goto cleanup;
>> +
>
>
> NACK,
>
> pool refresh should make libvirt update its internal state to match
> the on-disk state. Activating the volume should be done by whatever
> software created it.
>

Ok, why libvirt in vol-list does not display inactive lv?



-- 
Vasiliy Tolstov,
e-mail: v.tolstov@selfip.ru

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