Bug 768919

Summary: debian support
Product: [Retired] oVirt Reporter: Matthias H <redhat>
Component: vdsmAssignee: Dan Kenigsberg <danken>
Status: CLOSED CURRENTRELEASE QA Contact: yeylon <yeylon>
Severity: medium Docs Contact:
Priority: unspecified    
Version: unspecifiedCC: abaron, acathrow, bazulay, iheim, kyle, srevivo, ykaul
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-02-27 15:37:50 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
First patch for debian systems
none
Second version of the patch for debian support none

Description Matthias H 2011-12-19 12:30:52 UTC
Created attachment 548559 [details]
First patch for debian systems

Hi,

vdsm throws a lot of expections if it is not run on a Redhat or Redhat-equal system. I wrote a first patch to change this.

The patch is not fully done yet, because the "TBD" part needs some discussion.

There's a list of KEY_PACKAGES for vdsm that get checked for their version. I guess the whole array is forwareded to ovirt (correct me, if I'm wrong here). But not all KEY_PACKAGES have the same name in Debian as they do in RedHat.

KEY_PACKAGES are: (annotated do the packages in Debian)
* qemu-kvm (same name as in Debian)
* qemu-img (no such package in Debian. What does qemu-img do? Maybe it has a different name)
* vdsm (not yet packaged. But since this is a daemon it would be name vdsmd)
* spice-server (libspice-server1)
* libvirt (libvirt0)

I could write a translation list, but I consider this as a pretty dirty fix.

