Re: [libvirt] Availability of libvirt-4.6.0 Release Candidate 2

2018-08-05 Thread John Ferlan



On 08/01/2018 06:47 AM, Peter Krempa wrote:
> On Wed, Aug 01, 2018 at 12:40:14 +0200, Michal Privoznik wrote:
>> On 07/31/2018 07:19 PM, Ján Tomko wrote:
>>> And I'm still unsure about leaving in
>>> commit 55ce65646348884656fd7bf3f109ebf8f7603494
>>>    qemu: Use the correct vm def on cold attach
>>> https://libvirt.org/git/?p=libvirt.git;a=commitdiff;h=55ce6564634
>>> Which means attach-device --live --config will attach an interface
>>> with a different MAC address in live and persistent definition. Laine?
>>>
>>
>> Well, It's not only MAC address that can change. The device address
>> might change too. This points to a broader problem. When we are parsing
>> a device XML we fill in the blanks in postParse callbacks. However,
>> those look only at either live or at inactive XML. Not at both at the
>> same time. So how can we fill in the blanks that would be valid for both
>> XMLs?
> 
> We can fill in the definition and then copy it and validate it
> afterwards. That way the blanks are filled and we can then validate that
> it fits into the other definition. The description here sounds that in
> this release we made things worse than it was before though.
> 
> 
Like I said in response to Jano's note after the push:

https://www.redhat.com/archives/libvir-list/2018-July/msg01736.html

if the patch is reverted that's fine.

The referenced bz is for someone that doesn't define an  for a
 or  (I would think a common occurrence) and the counter
concern is for someone that doesn't supply a  for an  (a
perhaps less common, but equally concerning condition). In one instance
(duplicated ) the subsequent guest boot fails. In other other
instance (difference ) the subsequent guest boot has a different
mac. In both instances the  could be different and most likely
will be. The docs are not precise on what happens when adding a  to
both --live and --config. The network docs indicate to allow libvirt to
generate the mac to "assure that it is compatible with the
idiosyncrasies of the platform where libvirt is running".

Whether someone uses --config or --live or --config and --live it's
perhaps very difficult to impossible to be able to provide a solution
that will make "everyone" happy. To say we can "copy" from one or the
other I would think is problematic since who's to say which is "more
correct" once the guest is running. Someone could add 4 devices to
--config, then 2 to --live, and then decide to add 1 to both - if they
don't supply specific addresses, then IIRC even before this patch it's
not possible to "match" the two.

Having to have  code look through @def and @newDef to find an
unused address that could be used for both could be a challenging
algorithm especially since SCSI 's and 's can live on the
same adapter. Furthermore, SCSI 's have this preference related to
the @dst target name that really could get complicated with looking at
both live and config. Perhaps this just becomes one of those "hypervisor
defined" activities (regardless of whether the patch is removed or not)
and we just move on.

John

[hopefully this makes it to the list - given the unreliability to
receive libvir-list traffic over the last 24 hours here at Red Hat /-|]

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [libvirt] Availability of libvirt-4.6.0 Release Candidate 2

