-
Notifications
You must be signed in to change notification settings - Fork 0
add: rawstor boilerplate #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: rawstor
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -55,7 +55,7 @@ VIR_ENUM_IMPL(virStoragePool, | |
| "dir", "fs", "netfs", | ||
| "logical", "disk", "iscsi", | ||
| "iscsi-direct", "scsi", "mpath", | ||
| "rbd", "sheepdog", "gluster", | ||
| "rawstor", "rbd", "sheepdog", "gluster", | ||
| "zfs", "vstorage", | ||
| ); | ||
|
|
||
|
|
@@ -230,6 +230,13 @@ static virStoragePoolTypeInfo poolTypeInfo[] = { | |
| .flags = (VIR_STORAGE_POOL_SOURCE_ADAPTER), | ||
| }, | ||
| }, | ||
| {.poolType = VIR_STORAGE_POOL_RAWSTOR, | ||
| .poolOptions = { | ||
| .flags = (VIR_STORAGE_POOL_SOURCE_HOST | | ||
| VIR_STORAGE_POOL_SOURCE_NETWORK | | ||
| VIR_STORAGE_POOL_SOURCE_NAME), | ||
| } | ||
| }, | ||
|
Comment on lines
+233
to
+239
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The indentation of the closing brace for {.poolType = VIR_STORAGE_POOL_RAWSTOR,
.poolOptions = {
.flags = (VIR_STORAGE_POOL_SOURCE_HOST |
VIR_STORAGE_POOL_SOURCE_NETWORK |
VIR_STORAGE_POOL_SOURCE_NAME),
},
}, |
||
| {.poolType = VIR_STORAGE_POOL_RBD, | ||
| .poolOptions = { | ||
| .flags = (VIR_STORAGE_POOL_SOURCE_HOST | | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,18 @@ | ||||||||||
| #include "storage_backend.h" | ||||||||||
| #include "storage_backend_rawstor.h" | ||||||||||
|
|
||||||||||
|
|
||||||||||
| static virStorageBackend virStorageBackendRawstor = { | ||||||||||
| .type = VIR_STORAGE_POOL_RAWSTOR, | ||||||||||
|
|
||||||||||
| // .refreshPool = virStorageBackendMyVhostRefreshPool, | ||||||||||
| // .createVol = virStorageBackendMyVhostCreateVol, | ||||||||||
| // ... остальные обработчики | ||||||||||
|
Comment on lines
+8
to
+10
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The boilerplate code contains commented-out placeholder fields with Russian comments (
Suggested change
|
||||||||||
| }; | ||||||||||
|
|
||||||||||
|
|
||||||||||
| int | ||||||||||
| virStorageBackendRawstorRegister(void) | ||||||||||
| { | ||||||||||
| return virStorageBackendRegister(&virStorageBackendRawstor); | ||||||||||
| } | ||||||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,23 @@ | ||||||
| /* | ||||||
| * storage_backend_iscsi.h: storage backend for iSCSI handling | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The header comment block contains copy-paste remnants from
Suggested change
|
||||||
| * | ||||||
| * Copyright (C) 2025-2026 Vasily Stepanov | ||||||
| * | ||||||
| * This library is free software; you can redistribute it and/or | ||||||
| * modify it under the terms of the GNU Lesser General Public | ||||||
| * License as published by the Free Software Foundation; either | ||||||
| * version 2.1 of the License, or (at your option) any later version. | ||||||
| * | ||||||
| * This library is distributed in the hope that it will be useful, | ||||||
| * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||||
| * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||||||
| * Lesser General Public License for more details. | ||||||
| * | ||||||
| * You should have received a copy of the GNU Lesser General Public | ||||||
| * License along with this library. If not, see | ||||||
| * <http://www.gnu.org/licenses/>. | ||||||
| */ | ||||||
|
|
||||||
| #pragma once | ||||||
|
|
||||||
| int virStorageBackendRawstorRegister(void); | ||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The order of elements in
VIR_ENUM_IMPLmust exactly match thevirStoragePoolTypeenum insrc/conf/storage_conf.h. Currently,VIR_STORAGE_POOL_RAWSTORis placed at the end of the enum (index 14), but"rawstor"is inserted here at index 9 (before"rbd"). This mismatch will break the mapping between the enum and its string representation, causing bugs in XML parsing/formatting and API calls.Please move
"rawstor"to the end of theVIR_ENUM_IMPLlist (after"vstorage").