
Daniel P. Berrange wrote:
I know you're just replicating the existing code, but both these functions can be killed off and replaced with auto-generated code from our enum support macros
VIR_ENUM_IMPL(virStorageBackendDiskLabel, VIR_STORAGE_POOL_DISK_LAST, "dos", "dvh", "gpt", "mac", "bsd", "pc98", "sun", "lvm2" "unknown")
And in the header file just
VIR_ENUM_DECL(virStorageBackendDiskLabel)
I've implemented this, and there was quite a bit of fallout from it. In particular, I had to change the signature of poolOptions.formatToString and formatFromString, which required a bunch of changes elsewhere in the storage code. The good news is that we remove quite a bit of very similar hand crafted code, so this patch actually removes more code than it adds. Tested by me as before. -- Chris Lalancette