From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id B1CA31FF15C for ; Fri, 17 Oct 2025 13:35:16 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 6AD10201; Fri, 17 Oct 2025 13:35:36 +0200 (CEST) To: pve-devel@lists.proxmox.com Date: Fri, 17 Oct 2025 12:25:30 +0100 In-Reply-To: <20251017112539.26471-1-joao.sousa@eurotux.com> References: <20251017112539.26471-1-joao.sousa@eurotux.com> MIME-Version: 1.0 Message-ID: List-Id: Proxmox VE development discussion List-Post: From: Tiago Sousa via pve-devel Precedence: list Cc: Tiago Sousa X-Mailman-Version: 2.1.29 X-BeenThere: pve-devel@lists.proxmox.com List-Subscribe: , List-Unsubscribe: , List-Archive: Reply-To: Proxmox VE development discussion List-Help: Subject: [pve-devel] [PATCH qemu-server 5/8] qmeventd: add block write threshold event handling Content-Type: multipart/mixed; boundary="===============4735184585174746256==" Errors-To: pve-devel-bounces@lists.proxmox.com Sender: "pve-devel" --===============4735184585174746256== Content-Type: message/rfc822 Content-Disposition: inline Return-Path: X-Original-To: pve-devel@lists.proxmox.com Delivered-To: pve-devel@lists.proxmox.com Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id CBE36D0F82 for ; Fri, 17 Oct 2025 13:35:34 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id ACE1C27CC9 for ; Fri, 17 Oct 2025 13:35:04 +0200 (CEST) Received: from eurotux.com (mail.eurotux.com [185.98.249.9]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS for ; Fri, 17 Oct 2025 13:35:03 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by eurotux.com (Postfix) with ESMTP id 813DE30CFB19; Fri, 17 Oct 2025 12:26:03 +0100 (WEST) Authentication-Results: mail.prd.eurotux.pt (amavisd-new); dkim=pass (2048-bit key) reason="pass (just generated, assumed good)" header.d=eurotux.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=eurotux.com; h= content-transfer-encoding:mime-version:references:in-reply-to :x-mailer:message-id:date:date:subject:subject:from:from; s= default; t=1760700362; x=1762514763; bh=G6P8WNux84W7g3ARf3wKPBnQ 4k3aH/eK1OLilrFwEok=; b=rckYr4cAb88hu02ld5pDvg4KPGVpmEX+WdxGvVbp sbNh5OXh7RJpcAMDBbNTVs5/R38BCvqr3BZd/1qA1cACbr/8Y/vFsneLB2Mk+mxQ FO3R7rXWAVNfEEowBbQgyNm4GNu97KchGNRoY8UaSfjp2L95JSqXRUc90x/d73DE jhF7lyiEscSTwdYq+JXa0sJck2WIhxuqPKhBNCiLugsnUv2Y2xkwEKKFiZJCfNSr kJyBHghRCu0Q1GpPTXDUNm93MZ0QxWSLuA51Kwe/cQMfa2eHfBVrhIvIE9wW/ric zjJgy/Gh+yMXcQZILh8+S8iRB2vBzjgjUxX/OJaxFU67qw== X-Virus-Scanned: amavisd-new at mail.prd.eurotux.pt Received: from eurotux.com ([127.0.0.1]) by localhost (mail.prd.eurotux.pt [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id Vx0sgU-G38KL; Fri, 17 Oct 2025 12:26:02 +0100 (WEST) Received: from proxmox.example (184.137.90.149.rev.vodafone.pt [149.90.137.184]) (Authenticated sender: joao.sousa@eurotux.com) by eurotux.com (Postfix) with ESMTPSA id CBF9E30D17A1; Fri, 17 Oct 2025 12:26:01 +0100 (WEST) From: Tiago Sousa To: pve-devel@lists.proxmox.com Subject: [PATCH qemu-server 5/8] qmeventd: add block write threshold event handling Date: Fri, 17 Oct 2025 12:25:30 +0100 Message-ID: <20251017112539.26471-6-joao.sousa@eurotux.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20251017112539.26471-1-joao.sousa@eurotux.com> References: <20251017112539.26471-1-joao.sousa@eurotux.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SPAM-LEVEL: Spam detection results: 0 AWL -0.002 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain DMARC_PASS -0.1 DMARC pass policy RCVD_IN_MSPIKE_H2 0.001 Average reputation (+2) SPF_HELO_PASS -0.001 SPF: HELO matches SPF record SPF_PASS -0.001 SPF: sender matches SPF record Signed-off-by: Tiago Sousa --- src/qmeventd/qmeventd.c | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/src/qmeventd/qmeventd.c b/src/qmeventd/qmeventd.c index 1d9eb74a..7bae13f9 100644 --- a/src/qmeventd/qmeventd.c +++ b/src/qmeventd/qmeventd.c @@ -43,7 +43,7 @@ =20 #define DEFAULT_KILL_TIMEOUT 60 =20 -static int verbose =3D 0; +static int verbose =3D 1; static int kill_timeout =3D DEFAULT_KILL_TIMEOUT; static int epoll_fd =3D 0; static const char *progname; @@ -209,6 +209,25 @@ void handle_qmp_event(struct Client *client, struct = json_object *obj) { =20 // check if a backup is running and kill QEMU process if not terminate_check(client); + } else if (!strcmp(json_object_get_string(event), "BLOCK_WRITE_THRES= HOLD")) { + struct json_object *data; + struct json_object *nodename; + if (json_object_object_get_ex(obj, "data", &data) && + json_object_object_get_ex(data, "node-name", &nodename)) { + + // needs concurrency control + char extend_queue_path[] =3D "/etc/pve/extend-queue"; + FILE *p_extend_queue =3D fopen(extend_queue_path, "a"); + if (p_extend_queue =3D=3D NULL) { + VERBOSE_PRINT( + "%s: Couldn't open extend queue file %s", client->qe= mu.vmid, extend_queue_path + ); + } else { + const char *nodename_string =3D json_object_get_string(n= odename); + fprintf(p_extend_queue, "%s: %s\n", client->qemu.vmid, n= odename_string); + } + fclose(p_extend_queue); + } } } =20 --=20 2.47.3 --===============4735184585174746256== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel --===============4735184585174746256==--