Lines Matching refs:media

47 static descriptor_t	**apply_filter(descriptor_t **media, int filter[],
80 * Get the media descriptors for the given drive/partition/slice.
85 descriptor_t **media;
90 * For drives, this means no media but slice/part.
91 * require media.
102 media = (descriptor_t **)calloc(2, sizeof (descriptor_t *));
103 if (media == NULL) {
108 media[0] = cache_get_desc(DM_MEDIA, dp->p.disk, mname, NULL, errp);
110 free(media);
113 media[1] = NULL;
116 return (media);
152 descriptor_t **media;
156 media = cache_get_descriptors(DM_MEDIA, errp);
161 for (i = 0; media[i]; i++) {
162 if (libdiskmgt_str_eq(name, media[i]->name)) {
163 medium = media[i];
166 cache_free_descriptor(media[i]);
169 free(media);
181 descriptor_t **media;
183 media = cache_get_descriptors(DM_MEDIA, errp);
191 found = apply_filter(media, filter, errp);
193 media = NULL;
195 media = found;
199 return (media);
212 /* There are no stat types defined for media */
240 * Read the media information.
251 * This ioctl can fail if the media is not loaded or spun up.
253 * started the media before the ioctl timed out so the media may be
271 /* return 1 if there is media, 0 if not. */
278 /* not removable, so media name is devid */
285 /* This is a removable media drive. */
290 apply_filter(descriptor_t **media, int filter[], int *errp)
297 /* count the number of media in the snapshot */
298 for (i = 0; media[i]; i++) {
305 cache_free_descriptors(media);
310 for (i = 0; media[i]; i++) {
314 if ((fd = drive_open_disk(media[i]->p.disk, NULL, 0)) < 0) {
328 found[pos++] = media[i];
335 cache_free_descriptor(media[i]);
341 free(media);
347 /* return 1 if the media descriptor is still valid, 0 if not. */
351 /* First verify the media name for removable media */
381 /* The first thing to do is read the media */
535 * This function handles removable media.