CVS commit: src/lib/libdm
Module Name:src Committed By: christos Date: Mon Jun 21 03:13:33 UTC 2021 Modified Files: src/lib/libdm: libdm_ioctl.c Log Message: fix proplib deprecation To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/lib/libdm/libdm_ioctl.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libdm/libdm_ioctl.c diff -u src/lib/libdm/libdm_ioctl.c:1.5 src/lib/libdm/libdm_ioctl.c:1.6 --- src/lib/libdm/libdm_ioctl.c:1.5 Sun Jun 7 01:57:17 2020 +++ src/lib/libdm/libdm_ioctl.c Sun Jun 20 23:13:32 2021 @@ -266,7 +266,7 @@ libdm_task_get_name(libdm_task_t libdm_t { char *name; - if (!prop_dictionary_get_cstring_nocopy(libdm_task->ldm_task, + if (!prop_dictionary_get_string(libdm_task->ldm_task, DM_IOCTL_NAME, (const char **)&name)) return NULL; @@ -291,7 +291,7 @@ libdm_task_get_uuid(libdm_task_t libdm_t { char *uuid; - if (!prop_dictionary_get_cstring_nocopy(libdm_task->ldm_task, + if (!prop_dictionary_get_string(libdm_task->ldm_task, DM_IOCTL_UUID, (const char **)&uuid)) return NULL; @@ -304,7 +304,7 @@ libdm_task_get_command(libdm_task_t libd { char *command; - if (!prop_dictionary_get_cstring_nocopy(libdm_task->ldm_task, + if (!prop_dictionary_get_string(libdm_task->ldm_task, DM_IOCTL_COMMAND, (const char **)&command)) return NULL; @@ -755,7 +755,7 @@ libdm_table_get_target(libdm_table_t lib { char *target; - if (!prop_dictionary_get_cstring_nocopy(libdm_table->ldm_tbl, DM_TABLE_TYPE, + if (!prop_dictionary_get_string(libdm_table->ldm_tbl, DM_TABLE_TYPE, (const char **)&target)) return NULL; @@ -782,7 +782,7 @@ libdm_table_get_params(libdm_table_t li { char *params; - if (!prop_dictionary_get_cstring_nocopy(libdm_table->ldm_tbl, DM_TABLE_PARAMS, + if (!prop_dictionary_get_string(libdm_table->ldm_tbl, DM_TABLE_PARAMS, (const char **)¶ms)) return NULL; @@ -816,7 +816,7 @@ libdm_target_get_name(libdm_target_t lib { char *name; - if (!prop_dictionary_get_cstring_nocopy(libdm_target->ldm_trgt, + if (!prop_dictionary_get_string(libdm_target->ldm_trgt, DM_TARGETS_NAME, (const char **)&name)) return NULL; @@ -860,7 +860,7 @@ libdm_dev_get_name(libdm_dev_t libdm_dev { char *name; - if (!prop_dictionary_get_cstring_nocopy(libdm_dev->ldm_dev, + if (!prop_dictionary_get_string(libdm_dev->ldm_dev, DM_DEV_NAME, (const char **)&name)) return NULL;
CVS commit: src/lib/libdm
Module Name:src Committed By: wiz Date: Tue Feb 8 09:49:08 UTC 2011 Modified Files: src/lib/libdm: dm.3 Log Message: Improve a bit. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/lib/libdm/dm.3 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libdm/dm.3 diff -u src/lib/libdm/dm.3:1.1 src/lib/libdm/dm.3:1.2 --- src/lib/libdm/dm.3:1.1 Tue Feb 8 03:20:15 2011 +++ src/lib/libdm/dm.3 Tue Feb 8 09:49:07 2011 @@ -1,4 +1,4 @@ -.\" $NetBSD: dm.3,v 1.1 2011/02/08 03:20:15 haad Exp $ +.\" $NetBSD: dm.3,v 1.2 2011/02/08 09:49:07 wiz Exp $ .\" .\" Copyright (c) 2004,2009 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -26,7 +26,7 @@ .\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. -.Dd Januar, 22 +.Dd January 22, 2011 .Dt DM 3 .Os .Sh NAME @@ -127,7 +127,7 @@ .Ft int .Fn libdm_dev_set_newname "const char *newname" "libdm_cmd_t libdm_cmd" .Sh DESCRIPTION -Every object in libdm have it's own create and destroy routine. +Every object in libdm has its own create and destroy routine. .Bl -bullet -offset indent -compact .It libdm_task_t @@ -140,15 +140,14 @@ Except .Vt libdm_dev_t which is received from kernel as list of physical devices on which -logical device depends. +the logical device depends. .Vt libdm_target_t -which is received from kernel as list of available targets for use . +which is received from kernel as list of available targets to use. .Vt libdm_iter_t -which is used as itteration counter for array entries in task structure. -.Pp -Every object attribute in libdm can be set and get by appropriate routines, -therofore there is always set and get routine. +which is used as iteration counter for array entries in the task structure. .Pp +Every object attribute in libdm can be set and gotten by appropriate routines, +therefore there always are set and get routines. .Ss LIBDM TASK The .Fn libdm_task_create @@ -158,7 +157,7 @@ .Fa command is .Dv NULL , -libdm_task_t is not created and function return +libdm_task_t is not created and the function returns .Dv NULL . .Pp .Fn libdm_task_destroy @@ -170,7 +169,7 @@ .Fn libdm_task_run Sends created .Fa libdm_task -to kernel and receive new one as reply. +to kernel and receives new one as reply. .Pp List of attributes avaialable in .Vt libdm_task_t : @@ -185,99 +184,109 @@ .It Li DM_IOCTL_FLAGS Ta Device status flags Ta Read-Write .El .Pp - .Fn libdm_task_set_name and .Fn libdm_task_get_name -Set name of device for commands which need to have dm device identifier. -Device-mapper later uses device name to lookup device from list of all devices. -Get routine will fetch device name from task dictionary. +Set name of the device for commands which need to have a dm device +identifier. +The device-mapper later uses the device name to look up the device +from the list of all devices. +The get routine will fetch the device name from the task dictionary. .Pp .Fn libdm_task_set_uuid and .Fn libdm_task_get_uuid -Set uuid of device for commands which need to have dm device identifier. -Device-mapper later uses device uuid to lookup device from list of all devices. -Get routine will fetch device uuid from task dictionary. +Set uuid of device for commands which need to have a dm device +identifier. +The device-mapper later uses the device uuid to look up the device +from the list of all devices. +The get routine will fetch the device uuid from the task dictionary. .Pp .Fn libdm_task_set_minor and .Fn libdm_task_get_minor -Set minor device number of device for commands which need to have dm device identifier. -Device-mapper later uses device minor number to lookup device from list of all devices. -Get routine will fetch device minor number from task dictionary. +Set minor device number of device for commands which need to have +a dm device identifier. +The device-mapper later uses the device minor number to look up +the device from the list of all devices. +The get routine will fetch the device minor number from the task +dictionary. .Pp .Fn libdm_task_set_flags and .Fn libdm_task_get_flags -Set/Fetch device status flags from task dictionary. +Set/fetch device status flags from the task dictionary. .Pp .Fn libdm_task_get_open_num -Fetch number of opened devices from kernel and return them as +Fetch number of opened devices from the kernel and return them as .Rt count . .Pp .Fn libdm_task_get_target_num -Fetch number of opened devices from kernel and return them as +Fetch number of opened devices from the kernel and return them as .Rt count . .Pp .Fn libdm_task_get_cmd_version -Get dm driver in kernel version and set is as array +Get the version of the dm driver in the kernel as array .Fa uint32_t *ver -with -.Fa size -size. +of size
CVS commit: src/lib/libdm
Module Name:src Committed By: matt Date: Wed Mar 21 05:36:24 UTC 2012 Modified Files: src/lib/libdm: Makefile Log Message: Use WARNS=2 (the previous WARN=4 was incorrect and ignored). To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/lib/libdm/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libdm/Makefile diff -u src/lib/libdm/Makefile:1.1 src/lib/libdm/Makefile:1.2 --- src/lib/libdm/Makefile:1.1 Tue Feb 8 03:20:15 2011 +++ src/lib/libdm/Makefile Wed Mar 21 05:36:24 2012 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.1 2011/02/08 03:20:15 haad Exp $ +# $NetBSD: Makefile,v 1.2 2012/03/21 05:36:24 matt Exp $ USE_FORT?= no # network protocol library LIB=dm @@ -6,7 +6,7 @@ LIB=dm SRCS= libdm_ioctl.c MAN= dm.3 -WARN= 4 +WARNS= 2 CPPFLAGS+= -I${.CURDIR} #CFLAGS+= -g -O0
CVS commit: src/lib/libdm
Module Name:src Committed By: njoly Date: Mon Feb 28 09:10:28 UTC 2011 Modified Files: src/lib/libdm: dm.3 Log Message: Small macro fix (SS -> Ss). To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/lib/libdm/dm.3 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libdm/dm.3 diff -u src/lib/libdm/dm.3:1.2 src/lib/libdm/dm.3:1.3 --- src/lib/libdm/dm.3:1.2 Tue Feb 8 09:49:07 2011 +++ src/lib/libdm/dm.3 Mon Feb 28 09:10:28 2011 @@ -1,4 +1,4 @@ -.\" $NetBSD: dm.3,v 1.2 2011/02/08 09:49:07 wiz Exp $ +.\" $NetBSD: dm.3,v 1.3 2011/02/28 09:10:28 njoly Exp $ .\" .\" Copyright (c) 2004,2009 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -279,7 +279,7 @@ they can be created by the .Fn libdm_cmd_iter_create function. -.SS LIBDM CMD TABLE +.Ss LIBDM CMD TABLE A device table describes the logical mapping between the dm device and physical devices. Every table has the logical block start, the table length (in disk
CVS commit: src/lib/libdm
Module Name:src Committed By: wiz Date: Tue Mar 1 08:48:41 UTC 2011 Modified Files: src/lib/libdm: dm.3 Log Message: Whitespace nit. To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/lib/libdm/dm.3 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libdm/dm.3 diff -u src/lib/libdm/dm.3:1.4 src/lib/libdm/dm.3:1.5 --- src/lib/libdm/dm.3:1.4 Mon Feb 28 23:23:08 2011 +++ src/lib/libdm/dm.3 Tue Mar 1 08:48:41 2011 @@ -1,4 +1,4 @@ -.\" $NetBSD: dm.3,v 1.4 2011/02/28 23:23:08 haad Exp $ +.\" $NetBSD: dm.3,v 1.5 2011/03/01 08:48:41 wiz Exp $ .\" .\" Copyright (c) 2004,2009 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -218,10 +218,10 @@ Set/fetch device status flags from the task dictionary. .Pp .Fn libdm_task_get_open_num -Fetch number of opened devices from the kernel and return them as count . +Fetch number of opened devices from the kernel and return them as count. .Pp .Fn libdm_task_get_target_num -Fetch number of opened devices from the kernel and return them as count . +Fetch number of opened devices from the kernel and return them as count. .Pp .Fn libdm_task_get_cmd_version Get the version of the dm driver in the kernel as array
CVS commit: src/lib/libdm
Module Name:src Committed By: haad Date: Mon May 30 01:10:58 UTC 2011 Modified Files: src/lib/libdm: libdm_ioctl.c Log Message: Fix problem where DM_IOCTL_NAME was used in libdm_task_set_uuid except of DM_IOCTL_UUID. This makes lvremove to work properly. Thanks To hugo Silva and Toby Karyadi for reporting this issue. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/lib/libdm/libdm_ioctl.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libdm/libdm_ioctl.c diff -u src/lib/libdm/libdm_ioctl.c:1.1 src/lib/libdm/libdm_ioctl.c:1.2 --- src/lib/libdm/libdm_ioctl.c:1.1 Tue Feb 8 03:20:15 2011 +++ src/lib/libdm/libdm_ioctl.c Mon May 30 01:10:57 2011 @@ -262,7 +262,7 @@ if ((prop_dictionary_set_cstring(libdm_task->ldm_task, DM_IOCTL_NAME, name)) == false) return ENOENT; - + return 0; } @@ -285,7 +285,7 @@ { if ((prop_dictionary_set_cstring(libdm_task->ldm_task, - DM_IOCTL_NAME, uuid)) == false) + DM_IOCTL_UUID, uuid)) == false) return ENOENT; return 0;
CVS commit: src/lib/libdm
Module Name:src Committed By: dholland Date: Fri Jan 22 22:11:28 UTC 2016 Modified Files: src/lib/libdm: dm.h Log Message: - Has __BEGIN_DECLS so needs sys/cdefs.h; - Needs stddef.h and stdint.h to be compilable on its own To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/lib/libdm/dm.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libdm/dm.h diff -u src/lib/libdm/dm.h:1.1 src/lib/libdm/dm.h:1.2 --- src/lib/libdm/dm.h:1.1 Tue Feb 8 03:20:15 2011 +++ src/lib/libdm/dm.h Fri Jan 22 22:11:28 2016 @@ -31,6 +31,10 @@ #ifndef _LIB_DM_H_ #define _LIB_DM_H_ +#include +#include +#include + __BEGIN_DECLS #define DM_DEVICE_PATH "/dev/mapper/control"
CVS commit: src/lib/libdm
Module Name:src Committed By: dholland Date: Fri Jan 22 22:12:40 UTC 2016 Modified Files: src/lib/libdm: dm.3 Log Message: The actual header file for these functions is dm.h, not libdm.h. Bump date. To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/lib/libdm/dm.3 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libdm/dm.3 diff -u src/lib/libdm/dm.3:1.5 src/lib/libdm/dm.3:1.6 --- src/lib/libdm/dm.3:1.5 Tue Mar 1 08:48:41 2011 +++ src/lib/libdm/dm.3 Fri Jan 22 22:12:40 2016 @@ -1,4 +1,4 @@ -.\" $NetBSD: dm.3,v 1.5 2011/03/01 08:48:41 wiz Exp $ +.\" $NetBSD: dm.3,v 1.6 2016/01/22 22:12:40 dholland Exp $ .\" .\" Copyright (c) 2004,2009 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -26,7 +26,7 @@ .\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. -.Dd January 22, 2011 +.Dd January 22, 2016 .Dt DM 3 .Os .Sh NAME @@ -35,7 +35,7 @@ .Sh LIBRARY .Lb libdm .Sh SYNOPSIS -.In libdm.h +.In dm.h .Ft void .Fn libdm_iter_destroy "libdm_iter_t libdm_iter" .Ft int
CVS commit: src/lib/libdm
Module Name:src Committed By: mlelstv Date: Thu Dec 27 14:05:54 UTC 2018 Modified Files: src/lib/libdm: libdm_ioctl.c Log Message: Clean up double free in some error paths that did trigger an assertion in libprop. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/lib/libdm/libdm_ioctl.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libdm/libdm_ioctl.c diff -u src/lib/libdm/libdm_ioctl.c:1.2 src/lib/libdm/libdm_ioctl.c:1.3 --- src/lib/libdm/libdm_ioctl.c:1.2 Mon May 30 01:10:57 2011 +++ src/lib/libdm/libdm_ioctl.c Thu Dec 27 14:05:54 2018 @@ -165,8 +165,6 @@ libdm_task_run(libdm_task_t libdm_task) error = rump_sys_ioctl(libdm_control_fd, NETBSD_DM_IOCTL, &prefp); if (error < 0) { - libdm_task_destroy(libdm_task); - libdm_task = NULL; libdm_control_close(libdm_control_fd); return error; @@ -177,8 +175,6 @@ libdm_task_run(libdm_task_t libdm_task) error = prop_dictionary_sendrecv_ioctl(libdm_task->ldm_task, libdm_control_fd, NETBSD_DM_IOCTL, &dict); if ( error != 0) { - libdm_task_destroy(libdm_task); - libdm_task = NULL; libdm_control_close(libdm_control_fd); return error; }
CVS commit: src/lib/libdm
Module Name:src Committed By: riastradh Date: Sat Feb 15 22:55:22 UTC 2020 Modified Files: src/lib/libdm: libdm_ioctl.c Log Message: Let's not write temporary files to fixed paths in /tmp, shall we? XXX pullup To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/lib/libdm/libdm_ioctl.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libdm/libdm_ioctl.c diff -u src/lib/libdm/libdm_ioctl.c:1.3 src/lib/libdm/libdm_ioctl.c:1.4 --- src/lib/libdm/libdm_ioctl.c:1.3 Thu Dec 27 14:05:54 2018 +++ src/lib/libdm/libdm_ioctl.c Sat Feb 15 22:55:22 2020 @@ -171,14 +171,12 @@ libdm_task_run(libdm_task_t libdm_task) } dict = prop_dictionary_internalize(prefp.pref_plist); #else - prop_dictionary_externalize_to_file(libdm_task->ldm_task, "/tmp/libdm_in"); error = prop_dictionary_sendrecv_ioctl(libdm_task->ldm_task, libdm_control_fd, NETBSD_DM_IOCTL, &dict); if ( error != 0) { libdm_control_close(libdm_control_fd); return error; } - prop_dictionary_externalize_to_file(dict, "/tmp/libdm_out"); #endif libdm_control_close(libdm_control_fd);
CVS commit: src/lib/libdm
Module Name:src Committed By: thorpej Date: Sun Jun 7 05:57:17 UTC 2020 Modified Files: src/lib/libdm: libdm_ioctl.c Log Message: Update for proplib(3) API changes. To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/lib/libdm/libdm_ioctl.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libdm/libdm_ioctl.c diff -u src/lib/libdm/libdm_ioctl.c:1.4 src/lib/libdm/libdm_ioctl.c:1.5 --- src/lib/libdm/libdm_ioctl.c:1.4 Sat Feb 15 22:55:22 2020 +++ src/lib/libdm/libdm_ioctl.c Sun Jun 7 05:57:17 2020 @@ -207,7 +207,7 @@ libdm_task_create(const char *command) return NULL; } - if ((prop_dictionary_set_cstring(task->ldm_task, DM_IOCTL_COMMAND, + if ((prop_dictionary_set_string(task->ldm_task, DM_IOCTL_COMMAND, command)) == false) { prop_object_release(task->ldm_task); free(task); @@ -253,7 +253,7 @@ int libdm_task_set_name(const char *name, libdm_task_t libdm_task) { - if ((prop_dictionary_set_cstring(libdm_task->ldm_task, + if ((prop_dictionary_set_string(libdm_task->ldm_task, DM_IOCTL_NAME, name)) == false) return ENOENT; @@ -278,7 +278,7 @@ int libdm_task_set_uuid(const char *uuid, libdm_task_t libdm_task) { - if ((prop_dictionary_set_cstring(libdm_task->ldm_task, + if ((prop_dictionary_set_string(libdm_task->ldm_task, DM_IOCTL_UUID, uuid)) == false) return ENOENT; @@ -657,7 +657,7 @@ libdm_cmd_get_deps(libdm_iter_t libdm_it uint64_t deps; obj = prop_object_iterator_next(libdm_iter->ldm_obji); - deps = prop_number_unsigned_integer_value(obj); + deps = prop_number_unsigned_value(obj); if (obj != NULL) prop_object_release(obj); @@ -747,7 +747,7 @@ libdm_table_set_target(const char *name, if (libdm_table == NULL) return ENOENT; - return prop_dictionary_set_cstring(libdm_table->ldm_tbl, DM_TABLE_TYPE, name); + return prop_dictionary_set_string(libdm_table->ldm_tbl, DM_TABLE_TYPE, name); } char * @@ -769,7 +769,7 @@ libdm_table_set_params(const char *param if (libdm_table == NULL) return ENOENT; - return prop_dictionary_set_cstring(libdm_table->ldm_tbl, + return prop_dictionary_set_string(libdm_table->ldm_tbl, DM_TABLE_PARAMS, params); } @@ -885,5 +885,5 @@ libdm_dev_set_newname(const char *newnam if (newname == NULL) return ENOENT; - return prop_array_set_cstring(libdm_cmd->ldm_cmd, 0, newname); + return prop_array_set_string(libdm_cmd->ldm_cmd, 0, newname); }