Comment 1 Ayal Baron 2011-12-19 16:05:00 UTC
(In reply to comment #0)
> Created attachment 548559 [details]
> First patch for debian systems
> 
> Hi,
> 
> vdsm throws a lot of expections if it is not run on a Redhat or Redhat-equal
> system. I wrote a first patch to change this.
> 
> The patch is not fully done yet, because the "TBD" part needs some discussion.
> 
> There's a list of KEY_PACKAGES for vdsm that get checked for their version. I
> guess the whole array is forwareded to ovirt (correct me, if I'm wrong here).

You are correct.

> But not all KEY_PACKAGES have the same name in Debian as they do in RedHat.
> 
> KEY_PACKAGES are: (annotated do the packages in Debian)
> * qemu-kvm (same name as in Debian)
> * qemu-img (no such package in Debian. What does qemu-img do? Maybe it has a
> different name)

Could be that it's bundled with qemu-kvm on debian.  qemu-img is a command line tool that manipulates disk images.
it is used for creation of a disk image, conversion of disk images (raw -> qcow2 and vice versa) creation of qcow2 files on top of backing files etc.

> * vdsm (not yet packaged. But since this is a daemon it would be name vdsmd)
> * spice-server (libspice-server1)
> * libvirt (libvirt0)
> 
> I could write a translation list, but I consider this as a pretty dirty fix.

How do other packages in debian solve these issues?

Comment 2 Matthias H 2011-12-20 14:05:32 UTC
(In reply to comment #1)
> Could be that it's bundled with qemu-kvm on debian.  qemu-img is a command line
> tool that manipulates disk images.
> it is used for creation of a disk image, conversion of disk images (raw ->
> qcow2 and vice versa) creation of qcow2 files on top of backing files etc.

Found it. qemu-img is in the package qemu-utils


> > * vdsm (not yet packaged. But since this is a daemon it would be name vdsmd)
> > * spice-server (libspice-server1)
> > * libvirt (libvirt0)
> > 
> > I could write a translation list, but I consider this as a pretty dirty fix.
> 
> How do other packages in debian solve these issues?

I don't know. And I have no knowledge of any program that checks for package versions like vdsm does it. But I'll ask some people from the Debian directly, maybe they've got an idea.

Comment 3 Ayal Baron 2011-12-22 21:55:34 UTC
(In reply to comment #2)
> (In reply to comment #1)
> > Could be that it's bundled with qemu-kvm on debian.  qemu-img is a command line
> > tool that manipulates disk images.
> > it is used for creation of a disk image, conversion of disk images (raw ->
> > qcow2 and vice versa) creation of qcow2 files on top of backing files etc.
> 
> Found it. qemu-img is in the package qemu-utils
> 
> 
> > > * vdsm (not yet packaged. But since this is a daemon it would be name vdsmd)
> > > * spice-server (libspice-server1)
> > > * libvirt (libvirt0)
> > > 
> > > I could write a translation list, but I consider this as a pretty dirty fix.
> > 
> > How do other packages in debian solve these issues?
> 
> I don't know. And I have no knowledge of any program that checks for package
> versions like vdsm does it. But I'll ask some people from the Debian directly,
> maybe they've got an idea.

Great.  Once you get an answer, please post it here and put me on needinfo.
Thanks.

Comment 4 Matthias H 2011-12-23 12:58:33 UTC
(In reply to comment #3)
> Great.  Once you get an answer, please post it here and put me on needinfo.

Ok, I've asked around and nobody seems to have this problem before. At least I got a way to do solve this better than parsing the dpkg output. It was suggest to use python-apt with "except ImportError".

What I can do is to write a translation list that uses "static names".

Something like:

static name  | rpm          | deb              |
=============|==============|==================|
qemu-kvm     | qemu-kvm     | qemu-kvm         |
qemu-img     | qemu-img     | qemu-utils       |
vdsm         | vdsm         | vdsmd (sugg.)    |
spice-server | spice-server | libspice-server1 |
libvirt      | libvirt      | libvirt0         |

Luckily every static name equals the rpm package name, so the changes just have to be in the debian part.

Comment 5 Ayal Baron 2011-12-25 16:49:00 UTC
(In reply to comment #4)
> (In reply to comment #3)
> > Great.  Once you get an answer, please post it here and put me on needinfo.
> 
> Ok, I've asked around and nobody seems to have this problem before. At least I

That sounds odd as it looks like debian changes package names on a regular basis (5/5 above, but also see: http://enricozini.org/2011/debian/distromatch/)

> got a way to do solve this better than parsing the dpkg output. It was suggest
> to use python-apt with "except ImportError".
> 
> What I can do is to write a translation list that uses "static names".
> 
> Something like:
> 
> static name  | rpm          | deb              |
> =============|==============|==================|
> qemu-kvm     | qemu-kvm     | qemu-kvm         |
> qemu-img     | qemu-img     | qemu-utils       |
> vdsm         | vdsm         | vdsmd (sugg.)    |
> spice-server | spice-server | libspice-server1 |
> libvirt      | libvirt      | libvirt0         |
> 
> Luckily every static name equals the rpm package name, so the changes just have
> to be in the debian part.

This is a packaging issue so I think this should be dealt with in debian's build for vdsm.  Saggi, any input on this?

Comment 6 Matthias H 2012-01-05 10:46:23 UTC
(In reply to comment #5)
> That sounds odd as it looks like debian changes package names on a regular
> basis (5/5 above, but also see: http://enricozini.org/2011/debian/distromatch/)

It's not as bad, as it sounds. It's something that happens every few years, not on a daily or monthly basis.

And if the name of a package changes they can still apply a patch while packaging vdsm (and notify upstream).


> This is a packaging issue so I think this should be dealt with in debian's
> build for vdsm.  Saggi, any input on this?

Well, it would be possible to write a patch that does that within the package (as mentioned above). But I'd like to see a solution in vdsm.

Distromatch looks not like it should be used in a daemon. Another solution would be to search the dpkg database for a binary or library (e.g. qemu-img), but sometimes library names change, too and searching takes a lot of time.

So I'd suggest I write a patch and "translate" the package names, like I presented in my last comment. Because none of the package names have changed in the last years.

Comment 7 Matthias H 2012-01-17 13:59:07 UTC
Created attachment 555784 [details]
Second version of the patch for debian support

I developed the patch further. Comments appreciated!

Comment 8 Matthias H 2012-01-17 15:27:01 UTC
Here's the commit to gerrit: http://gerrit.ovirt.org/1110

Comment 9 Matthias H 2012-02-27 15:37:50 UTC
I'm sorry, but I've got no time to develop the debian support any further. The patch should do the trick for now.

Therefore I'm closing this bugreport.