From mboxrd@z Thu Jan 1 00:00:00 1970 From: eXeC001er Subject: blktap2 and pygrub: error Date: Thu, 20 May 2010 00:33:03 +0400 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0258972766==" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Xen-devel List-Id: xen-devel@lists.xenproject.org --===============0258972766== Content-Type: multipart/alternative; boundary=001636457730653bad0486f85dd1 --001636457730653bad0486f85dd1 Content-Type: text/plain; charset=UTF-8 Hi. I tried ti use VHD-disk-image for my Opensolaris DomU. Installation on this disk is fine, but i cannot to boot from it. in logs "Disk isn't accessible"; I mount image and tried to use pygrub directly: pygrub /dev/xvdp Traceback (most recent call last): File "/usr/bin/pygrub", line 705, in fs = fsimage.open(file, get_fs_offset(file)) IOError: [Errno 95] Operation not supported but i can 'dd' from it device-file. I researched this issue: error returned from: *** xen-src-root/tools/pygrub/src/fsimage/fsimage.c *** static PyObject * fsimage_open(PyObject *o, PyObject *args, PyObject *kwargs) { static char *kwlist[] = { "name", "offset", "options", NULL }; char *name; char *options = NULL; uint64_t offset = 0; fsimage_fs_t *fs; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "s|Ls", kwlist, &name, &offset, &options)) return (NULL); if ((fs = PyObject_NEW(fsimage_fs_t, &fsimage_fs_type)) == NULL) return (NULL); if ((fs->fs = fsi_open_fsimage(name, offset, options)) == NULL) { PyErr_SetFromErrno(PyExc_IOError); <<<<<<<<<<<<<<<<<<<<<<<< return (NULL); } return (PyObject *)fs; } *** xen-src-root/tools/libfsimage/common/fsimage.c *** fsi_t *fsi_open_fsimage(const char *path, uint64_t off, const char *options) { fsi_t *fsi = NULL; int fd; int err; if ((fd = open(path, O_RDONLY)) == -1) <<<<<<<<<<<<<<<<<<<<<< goto fail; if ((fsi = malloc(sizeof(*fsi))) == NULL) goto fail; fsi->f_fd = fd; fsi->f_off = off; fsi->f_data = NULL; fsi->f_bootstring = NULL; pthread_mutex_lock(&fsi_lock); err = find_plugin(fsi, path, options); pthread_mutex_unlock(&fsi_lock); if (err != 0) goto fail; return (fsi); fail: err = errno; if (fd != -1) (void) close(fd); free(fsi); errno = err; return (NULL); } If i use 'file:/' type of disk-image (i have other disk-image) then all ok. --001636457730653bad0486f85dd1 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi.

I tried ti use VHD-disk-image for my Opensolaris Dom= U.=C2=A0
Installation on this disk is fine, but i cannot to boot = from it.

in logs "Disk isn't accessible&q= uot;;

I mount image and tried to use pygrub directly:

pygrub=C2=A0/dev/xvdp
Traceback (most rece= nt call last):
=C2=A0=C2=A0File "/usr/bin/pygrub", line= 705, in <module>
=C2=A0=C2=A0 =C2=A0fs =3D fsimage.open(file, get_fs_offset(file))
IOError: [Errno 95] Operation not supported


but i can 'dd' from it device-file.
=
I researched this issue:

error returned from:<= div>*** xen-src-root/tools/pygrub/src/fsimage/fsimage.c ***

