From nobody Wed Nov 27 12:35:12 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1698994966; cv=none; d=zohomail.com; s=zohoarc; b=OW5UR701OcTlRFlKTEl/sPAr+mKpXWGW7scloThLSHyS4cp12swa7GuyF4cK3YuapS7rcJkw1MGQDPLOH86FVTrjUgUgu39Sa+75daV8P6axvectyBProxH7Cz2M5aOnlFCxUJo74zy54y+Mq9OYL3joxdBSMf3OXBlvPmlrcZU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1698994966; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=JvK2wAaFRVQTY/mBUoloVqKY0St+mXzXhj9d5h4ZicY=; b=ga6KxLgIvpZXlE0RAzMUu9zbTiGxf2jVBUCS+dQVjsBcA/i2r9fmYxM1kPAMN84VjbnDzFxww/JELC8K9WBu5/5hk8/B5Q/55/llwJPePoYS8+SSN2oQLll9+tbU7Ep7KvS3qwL/YLRvwHLcyUSK48EOTbYVyYvgqI8Gdbd150k= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1698994966905631.3903098676436; Fri, 3 Nov 2023 00:02:46 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qyoBq-000641-Ik; Fri, 03 Nov 2023 03:01:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qyoBn-000638-23 for qemu-devel@nongnu.org; Fri, 03 Nov 2023 03:01:56 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qyoBj-0000w5-Mm for qemu-devel@nongnu.org; Fri, 03 Nov 2023 03:01:54 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-661-p9Ur5iYSNQaYt1o2dJBFeQ-1; Fri, 03 Nov 2023 03:01:45 -0400 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 1DBCF811E82; Fri, 3 Nov 2023 07:01:45 +0000 (UTC) Received: from localhost (unknown [10.39.208.31]) by smtp.corp.redhat.com (Postfix) with ESMTP id B4395492BFA; Fri, 3 Nov 2023 07:01:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1698994910; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=JvK2wAaFRVQTY/mBUoloVqKY0St+mXzXhj9d5h4ZicY=; b=WMYwzCDexDnVlSSYBdIvp8whmpohQ0AZJEtmLEiGDRzqRiZgdU00wQ6CoedjjnsfQ0nIoY 2cAdOFYSwE4K6fWHS4+RxVgUhSOhzlWG1IhEb/9iE3CddLlDigLj5ZIEjPo2Zuw9OBj2to gPvG8fIFCnhVtPqVLDSTT+Jf4MY0TRY= X-MC-Unique: p9Ur5iYSNQaYt1o2dJBFeQ-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: Paolo Bonzini , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Gerd Hoffmann , Thomas Huth , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , "Dr. David Alan Gilbert" , "Michael S. Tsirkin" , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Eric Blake , Markus Armbruster , richard.henderson@linaro.org, Beraldo Leal , Wainer dos Santos Moschetta , Stephen Brennan Subject: [PULL 1/8] dump: Pass DumpState to write_ functions Date: Fri, 3 Nov 2023 11:01:29 +0400 Message-ID: <20231103070136.437557-2-marcandre.lureau@redhat.com> In-Reply-To: <20231103070136.437557-1-marcandre.lureau@redhat.com> References: <20231103070136.437557-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.10 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -24 X-Spam_score: -2.5 X-Spam_bar: -- X-Spam_report: (-2.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.393, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1698994968629100003 From: Stephen Brennan For the next patch, we need a reference to DumpState when writing data. Signed-off-by: Stephen Brennan Reviewed-by: Daniel P. Berrang=C3=A9 Reviewed-by: Marc-Andr=C3=A9 Lureau Message-Id: <20230918233233.1431858-2-stephen.s.brennan@oracle.com> --- include/sysemu/dump.h | 2 +- dump/dump.c | 40 ++++++++++++++++++++-------------------- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/include/sysemu/dump.h b/include/sysemu/dump.h index 7008d43d04..e27af8fb34 100644 --- a/include/sysemu/dump.h +++ b/include/sysemu/dump.h @@ -137,7 +137,7 @@ typedef struct QEMU_PACKED KdumpSubHeader64 { } KdumpSubHeader64; =20 typedef struct DataCache { - int fd; /* fd of the file where to write the cached data */ + DumpState *state; /* dump state related to this data */ uint8_t *buf; /* buffer for cached data */ size_t buf_size; /* size of the buf */ size_t data_size; /* size of cached data in buf */ diff --git a/dump/dump.c b/dump/dump.c index d355ada62e..eec34c4738 100644 --- a/dump/dump.c +++ b/dump/dump.c @@ -809,7 +809,7 @@ static void create_vmcore(DumpState *s, Error **errp) dump_end(s, errp); } =20 -static int write_start_flat_header(int fd) +static int write_start_flat_header(DumpState *s) { MakedumpfileHeader *mh; int ret =3D 0; @@ -824,7 +824,7 @@ static int write_start_flat_header(int fd) mh->version =3D cpu_to_be64(VERSION_FLAT_HEADER); =20 size_t written_size; - written_size =3D qemu_write_full(fd, mh, MAX_SIZE_MDF_HEADER); + written_size =3D qemu_write_full(s->fd, mh, MAX_SIZE_MDF_HEADER); if (written_size !=3D MAX_SIZE_MDF_HEADER) { ret =3D -1; } @@ -833,7 +833,7 @@ static int write_start_flat_header(int fd) return ret; } =20 -static int write_end_flat_header(int fd) +static int write_end_flat_header(DumpState *s) { MakedumpfileDataHeader mdh; =20 @@ -841,7 +841,7 @@ static int write_end_flat_header(int fd) mdh.buf_size =3D END_FLAG_FLAT_HEADER; =20 size_t written_size; - written_size =3D qemu_write_full(fd, &mdh, sizeof(mdh)); + written_size =3D qemu_write_full(s->fd, &mdh, sizeof(mdh)); if (written_size !=3D sizeof(mdh)) { return -1; } @@ -849,7 +849,7 @@ static int write_end_flat_header(int fd) return 0; } =20 -static int write_buffer(int fd, off_t offset, const void *buf, size_t size) +static int write_buffer(DumpState *s, off_t offset, const void *buf, size_= t size) { size_t written_size; MakedumpfileDataHeader mdh; @@ -857,12 +857,12 @@ static int write_buffer(int fd, off_t offset, const v= oid *buf, size_t size) mdh.offset =3D cpu_to_be64(offset); mdh.buf_size =3D cpu_to_be64(size); =20 - written_size =3D qemu_write_full(fd, &mdh, sizeof(mdh)); + written_size =3D qemu_write_full(s->fd, &mdh, sizeof(mdh)); if (written_size !=3D sizeof(mdh)) { return -1; } =20 - written_size =3D qemu_write_full(fd, buf, size); + written_size =3D qemu_write_full(s->fd, buf, size); if (written_size !=3D size) { return -1; } @@ -982,7 +982,7 @@ static void create_header32(DumpState *s, Error **errp) #endif dh->status =3D cpu_to_dump32(s, status); =20 - if (write_buffer(s->fd, 0, dh, size) < 0) { + if (write_buffer(s, 0, dh, size) < 0) { error_setg(errp, "dump: failed to write disk dump header"); goto out; } @@ -1012,7 +1012,7 @@ static void create_header32(DumpState *s, Error **err= p) kh->offset_note =3D cpu_to_dump64(s, offset_note); kh->note_size =3D cpu_to_dump32(s, s->note_size); =20 - if (write_buffer(s->fd, DISKDUMP_HEADER_BLOCKS * + if (write_buffer(s, DISKDUMP_HEADER_BLOCKS * block_size, kh, size) < 0) { error_setg(errp, "dump: failed to write kdump sub header"); goto out; @@ -1027,7 +1027,7 @@ static void create_header32(DumpState *s, Error **err= p) if (*errp) { goto out; } - if (write_buffer(s->fd, offset_note, s->note_buf, + if (write_buffer(s, offset_note, s->note_buf, s->note_size) < 0) { error_setg(errp, "dump: failed to write notes"); goto out; @@ -1093,7 +1093,7 @@ static void create_header64(DumpState *s, Error **err= p) #endif dh->status =3D cpu_to_dump32(s, status); =20 - if (write_buffer(s->fd, 0, dh, size) < 0) { + if (write_buffer(s, 0, dh, size) < 0) { error_setg(errp, "dump: failed to write disk dump header"); goto out; } @@ -1123,7 +1123,7 @@ static void create_header64(DumpState *s, Error **err= p) kh->offset_note =3D cpu_to_dump64(s, offset_note); kh->note_size =3D cpu_to_dump64(s, s->note_size); =20 - if (write_buffer(s->fd, DISKDUMP_HEADER_BLOCKS * + if (write_buffer(s, DISKDUMP_HEADER_BLOCKS * block_size, kh, size) < 0) { error_setg(errp, "dump: failed to write kdump sub header"); goto out; @@ -1139,7 +1139,7 @@ static void create_header64(DumpState *s, Error **err= p) goto out; } =20 - if (write_buffer(s->fd, offset_note, s->note_buf, + if (write_buffer(s, offset_note, s->note_buf, s->note_size) < 0) { error_setg(errp, "dump: failed to write notes"); goto out; @@ -1204,7 +1204,7 @@ static int set_dump_bitmap(uint64_t last_pfn, uint64_= t pfn, bool value, while (old_offset < new_offset) { /* calculate the offset and write dump_bitmap */ offset_bitmap1 =3D s->offset_dump_bitmap + old_offset; - if (write_buffer(s->fd, offset_bitmap1, buf, + if (write_buffer(s, offset_bitmap1, buf, bitmap_bufsize) < 0) { return -1; } @@ -1212,7 +1212,7 @@ static int set_dump_bitmap(uint64_t last_pfn, uint64_= t pfn, bool value, /* dump level 1 is chosen, so 1st and 2nd bitmap are same */ offset_bitmap2 =3D s->offset_dump_bitmap + s->len_dump_bitmap + old_offset; - if (write_buffer(s->fd, offset_bitmap2, buf, + if (write_buffer(s, offset_bitmap2, buf, bitmap_bufsize) < 0) { return -1; } @@ -1380,7 +1380,7 @@ out: static void prepare_data_cache(DataCache *data_cache, DumpState *s, off_t offset) { - data_cache->fd =3D s->fd; + data_cache->state =3D s; data_cache->data_size =3D 0; data_cache->buf_size =3D 4 * dump_bitmap_get_bufsize(s); data_cache->buf =3D g_malloc0(data_cache->buf_size); @@ -1399,11 +1399,11 @@ static int write_cache(DataCache *dc, const void *b= uf, size_t size, /* * if flag_sync is set, synchronize data in dc->buf into vmcore. * otherwise check if the space is enough for caching data in buf, if = not, - * write the data in dc->buf to dc->fd and reset dc->buf + * write the data in dc->buf to dc->state->fd and reset dc->buf */ if ((!flag_sync && dc->data_size + size > dc->buf_size) || (flag_sync && dc->data_size > 0)) { - if (write_buffer(dc->fd, dc->offset, dc->buf, dc->data_size) < 0) { + if (write_buffer(dc->state, dc->offset, dc->buf, dc->data_size) < = 0) { return -1; } =20 @@ -1644,7 +1644,7 @@ static void create_kdump_vmcore(DumpState *s, Error *= *errp) * +------------------------------------------+ */ =20 - ret =3D write_start_flat_header(s->fd); + ret =3D write_start_flat_header(s); if (ret < 0) { error_setg(errp, "dump: failed to write start flat header"); return; @@ -1665,7 +1665,7 @@ static void create_kdump_vmcore(DumpState *s, Error *= *errp) return; } =20 - ret =3D write_end_flat_header(s->fd); + ret =3D write_end_flat_header(s); if (ret < 0) { error_setg(errp, "dump: failed to write end flat header"); return; --=20 2.41.0 From nobody Wed Nov 27 12:35:12 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1698995007; cv=none; d=zohomail.com; s=zohoarc; b=mhLWHpQ9vFyns0+kiwiTZCGhRRHp/1j0tv/1majmVe5NgCITQClaUDb2jGYaJNjHCZEdvhs9+nrl4DWUY4Z2Qqi7g4xPZ98ffN9fA+eUfwGfyPU4yRPyUtQADSUsgyFl4e09xfLHYBk2tA7WEWwCjFAziyPDC1EjUS5OPjf/8hY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1698995007; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=a/97ELOFFgRZw3+KK7vgHBNgSfLau25BCHwiLcMW7c4=; b=Od02XsMq9VPg6z60O9Ip12XCLhhaNwMtYp0wtpIuzVhjthyazzWvab6W/fuCEDQ1dkgXgl4dpSckZRV4/WSMpMAglVmTTMwO+R8ZP7MBmYSh/ZrUSTr0Sb55JHWmKc0pUSRhEzqnrnW/fYjHnwHVeDJ8IBhYO1gcNCpuZQ2PZYk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1698995007715366.70860943010405; Fri, 3 Nov 2023 00:03:27 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qyoBr-00064V-Gk; Fri, 03 Nov 2023 03:01:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qyoBp-00063l-Ir for qemu-devel@nongnu.org; Fri, 03 Nov 2023 03:01:57 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qyoBm-0000wU-IP for qemu-devel@nongnu.org; Fri, 03 Nov 2023 03:01:57 -0400 Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-114-DpHo7ow9OCiqKcPbcCj70Q-1; Fri, 03 Nov 2023 03:01:49 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 6578829AB448; Fri, 3 Nov 2023 07:01:49 +0000 (UTC) Received: from localhost (unknown [10.39.208.31]) by smtp.corp.redhat.com (Postfix) with ESMTP id 408CF2166B27; Fri, 3 Nov 2023 07:01:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1698994913; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=a/97ELOFFgRZw3+KK7vgHBNgSfLau25BCHwiLcMW7c4=; b=YfrR5kIT8ou1a25t+Mlafg1VnI7c3heBaROnys26Qp+CB/Fmt6JtaDyBryLGvrALbJi+JW 3cumLxsauROe6BPsO25Di6+Qt+njo8Grs0ZPP4gkbuWBYqRtZve9g6SB4Sxxr4sFsO/eXi b71sE/GnMGbocOJctS9Wr8Arjnnal38= X-MC-Unique: DpHo7ow9OCiqKcPbcCj70Q-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: Paolo Bonzini , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Gerd Hoffmann , Thomas Huth , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , "Dr. David Alan Gilbert" , "Michael S. Tsirkin" , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Eric Blake , Markus Armbruster , richard.henderson@linaro.org, Beraldo Leal , Wainer dos Santos Moschetta , Stephen Brennan Subject: [PULL 2/8] dump: Allow directly outputting raw kdump format Date: Fri, 3 Nov 2023 11:01:30 +0400 Message-ID: <20231103070136.437557-3-marcandre.lureau@redhat.com> In-Reply-To: <20231103070136.437557-1-marcandre.lureau@redhat.com> References: <20231103070136.437557-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.6 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -24 X-Spam_score: -2.5 X-Spam_bar: -- X-Spam_report: (-2.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.393, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1698995008542100001 From: Stephen Brennan The flattened format (currently output by QEMU) is used by makedumpfile only when it is outputting a vmcore to a file which is not seekable. The flattened format functions essentially as a set of instructions of the form "seek to the given offset, then write the given bytes out". The flattened format can be reconstructed using makedumpfile -R, or makedumpfile-R.pl, but it is a slow process because it requires copying the entire vmcore. The flattened format can also be directly read by crash, but still, it requires a lengthy reassembly phase. To sum up, the flattened format is not an ideal one: it should only be used on files which are actually not seekable. This is the exact strategy which makedumpfile uses, as seen in the implementation of "write_buffer()" in makedumpfile [1]. However, QEMU has always used the flattened format. For compatibility it is best not to change the default output format without warning. So, add a flag to DumpState which changes the output to use the normal (i.e. raw) format. This flag will be added to the QMP and HMP commands in the next change. [1]: https://github.com/makedumpfile/makedumpfile/blob/f23bb943568188a2746d= bf9b6692668f5a2ac3b6/makedumpfile.c#L5008-L5040 Signed-off-by: Stephen Brennan Reviewed-by: Daniel P. Berrang=C3=A9 [ Marc-Andr=C3=A9: replace loff_t with off_t ] Reviewed-by: Marc-Andr=C3=A9 Lureau Message-Id: <20230918233233.1431858-3-stephen.s.brennan@oracle.com> --- include/sysemu/dump.h | 1 + dump/dump.c | 32 +++++++++++++++++++++++++------- 2 files changed, 26 insertions(+), 7 deletions(-) diff --git a/include/sysemu/dump.h b/include/sysemu/dump.h index e27af8fb34..d702854853 100644 --- a/include/sysemu/dump.h +++ b/include/sysemu/dump.h @@ -157,6 +157,7 @@ typedef struct DumpState { MemoryMappingList list; bool resume; bool detached; + bool kdump_raw; hwaddr memory_offset; int fd; =20 diff --git a/dump/dump.c b/dump/dump.c index eec34c4738..0f913e1f5c 100644 --- a/dump/dump.c +++ b/dump/dump.c @@ -814,6 +814,10 @@ static int write_start_flat_header(DumpState *s) MakedumpfileHeader *mh; int ret =3D 0; =20 + if (s->kdump_raw) { + return 0; + } + QEMU_BUILD_BUG_ON(sizeof *mh > MAX_SIZE_MDF_HEADER); mh =3D g_malloc0(MAX_SIZE_MDF_HEADER); =20 @@ -837,6 +841,10 @@ static int write_end_flat_header(DumpState *s) { MakedumpfileDataHeader mdh; =20 + if (s->kdump_raw) { + return 0; + } + mdh.offset =3D END_FLAG_FLAT_HEADER; mdh.buf_size =3D END_FLAG_FLAT_HEADER; =20 @@ -853,13 +861,21 @@ static int write_buffer(DumpState *s, off_t offset, c= onst void *buf, size_t size { size_t written_size; MakedumpfileDataHeader mdh; + off_t seek_loc; =20 - mdh.offset =3D cpu_to_be64(offset); - mdh.buf_size =3D cpu_to_be64(size); + if (s->kdump_raw) { + seek_loc =3D lseek(s->fd, offset, SEEK_SET); + if (seek_loc =3D=3D (off_t) -1) { + return -1; + } + } else { + mdh.offset =3D cpu_to_be64(offset); + mdh.buf_size =3D cpu_to_be64(size); =20 - written_size =3D qemu_write_full(s->fd, &mdh, sizeof(mdh)); - if (written_size !=3D sizeof(mdh)) { - return -1; + written_size =3D qemu_write_full(s->fd, &mdh, sizeof(mdh)); + if (written_size !=3D sizeof(mdh)) { + return -1; + } } =20 written_size =3D qemu_write_full(s->fd, buf, size); @@ -1775,7 +1791,8 @@ static void vmcoreinfo_update_phys_base(DumpState *s) =20 static void dump_init(DumpState *s, int fd, bool has_format, DumpGuestMemoryFormat format, bool paging, bool has_= filter, - int64_t begin, int64_t length, Error **errp) + int64_t begin, int64_t length, bool kdump_raw, + Error **errp) { ERRP_GUARD(); VMCoreInfoState *vmci =3D vmcoreinfo_find(); @@ -1786,6 +1803,7 @@ static void dump_init(DumpState *s, int fd, bool has_= format, s->has_format =3D has_format; s->format =3D format; s->written_size =3D 0; + s->kdump_raw =3D kdump_raw; =20 /* kdump-compressed is conflict with paging and filter */ if (has_format && format !=3D DUMP_GUEST_MEMORY_FORMAT_ELF) { @@ -2168,7 +2186,7 @@ void qmp_dump_guest_memory(bool paging, const char *f= ile, dump_state_prepare(s); =20 dump_init(s, fd, has_format, format, paging, has_begin, - begin, length, errp); + begin, length, false, errp); if (*errp) { qatomic_set(&s->status, DUMP_STATUS_FAILED); return; --=20 2.41.0 From nobody Wed Nov 27 12:35:12 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1698994970; cv=none; d=zohomail.com; s=zohoarc; b=ZlPjk2SL3nQn/zKnX2R+woicF/HX+8dqCCF1weX1mloP/ThT8zM9ChbP/z0bBn9gc66fIuC5Xw3ufhGTsu8QhDxuiE0iU/MOYwNlupziFTXPHwv4aYbIXFG3RC4EGnHlSyF2GZH9OYk+8YoZ6iO83kmcb3JVEGSk14bSBaOY3zI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1698994970; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=naVkma1I8TWwxMoJt4IYPuegIpP/uso5GkqRyi+ZnDM=; b=I4mNMEew+TMy+dVRtURX9yrPFmC495VGHEi53Kg8DphoQfewBZYvZGylZ626eM5vNM+oXcO2ffLIMwTk1rnlj+4Tw/LqaTQ10d1KpIOEqlDgevI7FpsqPwspSKJJ7do9EX9ttk5XeCRcHqeKassm0Kja0ES54YWWu+g+UV3vAmM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 169899497045357.52310371084229; Fri, 3 Nov 2023 00:02:50 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qyoBw-00065g-KR; Fri, 03 Nov 2023 03:02:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qyoBv-00065B-6X for qemu-devel@nongnu.org; Fri, 03 Nov 2023 03:02:03 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qyoBs-0000xa-1r for qemu-devel@nongnu.org; Fri, 03 Nov 2023 03:02:02 -0400 Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-31-ppUCRbciOfCUfcvz9cCCiQ-1; Fri, 03 Nov 2023 03:01:54 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id DDE9A3C0C107; Fri, 3 Nov 2023 07:01:53 +0000 (UTC) Received: from localhost (unknown [10.39.208.31]) by smtp.corp.redhat.com (Postfix) with ESMTP id B6D331121309; Fri, 3 Nov 2023 07:01:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1698994919; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=naVkma1I8TWwxMoJt4IYPuegIpP/uso5GkqRyi+ZnDM=; b=arxCASPHtE5LwUnshbPq3FXA8BiSbZ+R1Wj1yM6KKP0c3KUVPUinfFu6gtg5hZQ3x7uH69 lYc1FdtXexVfTe8kRNcHIq/dEJ0z2oefCqxNcaHaRit9g9zpIieuXmLICHl/aJipZXB3RC q7oFCPC00yuO3S3ezJ7AgV/d+RqwJXA= X-MC-Unique: ppUCRbciOfCUfcvz9cCCiQ-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: Paolo Bonzini , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Gerd Hoffmann , Thomas Huth , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , "Dr. David Alan Gilbert" , "Michael S. Tsirkin" , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Eric Blake , Markus Armbruster , richard.henderson@linaro.org, Beraldo Leal , Wainer dos Santos Moschetta , Stephen Brennan Subject: [PULL 3/8] dump: Add command interface for kdump-raw formats Date: Fri, 3 Nov 2023 11:01:31 +0400 Message-ID: <20231103070136.437557-4-marcandre.lureau@redhat.com> In-Reply-To: <20231103070136.437557-1-marcandre.lureau@redhat.com> References: <20231103070136.437557-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.3 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -24 X-Spam_score: -2.5 X-Spam_bar: -- X-Spam_report: (-2.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.393, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1698994972397100002 From: Stephen Brennan The QMP dump API represents the dump format as an enumeration. Add three new enumerators, one for each supported kdump compression, each named "kdump-raw-*". For the HMP command line, rather than adding a new flag corresponding to each format, it seems more human-friendly to add a single flag "-R" to switch the kdump formats to "raw" mode. The choice of "-R" also correlates nicely to the "makedumpfile -R" option, which would serve to reassemble a flattened vmcore. Signed-off-by: Stephen Brennan Reviewed-by: Daniel P. Berrang=C3=A9 [ Marc-Andr=C3=A9: replace loff_t with off_t, indent fixes ] Reviewed-by: Marc-Andr=C3=A9 Lureau Message-Id: <20230918233233.1431858-4-stephen.s.brennan@oracle.com> --- qapi/dump.json | 24 ++++++++++++++++++++---- dump/dump-hmp-cmds.c | 21 +++++++++++++++++---- dump/dump.c | 33 ++++++++++++++++++++++++++++++++- hmp-commands.hx | 9 +++++++-- 4 files changed, 76 insertions(+), 11 deletions(-) diff --git a/qapi/dump.json b/qapi/dump.json index 4ae1f722a9..5cbc237ad9 100644 --- a/qapi/dump.json +++ b/qapi/dump.json @@ -15,11 +15,23 @@ # # @elf: elf format # -# @kdump-zlib: kdump-compressed format with zlib-compressed +# @kdump-zlib: makedumpfile flattened, kdump-compressed format with zlib +# compression # -# @kdump-lzo: kdump-compressed format with lzo-compressed +# @kdump-lzo: makedumpfile flattened, kdump-compressed format with lzo +# compression # -# @kdump-snappy: kdump-compressed format with snappy-compressed +# @kdump-snappy: makedumpfile flattened, kdump-compressed format with snap= py +# compression +# +# @kdump-raw-zlib: raw assembled kdump-compressed format with zlib compres= sion +# (since 8.2) +# +# @kdump-raw-lzo: raw assembled kdump-compressed format with lzo compressi= on +# (since 8.2) +# +# @kdump-raw-snappy: raw assembled kdump-compressed format with snappy +# compression (since 8.2) # # @win-dmp: Windows full crashdump format, can be used instead of ELF # converting (since 2.13) @@ -27,7 +39,11 @@ # Since: 2.0 ## { 'enum': 'DumpGuestMemoryFormat', - 'data': [ 'elf', 'kdump-zlib', 'kdump-lzo', 'kdump-snappy', 'win-dmp' ] } + 'data': [ + 'elf', + 'kdump-zlib', 'kdump-lzo', 'kdump-snappy', + 'kdump-raw-zlib', 'kdump-raw-lzo', 'kdump-raw-snappy', + 'win-dmp' ] } =20 ## # @dump-guest-memory: diff --git a/dump/dump-hmp-cmds.c b/dump/dump-hmp-cmds.c index b038785fee..b428ec33df 100644 --- a/dump/dump-hmp-cmds.c +++ b/dump/dump-hmp-cmds.c @@ -19,6 +19,7 @@ void hmp_dump_guest_memory(Monitor *mon, const QDict *qdi= ct) bool paging =3D qdict_get_try_bool(qdict, "paging", false); bool zlib =3D qdict_get_try_bool(qdict, "zlib", false); bool lzo =3D qdict_get_try_bool(qdict, "lzo", false); + bool raw =3D qdict_get_try_bool(qdict, "raw", false); bool snappy =3D qdict_get_try_bool(qdict, "snappy", false); const char *file =3D qdict_get_str(qdict, "filename"); bool has_begin =3D qdict_haskey(qdict, "begin"); @@ -40,16 +41,28 @@ void hmp_dump_guest_memory(Monitor *mon, const QDict *q= dict) dump_format =3D DUMP_GUEST_MEMORY_FORMAT_WIN_DMP; } =20 - if (zlib) { - dump_format =3D DUMP_GUEST_MEMORY_FORMAT_KDUMP_ZLIB; + if (zlib && raw) { + if (raw) { + dump_format =3D DUMP_GUEST_MEMORY_FORMAT_KDUMP_RAW_ZLIB; + } else { + dump_format =3D DUMP_GUEST_MEMORY_FORMAT_KDUMP_ZLIB; + } } =20 if (lzo) { - dump_format =3D DUMP_GUEST_MEMORY_FORMAT_KDUMP_LZO; + if (raw) { + dump_format =3D DUMP_GUEST_MEMORY_FORMAT_KDUMP_RAW_LZO; + } else { + dump_format =3D DUMP_GUEST_MEMORY_FORMAT_KDUMP_LZO; + } } =20 if (snappy) { - dump_format =3D DUMP_GUEST_MEMORY_FORMAT_KDUMP_SNAPPY; + if (raw) { + dump_format =3D DUMP_GUEST_MEMORY_FORMAT_KDUMP_RAW_SNAPPY; + } else { + dump_format =3D DUMP_GUEST_MEMORY_FORMAT_KDUMP_SNAPPY; + } } =20 if (has_begin) { diff --git a/dump/dump.c b/dump/dump.c index 0f913e1f5c..44b27fef45 100644 --- a/dump/dump.c +++ b/dump/dump.c @@ -2090,6 +2090,7 @@ void qmp_dump_guest_memory(bool paging, const char *f= ile, int fd =3D -1; DumpState *s; bool detach_p =3D false; + bool kdump_raw =3D false; =20 if (runstate_check(RUN_STATE_INMIGRATE)) { error_setg(errp, "Dump not allowed during incoming migration."); @@ -2103,6 +2104,29 @@ void qmp_dump_guest_memory(bool paging, const char *= file, return; } =20 + /* + * externally, we represent kdump-raw-* as separate formats, but inter= nally + * they are handled the same, except for the "raw" flag + */ + if (has_format) { + switch (format) { + case DUMP_GUEST_MEMORY_FORMAT_KDUMP_RAW_ZLIB: + format =3D DUMP_GUEST_MEMORY_FORMAT_KDUMP_ZLIB; + kdump_raw =3D true; + break; + case DUMP_GUEST_MEMORY_FORMAT_KDUMP_RAW_LZO: + format =3D DUMP_GUEST_MEMORY_FORMAT_KDUMP_LZO; + kdump_raw =3D true; + break; + case DUMP_GUEST_MEMORY_FORMAT_KDUMP_RAW_SNAPPY: + format =3D DUMP_GUEST_MEMORY_FORMAT_KDUMP_SNAPPY; + kdump_raw =3D true; + break; + default: + break; + } + } + /* * kdump-compressed format need the whole memory dumped, so paging or * filter is not supported here. @@ -2166,6 +2190,10 @@ void qmp_dump_guest_memory(bool paging, const char *= file, error_setg(errp, QERR_INVALID_PARAMETER, "protocol"); return; } + if (kdump_raw && lseek(fd, 0, SEEK_CUR) =3D=3D (off_t) -1) { + error_setg(errp, "kdump-raw formats require a seekable file"); + return; + } =20 if (!dump_migration_blocker) { error_setg(&dump_migration_blocker, @@ -2186,7 +2214,7 @@ void qmp_dump_guest_memory(bool paging, const char *f= ile, dump_state_prepare(s); =20 dump_init(s, fd, has_format, format, paging, has_begin, - begin, length, false, errp); + begin, length, kdump_raw, errp); if (*errp) { qatomic_set(&s->status, DUMP_STATUS_FAILED); return; @@ -2214,15 +2242,18 @@ DumpGuestMemoryCapability *qmp_query_dump_guest_mem= ory_capability(Error **errp) =20 /* kdump-zlib is always available */ QAPI_LIST_APPEND(tail, DUMP_GUEST_MEMORY_FORMAT_KDUMP_ZLIB); + QAPI_LIST_APPEND(tail, DUMP_GUEST_MEMORY_FORMAT_KDUMP_RAW_ZLIB); =20 /* add new item if kdump-lzo is available */ #ifdef CONFIG_LZO QAPI_LIST_APPEND(tail, DUMP_GUEST_MEMORY_FORMAT_KDUMP_LZO); + QAPI_LIST_APPEND(tail, DUMP_GUEST_MEMORY_FORMAT_KDUMP_RAW_LZO); #endif =20 /* add new item if kdump-snappy is available */ #ifdef CONFIG_SNAPPY QAPI_LIST_APPEND(tail, DUMP_GUEST_MEMORY_FORMAT_KDUMP_SNAPPY); + QAPI_LIST_APPEND(tail, DUMP_GUEST_MEMORY_FORMAT_KDUMP_RAW_SNAPPY); #endif =20 if (win_dump_available(NULL)) { diff --git a/hmp-commands.hx b/hmp-commands.hx index 63eac22734..c0a27688b6 100644 --- a/hmp-commands.hx +++ b/hmp-commands.hx @@ -1085,14 +1085,16 @@ ERST =20 { .name =3D "dump-guest-memory", - .args_type =3D "paging:-p,detach:-d,windmp:-w,zlib:-z,lzo:-l,snap= py:-s,filename:F,begin:l?,length:l?", - .params =3D "[-p] [-d] [-z|-l|-s|-w] filename [begin length]", + .args_type =3D "paging:-p,detach:-d,windmp:-w,zlib:-z,lzo:-l,snap= py:-s,raw:-R,filename:F,begin:l?,length:l?", + .params =3D "[-p] [-d] [-z|-l|-s|-w] [-R] filename [begin leng= th]", .help =3D "dump guest memory into file 'filename'.\n\t\t\t" "-p: do paging to get guest's memory mapping.\n\t\t\= t" "-d: return immediately (do not wait for completion)= .\n\t\t\t" "-z: dump in kdump-compressed format, with zlib comp= ression.\n\t\t\t" "-l: dump in kdump-compressed format, with lzo compr= ession.\n\t\t\t" "-s: dump in kdump-compressed format, with snappy co= mpression.\n\t\t\t" + "-R: when using kdump (-z, -l, -s), use raw rather t= han makedumpfile-flattened\n\t\t\t" + " format\n\t\t\t" "-w: dump in Windows crashdump format (can be used i= nstead of ELF-dump converting),\n\t\t\t" " for Windows x86 and x64 guests with vmcoreinfo = driver only.\n\t\t\t" "begin: the starting physical address.\n\t\t\t" @@ -1115,6 +1117,9 @@ SRST dump in kdump-compressed format, with lzo compression. ``-s`` dump in kdump-compressed format, with snappy compression. + ``-R`` + when using kdump (-z, -l, -s), use raw rather than makedumpfile-flatte= ned + format ``-w`` dump in Windows crashdump format (can be used instead of ELF-dump conv= erting), for Windows x64 guests with vmcoreinfo driver only --=20 2.41.0 From nobody Wed Nov 27 12:35:12 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1698995031; cv=none; d=zohomail.com; s=zohoarc; b=QoLGdVY8K8hUP8Y03kKjeA5UxiIS7rwOGiDSKqP06zgGlFURGZRE3pqiegpYrCxfoKL3muGXxFui/KRbOEnk8RsBIKCr5GH1m9Zgc5+TQr8Izhw2/czEFmfu4PQfN6jKFnVFUgcHbqO4SBbE9July15TttnRX/WrBlNmEv4i6A0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1698995031; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=LRzur4oylqkPGhapy1hWxVxSmPaxl2ZmBpNoHMhYIV8=; b=NzcZXcB9+C0yrKYUz+eT5IugNCHgiRrFGLGkHLVWbZu+dS+t+vSoavNChbA0X9SYZ6AcoDGrGIOvn6/Suzk8oNwx4W5cFXxO+FyeIV7JMZ1G3GHcWjZueoHmj9im5/pzqD01gP0gnqFY/dCcLSjkiRxvMv/PQnaaecdiYjdE+yc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1698995031275176.4644731623705; Fri, 3 Nov 2023 00:03:51 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qyoBy-00066Y-JX; Fri, 03 Nov 2023 03:02:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qyoBx-00065y-As for qemu-devel@nongnu.org; Fri, 03 Nov 2023 03:02:05 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qyoBv-0000yB-P3 for qemu-devel@nongnu.org; Fri, 03 Nov 2023 03:02:05 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-275-WeTZvjIvN6-E87EGXvK52Q-1; Fri, 03 Nov 2023 03:01:58 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 74152101A52D; Fri, 3 Nov 2023 07:01:58 +0000 (UTC) Received: from localhost (unknown [10.39.208.31]) by smtp.corp.redhat.com (Postfix) with ESMTP id 67B4C2026D6E; Fri, 3 Nov 2023 07:01:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1698994922; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=LRzur4oylqkPGhapy1hWxVxSmPaxl2ZmBpNoHMhYIV8=; b=J+swQSDBcMR1zcIdWo+PLlvBAi+GIeT7YO0dz8oIFSiklR6LtUbG3Q2PttFctckzDrO0yz elpTOzKDKrNFMwu33RaGmdrofnb7odEdyRLL/o+48tNxiRlDCe/r0EbUjtmRh1Q0BJZczj 1AUN2TulcxAWUEuCwYJdQ1KnCHM+HYY= X-MC-Unique: WeTZvjIvN6-E87EGXvK52Q-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: Paolo Bonzini , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Gerd Hoffmann , Thomas Huth , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , "Dr. David Alan Gilbert" , "Michael S. Tsirkin" , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Eric Blake , Markus Armbruster , richard.henderson@linaro.org, Beraldo Leal , Wainer dos Santos Moschetta Subject: [PULL 4/8] dump: Rename qmp_dump_guest_memory() parameter to match QAPI schema Date: Fri, 3 Nov 2023 11:01:32 +0400 Message-ID: <20231103070136.437557-5-marcandre.lureau@redhat.com> In-Reply-To: <20231103070136.437557-1-marcandre.lureau@redhat.com> References: <20231103070136.437557-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.4 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -24 X-Spam_score: -2.5 X-Spam_bar: -- X-Spam_report: (-2.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.393, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1698995032680100003 From: Markus Armbruster The name of the second parameter differs between QAPI schema and C implementation: it's @protocol in the former and @file in the latter. Potentially confusing. Change the C implementation to match the QAPI schema. Signed-off-by: Markus Armbruster Reviewed-by: Marc-Andr=C3=A9 Lureau Message-Id: <20231031104531.3169721-2-armbru@redhat.com> --- dump/dump.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/dump/dump.c b/dump/dump.c index 44b27fef45..9cdb4a2bf8 100644 --- a/dump/dump.c +++ b/dump/dump.c @@ -2079,11 +2079,12 @@ DumpQueryResult *qmp_query_dump(Error **errp) return result; } =20 -void qmp_dump_guest_memory(bool paging, const char *file, +void qmp_dump_guest_memory(bool paging, const char *protocol, bool has_detach, bool detach, - bool has_begin, int64_t begin, bool has_length, - int64_t length, bool has_format, - DumpGuestMemoryFormat format, Error **errp) + bool has_begin, int64_t begin, + bool has_length, int64_t length, + bool has_format, DumpGuestMemoryFormat format, + Error **errp) { ERRP_GUARD(); const char *p; @@ -2170,7 +2171,7 @@ void qmp_dump_guest_memory(bool paging, const char *f= ile, } =20 #if !defined(WIN32) - if (strstart(file, "fd:", &p)) { + if (strstart(protocol, "fd:", &p)) { fd =3D monitor_get_fd(monitor_cur(), p, errp); if (fd =3D=3D -1) { return; @@ -2178,7 +2179,7 @@ void qmp_dump_guest_memory(bool paging, const char *f= ile, } #endif =20 - if (strstart(file, "file:", &p)) { + if (strstart(protocol, "file:", &p)) { fd =3D qemu_open_old(p, O_WRONLY | O_CREAT | O_TRUNC | O_BINARY, S= _IRUSR); if (fd < 0) { error_setg_file_open(errp, errno, p); --=20 2.41.0 From nobody Wed Nov 27 12:35:12 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1698994966; cv=none; d=zohomail.com; s=zohoarc; b=F/iIswV8ob94Wf3p3gLyY+PwU4Jdu5nYPnhoqQ31okajEKs0oNNqGg+jpDRRPy0IO1LLlLXFeeB75ykdys6qM3r+qoosV6Tbsh2FwTP48BE4S07BLlfE5nuTz3nlEdyGSBjljGhxMjFIMHQTD6p1sUZjrXuX0IXPLxN6HaES8ak= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1698994966; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=vqDoyJeC1dV1HMdeEXkNrkEXlcKivr1iUrSczhAu0OU=; b=P0eY8SfY9kgB5QfpGvLsrFHf4WJdCumMnsNTAzz+C9srntoWPnmqQMtw93Cwhs7vo9f9T4xTEHAFTah/4ldRCeXdojvwAzc0BBTGRM/LhLEbRQzX57NsSz6+lrQitFPdhH33/Asyde+DdYDODtI18ivnPaGsYhmkKKHNftxCDeg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1698994966702352.07056078708615; Fri, 3 Nov 2023 00:02:46 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qyoC3-00067D-L4; Fri, 03 Nov 2023 03:02:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qyoC1-000673-Py for qemu-devel@nongnu.org; Fri, 03 Nov 2023 03:02:09 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qyoBz-0000zv-Pc for qemu-devel@nongnu.org; Fri, 03 Nov 2023 03:02:09 -0400 Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-14-2WvR9EvONGaFEOEGslA_Iw-1; Fri, 03 Nov 2023 03:02:02 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 5F12C29AB448; Fri, 3 Nov 2023 07:02:02 +0000 (UTC) Received: from localhost (unknown [10.39.208.31]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1BDBEC1290F; Fri, 3 Nov 2023 07:02:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1698994927; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=vqDoyJeC1dV1HMdeEXkNrkEXlcKivr1iUrSczhAu0OU=; b=OM8D3urfp1o7fOJmi9f7A4r5reCdSk6ayqY0/gaUV04cloSGE7iTkT29MK6Xz5iillrM8e 5xNz47f9gpvvwKwNbtEpVyKhbJ7Whqlx/0jKIi9CiAmCzLoQSftESzHi1Ziba3N3DFANV7 r6J6lcgow0UcIuPTo56tD0XyxWPN9Dk= X-MC-Unique: 2WvR9EvONGaFEOEGslA_Iw-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: Paolo Bonzini , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Gerd Hoffmann , Thomas Huth , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , "Dr. David Alan Gilbert" , "Michael S. Tsirkin" , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Eric Blake , Markus Armbruster , richard.henderson@linaro.org, Beraldo Leal , Wainer dos Santos Moschetta Subject: [PULL 5/8] dump: Fix g_array_unref(NULL) in dump-guest-memory Date: Fri, 3 Nov 2023 11:01:33 +0400 Message-ID: <20231103070136.437557-6-marcandre.lureau@redhat.com> In-Reply-To: <20231103070136.437557-1-marcandre.lureau@redhat.com> References: <20231103070136.437557-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.8 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -24 X-Spam_score: -2.5 X-Spam_bar: -- X-Spam_report: (-2.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.393, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1698994968586100001 From: Markus Armbruster When dump_init()'s check for non-zero @length fails, dump_cleanup() passes null s->string_table_buf to g_array_unref(), which spews "GLib: g_array_unref: assertion 'array' failed" to stderr. Guard the g_array_unref(). Signed-off-by: Markus Armbruster Reviewed-by: Marc-Andr=C3=A9 Lureau Message-Id: <20231031104531.3169721-3-armbru@redhat.com> --- dump/dump.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dump/dump.c b/dump/dump.c index 9cdb4a2bf8..24c829e705 100644 --- a/dump/dump.c +++ b/dump/dump.c @@ -100,7 +100,7 @@ static int dump_cleanup(DumpState *s) memory_mapping_list_free(&s->list); close(s->fd); g_free(s->guest_note); - g_array_unref(s->string_table_buf); + g_clear_pointer(&s->string_table_buf, g_array_unref); s->guest_note =3D NULL; if (s->resume) { if (s->detached) { --=20 2.41.0 From nobody Wed Nov 27 12:35:12 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1698995014; cv=none; d=zohomail.com; s=zohoarc; b=bRVVNOaC+c9nMBkOD5uqwVLc0y+AKCJ7ZKF6xzYBg31gTNWdOWoSHQVwh06hZ3QEH7SfT2Xj70oeI8FBrz4KArPTv4MaCTafIAYm4y4jyPlVZY/cB06OenkAdXXqab/T5sQnlI54Og6t9STPVpsuP560V2ZHDQD7AyFJtJxjgfY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1698995014; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=/21livHKRGQmIPPnxdzyzUm1tOZ/MEskLDbFPCW8+uU=; b=Al46Y01IOjp6vTyAASuZaE3pp01ojvN0YO2LnIslJKG7HwX31E8PjxWRFr8ACZzCQBwCZW+8UJyjSAd3xmrAlMbt3cKCt2YfsIG+OC/TEdRBu25uoQIIe+K5SBZaZ35tfo0LB6XXx6HltFAvm8Saht2Lji/AR3hyPYDMNFvdSwU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 16989950146533.0587072637413257; Fri, 3 Nov 2023 00:03:34 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qyoC8-00068B-Bs; Fri, 03 Nov 2023 03:02:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qyoC7-000683-Ch for qemu-devel@nongnu.org; Fri, 03 Nov 2023 03:02:15 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qyoC5-00014c-4v for qemu-devel@nongnu.org; Fri, 03 Nov 2023 03:02:14 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-460-9BgVnpKOMq64f8bbOfd7TA-1; Fri, 03 Nov 2023 03:02:07 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id D41FB85A58B; Fri, 3 Nov 2023 07:02:06 +0000 (UTC) Received: from localhost (unknown [10.39.208.31]) by smtp.corp.redhat.com (Postfix) with ESMTP id C859E2026D6E; Fri, 3 Nov 2023 07:02:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1698994932; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=/21livHKRGQmIPPnxdzyzUm1tOZ/MEskLDbFPCW8+uU=; b=KI8ciP6cMN3L2czFXLDrsL5ociE70M9E3zRSvXvul8IRF0Jshav6UTFw1THDpBUuAmaAMF pxeEZH5DxedytupTUl2F7mEX5+92h+u252rvvYqYfz62tkLlYYx4VHeXEsQErrmoOzet+7 Z/4O+ygllp4u13QuBSDRcazh8mP3REc= X-MC-Unique: 9BgVnpKOMq64f8bbOfd7TA-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: Paolo Bonzini , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Gerd Hoffmann , Thomas Huth , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , "Dr. David Alan Gilbert" , "Michael S. Tsirkin" , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Eric Blake , Markus Armbruster , richard.henderson@linaro.org, Beraldo Leal , Wainer dos Santos Moschetta Subject: [PULL 6/8] dump: Recognize "fd:" protocols on Windows hosts Date: Fri, 3 Nov 2023 11:01:34 +0400 Message-ID: <20231103070136.437557-7-marcandre.lureau@redhat.com> In-Reply-To: <20231103070136.437557-1-marcandre.lureau@redhat.com> References: <20231103070136.437557-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.4 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -24 X-Spam_score: -2.5 X-Spam_bar: -- X-Spam_report: (-2.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.393, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1698995016518100003 From: Markus Armbruster A few QMP command can work with named file descriptors. The only way to create a named file descriptor used to be QMP command getfd, which only works on POSIX hosts. Thus, named file descriptors were actually usable only there. They became usable on Windows hosts when we added QMP command get-win32-socket (commit 4cda177c601 "qmp: add 'get-win32-socket'"). Except in dump-guest-memory, because qmp_dump_guest_memory() compiles its named file descriptor code only #if !defined(WIN32). Compile it unconditionally, like we do for the other commands supporting them. Signed-off-by: Markus Armbruster Reviewed-by: Marc-Andr=C3=A9 Lureau Message-Id: <20231031104531.3169721-4-armbru@redhat.com> --- dump/dump.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/dump/dump.c b/dump/dump.c index 24c829e705..2d0b5bd22b 100644 --- a/dump/dump.c +++ b/dump/dump.c @@ -2170,14 +2170,12 @@ void qmp_dump_guest_memory(bool paging, const char = *protocol, return; } =20 -#if !defined(WIN32) if (strstart(protocol, "fd:", &p)) { fd =3D monitor_get_fd(monitor_cur(), p, errp); if (fd =3D=3D -1) { return; } } -#endif =20 if (strstart(protocol, "file:", &p)) { fd =3D qemu_open_old(p, O_WRONLY | O_CREAT | O_TRUNC | O_BINARY, S= _IRUSR); --=20 2.41.0 From nobody Wed Nov 27 12:35:12 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1698995035; cv=none; d=zohomail.com; s=zohoarc; b=Z0VPp2OGpwiCx7uqXwPDBAXEMroMyuBbjiIEBzyHDzq6g0+TWIHX4guRyYEwhfJugd3VFp2KxMnhGp4Xn665s7XUVSsxZN0RBY5EjfY5muVCcauLNUT6RizSOo4ArRFCQfPnobCUKLmEpf+gXMRC+uQiKj8uOZeDwtzuqzyiCh8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1698995035; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=aFAo90F17fRMoMq2T6P+tJGS4tOKEdx+gWjM97sLSFo=; b=Ndt0KvdflN46WNhYBBBFH/vuwgmM8/IZFmPr0Ba8Yz2zBANlHCBDUGt4SvZyRwoCpnYYXOAIku5WCU3cagPQ4JGn53sDdg03fbGfoLeVJaiqGkpbf8GAzxrIS/8DXTuhbn5F8qs/EErQMOH2SeZYN+Eqhvs5USbSNICgJGMbuFs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1698995035932808.1924452316777; Fri, 3 Nov 2023 00:03:55 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qyoCN-0006Bz-4S; Fri, 03 Nov 2023 03:02:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qyoCK-0006A1-6L for qemu-devel@nongnu.org; Fri, 03 Nov 2023 03:02:28 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qyoC5-00014a-9S for qemu-devel@nongnu.org; Fri, 03 Nov 2023 03:02:27 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-103-s8B0CL8nPQGrEYFOb2CEGg-1; Fri, 03 Nov 2023 03:02:11 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id D4FE7101A52D; Fri, 3 Nov 2023 07:02:10 +0000 (UTC) Received: from localhost (unknown [10.39.208.31]) by smtp.corp.redhat.com (Postfix) with ESMTP id AF6B31121309; Fri, 3 Nov 2023 07:02:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1698994932; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=aFAo90F17fRMoMq2T6P+tJGS4tOKEdx+gWjM97sLSFo=; b=C09EKZnmpUSIwQvQRRXTWL7CN8BkgsGzKS6PtqMs7YiP2VEC8UuglZlFqrn23ezT5ccr9g DZMrVj3hxrayCmR8bIWJ+BmHyBMr/VnuqknpqQX+O1ywNMXGwkgkrqP4HXKmmtZdHgkZyA bL5bZjvqjZTnUB6R1NFvOaI0qMUewZw= X-MC-Unique: s8B0CL8nPQGrEYFOb2CEGg-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: Paolo Bonzini , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Gerd Hoffmann , Thomas Huth , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , "Dr. David Alan Gilbert" , "Michael S. Tsirkin" , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Eric Blake , Markus Armbruster , richard.henderson@linaro.org, Beraldo Leal , Wainer dos Santos Moschetta Subject: [PULL 7/8] dump: Improve some dump-guest-memory error messages Date: Fri, 3 Nov 2023 11:01:35 +0400 Message-ID: <20231103070136.437557-8-marcandre.lureau@redhat.com> In-Reply-To: <20231103070136.437557-1-marcandre.lureau@redhat.com> References: <20231103070136.437557-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.3 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -24 X-Spam_score: -2.5 X-Spam_bar: -- X-Spam_report: (-2.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.393, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01, T_SPF_TEMPERROR=0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1698995036744100001 From: Markus Armbruster Zero @length is rejected with "Invalid parameter 'length'". Improve to "parameter 'length' expects a non-zero length". qemu_open_old() is a wrapper around qemu_open_internal() that throws away error information. Switch to the wrapper that doesn't: qemu_create(). Example improvement: (qemu) dump-guest-memory /dev/fdset/x 0 1 Error: Could not open '/dev/fdset/x': Invalid argument becomes Error: Could not parse fdset /dev/fdset/x @protocol values not starting with "fd:" or "file:" are rejected with "Invalid parameter 'protocol'". Improve to "parameter 'protocol' must start with 'file:' or 'fd:'". While there, make the conditional checking @protocol a little more obvious. Signed-off-by: Markus Armbruster Reviewed-by: Marc-Andr=C3=A9 Lureau Message-Id: <20231031104531.3169721-5-armbru@redhat.com> --- dump/dump.c | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/dump/dump.c b/dump/dump.c index 2d0b5bd22b..ec2cfcf9f7 100644 --- a/dump/dump.c +++ b/dump/dump.c @@ -1828,7 +1828,7 @@ static void dump_init(DumpState *s, int fd, bool has_= format, =20 s->fd =3D fd; if (has_filter && !length) { - error_setg(errp, QERR_INVALID_PARAMETER, "length"); + error_setg(errp, "parameter 'length' expects a non-zero size"); goto cleanup; } s->filter_area_begin =3D begin; @@ -2088,7 +2088,7 @@ void qmp_dump_guest_memory(bool paging, const char *p= rotocol, { ERRP_GUARD(); const char *p; - int fd =3D -1; + int fd; DumpState *s; bool detach_p =3D false; bool kdump_raw =3D false; @@ -2175,18 +2175,14 @@ void qmp_dump_guest_memory(bool paging, const char = *protocol, if (fd =3D=3D -1) { return; } - } - - if (strstart(protocol, "file:", &p)) { - fd =3D qemu_open_old(p, O_WRONLY | O_CREAT | O_TRUNC | O_BINARY, S= _IRUSR); + } else if (strstart(protocol, "file:", &p)) { + fd =3D qemu_create(p, O_WRONLY | O_TRUNC | O_BINARY, S_IRUSR, errp= ); if (fd < 0) { - error_setg_file_open(errp, errno, p); return; } - } - - if (fd =3D=3D -1) { - error_setg(errp, QERR_INVALID_PARAMETER, "protocol"); + } else { + error_setg(errp, + "parameter 'protocol' must start with 'file:' or 'fd:'"= ); return; } if (kdump_raw && lseek(fd, 0, SEEK_CUR) =3D=3D (off_t) -1) { --=20 2.41.0 From nobody Wed Nov 27 12:35:12 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1698995003; cv=none; d=zohomail.com; s=zohoarc; b=Zy/kbtTErU3PICer30xecl9v9RVTbCJwlHoNENZIEiTCUJGO66LTSCvK3DlWa1fw2owk/bQ9H3x9CJNwzaLjrbMwJrVDaqEAnzo5qwxxysNSDG8aD/uWBUOz4NFaLN1Wl05Z2SSvy50xYIR3h4hbua7Xu1CCq/VOZOdfCPB/PJg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1698995003; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=akNyN4V+1gMYlC6Efl/CruHSEw0A6BWGqFLyhXEs/fI=; b=UzwsBHc6WRQNOFVTO7f5yfE6Jztd/6K7E1hLFL3IQeuPdv/NrVmQHAQwHZVO/HDOwk57C0Jd2314UscQL5lun0QyC5Ue4EnfRo3GtZjt/7sU3Y4nF5ZvuqoRBt0jC9GG/bDN3RWi6f8FQigecLAgOfy21OAnLGA/4LlDEtsFoZ4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1698995003338209.945505687876; Fri, 3 Nov 2023 00:03:23 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qyoCE-00069J-BK; Fri, 03 Nov 2023 03:02:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qyoCD-000697-OD for qemu-devel@nongnu.org; Fri, 03 Nov 2023 03:02:21 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qyoCC-00016c-6f for qemu-devel@nongnu.org; Fri, 03 Nov 2023 03:02:21 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-571-nByS8oPRMfq2EPEW4CCGTA-1; Fri, 03 Nov 2023 03:02:15 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 40A11185A780; Fri, 3 Nov 2023 07:02:15 +0000 (UTC) Received: from localhost (unknown [10.39.208.31]) by smtp.corp.redhat.com (Postfix) with ESMTP id 36C2F40C6EBC; Fri, 3 Nov 2023 07:02:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1698994939; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=akNyN4V+1gMYlC6Efl/CruHSEw0A6BWGqFLyhXEs/fI=; b=TwrnS2VMBfYDEN3OtMKVnyWUk+ZuRTq2aziMCeyYsXPbQtekSKYjNa/Fw2jovobKE6kqQq a9vVZOJRWDF5TX/lEDDSQ1HbchyWc+GahME7zvtXCslZXpVK+bORM28PHoacvJAX71pvif jS15fbLwSjaECFo2PUbiLou7LZucWm8= X-MC-Unique: nByS8oPRMfq2EPEW4CCGTA-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: Paolo Bonzini , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Gerd Hoffmann , Thomas Huth , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , "Dr. David Alan Gilbert" , "Michael S. Tsirkin" , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Eric Blake , Markus Armbruster , richard.henderson@linaro.org, Beraldo Leal , Wainer dos Santos Moschetta Subject: [PULL 8/8] dump: Drop redundant check for empty dump Date: Fri, 3 Nov 2023 11:01:36 +0400 Message-ID: <20231103070136.437557-9-marcandre.lureau@redhat.com> In-Reply-To: <20231103070136.437557-1-marcandre.lureau@redhat.com> References: <20231103070136.437557-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.2 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -24 X-Spam_score: -2.5 X-Spam_bar: -- X-Spam_report: (-2.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.393, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1698995004475100001 From: Markus Armbruster dump_init() first computes the size of the dump, taking the filter area into account, and fails if its zero. It then looks for memory in the filter area, and fails if there is none. This is redundant: if the size of the dump is zero, there is no memory, and vice versa. Delete this check. Signed-off-by: Markus Armbruster Reviewed-by: Marc-Andr=C3=A9 Lureau Message-Id: <20231031104531.3169721-6-armbru@redhat.com> --- dump/dump.c | 26 -------------------------- 1 file changed, 26 deletions(-) diff --git a/dump/dump.c b/dump/dump.c index ec2cfcf9f7..1c304cadfd 100644 --- a/dump/dump.c +++ b/dump/dump.c @@ -1688,26 +1688,6 @@ static void create_kdump_vmcore(DumpState *s, Error = **errp) } } =20 -static int validate_start_block(DumpState *s) -{ - GuestPhysBlock *block; - - if (!dump_has_filter(s)) { - return 0; - } - - QTAILQ_FOREACH(block, &s->guest_phys_blocks.head, next) { - /* This block is out of the range */ - if (block->target_start >=3D s->filter_area_begin + s->filter_area= _length || - block->target_end <=3D s->filter_area_begin) { - continue; - } - return 0; - } - - return -1; -} - static void get_max_mapnr(DumpState *s) { GuestPhysBlock *last_block; @@ -1857,12 +1837,6 @@ static void dump_init(DumpState *s, int fd, bool has= _format, goto cleanup; } =20 - /* Is the filter filtering everything? */ - if (validate_start_block(s) =3D=3D -1) { - error_setg(errp, QERR_INVALID_PARAMETER, "begin"); - goto cleanup; - } - /* get dump info: endian, class and architecture. * If the target architecture is not supported, cpu_get_dump_info() wi= ll * return -1. --=20 2.41.0