[Libvir] PATCH: 14/16: disk partition backend
Jim Meyering
jim at meyering.net
Fri Feb 15 16:11:03 UTC 2008
"Daniel P. Berrange" <berrange at redhat.com> wrote:
...
> diff -r 4c283aac5fd6 src/storage_backend_disk.c
> --- /dev/null Thu Jan 01 00:00:00 1970 +0000
> +++ b/src/storage_backend_disk.c Thu Feb 07 16:51:32 2008 -0500
...
> +static int virStorageBackendDiskVolFormatFromString(virConnectPtr conn,
> + const char *format) {
> + if (format == NULL)
> + return VIR_STORAGE_VOL_DISK_NONE;
> +
> + if (STREQ(format, "none"))
> + return VIR_STORAGE_VOL_DISK_NONE;
> + if (STREQ(format, "linux"))
> + return VIR_STORAGE_VOL_DISK_LINUX;
> + if (STREQ(format, "fat16"))
> + return VIR_STORAGE_VOL_DISK_FAT16;
> + if (STREQ(format, "fat32"))
> + return VIR_STORAGE_VOL_DISK_FAT32;
> + if (STREQ(format, "linux-swap"))
> + return VIR_STORAGE_VOL_DISK_LINUX_SWAP;
> + if (STREQ(format, "linux-lvm"))
> + return VIR_STORAGE_VOL_DISK_LINUX_LVM;
> + if (STREQ(format, "linux-raid"))
> + return VIR_STORAGE_VOL_DISK_LINUX_RAID;
> + if (STREQ(format, "extended"))
> + return VIR_STORAGE_VOL_DISK_EXTENDED;
> +
> + virStorageReportError(conn, VIR_ERR_INTERNAL_ERROR, "unsupported volume format %s", format);
> + return -1;
> +}
> +
> +static const char *virStorageBackendDiskVolFormatToString(virConnectPtr conn,
> + int format) {
> + switch (format) {
> + case VIR_STORAGE_VOL_DISK_NONE:
> + return "none";
> + case VIR_STORAGE_VOL_DISK_LINUX:
> + return "linux";
> + case VIR_STORAGE_VOL_DISK_FAT16:
> + return "fat16";
> + case VIR_STORAGE_VOL_DISK_FAT32:
> + return "fat32";
> + case VIR_STORAGE_VOL_DISK_LINUX_SWAP:
> + return "swap";
> + case VIR_STORAGE_VOL_DISK_LINUX_LVM:
> + return "lvm";
> + case VIR_STORAGE_VOL_DISK_LINUX_RAID:
> + return "raid";
> + case VIR_STORAGE_VOL_DISK_EXTENDED:
> + return "extended";
> + }
Hi Dan,
I suppose the above functions should have the same strings
and enum values? If so, the strings for the three
VIR_STORAGE_VOL_DISK_LINUX_* enums in the latter
need to match the "linux-..." prefixed ones above.
More information about the libvir-list
mailing list