=back
+=head1 ENVIRONMENT
+
+=over 4
+
+=item B<LIBXL_DISK_BACKEND_UNTRUSTED>
+
+Set this environment variable to "1" to suggest to the guest that the disk
+backend shouldn't be trusted. If the variable is absent or set to "0", the
+backend will be trusted.
+
+=item B<LIBXL_NIC_BACKEND_UNTRUSTED>
+
+Set this environment variable to "1" to suggest to the guest that the network
+backend shouldn't be trusted. If the variable is absent or set to "0", the
+backend will be trusted.
+
+=back
+
=head1 IGNORED FOR COMPATIBILITY WITH XM
xl is mostly command-line compatible with the old xm utility used with
libxl_domain_config d_config;
libxl_device_disk disk_saved;
libxl__domain_userdata_lock *lock = NULL;
+ const char *envvar;
libxl_domain_config_init(&d_config);
libxl_device_disk_init(&disk_saved);
flexarray_append(front, GCSPRINTF("%d", device->devid));
flexarray_append(front, "device-type");
flexarray_append(front, disk->is_cdrom ? "cdrom" : "disk");
+ flexarray_append(front, "trusted");
+ envvar = getenv("LIBXL_DISK_BACKEND_UNTRUSTED");
+ /* Set "trusted=1" if envvar missing or is "0". */
+ flexarray_append(front, !envvar || !strcmp("0", envvar) ? "1" : "0");
/*
* Old PV kernel disk frontends before 2.6.26 rely on tool stack to
flexarray_t *back, flexarray_t *front,
flexarray_t *ro_front)
{
+ const char *envvar;
+
flexarray_grow(back, 2);
if (nic->script)
flexarray_append(front, GCSPRINTF(
LIBXL_MAC_FMT, LIBXL_MAC_BYTES(nic->mac)));
+ flexarray_append(front, "trusted");
+ envvar = getenv("LIBXL_NIC_BACKEND_UNTRUSTED");
+ /* Set "trusted=1" if envvar missing or is "0". */
+ flexarray_append(front, !envvar || !strcmp("0", envvar) ? "1" : "0");
+
return 0;
}