[libvirt] [PATCH] storage: Fix logical pool fmt type unknown->auto
John Ferlan
jferlan at redhat.com
Thu Sep 25 13:21:33 UTC 2014
On 09/25/2014 08:20 AM, Jincheng Miao wrote:
> There is an existing NACK patch:
> https://www.redhat.com/archives/libvir-list/2014-June/msg00809.html
>
Right - so the problem as I see it is:
1. The docs/schemas/storagepool.rng uses 'auto':
<define name='sourcefmtlogical'>
<optional>
<element name='format'>
<attribute name='type'>
<choice>
<value>auto</value>
<value>lvm2</value>
...
2. The libvirt API has "unknown" which yes technically wrong.
3. However, we cannot just change the API to use auto...
So what happens to existing pools on restarts if we change the libvirt
API to use "auto" instead of "unknown"?
# virsh pool-list
Name State Autostart
-------------------------------------------
default active no
images active yes
LVM_Test active yes
test_nfs_pool active no
# virsh pool-dumpxml LVM_Test
<pool type='logical'>
<name>LVM_Test</name>
<uuid>c93d091b-2314-4909-8ab1-4559909adcce</uuid>
<capacity unit='bytes'>9995026432</capacity>
<allocation unit='bytes'>0</allocation>
<available unit='bytes'>9995026432</available>
<source>
<device path='/dev/sda3'/>
<name>LVM_Test</name>
<format type='unknown'/>
...
make the change, install it locally, restart libvirt
...
# service libvirtd restart
Restarting libvirtd (via systemctl): [ OK ]
# virsh pool-list
Name State Autostart
-------------------------------------------
default active no
images active yes
test_nfs_pool active no
# virsh pool-dumpxml LVM_Test
error: failed to get pool 'LVM_Test'
error: Storage pool not found: no storage pool with matching name 'LVM_Test'
...
Remove the change, install it locally, restart libvirt
...
# service libvirtd restart
Restarting libvirtd (via systemctl): [ OK ]
# virsh pool-list
Name State Autostart
-------------------------------------------
default active no
images active yes
LVM_Test active yes
test_nfs_pool active no
So the question becomes can we make 'auto' be a synonym for 'unknown' -
that is accept both in some way.
John
> On 09/25/2014 08:13 PM, Erik Skultety wrote:
>> According to our documentation logical pool supports formats 'auto' and
>> 'lvm2'. However, in storage_conf.c we prevously defined storage pool
>> formats: unknown, lvm2. Format 'auto' does make more sense than
>> format 'unknown', so we should probably stay consistent with the
>> documentation
>>
>> Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1123767
>> ---
>> src/conf/storage_conf.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/src/conf/storage_conf.c b/src/conf/storage_conf.c
>> index 36696a4..75004fe 100644
>> --- a/src/conf/storage_conf.c
>> +++ b/src/conf/storage_conf.c
>> @@ -81,7 +81,7 @@ VIR_ENUM_IMPL(virStoragePoolFormatDisk,
>>
>> VIR_ENUM_IMPL(virStoragePoolFormatLogical,
>> VIR_STORAGE_POOL_LOGICAL_LAST,
>> - "unknown", "lvm2")
>> + "auto", "lvm2")
>>
>>
>> VIR_ENUM_IMPL(virStorageVolFormatDisk,
>
> --
> libvir-list mailing list
> libvir-list at redhat.com
> https://www.redhat.com/mailman/listinfo/libvir-list
>
More information about the libvir-list
mailing list