2018-08-05 Thread Daniel P . Berrangé
On Wed, Aug 01, 2018 at 01:10:08PM +0100, Daniel P. Berrangé wrote:
> On Wed, Aug 01, 2018 at 01:41:48PM +0200, Bjoern Walk wrote:
> > Daniel P. Berrangé  [2018-08-01, 11:51AM +0100]:
> > > On Tue, Jul 31, 2018 at 03:54:43PM +0200, Bjoern Walk wrote:
> > > > Bjoern Walk  [2018-07-31, 03:16PM +0200]:
> > > > > I have not yet had the time to figure out what goes wrong, any ideas 
> > > > > are welcome.
> > > > 
> > > > Ah, classic. The mocked virRandomBytes function is not endian-agnostic,
> > > > generating a different interface name as expected by the test.
> > > 
> > > I'm not seeing why virRandomBytes is affected by endian-ness. It is simply
> > > populating an array of bytes, so there's no endin issues to consider 
> > > there.
> > 
> > Ahem, we are writing linearly to a byte array, of course this is
> > dependend on the endianness of the architecture. The actual problem is
> > that the mocked version does _not_ provide a random value, but a
> > deterministic one, which is byte order reversed on big endianness.
> 
> There's no concept of reversed byte order when you're accessing an
> array of bytes.  If you write elements 0, 1, 2, ...7, etc and then
> the caller reads elements 0, 1,2, ..., 7 everything is fine.
> 
> Endianness only comes into play if you take that array of bytes
> and then cast/assign it to a larger type were endianess is
> relevant (eg int16/int32/int64)
> 
> eg
> 
>char bytes[8];
> 
>virRandomBytes(bytes, 8);
> 
>uint64_t val = (uint64_t)bytes;
> 
> the problem in such a case isn't virRandomBytes, it is the cast
> to the larger sized integer type.
> 
> > > Can you elaborate on the actual error messages you are getting from the
> > > tests, and what aspect makes you think virRandomBytes is the problem ?
> > 
> > The name of the interface is wrong compared to what is explicitly
> > expected in the test case:
> > 
> > 200 if (virAsprintf(_ifacename,
> > (gdb)
> > 205 VIR_DEBUG("Attempting to create interface '%s' with IQN '%s'",
> > (gdb) p temp_ifacename
> > $1 = 0x1014320 "libvirt-iface-04050607"
> > 
> > > Seems more likely that it is something higher up the call stack.
> 
> That looks like it uses virRandomBits rather than virRandomBytes.

Yes, it is virRandomBits that is the problem - it is taking a uint64_t
variable and casting it to a "unsigned char *", which is not an
endian safe thing todo.

We need to rewrite virRandomBits to do

   char val[8];

   virRandomBytes(val, sizeof(val));

   uint64_t ret =
  val[0] |
  ((uint64_t)val[1]) << 8 |
  ((uint64_t)val[2]) << 16 |
  ((uint64_t)val[3]) << 24 |
  ((uint64_t)val[4]) << 32 |
  ((uint64_t)val[5]) << 40 |
  ((uint64_t)val[6]) << 48 |
  ((uint64_t)val[7]) << 56 |

   return ret & ((1ULL << nbits) -1);

to make it endiansafe.

Regards,
Daniel
-- 
|: https://berrange.com  -o-https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o-https://fstop138.berrange.com :|
|: https://entangle-photo.org-o-https://www.instagram.com/dberrange :|

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] Availability of libvirt-4.6.0 Release Candidate 2

2018-08-05 Thread Daniel P . Berrangé
On Wed, Aug 01, 2018 at 01:41:48PM +0200, Bjoern Walk wrote:
> Daniel P. Berrangé  [2018-08-01, 11:51AM +0100]:
> > On Tue, Jul 31, 2018 at 03:54:43PM +0200, Bjoern Walk wrote:
> > > Bjoern Walk  [2018-07-31, 03:16PM +0200]:
> > > > I have not yet had the time to figure out what goes wrong, any ideas 
> > > > are welcome.
> > > 
> > > Ah, classic. The mocked virRandomBytes function is not endian-agnostic,
> > > generating a different interface name as expected by the test.
> > 
> > I'm not seeing why virRandomBytes is affected by endian-ness. It is simply
> > populating an array of bytes, so there's no endin issues to consider there.
> 
> Ahem, we are writing linearly to a byte array, of course this is
> dependend on the endianness of the architecture. The actual problem is
> that the mocked version does _not_ provide a random value, but a
> deterministic one, which is byte order reversed on big endianness.

There's no concept of reversed byte order when you're accessing an
array of bytes.  If you write elements 0, 1, 2, ...7, etc and then
the caller reads elements 0, 1,2, ..., 7 everything is fine.

Endianness only comes into play if you take that array of bytes
and then cast/assign it to a larger type were endianess is
relevant (eg int16/int32/int64)

eg

   char bytes[8];

   virRandomBytes(bytes, 8);

   uint64_t val = (uint64_t)bytes;

the problem in such a case isn't virRandomBytes, it is the cast
to the larger sized integer type.

> > Can you elaborate on the actual error messages you are getting from the
> > tests, and what aspect makes you think virRandomBytes is the problem ?
> 
> The name of the interface is wrong compared to what is explicitly
> expected in the test case:
> 
> 200 if (virAsprintf(_ifacename,
> (gdb)
> 205 VIR_DEBUG("Attempting to create interface '%s' with IQN '%s'",
> (gdb) p temp_ifacename
> $1 = 0x1014320 "libvirt-iface-04050607"
> 
> > Seems more likely that it is something higher up the call stack.

That looks like it uses virRandomBits rather than virRandomBytes.


Regards,
Daniel
-- 
|: https://berrange.com  -o-https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o-https://fstop138.berrange.com :|
|: https://entangle-photo.org-o-https://www.instagram.com/dberrange :|

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] Availability of libvirt-4.6.0 Release Candidate 2

2018-08-05 Thread Bjoern Walk
Daniel P. Berrangé  [2018-08-01, 11:51AM +0100]:
> On Tue, Jul 31, 2018 at 03:54:43PM +0200, Bjoern Walk wrote:
> > Bjoern Walk  [2018-07-31, 03:16PM +0200]:
> > > I have not yet had the time to figure out what goes wrong, any ideas are 
> > > welcome.
> > 
> > Ah, classic. The mocked virRandomBytes function is not endian-agnostic,
> > generating a different interface name as expected by the test.
> 
> I'm not seeing why virRandomBytes is affected by endian-ness. It is simply
> populating an array of bytes, so there's no endin issues to consider there.

Ahem, we are writing linearly to a byte array, of course this is
dependend on the endianness of the architecture. The actual problem is
that the mocked version does _not_ provide a random value, but a
deterministic one, which is byte order reversed on big endianness.

> Can you elaborate on the actual error messages you are getting from the
> tests, and what aspect makes you think virRandomBytes is the problem ?

The name of the interface is wrong compared to what is explicitly
expected in the test case:

200 if (virAsprintf(_ifacename,
(gdb)
205 VIR_DEBUG("Attempting to create interface '%s' with IQN '%s'",
(gdb) p temp_ifacename
$1 = 0x1014320 "libvirt-iface-04050607"

> Seems more likely that it is something higher up the call stack.

Everything else looks fine.

> 
> Regards,
> Daniel

Best,
Bjoern


signature.asc
Description: PGP signature
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] Availability of libvirt-4.6.0 Release Candidate 2

2018-08-05 Thread Michal Privoznik
On 07/31/2018 07:19 PM, Ján Tomko wrote:
> And I'm still unsure about leaving in
> commit 55ce65646348884656fd7bf3f109ebf8f7603494
>    qemu: Use the correct vm def on cold attach
> https://libvirt.org/git/?p=libvirt.git;a=commitdiff;h=55ce6564634
> Which means attach-device --live --config will attach an interface
> with a different MAC address in live and persistent definition. Laine?
> 

Well, It's not only MAC address that can change. The device address
might change too. This points to a broader problem. When we are parsing
a device XML we fill in the blanks in postParse callbacks. However,
those look only at either live or at inactive XML. Not at both at the
same time. So how can we fill in the blanks that would be valid for both
XMLs?

Michal

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [libvirt] Availability of libvirt-4.6.0 Release Candidate 2

2018-08-02 Thread John Ferlan



On 08/02/2018 03:57 AM, Peter Krempa wrote:
> On Wed, Aug 01, 2018 at 17:44:56 -0400, John Ferlan wrote:
>> On 08/01/2018 04:44 PM, Laine Stump wrote:
> 
> [...]
> 
>>> At any rate, there is no perfect solution in sight for the current
>>> release, so the question is whether the new (bad) behavior is better or
>>> worse than the old (also bad) behavior. My understanding is that the old
>>> behavior could lead to a config that had two devices at the same PCI
>>> address, which is definitely undesirable. The new behavior could lead to
>>> the PCI address of a newly-added device being different the next time
>>> the guest is shutdown and restarted. I would tend to prefer the latter,
>>> with the caveat that this new behavior provides a config that works
>>> (from libvirt's domain parsing POV), but might create a strange error in
>>> the guest that would be extremely difficult to troubleshoot (especially
>>> 6 months from now after we've all forgotten about this patch (and
>>> forgotten about the idea that a more complete fix was needed).
>>>
>>> So I'm undecided about my opinion. And when undecided I tend toward
>>> inaction. Now *that's* helpful, isn't it?
>>>
>>
>> Laine is stumped ;-).
>>
>> I'm still stumped over what strange error could be created. How is the
>> virtual {PCI|SCSI} address changing any different from "real hardware"
>> if someone adds something new into their physical system? Or the other
> 
> Well, the issue is that you issue an API to add the device, which in
> real life would translate into plugging it into the machine.
> 
> Afterwards you turn the machine off and back on. Without any API (or
> physical contact) you expect that the hardware will not move places by
> itself.

If you chose the address yourself, then it wouldn't change. IOW: If I
physically plugged into a specific spot, then no change.

But in this case, the consumer said, I don't care, choose one for me and
we did. If the consumer said LIVE and CONFIG every time, then I'd
venture to guess/assume since the algorithm is the same that the
resulting libvirt chosen address would be the same.

The problem comes when the same customer chooses CONFIG (or LIVE) at
least once before choosing CONFIG & LIVE in a followup.

> 
> If the API call includes both AFFECT_LIVE and AFFECT_CONFIG we should
> make sure that the device plugged in is exactly the same. If they are
> issued separately we don't care at all though.
> 
> Btw, having this analogy, specifying only AFFECT_CONFIG is probably
> similar to putting a post-it note on top of the power button for the
> next person to attach the hardware prior to powering it up.
> 

Given the same physical situation of leaving a post-it note to plug this
thing in later into slot 3, but someone comes after the note is written
but before the power button is pressed and plugs something else into
slot 3 because it was just "next", then when it comes time to act upon
the post-it note where does said person plug this into since slot 3 is
taken?  Do they unplug whatever was plugged into slot 3, plug the
post-it note thing into slot 3 and then plug the other thing into slot 4
or do they just plug the post-it note device into slot 4.  I'd say it's
a coin flip and no worse than what we'd be doing. Conversely, if that
person plugging in live read the note and then chose slot 4, then when
it comes time to act upon the post-it note to plug at slot 3, everyone
is happy.  Of course in this case, we had a human deciding to "assign"
the addresses to specific devices or in XML terms provide the 
to assign the device rather than deciding upon the next available slot.

John

> 
>> fun adventure, a physical move from location A to location B where
>> someone "forgot" to properly label what went where and upon reassembly
>> things are ordered differently.
>>
>> Consider some (perhaps not so) long ago SCSI devices where you'd need to
>> grab a small, sharp, pin like object to toggle switches to define the
>> address for the device when it got plugged in.
> 
> Note that in that era it would be very bad in some cases when the
> hardware would change the jumper configuration by itself as sometimes
> the drivers could not autoconfigure. The addresses were put in config
> files.
> 

Still trying to picture how "hardware would change the jumper
configuration by itself" without any human interaction. Those toggle
switches and connectors were a pain to deal with if you didn't have the
right tools. If only the hardware would have done it by itself, then we
wouldn't need the jumpers or toggle switches.

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [libvirt] Availability of libvirt-4.6.0 Release Candidate 2

2018-08-02 Thread Peter Krempa
On Wed, Aug 01, 2018 at 17:44:56 -0400, John Ferlan wrote:
> On 08/01/2018 04:44 PM, Laine Stump wrote:

[...]

> > At any rate, there is no perfect solution in sight for the current
> > release, so the question is whether the new (bad) behavior is better or
> > worse than the old (also bad) behavior. My understanding is that the old
> > behavior could lead to a config that had two devices at the same PCI
> > address, which is definitely undesirable. The new behavior could lead to
> > the PCI address of a newly-added device being different the next time
> > the guest is shutdown and restarted. I would tend to prefer the latter,
> > with the caveat that this new behavior provides a config that works
> > (from libvirt's domain parsing POV), but might create a strange error in
> > the guest that would be extremely difficult to troubleshoot (especially
> > 6 months from now after we've all forgotten about this patch (and
> > forgotten about the idea that a more complete fix was needed).
> > 
> > So I'm undecided about my opinion. And when undecided I tend toward
> > inaction. Now *that's* helpful, isn't it?
> > 
> 
> Laine is stumped ;-).
> 
> I'm still stumped over what strange error could be created. How is the
> virtual {PCI|SCSI} address changing any different from "real hardware"
> if someone adds something new into their physical system? Or the other

Well, the issue is that you issue an API to add the device, which in
real life would translate into plugging it into the machine.

Afterwards you turn the machine off and back on. Without any API (or
physical contact) you expect that the hardware will not move places by
itself.

If the API call includes both AFFECT_LIVE and AFFECT_CONFIG we should
make sure that the device plugged in is exactly the same. If they are
issued separately we don't care at all though.

Btw, having this analogy, specifying only AFFECT_CONFIG is probably
similar to putting a post-it note on top of the power button for the
next person to attach the hardware prior to powering it up.


> fun adventure, a physical move from location A to location B where
> someone "forgot" to properly label what went where and upon reassembly
> things are ordered differently.
> 
> Consider some (perhaps not so) long ago SCSI devices where you'd need to
> grab a small, sharp, pin like object to toggle switches to define the
> address for the device when it got plugged in.

Note that in that era it would be very bad in some cases when the
hardware would change the jumper configuration by itself as sometimes
the drivers could not autoconfigure. The addresses were put in config
files.


signature.asc
Description: PGP signature
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] Availability of libvirt-4.6.0 Release Candidate 2

2018-08-01 Thread John Ferlan


On 08/01/2018 04:44 PM, Laine Stump wrote:
> (Let's see now which people were the ones who believe it's a huge
> insult to Cc them in list replies, and which are the ones who appreciate
> the Cc and use it as a flag to raise the visibility of the message in
> their mail client . ?. Ah, I give up, just leaving in the Cc's
> and let the complaints fly)(For the record, I like explicit Cc's when
> you want to make sure I see something - that sends a copy to my phone,
> which can be mildly annoying if it's a series of 40 patches, but also
> very effective in getting my attention :-P)
> 
> On 08/01/2018 06:40 AM, Michal Privoznik wrote:
>> On 07/31/2018 07:19 PM, Ján Tomko wrote:
>>> And I'm still unsure about leaving in
>>> commit 55ce65646348884656fd7bf3f109ebf8f7603494
>>>    qemu: Use the correct vm def on cold attach
>>> https://libvirt.org/git/?p=libvirt.git;a=commitdiff;h=55ce6564634
>>> Which means attach-device --live --config will attach an interface
>>> with a different MAC address in live and persistent definition. Laine?
> 
> (Let's see, you said my name once in the Cc, and once here. You really
> need to say it *three* times to get my attention ala Beetlejuice or
> Biggy Smalls. (and it helps to recite it into a mirror in a dark room,
> apparently)).
> 
>>>
>> Well, It's not only MAC address that can change. The device address
>> might change too. This points to a broader problem. When we are parsing
>> a device XML we fill in the blanks in postParse callbacks. However,
>> those look only at either live or at inactive XML. Not at both at the
>> same time. So how can we fill in the blanks that would be valid for both
>> XMLs?
> 
> Yeah, this has been a problem for a long time (it's also problematic
> for, e.g. the index of PCI controllers, which can cascade into
> differences in the PCI addresses of devices that are connected to those
> controllers; similar problem for other types of controllers of course).
> I think I even tried fixing it once, but the solution was inadequate.
> 
> The problem comes when someone uses a mixture of --live only, --config
> only, and --live+--config device attaches/detaches. At the base of the
> problem is the fact that the live and config domaindef objects are
> stored completely independent of each other, and the code that assigns
> PCI addresses "seeds" the list of in-use address from a single domaindef
> object. Perhaps we need to merge these into a single object where each
> device is marked as "live", "config" or "both" - then any new device
> added would be guaranteed to not conflict with any existing device in
> live or config - the unified device list would be used to determine what
> addresses are used, and the new device would just be added once to one
> domaindef object (just with live and config flags set) so there would be
> no need to copy it.
> 
> Or, well..., after about 30 seconds of thought I realize this would lead
> to different behavior if someone e.g. deleted a currently-active device
> only from the config, then wanted to add that same device back again -
> the re-added device would end up with a different PCI address. So maybe
> that isn't the right solution either.
> 
> At any rate, there is no perfect solution in sight for the current
> release, so the question is whether the new (bad) behavior is better or
> worse than the old (also bad) behavior. My understanding is that the old
> behavior could lead to a config that had two devices at the same PCI
> address, which is definitely undesirable. The new behavior could lead to
> the PCI address of a newly-added device being different the next time
> the guest is shutdown and restarted. I would tend to prefer the latter,
> with the caveat that this new behavior provides a config that works
> (from libvirt's domain parsing POV), but might create a strange error in
> the guest that would be extremely difficult to troubleshoot (especially
> 6 months from now after we've all forgotten about this patch (and
> forgotten about the idea that a more complete fix was needed).
> 
> So I'm undecided about my opinion. And when undecided I tend toward
> inaction. Now *that's* helpful, isn't it?
> 

Laine is stumped ;-).

I'm still stumped over what strange error could be created. How is the
virtual {PCI|SCSI} address changing any different from "real hardware"
if someone adds something new into their physical system? Or the other
fun adventure, a physical move from location A to location B where
someone "forgot" to properly label what went where and upon reassembly
things are ordered differently.

Consider some (perhaps not so) long ago SCSI devices where you'd need to
grab a small, sharp, pin like object to toggle switches to define the
address for the device when it got plugged in. That means the user had
to guess and figure out what address to use. Good luck if you conflicted
with something else. After some time it was also difficult to tell which
end was the low address toggle/bits.

Still, 

Re: [libvirt] Availability of libvirt-4.6.0 Release Candidate 2

2018-08-01 Thread Laine Stump
(Let's see now which people were the ones who believe it's a huge
insult to Cc them in list replies, and which are the ones who appreciate
the Cc and use it as a flag to raise the visibility of the message in
their mail client . ?. Ah, I give up, just leaving in the Cc's
and let the complaints fly)(For the record, I like explicit Cc's when
you want to make sure I see something - that sends a copy to my phone,
which can be mildly annoying if it's a series of 40 patches, but also
very effective in getting my attention :-P)

On 08/01/2018 06:40 AM, Michal Privoznik wrote:
> On 07/31/2018 07:19 PM, Ján Tomko wrote:
>> And I'm still unsure about leaving in
>> commit 55ce65646348884656fd7bf3f109ebf8f7603494
>>    qemu: Use the correct vm def on cold attach
>> https://libvirt.org/git/?p=libvirt.git;a=commitdiff;h=55ce6564634
>> Which means attach-device --live --config will attach an interface
>> with a different MAC address in live and persistent definition. Laine?

(Let's see, you said my name once in the Cc, and once here. You really
need to say it *three* times to get my attention ala Beetlejuice or
Biggy Smalls. (and it helps to recite it into a mirror in a dark room,
apparently)).

>>
> Well, It's not only MAC address that can change. The device address
> might change too. This points to a broader problem. When we are parsing
> a device XML we fill in the blanks in postParse callbacks. However,
> those look only at either live or at inactive XML. Not at both at the
> same time. So how can we fill in the blanks that would be valid for both
> XMLs?

Yeah, this has been a problem for a long time (it's also problematic
for, e.g. the index of PCI controllers, which can cascade into
differences in the PCI addresses of devices that are connected to those
controllers; similar problem for other types of controllers of course).
I think I even tried fixing it once, but the solution was inadequate.

The problem comes when someone uses a mixture of --live only, --config
only, and --live+--config device attaches/detaches. At the base of the
problem is the fact that the live and config domaindef objects are
stored completely independent of each other, and the code that assigns
PCI addresses "seeds" the list of in-use address from a single domaindef
object. Perhaps we need to merge these into a single object where each
device is marked as "live", "config" or "both" - then any new device
added would be guaranteed to not conflict with any existing device in
live or config - the unified device list would be used to determine what
addresses are used, and the new device would just be added once to one
domaindef object (just with live and config flags set) so there would be
no need to copy it.

Or, well..., after about 30 seconds of thought I realize this would lead
to different behavior if someone e.g. deleted a currently-active device
only from the config, then wanted to add that same device back again -
the re-added device would end up with a different PCI address. So maybe
that isn't the right solution either.

At any rate, there is no perfect solution in sight for the current
release, so the question is whether the new (bad) behavior is better or
worse than the old (also bad) behavior. My understanding is that the old
behavior could lead to a config that had two devices at the same PCI
address, which is definitely undesirable. The new behavior could lead to
the PCI address of a newly-added device being different the next time
the guest is shutdown and restarted. I would tend to prefer the latter,
with the caveat that this new behavior provides a config that works
(from libvirt's domain parsing POV), but might create a strange error in
the guest that would be extremely difficult to troubleshoot (especially
6 months from now after we've all forgotten about this patch (and
forgotten about the idea that a more complete fix was needed).

So I'm undecided about my opinion. And when undecided I tend toward
inaction. Now *that's* helpful, isn't it?

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] Availability of libvirt-4.6.0 Release Candidate 2

2018-08-01 Thread Michal Prívozník
On 08/01/2018 12:47 PM, Peter Krempa wrote:
> On Wed, Aug 01, 2018 at 12:40:14 +0200, Michal Privoznik wrote:
>> On 07/31/2018 07:19 PM, Ján Tomko wrote:
>>> And I'm still unsure about leaving in
>>> commit 55ce65646348884656fd7bf3f109ebf8f7603494
>>>    qemu: Use the correct vm def on cold attach
>>> https://libvirt.org/git/?p=libvirt.git;a=commitdiff;h=55ce6564634
>>> Which means attach-device --live --config will attach an interface
>>> with a different MAC address in live and persistent definition. Laine?
>>>
>>
>> Well, It's not only MAC address that can change. The device address
>> might change too. This points to a broader problem. When we are parsing
>> a device XML we fill in the blanks in postParse callbacks. However,
>> those look only at either live or at inactive XML. Not at both at the
>> same time. So how can we fill in the blanks that would be valid for both
>> XMLs?
> 
> We can fill in the definition and then copy it and validate it
> afterwards. That way the blanks are filled and we can then validate that
> it fits into the other definition. The description here sounds that in
> this release we made things worse than it was before though.

But that might fail. For instance, we generate a PCI for a hot plugged
device based on say live XML, but the address is already taken in config
XML. I'm not sure if there's an easy way out of this.

And regarding the revert - I guess it's just a matter of somebody
posting the patch.

Michal

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [libvirt] Availability of libvirt-4.6.0 Release Candidate 2

2018-08-01 Thread Daniel P . Berrangé
On Tue, Jul 31, 2018 at 03:54:43PM +0200, Bjoern Walk wrote:
> Bjoern Walk  [2018-07-31, 03:16PM +0200]:
> > I have not yet had the time to figure out what goes wrong, any ideas are 
> > welcome.
> 
> Ah, classic. The mocked virRandomBytes function is not endian-agnostic,
> generating a different interface name as expected by the test.

I'm not seeing why virRandomBytes is affected by endian-ness. It is simply
populating an array of bytes, so there's no endin issues to consider there.

Can you elaborate on the actual error messages you are getting from the
tests, and what aspect makes you think virRandomBytes is the problem ?

Seems more likely that it is something higher up the call stack.

Regards,
Daniel
-- 
|: https://berrange.com  -o-https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o-https://fstop138.berrange.com :|
|: https://entangle-photo.org-o-https://www.instagram.com/dberrange :|

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [libvirt] Availability of libvirt-4.6.0 Release Candidate 2

2018-08-01 Thread Peter Krempa
On Wed, Aug 01, 2018 at 12:40:14 +0200, Michal Privoznik wrote:
> On 07/31/2018 07:19 PM, Ján Tomko wrote:
> > And I'm still unsure about leaving in
> > commit 55ce65646348884656fd7bf3f109ebf8f7603494
> >    qemu: Use the correct vm def on cold attach
> > https://libvirt.org/git/?p=libvirt.git;a=commitdiff;h=55ce6564634
> > Which means attach-device --live --config will attach an interface
> > with a different MAC address in live and persistent definition. Laine?
> > 
> 
> Well, It's not only MAC address that can change. The device address
> might change too. This points to a broader problem. When we are parsing
> a device XML we fill in the blanks in postParse callbacks. However,
> those look only at either live or at inactive XML. Not at both at the
> same time. So how can we fill in the blanks that would be valid for both
> XMLs?

We can fill in the definition and then copy it and validate it
afterwards. That way the blanks are filled and we can then validate that
it fits into the other definition. The description here sounds that in
this release we made things worse than it was before though.


signature.asc
Description: PGP signature
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] Availability of libvirt-4.6.0 Release Candidate 2

2018-08-01 Thread Peter Krempa
On Tue, Jul 31, 2018 at 19:19:33 +0200, Ján Tomko wrote:
> On Tue, Jul 31, 2018 at 12:19:28PM +0800, Daniel Veillard wrote:
> >   It is out, tagged in git and with signed tarball and rpms at the
> > usual place:
> > 
> >   ftp://libvirt.org/libvirt/
> > 
> > in my limited testing it works but we have that pending issue
> > raised by Andrea. worse case someone reverse the patches and
> > allows to build against the old lib.
> > 
> > Please give it some testing, I will watch the commits and
> > if there isn't any solution 2 days from now I will postpone the
> > GA by a couple of days. Hopefully that won't be needed :-)
> > 
> 
> Since commit 50edca1331298bfcb2622e8fe588d493aff9ab68
>qemu: monitor: Add the 'query-nodes' argument for query-blockstats
> https://libvirt.org/git/?p=libvirt.git;a=commitdiff;h=50edca133129
> 
> 'virsh domblkstat' shows nothing for me with QEMU 2.9.0 (works with
> v3.0.0-rc0-66-gccf02d73d1)

This is probably a red herring. The 'B' modifier used in the patch does
not put the argument unless it's true to the monitor.

I traced the problem to a bug in commit 8d9ca6cdb3a58414 where I've
changed 'nstats' to a pointer but did not fix the usage in the macro
which gathers the stats. This means that the expanded code was
incrementing the pointer which was not dereferenced aferwards rather
than the value itself.

I'll post a patch soon.


signature.asc
Description: PGP signature
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] Availability of libvirt-4.6.0 Release Candidate 2

2018-07-31 Thread Ján Tomko

On Tue, Jul 31, 2018 at 12:19:28PM +0800, Daniel Veillard wrote:

  It is out, tagged in git and with signed tarball and rpms at the
usual place:

  ftp://libvirt.org/libvirt/

in my limited testing it works but we have that pending issue
raised by Andrea. worse case someone reverse the patches and
allows to build against the old lib.

Please give it some testing, I will watch the commits and
if there isn't any solution 2 days from now I will postpone the
GA by a couple of days. Hopefully that won't be needed :-)



Since commit 50edca1331298bfcb2622e8fe588d493aff9ab68
   qemu: monitor: Add the 'query-nodes' argument for query-blockstats
https://libvirt.org/git/?p=libvirt.git;a=commitdiff;h=50edca133129

'virsh domblkstat' shows nothing for me with QEMU 2.9.0 (works with
v3.0.0-rc0-66-gccf02d73d1)

And I'm still unsure about leaving in
commit 55ce65646348884656fd7bf3f109ebf8f7603494
   qemu: Use the correct vm def on cold attach
https://libvirt.org/git/?p=libvirt.git;a=commitdiff;h=55ce6564634
Which means attach-device --live --config will attach an interface
with a different MAC address in live and persistent definition. Laine?

Jano


 thanks in advance,

Daniel

--
Daniel Veillard  | Red Hat Developers Tools http://developer.redhat.com/
veill...@redhat.com  | libxml Gnome XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | virtualization library  http://libvirt.org/

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


signature.asc
Description: Digital signature
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] Availability of libvirt-4.6.0 Release Candidate 2

2018-07-31 Thread Bjoern Walk
Michal Privoznik  [2018-07-31, 04:10PM +0200]:
> On 07/31/2018 03:54 PM, Bjoern Walk wrote:
> > Bjoern Walk  [2018-07-31, 03:16PM +0200]:
> >> I have not yet had the time to figure out what goes wrong, any ideas are 
> >> welcome.
> > 
> > Ah, classic. The mocked virRandomBytes function is not endian-agnostic,
> > generating a different interface name as expected by the test.
> > 
> 
> Ugrh. Are you working on a fix or should I give it a try?

I didn't find a quick solution and can probably only only work on this
tomorrow, so depending on the time frame for the relase, if you find a
fix, go for it.

> 
> Michal
> 
> --
> libvir-list mailing list
> libvir-list@redhat.com
> https://www.redhat.com/mailman/listinfo/libvir-list
> 

-- 
IBM Systems
Linux on Z & Virtualization Development

IBM Deutschland Research & Development GmbH
Schönaicher Str. 220, 71032 Böblingen
Phone: +49 7031 16 1819

Vorsitzende des Aufsichtsrats: Martina Koederitz
Geschäftsführung: Dirk Wittkopp
Sitz der Gesellschaft: Böblingen
Registergericht: Amtsgericht Stuttgart, HRB 243294 


signature.asc
Description: PGP signature
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] Availability of libvirt-4.6.0 Release Candidate 2

2018-07-31 Thread Michal Privoznik
On 07/31/2018 03:54 PM, Bjoern Walk wrote:
> Bjoern Walk  [2018-07-31, 03:16PM +0200]:
>> I have not yet had the time to figure out what goes wrong, any ideas are 
>> welcome.
> 
> Ah, classic. The mocked virRandomBytes function is not endian-agnostic,
> generating a different interface name as expected by the test.
> 

Ugrh. Are you working on a fix or should I give it a try?

Michal

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [libvirt] Availability of libvirt-4.6.0 Release Candidate 2

2018-07-31 Thread Bjoern Walk
Bjoern Walk  [2018-07-31, 03:16PM +0200]:
> I have not yet had the time to figure out what goes wrong, any ideas are 
> welcome.

Ah, classic. The mocked virRandomBytes function is not endian-agnostic,
generating a different interface name as expected by the test.

Bjoern

-- 
IBM Systems
Linux on Z & Virtualization Development

IBM Deutschland Research & Development GmbH
Schönaicher Str. 220, 71032 Böblingen
Phone: +49 7031 16 1819

Vorsitzende des Aufsichtsrats: Martina Koederitz
Geschäftsführung: Dirk Wittkopp
Sitz der Gesellschaft: Böblingen
Registergericht: Amtsgericht Stuttgart, HRB 243294 


signature.asc
Description: PGP signature
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] Availability of libvirt-4.6.0 Release Candidate 2

