From nobody Sat May 4 09:17:10 2024 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 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1500905405022226.62080235914414; Mon, 24 Jul 2017 07:10:05 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id DEB26C001CCB; Mon, 24 Jul 2017 14:09:55 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B628F89F2C; Mon, 24 Jul 2017 14:09:55 +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 5F38814B24; Mon, 24 Jul 2017 14:09:55 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v6OE9jEL007552 for ; Mon, 24 Jul 2017 10:09:45 -0400 Received: by smtp.corp.redhat.com (Postfix) id 521E061F2F; Mon, 24 Jul 2017 14:09:45 +0000 (UTC) Received: from caroline.brq.redhat.com (unknown [10.43.2.67]) by smtp.corp.redhat.com (Postfix) with ESMTP id CB9EC87CB4 for ; Mon, 24 Jul 2017 14:09:44 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com DEB26C001CCB Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=libvir-list-bounces@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com DEB26C001CCB From: Martin Kletzander To: libvir-list@redhat.com Date: Mon, 24 Jul 2017 16:09:31 +0200 Message-Id: In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 1/4] conf: Pass config.priv to xmlopt->privateData.alloc 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: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Mon, 24 Jul 2017 14:09:56 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" This will help us to get to some data more easily. Signed-off-by: Martin Kletzander --- src/bhyve/bhyve_domain.c | 2 +- src/conf/domain_conf.c | 3 ++- src/conf/domain_conf.h | 2 +- src/libxl/libxl_domain.c | 2 +- src/lxc/lxc_domain.c | 2 +- src/qemu/qemu_domain.c | 2 +- src/uml/uml_driver.c | 2 +- src/vmware/vmware_driver.c | 2 +- src/vz/vz_utils.c | 2 +- 9 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/bhyve/bhyve_domain.c b/src/bhyve/bhyve_domain.c index 71764554eb11..3c2344196949 100644 --- a/src/bhyve/bhyve_domain.c +++ b/src/bhyve/bhyve_domain.c @@ -33,7 +33,7 @@ VIR_LOG_INIT("bhyve.bhyve_domain"); =20 static void * -bhyveDomainObjPrivateAlloc(void) +bhyveDomainObjPrivateAlloc(void *opaque ATTRIBUTE_UNUSED) { bhyveDomainObjPrivatePtr priv; =20 diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index d8b3c9b65cd6..2231b195b9c4 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -3032,7 +3032,8 @@ virDomainObjNew(virDomainXMLOptionPtr xmlopt) } =20 if (xmlopt->privateData.alloc) { - if (!(domain->privateData =3D (xmlopt->privateData.alloc)())) + domain->privateData =3D (xmlopt->privateData.alloc)(xmlopt->config= .priv); + if (!domain->privateData) goto error; domain->privateDataFreeFunc =3D xmlopt->privateData.free; } diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 4fef773efd93..dfc51208a029 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -2562,7 +2562,7 @@ struct _virDomainDefParserConfig { unsigned char macPrefix[VIR_MAC_PREFIX_BUFLEN]; }; =20 -typedef void *(*virDomainXMLPrivateDataAllocFunc)(void); +typedef void *(*virDomainXMLPrivateDataAllocFunc)(void *); typedef void (*virDomainXMLPrivateDataFreeFunc)(void *); typedef virObjectPtr (*virDomainXMLPrivateDataNewFunc)(void); typedef int (*virDomainXMLPrivateDataFormatFunc)(virBufferPtr, diff --git a/src/libxl/libxl_domain.c b/src/libxl/libxl_domain.c index 68a501cf1664..7caa6747494a 100644 --- a/src/libxl/libxl_domain.c +++ b/src/libxl/libxl_domain.c @@ -206,7 +206,7 @@ libxlDomainJobUpdateTime(struct libxlDomainJobObj *job) } =20 static void * -libxlDomainObjPrivateAlloc(void) +libxlDomainObjPrivateAlloc(void *opaque ATTRIBUTE_UNUSED) { libxlDomainObjPrivatePtr priv; =20 diff --git a/src/lxc/lxc_domain.c b/src/lxc/lxc_domain.c index 3a7404f407c9..7c1386e40c82 100644 --- a/src/lxc/lxc_domain.c +++ b/src/lxc/lxc_domain.c @@ -150,7 +150,7 @@ virLXCDomainObjEndJob(virLXCDriverPtr driver ATTRIBUTE_= UNUSED, =20 =20 static void * -virLXCDomainObjPrivateAlloc(void) +virLXCDomainObjPrivateAlloc(void *opaque ATTRIBUTE_UNUSED) { virLXCDomainObjPrivatePtr priv; =20 diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 2c8c9a74542b..f1e144d92b64 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -1662,7 +1662,7 @@ qemuDomainClearPrivatePaths(virDomainObjPtr vm) =20 =20 static void * -qemuDomainObjPrivateAlloc(void) +qemuDomainObjPrivateAlloc(void *opaque ATTRIBUTE_UNUSED) { qemuDomainObjPrivatePtr priv; =20 diff --git a/src/uml/uml_driver.c b/src/uml/uml_driver.c index 224b71984250..1846835cc659 100644 --- a/src/uml/uml_driver.c +++ b/src/uml/uml_driver.c @@ -90,7 +90,7 @@ static int umlProcessAutoDestroyRemove(struct uml_driver = *driver, =20 static int umlStateCleanup(void); =20 -static void *umlDomainObjPrivateAlloc(void) +static void *umlDomainObjPrivateAlloc(void *opaque ATTRIBUTE_UNUSED) { umlDomainObjPrivatePtr priv; =20 diff --git a/src/vmware/vmware_driver.c b/src/vmware/vmware_driver.c index 0ee1c5bb983b..8b487c4a7ce0 100644 --- a/src/vmware/vmware_driver.c +++ b/src/vmware/vmware_driver.c @@ -60,7 +60,7 @@ vmwareDriverUnlock(struct vmware_driver *driver) } =20 static void * -vmwareDataAllocFunc(void) +vmwareDataAllocFunc(void *opaque ATTRIBUTE_UNUSED) { vmwareDomainPtr dom; =20 diff --git a/src/vz/vz_utils.c b/src/vz/vz_utils.c index a6d7b93cbc50..770b499c9286 100644 --- a/src/vz/vz_utils.c +++ b/src/vz/vz_utils.c @@ -581,7 +581,7 @@ int vzCheckUnsupportedGraphics(virDomainGraphicsDefPtr = gr) } =20 void* -vzDomObjAlloc(void) +vzDomObjAlloc(void *opaque ATTRIBUTE_UNUSED) { vzDomObjPtr pdom =3D NULL; =20 --=20 2.13.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sat May 4 09:17:10 2024 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 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 15009053957481020.2129509041679; Mon, 24 Jul 2017 07:09:55 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id AEB4FC0BAA11; Mon, 24 Jul 2017 14:09:48 +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 814D36F97E; Mon, 24 Jul 2017 14:09:48 +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 39D0E180597B; Mon, 24 Jul 2017 14:09:48 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v6OE9k9C007562 for ; Mon, 24 Jul 2017 10:09:46 -0400 Received: by smtp.corp.redhat.com (Postfix) id D956D87C91; Mon, 24 Jul 2017 14:09:46 +0000 (UTC) Received: from caroline.brq.redhat.com (unknown [10.43.2.67]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6016187CB0 for ; Mon, 24 Jul 2017 14:09:45 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com AEB4FC0BAA11 Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=libvir-list-bounces@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com AEB4FC0BAA11 From: Martin Kletzander To: libvir-list@redhat.com Date: Mon, 24 Jul 2017 16:09:32 +0200 Message-Id: In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 2/4] qemu: Save qemu driver in qemuDomainObjPrivateData 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: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Mon, 24 Jul 2017 14:09:49 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" This way we can finally make it static and not use any externs anywhere. Signed-off-by: Martin Kletzander --- src/qemu/qemu_domain.c | 3 ++- src/qemu/qemu_domain.h | 2 ++ src/qemu/qemu_driver.c | 2 +- src/qemu/qemu_process.c | 5 +---- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index f1e144d92b64..0b7c45280321 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -1662,7 +1662,7 @@ qemuDomainClearPrivatePaths(virDomainObjPtr vm) =20 =20 static void * -qemuDomainObjPrivateAlloc(void *opaque ATTRIBUTE_UNUSED) +qemuDomainObjPrivateAlloc(void *opaque) { qemuDomainObjPrivatePtr priv; =20 @@ -1679,6 +1679,7 @@ qemuDomainObjPrivateAlloc(void *opaque ATTRIBUTE_UNUS= ED) goto error; =20 priv->migMaxBandwidth =3D QEMU_DOMAIN_MIG_BANDWIDTH_MAX; + priv->driver =3D opaque; =20 return priv; =20 diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h index 365b23c96167..71567af034f5 100644 --- a/src/qemu/qemu_domain.h +++ b/src/qemu/qemu_domain.h @@ -217,6 +217,8 @@ struct _qemuDomainSecretInfo { typedef struct _qemuDomainObjPrivate qemuDomainObjPrivate; typedef qemuDomainObjPrivate *qemuDomainObjPrivatePtr; struct _qemuDomainObjPrivate { + virQEMUDriverPtr driver; + struct qemuDomainJobObj job; =20 virBitmapPtr namespaces; diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 6568def156f4..9c54571cf078 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -159,7 +159,7 @@ static int qemuGetDHCPInterfaces(virDomainPtr dom, virDomainObjPtr vm, virDomainInterfacePtr **ifaces); =20 -virQEMUDriverPtr qemu_driver =3D NULL; +static virQEMUDriverPtr qemu_driver; =20 =20 static void diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 525521aaf0ca..757f5d95e0b7 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -120,9 +120,6 @@ qemuProcessRemoveDomainStatus(virQEMUDriverPtr driver, } =20 =20 -/* XXX figure out how to remove this */ -extern virQEMUDriverPtr qemu_driver; - /* * This is a callback registered with a qemuAgentPtr instance, * and to be invoked when the agent console hits an end of file @@ -518,9 +515,9 @@ qemuProcessHandleReset(qemuMonitorPtr mon ATTRIBUTE_UNU= SED, static void qemuProcessFakeReboot(void *opaque) { - virQEMUDriverPtr driver =3D qemu_driver; virDomainObjPtr vm =3D opaque; qemuDomainObjPrivatePtr priv =3D vm->privateData; + virQEMUDriverPtr driver =3D priv->driver; virObjectEventPtr event =3D NULL; virQEMUDriverConfigPtr cfg =3D virQEMUDriverGetConfig(driver); virDomainRunningReason reason =3D VIR_DOMAIN_RUNNING_BOOTED; --=20 2.13.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sat May 4 09:17:10 2024 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 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1500905499805761.4472336085927; Mon, 24 Jul 2017 07:11:39 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B29387EA89; Mon, 24 Jul 2017 14:11:34 +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 54F0394C78; Mon, 24 Jul 2017 14:11:34 +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 0358B180597C; Mon, 24 Jul 2017 14:11:34 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v6OE9orT007578 for ; Mon, 24 Jul 2017 10:09:50 -0400 Received: by smtp.corp.redhat.com (Postfix) id 43EDD87F81; Mon, 24 Jul 2017 14:09:50 +0000 (UTC) Received: from caroline.brq.redhat.com (unknown [10.43.2.67]) by smtp.corp.redhat.com (Postfix) with ESMTP id BBC1987F80 for ; Mon, 24 Jul 2017 14:09:47 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com B29387EA89 Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=libvir-list-bounces@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com B29387EA89 From: Martin Kletzander To: libvir-list@redhat.com Date: Mon, 24 Jul 2017 16:09:33 +0200 Message-Id: In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 3/4] lxc: Make lxcProcessStop callable even without PID being available 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: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Mon, 24 Jul 2017 14:11:35 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" This way the function can work as a central point of clean-up code and we don't have to duplicate code. And it works similarly to the qemu driver. Signed-off-by: Martin Kletzander --- src/lxc/lxc_process.c | 32 ++------------------------------ 1 file changed, 2 insertions(+), 30 deletions(-) diff --git a/src/lxc/lxc_process.c b/src/lxc/lxc_process.c index 2658ea61f89e..724297d128d0 100644 --- a/src/lxc/lxc_process.c +++ b/src/lxc/lxc_process.c @@ -845,12 +845,6 @@ int virLXCProcessStop(virLXCDriverPtr driver, =20 priv =3D vm->privateData; =20 - if (vm->pid <=3D 0) { - virReportError(VIR_ERR_INTERNAL_ERROR, - _("Invalid PID %d for container"), vm->pid); - return -1; - } - virSecurityManagerRestoreAllLabel(driver->securityManager, vm->def, false, false); virSecurityManagerReleaseLabel(driver->securityManager, vm->def); @@ -895,7 +889,7 @@ int virLXCProcessStop(virLXCDriverPtr driver, _("Some processes refused to die")); return -1; } - } else { + } else if (vm->pid > 0) { /* If cgroup doesn't exist, just try cleaning up the * libvirt_lxc process */ if (virProcessKillPainfully(vm->pid, true) < 0) { @@ -1210,8 +1204,6 @@ int virLXCProcessStart(virConnectPtr conn, virCgroupPtr selfcgroup; int status; char *pidfile =3D NULL; - bool clearSeclabel =3D false; - bool need_stop =3D false; =20 if (virCgroupNewSelf(&selfcgroup) < 0) return -1; @@ -1331,9 +1323,6 @@ int virLXCProcessStart(virConnectPtr conn, then generate a security label for isolation */ VIR_DEBUG("Generating domain security label (if required)"); =20 - clearSeclabel =3D vm->def->nseclabels =3D=3D 0 || - vm->def->seclabels[0]->type =3D=3D VIR_DOMAIN_SECLABEL= _DEFAULT; - if (vm->def->nseclabels && vm->def->seclabels[0]->type =3D=3D VIR_DOMAIN_SECLABEL_DEFAULT) vm->def->seclabels[0]->type =3D VIR_DOMAIN_SECLABEL_NONE; @@ -1468,7 +1457,6 @@ int virLXCProcessStart(virConnectPtr conn, goto cleanup; } =20 - need_stop =3D true; priv->stopReason =3D VIR_DOMAIN_EVENT_STOPPED_FAILED; priv->wantReboot =3D false; vm->def->id =3D vm->pid; @@ -1574,23 +1562,7 @@ int virLXCProcessStart(virConnectPtr conn, } if (rc !=3D 0) { err =3D virSaveLastError(); - if (need_stop) { - virLXCProcessStop(driver, vm, VIR_DOMAIN_SHUTOFF_FAILED); - } else { - virSecurityManagerRestoreAllLabel(driver->securityManager, - vm->def, false, false); - virSecurityManagerReleaseLabel(driver->securityManager, vm->de= f); - /* Clear out dynamically assigned labels */ - if (vm->def->nseclabels && - (vm->def->seclabels[0]->type =3D=3D VIR_DOMAIN_SECLABEL_DY= NAMIC || - clearSeclabel)) { - VIR_FREE(vm->def->seclabels[0]->model); - VIR_FREE(vm->def->seclabels[0]->label); - VIR_FREE(vm->def->seclabels[0]->imagelabel); - VIR_DELETE_ELEMENT(vm->def->seclabels, 0, vm->def->nseclab= els); - } - virLXCProcessCleanup(driver, vm, VIR_DOMAIN_SHUTOFF_FAILED); - } + virLXCProcessStop(driver, vm, VIR_DOMAIN_SHUTOFF_FAILED); } virCommandFree(cmd); for (i =3D 0; i < nveths; i++) --=20 2.13.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sat May 4 09:17:10 2024 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 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1500905405588586.9838753460037; Mon, 24 Jul 2017 07:10:05 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A230E13A42; Mon, 24 Jul 2017 14:09:57 +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 7F73B61B9E; Mon, 24 Jul 2017 14:09:57 +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 31E60180597F; Mon, 24 Jul 2017 14:09:57 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v6OE9q3d007590 for ; Mon, 24 Jul 2017 10:09:52 -0400 Received: by smtp.corp.redhat.com (Postfix) id D128B87F80; Mon, 24 Jul 2017 14:09:52 +0000 (UTC) Received: from caroline.brq.redhat.com (unknown [10.43.2.67]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2CF3C87F84 for ; Mon, 24 Jul 2017 14:09:50 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com A230E13A42 Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=libvir-list-bounces@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com A230E13A42 From: Martin Kletzander To: libvir-list@redhat.com Date: Mon, 24 Jul 2017 16:09:34 +0200 Message-Id: <2fb5cdba6a29c16f93827c4604559f946ac27865.1500905112.git.mkletzan@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 4/4] Move machineName generation from virsystemd into domain_conf 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: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Mon, 24 Jul 2017 14:09:58 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" It is more related to a domain as we might use it even when there is no systemd and it does not use any dbus/systemd functions. In order not to use code from conf/ in util/ pass machineName in cgroups code as a parameter. That also fixes a leak of machineName in the lxc driver and cleans up and de-duplicates some code. Signed-off-by: Martin Kletzander --- src/conf/domain_conf.c | 62 ++++++++++++++++++++++++++++++++++++++++++++= ++++ src/conf/domain_conf.h | 5 ++++ src/libvirt_private.syms | 2 +- src/lxc/lxc_cgroup.c | 5 +--- src/lxc/lxc_domain.c | 19 +++++++++++++++ src/lxc/lxc_domain.h | 3 +++ src/lxc/lxc_process.c | 25 +++++++++---------- src/qemu/qemu_cgroup.c | 24 ++++--------------- src/qemu/qemu_domain.c | 21 ++++++++++++++++ src/qemu/qemu_domain.h | 3 +++ src/qemu/qemu_process.c | 6 +++++ src/util/vircgroup.c | 15 ++++-------- src/util/vircgroup.h | 14 +++++------ src/util/virsystemd.c | 62 --------------------------------------------= ---- src/util/virsystemd.h | 5 ---- tests/virsystemdtest.c | 4 ++-- 16 files changed, 153 insertions(+), 122 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 2231b195b9c4..98e2e7292912 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -27007,3 +27007,65 @@ virDomainDiskSetBlockIOTune(virDomainDiskDefPtr di= sk, =20 return 0; } + +#define HOSTNAME_CHARS \ + "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-" + +static void +virDomainMachineNameAppendValid(virBufferPtr buf, + const char *name) +{ + bool skip_dot =3D false; + + for (; *name; name++) { + if (virBufferError(buf)) + break; + if (strlen(virBufferCurrentContent(buf)) >=3D 64) + break; + + if (*name =3D=3D '.') { + if (!skip_dot) + virBufferAddChar(buf, *name); + skip_dot =3D true; + continue; + } + + skip_dot =3D false; + + if (!strchr(HOSTNAME_CHARS, *name)) + continue; + + virBufferAddChar(buf, *name); + } +} + +#undef HOSTNAME_CHARS + +char * +virDomainGenerateMachineName(const char *drivername, + int id, + const char *name, + bool privileged) +{ + char *machinename =3D NULL; + char *username =3D NULL; + virBuffer buf =3D VIR_BUFFER_INITIALIZER; + + if (privileged) { + virBufferAsprintf(&buf, "%s-", drivername); + } else { + if (!(username =3D virGetUserName(geteuid()))) + goto cleanup; + + virBufferAsprintf(&buf, "%s-%s-", username, drivername); + } + + virBufferAsprintf(&buf, "%d-", id); + virDomainMachineNameAppendValid(&buf, name); + + machinename =3D virBufferContentAndReset(&buf); + cleanup: + VIR_FREE(username); + + return machinename; +} diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index dfc51208a029..e422e01e71ed 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -3341,4 +3341,9 @@ virDomainGetBlkioParametersAssignFromDef(virDomainDef= Ptr def, int virDomainDiskSetBlockIOTune(virDomainDiskDefPtr disk, virDomainBlockIoTuneInfo *info); =20 +char * +virDomainGenerateMachineName(const char *drivername, + int id, + const char *name, + bool privileged); #endif /* __DOMAIN_CONF_H */ diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index 87753758f9cc..c5c048d0189f 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -340,6 +340,7 @@ virDomainFSTypeFromString; virDomainFSTypeToString; virDomainFSWrpolicyTypeFromString; virDomainFSWrpolicyTypeToString; +virDomainGenerateMachineName; virDomainGetFilesystemForTarget; virDomainGraphicsAuthConnectedTypeFromString; virDomainGraphicsAuthConnectedTypeToString; @@ -2711,7 +2712,6 @@ virSystemdCanSuspend; virSystemdCreateMachine; virSystemdGetMachineNameByPID; virSystemdHasMachinedResetCachedValue; -virSystemdMakeMachineName; virSystemdMakeScopeName; virSystemdMakeSliceName; virSystemdNotifyStartup; diff --git a/src/lxc/lxc_cgroup.c b/src/lxc/lxc_cgroup.c index 1c42ab5cde9d..336980187035 100644 --- a/src/lxc/lxc_cgroup.c +++ b/src/lxc/lxc_cgroup.c @@ -485,10 +485,7 @@ virCgroupPtr virLXCCgroupCreate(virDomainDefPtr def, int *nicindexes) { virCgroupPtr cgroup =3D NULL; - char *machineName =3D virSystemdMakeMachineName("lxc", - def->id, - def->name, - true); + char *machineName =3D virLXCDomainGetMachineName(def, 0); =20 if (!machineName) goto cleanup; diff --git a/src/lxc/lxc_domain.c b/src/lxc/lxc_domain.c index 7c1386e40c82..d23969a585f4 100644 --- a/src/lxc/lxc_domain.c +++ b/src/lxc/lxc_domain.c @@ -31,6 +31,7 @@ #include "virutil.h" #include "virfile.h" #include "virtime.h" +#include "virsystemd.h" =20 #define VIR_FROM_THIS VIR_FROM_LXC #define LXC_NAMESPACE_HREF "http://libvirt.org/schemas/domain/lxc/1.0" @@ -397,3 +398,21 @@ virDomainDefParserConfig virLXCDriverDomainDefParserCo= nfig =3D { .domainPostParseCallback =3D virLXCDomainDefPostParse, .devicesPostParseCallback =3D virLXCDomainDeviceDefPostParse, }; + + +char * +virLXCDomainGetMachineName(virDomainDefPtr def, pid_t pid) +{ + char *ret =3D NULL; + + if (pid) { + ret =3D virSystemdGetMachineNameByPID(pid); + if (!ret) + virResetLastError(); + } + + if (!ret) + ret =3D virDomainGenerateMachineName("lxc", def->id, def->name, tr= ue); + + return ret; +} diff --git a/src/lxc/lxc_domain.h b/src/lxc/lxc_domain.h index 5c4f31e54625..b248cdfd6f34 100644 --- a/src/lxc/lxc_domain.h +++ b/src/lxc/lxc_domain.h @@ -107,4 +107,7 @@ virLXCDomainObjEndJob(virLXCDriverPtr driver, virDomainObjPtr obj); =20 =20 +char * +virLXCDomainGetMachineName(virDomainDefPtr def, pid_t pid); + #endif /* __LXC_DOMAIN_H__ */ diff --git a/src/lxc/lxc_process.c b/src/lxc/lxc_process.c index 724297d128d0..05f1dec4c421 100644 --- a/src/lxc/lxc_process.c +++ b/src/lxc/lxc_process.c @@ -234,6 +234,7 @@ static void virLXCProcessCleanup(virLXCDriverPtr driver, * the bug we are working around here. */ virCgroupTerminateMachine(priv->machineName); + VIR_FREE(priv->machineName); =20 /* The "release" hook cleans up additional resources */ if (virHookPresent(VIR_HOOK_DRIVER_LXC)) { @@ -1494,13 +1495,17 @@ int virLXCProcessStart(virConnectPtr conn, goto cleanup; } =20 + priv->machineName =3D virLXCDomainGetMachineName(vm->def, vm->pid); + if (!priv->machineName) + goto cleanup; + /* We know the cgroup must exist by this synchronization * point so lets detect that first, since it gives us a * more reliable way to kill everything off if something * goes wrong from here onwards ... */ if (virCgroupNewDetectMachine(vm->def->name, "lxc", - vm->def->id, true, - vm->pid, -1, &priv->cgroup) < 0) + vm->pid, -1, priv->machineName, + &priv->cgroup) < 0) goto cleanup; =20 if (!priv->cgroup) { @@ -1510,11 +1515,6 @@ int virLXCProcessStart(virConnectPtr conn, goto cleanup; } =20 - /* Get the machine name so we can properly delete it through - * systemd later */ - if (!(priv->machineName =3D virSystemdGetMachineNameByPID(vm->pid))) - virResetLastError(); - /* And we can get the first monitor connection now too */ if (!(priv->monitor =3D virLXCProcessConnectMonitor(driver, vm))) { /* Intentionally overwrite the real monitor error message, @@ -1666,8 +1666,12 @@ virLXCProcessReconnectDomain(virDomainObjPtr vm, if (!(priv->monitor =3D virLXCProcessConnectMonitor(driver, vm))) goto error; =20 - if (virCgroupNewDetectMachine(vm->def->name, "lxc", vm->def->id, t= rue, - vm->pid, -1, &priv->cgroup) < 0) + priv->machineName =3D virLXCDomainGetMachineName(vm->def, vm->pid); + if (!priv->machineName) + goto cleanup; + + if (virCgroupNewDetectMachine(vm->def->name, "lxc", vm->pid, -1, + priv->machineName, &priv->cgroup) < = 0) goto error; =20 if (!priv->cgroup) { @@ -1677,9 +1681,6 @@ virLXCProcessReconnectDomain(virDomainObjPtr vm, goto error; } =20 - if (!(priv->machineName =3D virSystemdGetMachineNameByPID(vm->pid)= )) - virResetLastError(); - if (virLXCUpdateActiveUSBHostdevs(driver, vm->def) < 0) goto error; =20 diff --git a/src/qemu/qemu_cgroup.c b/src/qemu/qemu_cgroup.c index 36762d4f676e..7355527c1cc5 100644 --- a/src/qemu/qemu_cgroup.c +++ b/src/qemu/qemu_cgroup.c @@ -852,17 +852,6 @@ qemuInitCgroup(virQEMUDriverPtr driver, goto cleanup; } =20 - /* - * We need to do this because of systemd-machined, because - * CreateMachine requires the name to be a valid hostname. - */ - priv->machineName =3D virSystemdMakeMachineName("qemu", - vm->def->id, - vm->def->name, - virQEMUDriverIsPrivilege= d(driver)); - if (!priv->machineName) - goto cleanup; - if (virCgroupNewMachine(priv->machineName, "qemu", vm->def->uuid, @@ -978,21 +967,20 @@ qemuConnectCgroup(virQEMUDriverPtr driver, if (!virCgroupAvailable()) goto done; =20 + priv->machineName =3D qemuDomainGetMachineName(vm); + if (!priv->machineName) + goto cleanup; + virCgroupFree(&priv->cgroup); =20 if (virCgroupNewDetectMachine(vm->def->name, "qemu", - vm->def->id, - virQEMUDriverIsPrivileged(driver), vm->pid, cfg->cgroupControllers, + priv->machineName, &priv->cgroup) < 0) goto cleanup; =20 - priv->machineName =3D virSystemdGetMachineNameByPID(vm->pid); - if (!priv->machineName) - virResetLastError(); - qemuRestoreCgroupState(vm); =20 done: @@ -1164,8 +1152,6 @@ qemuRemoveCgroup(virDomainObjPtr vm) VIR_DEBUG("Failed to terminate cgroup for %s", vm->def->name); } =20 - VIR_FREE(priv->machineName); - return virCgroupRemove(priv->cgroup); } =20 diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 0b7c45280321..b71ca168ce18 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -49,6 +49,7 @@ #include "viratomic.h" #include "virprocess.h" #include "vircrypto.h" +#include "virsystemd.h" #include "secret_util.h" #include "logging/log_manager.h" #include "locking/domain_lock.h" @@ -9568,3 +9569,23 @@ qemuDomainUpdateCPU(virDomainObjPtr vm, =20 return 0; } + +char * +qemuDomainGetMachineName(virDomainObjPtr vm) +{ + qemuDomainObjPrivatePtr priv =3D vm->privateData; + virQEMUDriverPtr driver =3D priv->driver; + char *ret =3D NULL; + + if (vm->pid) { + ret =3D virSystemdGetMachineNameByPID(vm->pid); + if (!ret) + virResetLastError(); + } + + if (!ret) + ret =3D virDomainGenerateMachineName("qemu", vm->def->id, vm->def-= >name, + virQEMUDriverIsPrivileged(drive= r)); + + return ret; +} diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h index 71567af034f5..4c9050aff000 100644 --- a/src/qemu/qemu_domain.h +++ b/src/qemu/qemu_domain.h @@ -934,4 +934,7 @@ qemuDomainUpdateCPU(virDomainObjPtr vm, virCPUDefPtr cpu, virCPUDefPtr *origCPU); =20 +char * +qemuDomainGetMachineName(virDomainObjPtr vm); + #endif /* __QEMU_DOMAIN_H__ */ diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 757f5d95e0b7..87ab85fdb476 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -5242,6 +5242,10 @@ qemuProcessPrepareDomain(virConnectPtr conn, if (!(caps =3D virQEMUDriverGetCapabilities(driver, false))) goto cleanup; =20 + priv->machineName =3D qemuDomainGetMachineName(vm); + if (!priv->machineName) + goto cleanup; + if (!(flags & VIR_QEMU_PROCESS_START_PRETEND)) { /* If you are using a SecurityDriver with dynamic labelling, then generate a security label for isolation */ @@ -6307,6 +6311,8 @@ void qemuProcessStop(virQEMUDriverPtr driver, } } =20 + VIR_FREE(priv->machineName); + vm->taint =3D 0; vm->pid =3D -1; virDomainObjSetState(vm, VIR_DOMAIN_SHUTOFF, reason); diff --git a/src/util/vircgroup.c b/src/util/vircgroup.c index 2912fc9be539..f274aee81ab9 100644 --- a/src/util/vircgroup.c +++ b/src/util/vircgroup.c @@ -252,17 +252,14 @@ static bool virCgroupValidateMachineGroup(virCgroupPtr group, const char *name, const char *drivername, - int id, - bool privileged, - bool stripEmulatorSuffix) + bool stripEmulatorSuffix, + char *machinename) { size_t i; bool valid =3D false; char *partname =3D NULL; char *scopename_old =3D NULL; char *scopename_new =3D NULL; - char *machinename =3D virSystemdMakeMachineName(drivername, id, - name, privileged); char *partmachinename =3D NULL; =20 if (virAsprintf(&partname, "%s.libvirt-%s", @@ -1539,10 +1536,9 @@ virCgroupNewDetect(pid_t pid, int virCgroupNewDetectMachine(const char *name, const char *drivername, - int id, - bool privileged, pid_t pid, int controllers, + char *machinename, virCgroupPtr *group) { if (virCgroupNewDetect(pid, controllers, group) < 0) { @@ -1552,7 +1548,7 @@ virCgroupNewDetectMachine(const char *name, } =20 if (!virCgroupValidateMachineGroup(*group, name, drivername, - id, privileged, true)) { + true, machinename)) { VIR_DEBUG("Failed to validate machine name for '%s' driver '%s'", name, drivername); virCgroupFree(group); @@ -4208,10 +4204,9 @@ virCgroupNewDetect(pid_t pid ATTRIBUTE_UNUSED, int virCgroupNewDetectMachine(const char *name ATTRIBUTE_UNUSED, const char *drivername ATTRIBUTE_UNUSED, - int id ATTRIBUTE_UNUSED, - bool privileged ATTRIBUTE_UNUSED, pid_t pid ATTRIBUTE_UNUSED, int controllers ATTRIBUTE_UNUSED, + char *machinename ATTRIBUTE_UNUSED, virCgroupPtr *group ATTRIBUTE_UNUSED) { virReportSystemError(ENXIO, "%s", diff --git a/src/util/vircgroup.h b/src/util/vircgroup.h index 2de1bf2de4ce..d83392767864 100644 --- a/src/util/vircgroup.h +++ b/src/util/vircgroup.h @@ -94,13 +94,13 @@ int virCgroupNewDetect(pid_t pid, int controllers, virCgroupPtr *group); =20 -int virCgroupNewDetectMachine(const char *name, - const char *drivername, - int id, - bool privileged, - pid_t pid, - int controllers, - virCgroupPtr *group) +int +virCgroupNewDetectMachine(const char *name, + const char *drivername, + pid_t pid, + int controllers, + char *machinename, + virCgroupPtr *group) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); =20 int virCgroupNewMachine(const char *name, diff --git a/src/util/virsystemd.c b/src/util/virsystemd.c index 5d9746f9955f..829b92d54d94 100644 --- a/src/util/virsystemd.c +++ b/src/util/virsystemd.c @@ -125,68 +125,6 @@ char *virSystemdMakeSliceName(const char *partition) return virBufferContentAndReset(&buf); } =20 -#define HOSTNAME_CHARS \ - "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-" - -static void -virSystemdAppendValidMachineName(virBufferPtr buf, - const char *name) -{ - bool skip_dot =3D false; - - for (; *name; name++) { - if (virBufferError(buf)) - break; - if (strlen(virBufferCurrentContent(buf)) >=3D 64) - break; - - if (*name =3D=3D '.') { - if (!skip_dot) - virBufferAddChar(buf, *name); - skip_dot =3D true; - continue; - } - - skip_dot =3D false; - - if (!strchr(HOSTNAME_CHARS, *name)) - continue; - - virBufferAddChar(buf, *name); - } -} - -#undef HOSTNAME_CHARS - -char * -virSystemdMakeMachineName(const char *drivername, - int id, - const char *name, - bool privileged) -{ - char *machinename =3D NULL; - char *username =3D NULL; - virBuffer buf =3D VIR_BUFFER_INITIALIZER; - - if (privileged) { - virBufferAsprintf(&buf, "%s-", drivername); - } else { - if (!(username =3D virGetUserName(geteuid()))) - goto cleanup; - - virBufferAsprintf(&buf, "%s-%s-", username, drivername); - } - - virBufferAsprintf(&buf, "%d-", id); - virSystemdAppendValidMachineName(&buf, name); - - machinename =3D virBufferContentAndReset(&buf); - cleanup: - VIR_FREE(username); - - return machinename; -} - static int virSystemdHasMachinedCachedValue =3D -1; =20 /* Reset the cache from tests for testing the underlying dbus calls diff --git a/src/util/virsystemd.h b/src/util/virsystemd.h index 93b0aae7e15f..9aedb40b86f1 100644 --- a/src/util/virsystemd.h +++ b/src/util/virsystemd.h @@ -29,11 +29,6 @@ char *virSystemdMakeScopeName(const char *name, bool legacy_behaviour); char *virSystemdMakeSliceName(const char *partition); =20 -char *virSystemdMakeMachineName(const char *drivername, - int id, - const char *name, - bool privileged); - int virSystemdCreateMachine(const char *name, const char *drivername, const unsigned char *uuid, diff --git a/tests/virsystemdtest.c b/tests/virsystemdtest.c index 15642759e94f..4f4f29bfacde 100644 --- a/tests/virsystemdtest.c +++ b/tests/virsystemdtest.c @@ -413,8 +413,8 @@ testMachineName(const void *opaque) int ret =3D -1; char *actual =3D NULL; =20 - if (!(actual =3D virSystemdMakeMachineName("qemu", data->id, - data->name, true))) + if (!(actual =3D virDomainGenerateMachineName("qemu", data->id, + data->name, true))) goto cleanup; =20 if (STRNEQ(actual, data->expected)) { --=20 2.13.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list