Generate a default name and give the default max size if not defined.
snapshot_output_node; snapshot_output_node =
xmlNextElementSibling(snapshot_output_node)) {
char *name = NULL;
snapshot_output_node; snapshot_output_node =
xmlNextElementSibling(snapshot_output_node)) {
char *name = NULL;
- uint64_t max_size = UINT64_MAX;
+ uint64_t max_size = DEFAULT_SNAPSHOT_MAX_SIZE;
struct consumer_output output = { 0 };
struct lttng_snapshot_output *snapshot_output = NULL;
struct consumer_output output = { 0 };
struct lttng_snapshot_output *snapshot_output = NULL;
goto error_snapshot_output;
}
goto error_snapshot_output;
}
+ if (!name) {
+ /* Generate a default name */
+ int pret;
+ pret = asprintf(&name, DEFAULT_SNAPSHOT_NAME "-%" PRIu32,
+ lttng_snapshot_output_get_id(snapshot_output));
+ if (pret < 0) {
+ name = NULL;
+ PERROR("snprintf output name");
+ goto error_snapshot_output;
+ }
+ }
+
ret = lttng_snapshot_output_set_name(name, snapshot_output);
if (ret) {
goto error_snapshot_output;
ret = lttng_snapshot_output_set_name(name, snapshot_output);
if (ret) {
goto error_snapshot_output;
<xs:complexType name="snapshot_output_type">
<xs:all>
<xs:complexType name="snapshot_output_type">
<xs:all>
- <xs:element name="name" type="name_type"/>
- <xs:element name="max_size" type="uint64_type"/>
+ <xs:element name="name" type="name_type" minOccurs="0"/>
+ <xs:element name="max_size" type="uint64_type" minOccurs="0"/>
<xs:element name="consumer_output" type="consumer_output_type"/>
</xs:all>
</xs:complexType>
<xs:element name="consumer_output" type="consumer_output_type"/>
</xs:all>
</xs:complexType>