From nobody Mon Feb 9 00:02:34 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1560519116; cv=none; d=zoho.com; s=zohoarc; b=Fj8zCpkC/Tip5/m6iez8SQV87/SZCCOpk7yPCiD3ujfJyVF5UyvWFlvtUc8LviblR0bvR4+a2w4xJDq9D8AFpX9QEdnM5vYxljYBA9JaLNei57iogkV2G6HKZZqqFfidMUNcw4/PHxUp1rtfRctG5HnLpWXAyB9tl3q6TsGvpyU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1560519116; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=3p5PYuYfxZritpWDOz/ceLHdFz08Pr0ABxORG8iHa9E=; b=nr7s5Dy9wecAQ+SuhrpZkln5inpmHdOIb6VulyrzcZlbOQcBKcPLdea5tipVD8ZlrprecFjG94IY1dDyVH+U6d52Hei0Tz83cHjjyvzUcmhZ8VQ8q9abC1sAO2lBGr1QO7wyT9bh0sn3jI0lrQamT8oeF2etr/JX2D2K9Vd18lU= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1560519116547786.568387629941; Fri, 14 Jun 2019 06:31:56 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 56BBDA3B79; Fri, 14 Jun 2019 13:31:43 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 3E90019C58; Fri, 14 Jun 2019 13:31:37 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 847BD1806B0F; Fri, 14 Jun 2019 13:31:32 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x5EDUWov019736 for ; Fri, 14 Jun 2019 09:30:32 -0400 Received: by smtp.corp.redhat.com (Postfix) id B50331753B; Fri, 14 Jun 2019 13:30:32 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.229]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3FC3E2CE56 for ; Fri, 14 Jun 2019 13:30:32 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Fri, 14 Jun 2019 15:30:24 +0200 Message-Id: <4b97209356cd3f4b1fcdbef3a38ff2e075b9252b.1560518789.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Subject: [libvirt] [RFC PATCH 2/5] qemu: parse: Drop qemuParseCommandLinePid and friends X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Fri, 14 Jun 2019 13:31:54 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Now that we no longer support attaching to a live non-libvirt qemu we can drop the backend functions as well. Signed-off-by: Peter Krempa --- src/qemu/qemu_parse_command.c | 92 ----------------------------------- src/qemu/qemu_parse_command.h | 7 --- 2 files changed, 99 deletions(-) diff --git a/src/qemu/qemu_parse_command.c b/src/qemu/qemu_parse_command.c index fc3f70fcde..b522882c78 100644 --- a/src/qemu/qemu_parse_command.c +++ b/src/qemu/qemu_parse_command.c @@ -2767,95 +2767,3 @@ virDomainDefPtr qemuParseCommandLineString(virFileCa= chePtr capsCache, return def; } - - -static int qemuParseProcFileStrings(int pid_value, - const char *name, - char ***list) -{ - char *path =3D NULL; - int ret =3D -1; - char *data =3D NULL; - ssize_t len; - char *tmp; - size_t nstr =3D 0; - char **str =3D NULL; - - if (virAsprintf(&path, "/proc/%d/%s", pid_value, name) < 0) - goto cleanup; - - if ((len =3D virFileReadAll(path, 1024*128, &data)) < 0) - goto cleanup; - - tmp =3D data; - while (tmp < (data + len)) { - if (VIR_EXPAND_N(str, nstr, 1) < 0) - goto cleanup; - - if (VIR_STRDUP(str[nstr-1], tmp) < 0) - goto cleanup; - /* Skip arg */ - tmp +=3D strlen(tmp); - /* Skip \0 separator */ - tmp++; - } - - if (VIR_EXPAND_N(str, nstr, 1) < 0) - goto cleanup; - - str[nstr-1] =3D NULL; - - ret =3D nstr-1; - *list =3D str; - - cleanup: - if (ret < 0) - virStringListFree(str); - VIR_FREE(data); - VIR_FREE(path); - return ret; -} - -virDomainDefPtr qemuParseCommandLinePid(virFileCachePtr capsCache, - virCapsPtr caps, - virDomainXMLOptionPtr xmlopt, - pid_t pid, - char **pidfile, - virDomainChrSourceDefPtr *monConfi= g, - bool *monJSON) -{ - virDomainDefPtr def =3D NULL; - char **progargv =3D NULL; - char **progenv =3D NULL; - char *exepath =3D NULL; - char *emulator; - - /* The parser requires /proc/pid, which only exists on platforms - * like Linux where pid_t fits in int. */ - if ((int)pid !=3D pid || - qemuParseProcFileStrings(pid, "cmdline", &progargv) < 0 || - qemuParseProcFileStrings(pid, "environ", &progenv) < 0) - goto cleanup; - - if (!(def =3D qemuParseCommandLine(capsCache, caps, xmlopt, progenv, p= rogargv, - pidfile, monConfig, monJSON))) - goto cleanup; - - if (virAsprintf(&exepath, "/proc/%d/exe", (int)pid) < 0) - goto cleanup; - - if (virFileResolveLink(exepath, &emulator) < 0) { - virReportSystemError(errno, - _("Unable to resolve %s for pid %u"), - exepath, (int)pid); - goto cleanup; - } - VIR_FREE(def->emulator); - def->emulator =3D emulator; - - cleanup: - VIR_FREE(exepath); - virStringListFree(progargv); - virStringListFree(progenv); - return def; -} diff --git a/src/qemu/qemu_parse_command.h b/src/qemu/qemu_parse_command.h index 5eeb344c60..4dbb08fd59 100644 --- a/src/qemu/qemu_parse_command.h +++ b/src/qemu/qemu_parse_command.h @@ -37,13 +37,6 @@ virDomainDefPtr qemuParseCommandLineString(virFileCacheP= tr capsCache, char **pidfile, virDomainChrSourceDefPtr *monCo= nfig, bool *monJSON); -virDomainDefPtr qemuParseCommandLinePid(virFileCachePtr capsCache, - virCapsPtr caps, - virDomainXMLOptionPtr xmlopt, - pid_t pid, - char **pidfile, - virDomainChrSourceDefPtr *monConfi= g, - bool *monJSON); void qemuParseKeywordsFree(int nkeywords, --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list