After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 670994 - Make use of Libvirt.Domain.get_devices()
Make use of Libvirt.Domain.get_devices()
Status: RESOLVED FIXED
Product: gnome-boxes
Classification: Applications
Component: general
unspecified
Other All
: Normal normal
: --
Assigned To: GNOME Boxes maintainer(s)
GNOME Boxes maintainer(s)
Depends on:
Blocks: 664774
 
 
Reported: 2012-02-28 18:31 UTC by Zeeshan Ali
Modified: 2016-03-31 13:59 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Make use of Libvirt.Domain.get_devices() (3.24 KB, patch)
2012-02-28 18:31 UTC, Zeeshan Ali
none Details | Review
Make use of Libvirt.Domain.get_devices() (3.49 KB, patch)
2012-02-29 19:53 UTC, Zeeshan Ali
reviewed Details | Review
Make use of Libvirt.Domain.get_devices() (4.10 KB, patch)
2012-03-01 00:01 UTC, Zeeshan Ali
none Details | Review
Make use of Libvirt.Domain.get_devices() (5.31 KB, patch)
2012-03-01 21:40 UTC, Zeeshan Ali
none Details | Review
Make use of Libvirt.Domain.get_devices() (5.25 KB, patch)
2012-03-02 00:23 UTC, Zeeshan Ali
committed Details | Review

Description Zeeshan Ali 2012-02-28 18:31:28 UTC
This requires my yet-to-be-reviewed libvirt-glib patches.
Comment 1 Zeeshan Ali 2012-02-28 18:31:30 UTC
Created attachment 208619 [details] [review]
Make use of Libvirt.Domain.get_devices()
Comment 2 Zeeshan Ali 2012-02-29 19:53:36 UTC
Created attachment 208714 [details] [review]
Make use of Libvirt.Domain.get_devices()

Same patch, only that it ensures we are getting statistics for the correct disk.
Comment 3 Marc-Andre Lureau 2012-02-29 23:35:03 UTC
Review of attachment 208714 [details] [review]:

not really interested by this change at this point (it was working fine), but since you did it

::: src/libvirt-machine.vala
@@ +147,1 @@
             // FIXME: switch to domain.get_devices () and loop over all interfaces

ok to keep the FIXME, because we aren't yet stats'ing all the interfaces, but you could perhaps update it.

but why do you remove it for the other? it is a marker everywhere a related change is needed.

@@ +152,3 @@
+                    if (disk_type == GVirConfig.DomainDiskGuestDeviceType.DISK)
+                        break;
+                    else

the else isn't really necessary here
Comment 4 Zeeshan Ali 2012-02-29 23:47:56 UTC
(In reply to comment #3)
> Review of attachment 208714 [details] [review]:
> 
> not really interested by this change at this point (it was working fine), but
> since you did it

I mainly did this patch to test the new API/changes and because I'll be using this in bug#664774 in the same module.

> ::: src/libvirt-machine.vala
> @@ +147,1 @@
>              // FIXME: switch to domain.get_devices () and loop over all
> interfaces
> 
> ok to keep the FIXME, because we aren't yet stats'ing all the interfaces, but
> you could perhaps update it.

K

> but why do you remove it for the other? it is a marker everywhere a related
> change is needed.

You meant to write "why don't you"?

> @@ +152,3 @@
> +                    if (disk_type ==
> GVirConfig.DomainDiskGuestDeviceType.DISK)
> +                        break;
> +                    else
> 
> the else isn't really necessary here

the 'disk' variable is already set so it needs to be unset. Now that I think of it, its only needed on the last loop.
Comment 5 Zeeshan Ali 2012-03-01 00:01:22 UTC
Created attachment 208733 [details] [review]
Make use of Libvirt.Domain.get_devices()

This version attempts to address the issues pointed out in previous review and adds warning for the related errors.
Comment 6 Zeeshan Ali 2012-03-01 21:40:36 UTC
Created attachment 208819 [details] [review]
Make use of Libvirt.Domain.get_devices()

Refactored version that prefers Boxes' managed volume over other disks.
Comment 7 Zeeshan Ali 2012-03-02 00:23:03 UTC
Created attachment 208832 [details] [review]
Make use of Libvirt.Domain.get_devices()

Same but with some minor coding-style fixes.
Comment 8 Zeeshan Ali 2012-03-02 13:35:15 UTC
(In reply to comment #6)
> Created an attachment (id=208819) [details] [review]
> Make use of Libvirt.Domain.get_devices()
> 
> Refactored version that prefers Boxes' managed volume over other disks.

BTW, this is something the existing code doesn't do at all and since it shows statistics for the first disk in the config, there is no guarantees that the stats we get are for the main volume and not the floppy or cdrom disk..
Comment 9 Marc-Andre Lureau 2012-03-02 16:53:24 UTC
(In reply to comment #8)
> (In reply to comment #6)
> > Created an attachment (id=208819) [details] [review] [details] [review]
> > Make use of Libvirt.Domain.get_devices()
> > 
> > Refactored version that prefers Boxes' managed volume over other disks.
> 
> BTW, this is something the existing code doesn't do at all and since it shows
> statistics for the first disk in the config, there is no guarantees that the
> stats we get are for the main volume and not the floppy or cdrom disk..

Doing it over only the disk created by boxes is as bad, as it may not even work with VM created with say virt-manager, and we should be fully compatible with those.

Also, it should stats over all IO: all disks, all interfaces, ..
Comment 10 Zeeshan Ali 2012-03-03 01:42:53 UTC
(In reply to comment #9)
> (In reply to comment #8)
> > (In reply to comment #6)
> > > Created an attachment (id=208819) [details] [review] [details] [review] [details] [review]
> > > Make use of Libvirt.Domain.get_devices()
> > > 
> > > Refactored version that prefers Boxes' managed volume over other disks.
> > 
> > BTW, this is something the existing code doesn't do at all and since it shows
> > statistics for the first disk in the config, there is no guarantees that the
> > stats we get are for the main volume and not the floppy or cdrom disk..
> 
> Doing it over only the disk created by boxes is as bad, as it may not even work
> with VM created with say virt-manager, and we should be fully compatible with
> those.

Its not doing that. It only uses the boxes' created volume if there is one. I made sure of this.

> Also, it should stats over all IO: all disks, all interfaces, ..

Yeah, that could be another patch.
Comment 11 Zeeshan Ali 2012-03-03 02:58:50 UTC
Oh and I forgot to mention that I made sure to break the existing system totally against latest git master of libvirt-glib. :P
Comment 12 Marc-Andre Lureau 2012-03-03 17:24:58 UTC
(In reply to comment #10)

> Its not doing that. It only uses the boxes' created volume if there is one. I
> made sure of this.

Can you make sure it also works with VM created with virt-manager? It used to work.
Comment 13 Marc-Andre Lureau 2012-03-03 17:27:15 UTC
Review of attachment 208832 [details] [review]:

it seems to work as well as before with virt-manager vm, so ack, since I can't spot regressions.
Comment 14 Zeeshan Ali 2012-03-03 17:37:47 UTC
Attachment 208832 [details] pushed as 02040fc - Make use of Libvirt.Domain.get_devices()