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 CD38C1FF161 for ; Sat, 2 Aug 2025 18:42:05 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 57A709436; Sat, 2 Aug 2025 18:43:34 +0200 (CEST) To: pve-devel@lists.proxmox.com Date: Sat, 2 Aug 2025 17:42:40 +0100 In-Reply-To: <20250802164240.21751-1-joao.sousa@eurotux.com> References: <20250802164240.21751-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 2/2] qmeventd: add block write threshold event handling Content-Type: multipart/mixed; boundary="===============7039109927185529098==" Errors-To: pve-devel-bounces@lists.proxmox.com Sender: "pve-devel" --===============7039109927185529098== 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 9CA99D0975 for ; Sat, 2 Aug 2025 18:43:33 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 7883D945D for ; Sat, 2 Aug 2025 18:43:03 +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 ; Sat, 2 Aug 2025 18:43:02 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by eurotux.com (Postfix) with ESMTP id 0C91530C99C7; Sat, 2 Aug 2025 17:43:02 +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=1754152981; x=1755967382; bh=Gt2Xx0mJdH6iqH5QualEarjH QIUV9ecNzZ+bhucslNM=; b=xWkAugnv1aQ0NrCRvUpWlrpQ/agBAbQlDqCrR3Tv msuASt8epVVqWdsAiL1yTkZEmAr6tted1Adj1CCkI/P0Ry/CpdzpJ8wGE7UHEIU8 ZcAlFfnfQS7rcUS8G28zi1a6SFE2LJ3apeI9zjRo5fp3WrWLbVfOD33eHZLqphEl skQ7mknXmSEt32MF/04QhMiqX8tW4Ncx4JoxMkipyreli9hY4AXO74EeUvTKVG8m ydT1UGbIMkrFscWS0BwaQDksWIQR5zHjgiu5xeLBAofJmpauJrxFezNopkoJcvqJ xd7axzqzvZAHRZ0TCWJpcAUvz/OPCvrRGc/sBS714QrwHA== 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 4ErnWrjYa5CK; Sat, 2 Aug 2025 17:43:01 +0100 (WEST) Received: from proxmox.example (unknown [161.230.225.89]) (Authenticated sender: joao.sousa@eurotux.com) by eurotux.com (Postfix) with ESMTPSA id 6A70830C6F9D; Sat, 2 Aug 2025 17:43:01 +0100 (WEST) From: Tiago Sousa To: pve-devel@lists.proxmox.com Subject: [PATCH qemu-server 2/2] qmeventd: add block write threshold event handling Date: Sat, 2 Aug 2025 17:42:40 +0100 Message-Id: <20250802164240.21751-3-joao.sousa@eurotux.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250802164240.21751-1-joao.sousa@eurotux.com> References: <20250802164240.21751-1-joao.sousa@eurotux.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SPAM-LEVEL: Spam detection results: 0 AWL 0.038 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 | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/qmeventd/qmeventd.c b/src/qmeventd/qmeventd.c index 1d9eb74a..616b6521 100644 --- a/src/qmeventd/qmeventd.c +++ b/src/qmeventd/qmeventd.c @@ -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\n", nodename_string); + } + fclose(p_extend_queue); + } } } =20 --=20 2.39.5 --===============7039109927185529098== 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 --===============7039109927185529098==--