add alloc and free function for virConsole