2018-07-31 Thread Bjoern Walk
Bjoern Walk  [2018-07-31, 02:21PM +0200]:
> Daniel Veillard  [2018-07-31, 12:19PM +0800]:
> >It is out, tagged in git and with signed tarball and rpms at the
> > usual place:
> > 
> >ftp://libvirt.org/libvirt/
> > 
> >  in my limited testing it works but we have that pending issue
> > raised by Andrea. worse case someone reverse the patches and
> > allows to build against the old lib.
> > 
> >  Please give it some testing, I will watch the commits and
> > if there isn't any solution 2 days from now I will postpone the
> > GA by a couple of days. Hopefully that won't be needed :-)
> > 
> >   thanks in advance,
> > 
> > Daniel
> > 
> > -- 
> > Daniel Veillard  | Red Hat Developers Tools http://developer.redhat.com/
> > veill...@redhat.com  | libxml Gnome XML XSLT toolkit  http://xmlsoft.org/
> > http://veillard.com/ | virtualization library  http://libvirt.org/
> > 
> > --
> > libvir-list mailing list
> > libvir-list@redhat.com
> > https://www.redhat.com/mailman/listinfo/libvir-list
> > 
> 
> We have a test failure for the viriscsitest on s390x. I have not found
> out the reason but bisect showed this commit:
> 

