Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JIOfs-0007EK-KW for qemu-devel@nongnu.org; Fri, 25 Jan 2008 08:32:52 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JIOfr-0007CL-D9 for qemu-devel@nongnu.org; Fri, 25 Jan 2008 08:32:52 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JIOfr-0007C5-52 for qemu-devel@nongnu.org; Fri, 25 Jan 2008 08:32:51 -0500 Received: from smtp02.citrix.com ([66.165.176.63]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JIOfq-0007jh-TO for qemu-devel@nongnu.org; Fri, 25 Jan 2008 08:32:51 -0500 Received: from mariner.uk.xensource.com (mariner.uk.xensource.com [172.31.17.38]) by smtp01.ad.xensource.com (8.13.1/8.13.1) with ESMTP id m0PDW4Ux007871 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NO) for ; Fri, 25 Jan 2008 05:32:07 -0800 Received: from iwj by mariner.uk.xensource.com with local (Exim 4.63) (envelope-from ) id 1JIOdw-0001L7-1L for qemu-devel@nongnu.org; Fri, 25 Jan 2008 13:30:52 +0000 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="KBnhFnChj4" Content-Transfer-Encoding: 7bit Message-ID: <18329.58508.33768.622480@mariner.uk.xensource.com> Date: Fri, 25 Jan 2008 13:30:52 +0000 From: Ian Jackson Subject: [Qemu-devel] [PATCH] Remove clone-and-hack code from qemu-img 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 --KBnhFnChj4 Content-Type: text/plain; charset=us-ascii Content-Description: message body text Content-Transfer-Encoding: 7bit qemu-img.c has copies of qemu_malloc et al, which are already provided in osdep.c. The attached patch removes these from qemu-img.c and adds osdep.o to BLOCK_OBJS. (It wants to be in BLOCK_OBJS rather than just in qemu-img to support my next patch.) Regards, Ian. --KBnhFnChj4 Content-Type: text/plain Content-Description: remove duplicated code from qemu-img.c Content-Disposition: inline; filename="qemu-img-noduplication.patch" Content-Transfer-Encoding: 7bit Index: Makefile =================================================================== RCS file: /sources/qemu/qemu/Makefile,v retrieving revision 1.143 diff -u -r1.143 Makefile --- Makefile 14 Jan 2008 04:24:27 -0000 1.143 +++ Makefile 25 Jan 2008 13:29:03 -0000 @@ -37,7 +37,7 @@ ####################################################################### # BLOCK_OBJS is code used by both qemu system emulation and qemu-img -BLOCK_OBJS=cutils.o +BLOCK_OBJS=cutils.o osdep.o BLOCK_OBJS+=block-cow.o block-qcow.o aes.o block-vmdk.o block-cloop.o BLOCK_OBJS+=block-dmg.o block-bochs.o block-vpc.o block-vvfat.o BLOCK_OBJS+=block-qcow2.o block-parallels.o Index: qemu-img.c =================================================================== RCS file: /sources/qemu/qemu/qemu-img.c,v retrieving revision 1.28 diff -u -r1.28 qemu-img.c --- qemu-img.c 6 Jan 2008 17:21:48 -0000 1.28 +++ qemu-img.c 25 Jan 2008 13:29:10 -0000 @@ -30,41 +30,6 @@ #include #endif -void *get_mmap_addr(unsigned long size) -{ - return NULL; -} - -void qemu_free(void *ptr) -{ - free(ptr); -} - -void *qemu_malloc(size_t size) -{ - return malloc(size); -} - -void *qemu_mallocz(size_t size) -{ - void *ptr; - ptr = qemu_malloc(size); - if (!ptr) - return NULL; - memset(ptr, 0, size); - return ptr; -} - -char *qemu_strdup(const char *str) -{ - char *ptr; - ptr = qemu_malloc(strlen(str) + 1); - if (!ptr) - return NULL; - strcpy(ptr, str); - return ptr; -} - static void __attribute__((noreturn)) error(const char *fmt, ...) { va_list ap; --KBnhFnChj4--