<= /div>
static PyObject *
fsimage_open(PyObject *o, PyObject *a= rgs, PyObject *kwargs)
{
=C2=A0=C2=A0 =C2=A0 =C2=A0 =C2= =A0static char *kwlist[] =3D { "name", "offset", "= options", NULL };
=C2=A0=C2=A0 =C2=A0 =C2=A0 =C2=A0char *name;
=C2=A0=C2=A0 = =C2=A0 =C2=A0 =C2=A0char *options =3D NULL;
=C2=A0=C2=A0 =C2=A0 = =C2=A0 =C2=A0uint64_t offset =3D 0;
=C2=A0=C2=A0 =C2=A0 =C2=A0 = =C2=A0fsimage_fs_t *fs;

=C2=A0=C2=A0 =C2=A0 =C2=A0= =C2=A0if (!PyArg_ParseTupleAndKeywords(args, kwargs, "s|Ls", kwl= ist,
=C2=A0=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&name, &offset,= &options))
=C2=A0=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0return (NULL);

=C2=A0=C2=A0 =C2=A0 = =C2=A0 =C2=A0if ((fs =3D PyObject_NEW(fsimage_fs_t, &fsimage_fs_type)) = =3D=3D NULL)
=C2=A0=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0return (NULL);

=C2=A0=C2=A0 =C2=A0 =C2=A0 =C2=A0if ((fs->fs =3D fsi= _open_fsimage(name, offset, options)) =3D=3D NULL) {
=C2=A0=C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0PyErr_SetFromErrno(PyExc_I= OError); =C2=A0 =C2=A0 <<<<<<<<<<<<<= <<<<<<<<<<<
=C2=A0=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0return (N= ULL);
=C2=A0=C2=A0 =C2=A0 =C2=A0 =C2=A0}

=C2=A0=C2=A0 =C2=A0 =C2=A0 =C2=A0return (PyObject *)fs;
}
<= /div>

*** xen-src-root/tools/libfsimage/common/fsimage.c= ***
fsi_t *fsi_open_fsimage(const char *path, uint64_t off, const char *options= )
{
=C2=A0=C2=A0 =C2=A0 =C2=A0 =C2=A0fsi_t *fsi =3D NUL= L;
=C2=A0=C2=A0 =C2=A0 =C2=A0 =C2=A0int fd;
=C2=A0=C2= =A0 =C2=A0 =C2=A0 =C2=A0int err;

=C2=A0=C2=A0 =C2= =A0 =C2=A0 =C2=A0if ((fd =3D open(path, O_RDONLY)) =3D=3D -1) =C2=A0 =C2=A0= =C2=A0 <<<<<<<<<<<<<<<<<= ;<<<<<
=C2=A0=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0goto fail= ;

=C2=A0=C2=A0 =C2=A0 =C2=A0 =C2=A0if ((fsi =3D ma= lloc(sizeof(*fsi))) =3D=3D NULL)
=C2=A0=C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0goto fail;

=C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0fsi->f_fd =3D fd;
=C2=A0=C2=A0 =C2= =A0 =C2=A0 =C2=A0fsi->f_off =3D off;
=C2=A0=C2=A0 =C2=A0 =C2=A0 =C2=A0fsi->f_data =3D NULL;
= =C2=A0=C2=A0 =C2=A0 =C2=A0 =C2=A0fsi->f_bootstring =3D NULL;
<= br>
=C2=A0=C2=A0 =C2=A0 =C2=A0 =C2=A0pthread_mutex_lock(&fsi_= lock);
=C2=A0=C2=A0 =C2=A0 =C2=A0 =C2=A0err =3D find_plugin(fsi, = path, options);
=C2=A0=C2=A0 =C2=A0 =C2=A0 =C2=A0pthread_mutex_un= lock(&fsi_lock);
=C2=A0=C2=A0 =C2=A0 =C2=A0 =C2=A0if (err !=3D 0)
=C2=A0=C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0goto fail;
=C2=A0=C2=A0 =C2=A0 =C2=A0 =C2=A0return (fsi);

<= /div>
fail:
=C2=A0=C2=A0 =C2=A0 =C2=A0 =C2=A0err =3D errno;
=C2=A0=C2=A0 =C2=A0 =C2=A0 =C2=A0if (fd !=3D -1)
=C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(void) close(fd);
=C2=A0=C2=A0 =C2=A0 =C2=A0 =C2=A0free(fsi);
=C2=A0=C2=A0 =C2= =A0 =C2=A0 =C2=A0errno =3D err;
=C2=A0=C2=A0 =C2=A0 =C2=A0 =C2=A0= return (NULL);
}

If i use 'fil= e:/' type of disk-image (i have other disk-image) then all ok.
--001636457730653bad0486f85dd1-- --===============0258972766== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --===============0258972766==--