Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JzZn9-00051O-7X for qemu-devel@nongnu.org; Fri, 23 May 2008 12:06:51 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JzZn8-000506-8s for qemu-devel@nongnu.org; Fri, 23 May 2008 12:06:50 -0400 Received: from [199.232.76.173] (port=38814 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JzZn8-0004zt-4J for qemu-devel@nongnu.org; Fri, 23 May 2008 12:06:50 -0400 Received: from savannah.gnu.org ([199.232.41.3]:51342 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1JzZn7-0004d8-SK for qemu-devel@nongnu.org; Fri, 23 May 2008 12:06:49 -0400 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1JzZn2-0000Qq-6J for qemu-devel@nongnu.org; Fri, 23 May 2008 16:06:44 +0000 Received: from pbrook by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1JzZn1-0000Qm-RF for qemu-devel@nongnu.org; Fri, 23 May 2008 16:06:44 +0000 MIME-Version: 1.0 Errors-To: pbrook Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Paul Brook Message-Id: Date: Fri, 23 May 2008 16:06:43 +0000 Subject: [Qemu-devel] [4543] Fix build failure with old kernel headers (loop. h is incompatible with Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Revision: 4543 http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=4543 Author: pbrook Date: 2008-05-23 16:06:43 +0000 (Fri, 23 May 2008) Log Message: ----------- Fix build failure with old kernel headers (loop.h is incompatible with glibc headers). Modified Paths: -------------- trunk/linux-user/syscall.c Added Paths: ----------- trunk/linux-user/linux_loop.h Added: trunk/linux-user/linux_loop.h =================================================================== --- trunk/linux-user/linux_loop.h (rev 0) +++ trunk/linux-user/linux_loop.h 2008-05-23 16:06:43 UTC (rev 4543) @@ -0,0 +1,95 @@ +/* Copied from 2.6.25 kernel headers to avoid problems on older hosts. */ +#ifndef _LINUX_LOOP_H +#define _LINUX_LOOP_H + +/* + * include/linux/loop.h + * + * Written by Theodore Ts'o, 3/29/93. + * + * Copyright 1993 by Theodore Ts'o. Redistribution of this file is + * permitted under the GNU General Public License. + */ + +#define LO_NAME_SIZE 64 +#define LO_KEY_SIZE 32 + + +/* + * Loop flags + */ +enum { + LO_FLAGS_READ_ONLY = 1, + LO_FLAGS_USE_AOPS = 2, + LO_FLAGS_AUTOCLEAR = 4, +}; + +#include +#include /* for __kernel_old_dev_t */ +#include /* for __u64 */ + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0) /* This is a guess. */ +#define __kernel_old_dev_t __kernel_dev_t +#endif + +/* Backwards compatibility version */ +struct loop_info { + int lo_number; /* ioctl r/o */ + __kernel_old_dev_t lo_device; /* ioctl r/o */ + unsigned long lo_inode; /* ioctl r/o */ + __kernel_old_dev_t lo_rdevice; /* ioctl r/o */ + int lo_offset; + int lo_encrypt_type; + int lo_encrypt_key_size; /* ioctl w/o */ + int lo_flags; /* ioctl r/o */ + char lo_name[LO_NAME_SIZE]; + unsigned char lo_encrypt_key[LO_KEY_SIZE]; /* ioctl w/o */ + unsigned long lo_init[2]; + char reserved[4]; +}; + +struct loop_info64 { + __u64 lo_device; /* ioctl r/o */ + __u64 lo_inode; /* ioctl r/o */ + __u64 lo_rdevice; /* ioctl r/o */ + __u64 lo_offset; + __u64 lo_sizelimit;/* bytes, 0 == max available */ + __u32 lo_number; /* ioctl r/o */ + __u32 lo_encrypt_type; + __u32 lo_encrypt_key_size; /* ioctl w/o */ + __u32 lo_flags; /* ioctl r/o */ + __u8 lo_file_name[LO_NAME_SIZE]; + __u8 lo_crypt_name[LO_NAME_SIZE]; + __u8 lo_encrypt_key[LO_KEY_SIZE]; /* ioctl w/o */ + __u64 lo_init[2]; +}; + +/* + * Loop filter types + */ + +#define LO_CRYPT_NONE 0 +#define LO_CRYPT_XOR 1 +#define LO_CRYPT_DES 2 +#define LO_CRYPT_FISH2 3 /* Twofish encryption */ +#define LO_CRYPT_BLOW 4 +#define LO_CRYPT_CAST128 5 +#define LO_CRYPT_IDEA 6 +#define LO_CRYPT_DUMMY 9 +#define LO_CRYPT_SKIPJACK 10 +#define LO_CRYPT_CRYPTOAPI 18 +#define MAX_LO_CRYPT 20 + +/* + * IOCTL commands --- we will commandeer 0x4C ('L') + */ + +#define LOOP_SET_FD 0x4C00 +#define LOOP_CLR_FD 0x4C01 +#define LOOP_SET_STATUS 0x4C02 +#define LOOP_GET_STATUS 0x4C03 +#define LOOP_SET_STATUS64 0x4C04 +#define LOOP_GET_STATUS64 0x4C05 +#define LOOP_CHANGE_FD 0x4C06 + +#endif Modified: trunk/linux-user/syscall.c =================================================================== --- trunk/linux-user/syscall.c 2008-05-23 12:55:11 UTC (rev 4542) +++ trunk/linux-user/syscall.c 2008-05-23 16:06:43 UTC (rev 4543) @@ -68,7 +68,7 @@ #include #include #include -#include +#include "linux_loop.h" #include "qemu.h"