Woops, my bisect-foo was off in the heat. This is the bad commit:

149f0c4e00f738a0a444325db9e2e81979256d65 is the first bad commit
commit 149f0c4e00f738a0a444325db9e2e81979256d65
Author: Michal Privoznik 
Date:   Wed Jul 4 10:41:54 2018 +0200

viriscsitest: Extend virISCSIConnectionLogin test

Extend this existing test so that a case when IQN is provided is
tested too. Since a special iSCSI interface is created and its
name is randomly generated at runtime we need to link with
virrandommock to have predictable names.

Signed-off-by: Michal Privoznik 
Reviewed-by: John Ferlan 

:04 04 ad6c77fb880d4b1bbbaac1ab2cd42c1ef4012ffa 
6bdebc77e74bd3497422259049a4670d3e9d31e0 M  tests

I have not yet had the time to figure out what goes wrong, any ideas are 
welcome.

Bjoern

-- 
IBM Systems
Linux on Z & Virtualization Development

IBM Deutschland Research & Development GmbH
Schönaicher Str. 220, 71032 Böblingen
Phone: +49 7031 16 1819

Vorsitzende des Aufsichtsrats: Martina Koederitz
Geschäftsführung: Dirk Wittkopp
Sitz der Gesellschaft: Böblingen
Registergericht: Amtsgericht Stuttgart, HRB 243294 


