From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51936) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wxzv0-0004fL-DL for qemu-devel@nongnu.org; Fri, 20 Jun 2014 10:36:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wxzur-0007gX-9U for qemu-devel@nongnu.org; Fri, 20 Jun 2014 10:35:54 -0400 Received: from mail-wi0-x235.google.com ([2a00:1450:400c:c05::235]:43220) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wxzur-0007gR-2B for qemu-devel@nongnu.org; Fri, 20 Jun 2014 10:35:45 -0400 Received: by mail-wi0-f181.google.com with SMTP id n3so913506wiv.14 for ; Fri, 20 Jun 2014 07:35:42 -0700 (PDT) Date: Fri, 20 Jun 2014 22:35:34 +0800 From: Stefan Hajnoczi Message-ID: <20140620143534.GH11029@stefanha-thinkpad.redhat.com> References: <1403189328-18457-1-git-send-email-cnanakos@grnet.gr> <1403189328-18457-3-git-send-email-cnanakos@grnet.gr> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="J/zg8ciPNcraoWb6" Content-Disposition: inline In-Reply-To: <1403189328-18457-3-git-send-email-cnanakos@grnet.gr> Subject: Re: [Qemu-devel] [PATCH v4 2/3] block/archipelago: Add support for creating images List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Chrysostomos Nanakos Cc: kwolf@redhat.com, qemu-devel@nongnu.org, stefanha@redhat.com --J/zg8ciPNcraoWb6 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Thu, Jun 19, 2014 at 05:48:47PM +0300, Chrysostomos Nanakos wrote: > +static int qemu_archipelago_create_volume(Error **errp, const char *volname, > + uint64_t size, xport mportno, > + xport vportno) > +{ > + int ret, targetlen; > + struct xseg *xseg = NULL; > + struct xseg_request *req; > + struct xseg_request_clone *xclone; > + struct xseg_port *port; > + xport srcport = NoPort, sport = NoPort; > + char *target; > + > + /* Try default values if none has been set */ > + if (mportno == (xport) -1) { > + mportno = 1001; > + } > + > + if (vportno == (xport) -1) { > + vportno = 501; > + } > + > + if (xseg_initialize()) { > + error_setg(errp, "Cannot initialize XSEG"); > + return -1; > + } > + > + xseg = xseg_join((char *)"posix", (char *)"archipelago", > + (char *)"posixfd", NULL); > + > + if (!xseg) { > + error_setg(errp, "Cannot join XSEG shared memory segment"); > + return -1; > + } > + > + port = xseg_bind_dynport(xseg); > + srcport = port->portno; > + init_local_signal(xseg, sport, srcport); > + > + req = xseg_get_request(xseg, srcport, mportno, X_ALLOC); > + if (!req) { > + error_setg(errp, "Cannot get XSEG request"); > + return -1; xseg_leave() is missing. --J/zg8ciPNcraoWb6 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJTpEa2AAoJEJykq7OBq3PIDG4H/jQwbpJdvTMi4h47ZkoiJ91U TkDexhdVvc9jK6r6QDWX15P0QyCophL9gfkQPRRAxo/nAwjloHmtzns3ZRBs7T2H 5/a7pLRDab0IlIzGNuSxkoXB7Yg3FL573I8xm/qxtsA6Bq6KAP7OQ04q3PbNJD1u 9IjHwpkuymnIMET5U09cdvIaVADERD6efmzTHuoKCiFZ6R9X34ALkSqCodOLogw7 ZtJv/gsFk7pF0S84AoaxGo+t3RY39xtm2By2bF4miTJpSadScjD2DP0R0cbGigvb 6QwWZEP1taUJDwrPIJbAWXOR38jy+pzkinMaoG8pUdDof06LNy1rTkxtdcKSKMA= =oRF0 -----END PGP SIGNATURE----- --J/zg8ciPNcraoWb6--