diff --git a/src/conf/storage_source_conf.c b/src/conf/storage_source_conf.c index 2b658dd485..ca956a1b7c 100644 --- a/src/conf/storage_source_conf.c +++ b/src/conf/storage_source_conf.c @@ -917,6 +917,8 @@ virStorageSourceCopy(const virStorageSource *src, def->nfs_uid = src->nfs_uid; def->nfs_gid = src->nfs_gid; + /* 'ioerror_timestamp' and 'ioerror_message' are deliberately not copied */ + return g_steal_pointer(&def); } @@ -1203,6 +1205,9 @@ virStorageSourceClear(virStorageSource *def) g_clear_pointer(&def->fdtuple, g_object_unref); + VIR_FREE(def->ioerror_timestamp); + VIR_FREE(def->ioerror_message); + /* clear everything except the class header as the object APIs * will break otherwise */ memset((char *) def + sizeof(def->parent), 0, diff --git a/src/conf/storage_source_conf.h b/src/conf/storage_source_conf.h index 9463722518..e6cbb93c06 100644 --- a/src/conf/storage_source_conf.h +++ b/src/conf/storage_source_conf.h @@ -445,6 +445,12 @@ struct _virStorageSource { * to do this decision. */ bool seclabelSkipRemember; + + /* Last instance of hypervisor originated I/O error message and timestamp. + * The error stored here is not designed to be stable. The message + * is also not copied via virStorageSourceCopy */ + char *ioerror_timestamp; + char *ioerror_message; }; G_DEFINE_AUTOPTR_CLEANUP_FUNC(virStorageSource, virObjectUnref);