Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/external/gpl2/lvm2/dist/libdm/ioctl Add support for building...



details:   https://anonhg.NetBSD.org/src/rev/753c7a5cae79
branches:  trunk
changeset: 749800:753c7a5cae79
user:      haad <haad%NetBSD.org@localhost>
date:      Wed Dec 09 00:15:51 2009 +0000

description:
Add support for building RUMP_ACTION libdevmapper which will build and link
libdevmapper with RUMP kernel and libdm(RUMP based device-mapper library).
This enables testing of dmsetup and libdevmapper with RUMP.

diffstat:

 external/gpl2/lvm2/dist/libdm/ioctl/libdm-nbsd-iface.c |  24 ++++++++++++++++-
 1 files changed, 22 insertions(+), 2 deletions(-)

diffs (61 lines):

diff -r a6ff1b9e3fd6 -r 753c7a5cae79 external/gpl2/lvm2/dist/libdm/ioctl/libdm-nbsd-iface.c
--- a/external/gpl2/lvm2/dist/libdm/ioctl/libdm-nbsd-iface.c    Wed Dec 09 00:11:21 2009 +0000
+++ b/external/gpl2/lvm2/dist/libdm/ioctl/libdm-nbsd-iface.c    Wed Dec 09 00:15:51 2009 +0000
@@ -1,4 +1,4 @@
-/*      $NetBSD: libdm-nbsd-iface.c,v 1.5 2009/12/05 11:42:24 haad Exp $        */
+/*      $NetBSD: libdm-nbsd-iface.c,v 1.6 2009/12/09 00:15:51 haad Exp $        */
 
 /*
  * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
@@ -32,6 +32,11 @@
 
 #include <dm-ioctl.h>
 
+#ifdef RUMP_ACTION
+#include <rump/rump.h>
+#include <rump/rump_syscalls.h>
+#endif
+
 /*
  * Ensure build compatibility.  
  * The hard-coded versions here are the highest present 
@@ -189,6 +194,9 @@
        if (_control_fd != -1)
                return 1;
 
+#ifdef RUMP_ACTION     
+       rump_init();
+#endif
        snprintf(control, sizeof(control), "%s/control", dm_dir());
 
        if (!_control_device_number(&major, &minor))
@@ -1018,9 +1026,18 @@
        //printf("name %s, major %d minor %d\n uuid %s\n", 
         //dm_task_get_name(dmt), dmt->minor, dmt->major, dm_task_get_uuid(dmt));
        /* Send dictionary to kernel and wait for reply. */
+#ifdef RUMP_ACTION
+       struct plistref prefp;
+       int err;
+       prop_dictionary_externalize_to_pref(dm_dict_in, &prefp);
+
+       if (rump_sys_ioctl(_control_fd, NETBSD_DM_IOCTL, &prefp) != 0) {
+
+               dm_dict_out = prop_dictionary_internalize(prefp.pref_plist);
+#else  
        if (prop_dictionary_sendrecv_ioctl(dm_dict_in,_control_fd,
                NETBSD_DM_IOCTL,&dm_dict_out) != 0) {
-
+#endif
                if (errno == ENOENT &&
                    ((dmt->type == DM_DEVICE_INFO) ||
                        (dmt->type == DM_DEVICE_MKNODES) ||
@@ -1051,6 +1068,9 @@
                }
        }
 
+#ifdef RUMP_ACTION
+       dm_dict_out = prop_dictionary_internalize(prefp.pref_plist);
+#endif 
        prop_dictionary_externalize_to_file(dm_dict_out,"/tmp/test_out");
 
        /* Parse kernel dictionary to dmi structure and return it to libdevmapper. */



Home | Main Index | Thread Index | Old Index