[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v4 2/3] block/archipelago: Add support for creat
From: |
Stefan Hajnoczi |
Subject: |
Re: [Qemu-devel] [PATCH v4 2/3] block/archipelago: Add support for creating images |
Date: |
Fri, 20 Jun 2014 22:35:34 +0800 |
User-agent: |
Mutt/1.5.23 (2014-03-12) |
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.
pgpUldZracpHW.pgp
Description: PGP signature