signature.asc
Description: PGP signature
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] Availability of libvirt-4.6.0 Release Candidate 2

2018-07-31 Thread Bjoern Walk
Daniel Veillard  [2018-07-31, 12:19PM +0800]:
>It is out, tagged in git and with signed tarball and rpms at the
> usual place:
> 
>ftp://libvirt.org/libvirt/
> 
>  in my limited testing it works but we have that pending issue
> raised by Andrea. worse case someone reverse the patches and
> allows to build against the old lib.
> 
>  Please give it some testing, I will watch the commits and
> if there isn't any solution 2 days from now I will postpone the
> GA by a couple of days. Hopefully that won't be needed :-)
> 
>   thanks in advance,
> 
> Daniel
> 
> -- 
> Daniel Veillard  | Red Hat Developers Tools http://developer.redhat.com/
> veill...@redhat.com  | libxml Gnome XML XSLT toolkit  http://xmlsoft.org/
> http://veillard.com/ | virtualization library  http://libvirt.org/
> 
> --
> libvir-list mailing list
> libvir-list@redhat.com
> https://www.redhat.com/mailman/listinfo/libvir-list
> 

We have a test failure for the viriscsitest on s390x. I have not found
out the reason but bisect showed this commit:

commit e0b46ad62337ae770e22272ec8ee8ad8cebefde7 (HEAD, 
refs/bisect/good-e0b46ad62337ae770e22272ec8ee8ad8cebefde7)
Author: Michal Privoznik 
Date:   Mon Jul 30 11:04:26 2018 +0200

Revert "util: cgroup: define cleanup function using 
VIR_DEFINE_AUTOPTR_FUNC"

This reverts commit 4da4a9fe0c0956feefe3d592b4ba2b92b2a9a2f9.

Turns out, our code relies on virCgroupFree() setting
var = NULL.

Signed-off-by: Michal Privoznik 
Reviewed-by: Pavel Hrdina 

-- 
IBM Systems
Linux on Z & Virtualization Development

IBM Deutschland Research & Development GmbH
Schönaicher Str. 220, 71032 Böblingen
Phone: +49 7031 16 1819

Vorsitzende des Aufsichtsrats: Martina Koederitz
Geschäftsführung: Dirk Wittkopp
Sitz der Gesellschaft: Böblingen
Registergericht: Amtsgericht Stuttgart, HRB 243294 


signature.asc
Description: PGP signature
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list