Message ID | 20181214144214.1260-17-peter.maydell@linaro.org |
---|---|
State | Accepted |
Commit | 061923298fe34e1bf5f32006f8d725a547fc4118 |
Headers | show
Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp2168722ljp; Fri, 14 Dec 2018 06:59:36 -0800 (PST) X-Google-Smtp-Source: AFSGD/UNJdSxf2/l4i7ibiiiAEBnwY2znp61nPXTyTKFOh1/HV8zj4fOJpOQY7RAVAQRixlsT7xj X-Received: by 2002:a37:d106:: with SMTP id s6mr2848759qki.105.1544799576459; Fri, 14 Dec 2018 06:59:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544799576; cv=none; d=google.com; s=arc-20160816; b=FSzzrTx1Wn5AiCa+o11Vd5DyAqJb4jfr1CaS5/M/Zx+gsWcc0i1atqHqDoqPCdPE/M 8o/fY/wRqXqmLJW/XY3b+jMv/c1YqRaIzo2JcJMDh3dmI3KBq9ICFIDLds5b3d1s77Ef 0snB71Nhgu6npKv1zLeKhZBj3GsMXelV+X3X9g4SOa4iSkjIpKXTB1jPQLrqvHFPrMXr f387Vzhjarm7McTyGw1Q3Nozghmn9PnSSLg27XhrZUq8eEQuL3tAHvD0MiShzP6l6raS MwYO9eVEILI2RarPeUPLsCL+j9CbDsfZIEoKN4vsFCcRJObdlu6Ve3ojJBf0MmxQO9uW bdSw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=REjFPA094fKh2KtdwLubWwKQkwwTFmgau+pbtGC2D58=; b=sfjluF+iQ4KmwMgXexiyY9TLEAxNT5G7sg4iXLg3fETKSjITvP7194GUgwPKsIVqBZ bLKTjFrS4Q318rjA1pCYuAcZzZ69gYOnB2KT10YoNBkKpGHX2vfrEIvRyg/mQSpEleXc 4VXduOglX+v44NLyxRXpukmgatzP7nsjI8bi/7Lwr+oUyQobncbNl8CeskFoD5LpZOEJ smadl6gKOav7pShYCsChtYlG4V8WDMvrh9lgQSd+UraEqujVB3OAEHzFk9SaBkFOfkPN 2yooY8h/L2W5c4Fj43Sl2sekatjoPwohZs61sN+JNX6OXTLRrem+Ff4JM0qGsxXVB0lV 0N4Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=FpJ2k7rv; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: <qemu-devel-bounces+patch=linaro.org@nongnu.org> Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id u22si2957760qvf.20.2018.12.14.06.59.36 for <patch@linaro.org> (version=TLS1 cipher=AES128-SHA bits=128/128); Fri, 14 Dec 2018 06:59:36 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=FpJ2k7rv; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:33961 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from <qemu-devel-bounces+patch=linaro.org@nongnu.org>) id 1gXowB-00070M-VC for patch@linaro.org; Fri, 14 Dec 2018 09:59:35 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38441) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from <peter.maydell@linaro.org>) id 1gXofq-0000Cs-E5 for qemu-devel@nongnu.org; Fri, 14 Dec 2018 09:42:43 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from <peter.maydell@linaro.org>) id 1gXofm-0004TE-9S for qemu-devel@nongnu.org; Fri, 14 Dec 2018 09:42:42 -0500 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]:35707) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from <peter.maydell@linaro.org>) id 1gXofm-0004SE-2g for qemu-devel@nongnu.org; Fri, 14 Dec 2018 09:42:38 -0500 Received: by mail-wr1-x429.google.com with SMTP id 96so5680232wrb.2 for <qemu-devel@nongnu.org>; Fri, 14 Dec 2018 06:42:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=REjFPA094fKh2KtdwLubWwKQkwwTFmgau+pbtGC2D58=; b=FpJ2k7rvc85/nE2SF+Oebv77ClZ2oQrCsy0xsZPN9bf9DoFd6eyjZI0UWd9jRhL8Em Weesbzd4+s1TyUHJWvVQCwh1nlo+06cikvsDqJinN9yRv3d+xeFZQc8aOOqZZkt9VLvc celCMGPh53inPSw4+aPyPz7giMAOiWdR3Lu+k= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=REjFPA094fKh2KtdwLubWwKQkwwTFmgau+pbtGC2D58=; b=ItoPQY3QQDpaVADeO3P/CVqjbMLR+C0KCpaOFwc4B7HuQUq5dYEwWIYukcPoM3LCyN J8ZfdfpCEJlIMGLZPUfInM1Oz9KnYljXEcPS6UqOn+iOwMW+ZFGjkq+F8qgy9E+1MKIa TC+ngcNuV8vZLKASPUCZcuysaLVKdabNG75O7wTOS1XS34Tp+g0KCmKZatwHUzqkHZsT KuiXh7xJVUY3LAkxoOMRToCmrCasFZ10sPyPmnXEz2yQHM2LandOaoa+ilG4ihSI5pWO Qzi7U0cG0LYGmcKHW6KhLsUhqmeC1MpIDuXLth27IrP6jXfmLM6xOeJn+ICEAoOrETEm BUSA== X-Gm-Message-State: AA+aEWZuxjVX1VGirYjmJhbcX870Ho6lGbCOekiSOcaaYcxBDyLN4pjU Nr45vq8SzRsaOdVUeTQyvssTflt+YMU= X-Received: by 2002:a5d:634b:: with SMTP id b11mr2885959wrw.14.1544798556040; Fri, 14 Dec 2018 06:42:36 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id m6sm3263204wrv.24.2018.12.14.06.42.35 for <qemu-devel@nongnu.org> (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 14 Dec 2018 06:42:35 -0800 (PST) From: Peter Maydell <peter.maydell@linaro.org> To: qemu-devel@nongnu.org Date: Fri, 14 Dec 2018 14:42:08 +0000 Message-Id: <20181214144214.1260-17-peter.maydell@linaro.org> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20181214144214.1260-1-peter.maydell@linaro.org> References: <20181214144214.1260-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::429 Subject: [Qemu-devel] [PULL 16/22] include/hw/loader.h: Document load_image_size() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: <qemu-devel.nongnu.org> List-Unsubscribe: <https://lists.nongnu.org/mailman/options/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe> List-Archive: <http://lists.nongnu.org/archive/html/qemu-devel/> List-Post: <mailto:qemu-devel@nongnu.org> List-Help: <mailto:qemu-devel-request@nongnu.org?subject=help> List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=subscribe> Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" <qemu-devel-bounces+patch=linaro.org@nongnu.org> |
Series |
misc queue
|
expand
|
diff --git a/include/hw/loader.h b/include/hw/loader.h index 3766559bc24..0a0ad808ea3 100644 --- a/include/hw/loader.h +++ b/include/hw/loader.h @@ -11,6 +11,22 @@ * On error, errno is also set as appropriate. */ int64_t get_image_size(const char *filename); +/** + * load_image_size: load an image file into specified buffer + * @filename: Path to the image file + * @addr: Buffer to load image into + * @size: Size of buffer in bytes + * + * Load an image file from disk into the specified buffer. + * If the image is larger than the specified buffer, only + * @size bytes are read (this is not considered an error). + * + * Prefer to use the GLib function g_file_get_contents() rather + * than a "get_image_size()/g_malloc()/load_image_size()" sequence. + * + * Returns the number of bytes read, or -1 on error. On error, + * errno is also set as appropriate. + */ ssize_t load_image_size(const char *filename, void *addr, size_t size); /**load_image_targphys_as: