g_free(vminfo);
}
+static const char *vminfo_type_to_string(vminfo_t *vminfo) {
+ if (vminfo->vmtype == VMTYPE_QEMU) {
+ return "qemu";
+ } else if (vminfo->vmtype == VMTYPE_OPENVZ) {
+ return "openvz";
+ } else if (vminfo->vmtype == VMTYPE_LXC) {
+ return "lxc";
+ } else {
+ return "unknown";
+ }
+}
+
void cfs_clnode_destroy(
cfs_clnode_t *clnode)
{
int first = 1;
while (g_hash_table_iter_next (&iter, &key, &value)) {
vminfo_t *vminfo = (vminfo_t *)value;
- char *type;
- if (vminfo->vmtype == VMTYPE_QEMU) {
- type = "qemu";
- } else if (vminfo->vmtype == VMTYPE_OPENVZ) {
- type = "openvz";
- } else if (vminfo->vmtype == VMTYPE_LXC) {
- type = "lxc";
- } else {
- type = "unknown";
- }
+ const char *type = vminfo_type_to_string(vminfo);
if (!first)
g_string_append_printf(str, ",\n");
g_mutex_unlock (&mutex);
}
-