Message ID | 1501260134-11837-1-git-send-email-marmarek@invisiblethingslab.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On Fri, Jul 28, 2017 at 06:42:13PM +0200, Marek Marczykowski-Górecki wrote: > This will allow later to make HVM domain without qemu in dom0 (in > addition to the one in stubdomain). > > Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com> > > --- > This is extracted from v1 of "libxl: do not start dom0 qemu for > stubdomain when not needed". > > Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com> > --- > tools/libxl/libxl_disk.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/tools/libxl/libxl_disk.c b/tools/libxl/libxl_disk.c > index 63de75c..7842d9b 100644 > --- a/tools/libxl/libxl_disk.c > +++ b/tools/libxl/libxl_disk.c > @@ -56,10 +56,12 @@ static void disk_eject_xswatch_callback(libxl__egc *egc, libxl__ev_xswatch *w, > "/local/domain/%d/backend/%" TOSTRING(BACKEND_STRING_SIZE) > "[a-z]/%*d/%*d", > &disk->backend_domid, backend_type); > - if (!strcmp(backend_type, "tap") || !strcmp(backend_type, "vbd")) { > + if (!strcmp(backend_type, "tap")) { > disk->backend = LIBXL_DISK_BACKEND_TAP; > } else if (!strcmp(backend_type, "qdisk")) { > disk->backend = LIBXL_DISK_BACKEND_QDISK; > + } else if (!strcmp(backend_type, "vbd")) { > + disk->backend = LIBXL_DISK_BACKEND_PHY; Wait, it only occurred to me until now this patch is changing disk_eject_xswatch_callback. Is this a bug fix? How is it possible for the backend_type to be "vbd" when there isn't such thing in libxl_types.idl?
On Mon, Jul 31, 2017 at 04:56:04PM +0100, Wei Liu wrote: > On Fri, Jul 28, 2017 at 06:42:13PM +0200, Marek Marczykowski-Górecki wrote: > > This will allow later to make HVM domain without qemu in dom0 (in > > addition to the one in stubdomain). > > > > Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com> > > > > --- > > This is extracted from v1 of "libxl: do not start dom0 qemu for > > stubdomain when not needed". > > > > Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com> > > --- > > tools/libxl/libxl_disk.c | 4 +++- > > 1 file changed, 3 insertions(+), 1 deletion(-) > > > > diff --git a/tools/libxl/libxl_disk.c b/tools/libxl/libxl_disk.c > > index 63de75c..7842d9b 100644 > > --- a/tools/libxl/libxl_disk.c > > +++ b/tools/libxl/libxl_disk.c > > @@ -56,10 +56,12 @@ static void disk_eject_xswatch_callback(libxl__egc *egc, libxl__ev_xswatch *w, > > "/local/domain/%d/backend/%" TOSTRING(BACKEND_STRING_SIZE) > > "[a-z]/%*d/%*d", > > &disk->backend_domid, backend_type); > > - if (!strcmp(backend_type, "tap") || !strcmp(backend_type, "vbd")) { > > + if (!strcmp(backend_type, "tap")) { > > disk->backend = LIBXL_DISK_BACKEND_TAP; > > } else if (!strcmp(backend_type, "qdisk")) { > > disk->backend = LIBXL_DISK_BACKEND_QDISK; > > + } else if (!strcmp(backend_type, "vbd")) { > > + disk->backend = LIBXL_DISK_BACKEND_PHY; > > Wait, it only occurred to me until now this patch is changing > disk_eject_xswatch_callback. > > Is this a bug fix? How is it possible for the backend_type to be "vbd" > when there isn't such thing in libxl_types.idl? Oh, I'm an idiot. That's read from xenstore path. I think this patch is correct. But I still tend to think this is a bug fix. How do you discover this problem? Has disk eject ever worked for you?
On Mon, Jul 31, 2017 at 05:01:08PM +0100, Wei Liu wrote: > On Mon, Jul 31, 2017 at 04:56:04PM +0100, Wei Liu wrote: > > On Fri, Jul 28, 2017 at 06:42:13PM +0200, Marek Marczykowski-Górecki wrote: > > > This will allow later to make HVM domain without qemu in dom0 (in > > > addition to the one in stubdomain). > > > > > > Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com> > > > > > > --- > > > This is extracted from v1 of "libxl: do not start dom0 qemu for > > > stubdomain when not needed". > > > > > > Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com> > > > --- > > > tools/libxl/libxl_disk.c | 4 +++- > > > 1 file changed, 3 insertions(+), 1 deletion(-) > > > > > > diff --git a/tools/libxl/libxl_disk.c b/tools/libxl/libxl_disk.c > > > index 63de75c..7842d9b 100644 > > > --- a/tools/libxl/libxl_disk.c > > > +++ b/tools/libxl/libxl_disk.c > > > @@ -56,10 +56,12 @@ static void disk_eject_xswatch_callback(libxl__egc *egc, libxl__ev_xswatch *w, > > > "/local/domain/%d/backend/%" TOSTRING(BACKEND_STRING_SIZE) > > > "[a-z]/%*d/%*d", > > > &disk->backend_domid, backend_type); > > > - if (!strcmp(backend_type, "tap") || !strcmp(backend_type, "vbd")) { > > > + if (!strcmp(backend_type, "tap")) { > > > disk->backend = LIBXL_DISK_BACKEND_TAP; > > > } else if (!strcmp(backend_type, "qdisk")) { > > > disk->backend = LIBXL_DISK_BACKEND_QDISK; > > > + } else if (!strcmp(backend_type, "vbd")) { > > > + disk->backend = LIBXL_DISK_BACKEND_PHY; > > > > Wait, it only occurred to me until now this patch is changing > > disk_eject_xswatch_callback. > > > > Is this a bug fix? How is it possible for the backend_type to be "vbd" > > when there isn't such thing in libxl_types.idl? > > Oh, I'm an idiot. That's read from xenstore path. I think this patch is > correct. But I still tend to think this is a bug fix. How do you > discover this problem? Has disk eject ever worked for you? Hmm, I think I've failed with forward-porting this patch. In current Xen it isn't possible to create cdrom with backend_type!=qdisk... So, this patch alone isn't sufficient. Please ignore it.
diff --git a/tools/libxl/libxl_disk.c b/tools/libxl/libxl_disk.c index 63de75c..7842d9b 100644 --- a/tools/libxl/libxl_disk.c +++ b/tools/libxl/libxl_disk.c @@ -56,10 +56,12 @@ static void disk_eject_xswatch_callback(libxl__egc *egc, libxl__ev_xswatch *w, "/local/domain/%d/backend/%" TOSTRING(BACKEND_STRING_SIZE) "[a-z]/%*d/%*d", &disk->backend_domid, backend_type); - if (!strcmp(backend_type, "tap") || !strcmp(backend_type, "vbd")) { + if (!strcmp(backend_type, "tap")) { disk->backend = LIBXL_DISK_BACKEND_TAP; } else if (!strcmp(backend_type, "qdisk")) { disk->backend = LIBXL_DISK_BACKEND_QDISK; + } else if (!strcmp(backend_type, "vbd")) { + disk->backend = LIBXL_DISK_BACKEND_PHY; } else { disk->backend = LIBXL_DISK_BACKEND_UNKNOWN; }